|
|
|
@ -193,106 +193,107 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var dataTransfer = '';
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "{:U('getRootPromote')}",
|
|
|
|
|
type: "post",
|
|
|
|
|
data: {group_id: $('#group_id').val()},
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (data) {
|
|
|
|
|
// datas = data;
|
|
|
|
|
layui.use(['transfer', 'layer', 'util'], function(){
|
|
|
|
|
var $ = layui.$
|
|
|
|
|
,transfer = layui.transfer
|
|
|
|
|
,layer = layui.layer
|
|
|
|
|
,util = layui.util;
|
|
|
|
|
|
|
|
|
|
var data1 =data;
|
|
|
|
|
var data2 = [];
|
|
|
|
|
if (JSON.parse(data1).data_president) {
|
|
|
|
|
data2 = JSON.parse(data1).data_president.split(",");
|
|
|
|
|
}
|
|
|
|
|
// var dataTransfers = transfer.getData('key123');
|
|
|
|
|
// $('#promote_data').val(JSON.stringify(dataTransfers));
|
|
|
|
|
//显示搜索框
|
|
|
|
|
transfer.render({
|
|
|
|
|
elem: '#test4'
|
|
|
|
|
,data: JSON.parse(data1).list
|
|
|
|
|
,title: ['全部成员', '选中成员']
|
|
|
|
|
,showSearch: true,
|
|
|
|
|
value: data2,
|
|
|
|
|
id: 'key123',
|
|
|
|
|
onchange: function(data, index){
|
|
|
|
|
|
|
|
|
|
dataTransfer = transfer.getData('key123'); //获取右侧数据
|
|
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
|
|
|
|
|
for (var i=0;i<data.length;i++) {
|
|
|
|
|
data2.push(data[i]['value']);
|
|
|
|
|
}
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
return;
|
|
|
|
|
} else if (index == 1){
|
|
|
|
|
|
|
|
|
|
for(var i=0;i<data2.length;i++)
|
|
|
|
|
{
|
|
|
|
|
console.log(data2[i])
|
|
|
|
|
for(var j=0;j<data.length;j++) {
|
|
|
|
|
if (data2[i]==data[j]['value']) {
|
|
|
|
|
data2.splice(i,1);
|
|
|
|
|
i=i-1;
|
|
|
|
|
$(function () {
|
|
|
|
|
layui.use(['transfer', 'layer', 'util'], function(){
|
|
|
|
|
var $ = layui.$ ,transfer = layui.transfer,layer = layui.layer ,util = layui.util;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "{:U('getRootPromote')}",
|
|
|
|
|
type: "post",
|
|
|
|
|
data: {group_id: $('#group_id').val()},
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function (data) {
|
|
|
|
|
// datas = data;
|
|
|
|
|
var data1 =data;
|
|
|
|
|
var data2 = [];
|
|
|
|
|
if (JSON.parse(data1).data_president) {
|
|
|
|
|
data2 = JSON.parse(data1).data_president.split(",");
|
|
|
|
|
}
|
|
|
|
|
// var dataTransfers = transfer.getData('key123');
|
|
|
|
|
// $('#promote_data').val(JSON.stringify(dataTransfers));
|
|
|
|
|
//显示搜索框
|
|
|
|
|
transfer.render({
|
|
|
|
|
elem: '#test4'
|
|
|
|
|
,data: JSON.parse(data1).list
|
|
|
|
|
,title: ['全部成员', '选中成员']
|
|
|
|
|
,showSearch: true,
|
|
|
|
|
value: data2,
|
|
|
|
|
id: 'key123',
|
|
|
|
|
onchange: function(data, index){
|
|
|
|
|
|
|
|
|
|
dataTransfer = transfer.getData('key123'); //获取右侧数据
|
|
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
|
|
|
|
|
for (var i=0;i<data.length;i++) {
|
|
|
|
|
data2.push(data[i]['value']);
|
|
|
|
|
}
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
return;
|
|
|
|
|
} else if (index == 1){
|
|
|
|
|
|
|
|
|
|
for(var i=0;i<data2.length;i++)
|
|
|
|
|
{
|
|
|
|
|
console.log(data2[i])
|
|
|
|
|
for(var j=0;j<data.length;j++) {
|
|
|
|
|
if (data2[i]==data[j]['value']) {
|
|
|
|
|
data2.splice(i,1);
|
|
|
|
|
i=i-1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// data2.push(data[0]['value']);
|
|
|
|
|
transfer.reload('key123',{elem: '#test4',data: JSON.parse(data1).list,title: ['全部成员', '选中成员'],showSearch: true,value: data2,id: 'key123'});
|
|
|
|
|
dataTransfer = transfer.getData('key123');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// data2.push(data[0]['value']);
|
|
|
|
|
transfer.reload('key123',{elem: '#test4',data: JSON.parse(data1).list,title: ['全部成员', '选中成员'],showSearch: true,value: data2,id: 'key123'});
|
|
|
|
|
dataTransfer = transfer.getData('key123');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var dataTransfers = transfer.getData('key123');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfers));
|
|
|
|
|
transfets = transfer;
|
|
|
|
|
//批量办法定事件
|
|
|
|
|
util.event('lay-demoTransferActive', {
|
|
|
|
|
getData: function(othis){
|
|
|
|
|
var getData = transfer.getData('key123'); //获取右侧数据
|
|
|
|
|
layer.alert(JSON.stringify(getData));
|
|
|
|
|
}
|
|
|
|
|
,reload:function(){
|
|
|
|
|
//实例重载
|
|
|
|
|
transfer.reload('key123', {
|
|
|
|
|
title: ['文人', '喜欢的文人']
|
|
|
|
|
,value: ['2', '5', '9']
|
|
|
|
|
,showSearch: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var dataTransfers = transfer.getData('key123');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfers));
|
|
|
|
|
transfets = transfer;
|
|
|
|
|
//批量办法定事件
|
|
|
|
|
util.event('lay-demoTransferActive', {
|
|
|
|
|
getData: function(othis){
|
|
|
|
|
var getData = transfer.getData('key123'); //获取右侧数据
|
|
|
|
|
layer.alert(JSON.stringify(getData));
|
|
|
|
|
}
|
|
|
|
|
,reload:function(){
|
|
|
|
|
//实例重载
|
|
|
|
|
transfer.reload('key123', {
|
|
|
|
|
title: ['文人', '喜欢的文人']
|
|
|
|
|
,value: ['2', '5', '9']
|
|
|
|
|
,showSearch: true
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
var status = $('input:radio[name="data_empower_type"]:checked').val();
|
|
|
|
|
$('#status').val(status);
|
|
|
|
|
});
|
|
|
|
|
$(":radio").click(function () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var status = $('input:radio[name="data_empower_type"]:checked').val();
|
|
|
|
|
$('#status').val(status);
|
|
|
|
|
if (status != 2) {
|
|
|
|
|
$("#test4").css('display','none');
|
|
|
|
|
$('#promote_data').val('[]');
|
|
|
|
|
} else {
|
|
|
|
|
$("#test4").css('display','block');
|
|
|
|
|
ajaxPostCallback(function(){
|
|
|
|
|
dataTransfer = transfer.getData('key123');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(":radio").click(function () {
|
|
|
|
|
var status = $('input:radio[name="data_empower_type"]:checked').val();
|
|
|
|
|
$('#status').val(status);
|
|
|
|
|
if (status != 2) {
|
|
|
|
|
$("#test4").css('display','none');
|
|
|
|
|
$('#promote_data').val('[]');
|
|
|
|
|
} else {
|
|
|
|
|
$("#test4").css('display','block');
|
|
|
|
|
$('#promote_data').val(JSON.stringify(dataTransfer));
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
@ -300,7 +301,7 @@
|
|
|
|
|
location.href = this.value;
|
|
|
|
|
});
|
|
|
|
|
//导航高亮
|
|
|
|
|
highlight_subnav('{:U('AuthManager/index')}');
|
|
|
|
|
highlight_subnav("{:U('AuthManager/index')}");
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|