diff --git a/web/pages/copykanban.html b/web/pages/copykanban.html index 75d16c4..25c7c7a 100644 --- a/web/pages/copykanban.html +++ b/web/pages/copykanban.html @@ -27,7 +27,7 @@ -->
该复制是项目之间复制报表内容
-
取消
+
确定
diff --git a/web/pages/copyreport.html b/web/pages/copyreport.html index 34753f1..08d0fbf 100644 --- a/web/pages/copyreport.html +++ b/web/pages/copyreport.html @@ -16,7 +16,7 @@ -
+ +
确定
diff --git a/web/pages/dashboard.html b/web/pages/dashboard.html index c192867..2de1559 100644 --- a/web/pages/dashboard.html +++ b/web/pages/dashboard.html @@ -564,18 +564,20 @@ {{# layui.each(d, function(index, item) { }} {{# if(item.name != undefined ){ }}
  • - {{item.name}} + + {{item.name}} +
    {{# layui.each(item.children, function(indexs, items){ }} {{# if(items.isFolder === true){ }}
  • {{items.name}} - + {{# layui.each(items.children, function(value, datas){ }}
    {{datas.name}} -
    +
    {{# }); }}
  • @@ -585,6 +587,7 @@ {{# } }} {{# }); }} +
  • {{# } }} diff --git a/web/pages/kongjianshezhi.html b/web/pages/kongjianshezhi.html index f8f7fd3..65b7aa7 100644 --- a/web/pages/kongjianshezhi.html +++ b/web/pages/kongjianshezhi.html @@ -42,15 +42,14 @@
    - + + -->
    取消
    完成
    diff --git a/web/src/x.min.js b/web/src/x.min.js index 26f7fb5..44e4349 100644 --- a/web/src/x.min.js +++ b/web/src/x.min.js @@ -5,7 +5,11 @@ var X = window.X || { pageLogic : {}, DATA : { 'echartscolor': [ '#3ea7fd', '#cdddfd', '#5ad8a6', '#cdf3e4', '#5d7092', '#ced4de', '#f6bd16','#fcebb9','#e86452','#f8d0cb','#6dc8ec', '#d3eef9', '#9270ca', '#d3c6ea', '#ff9d4d', '#ffd8b8', '#269a99','#aad8d8','#ff99c3','#ffd6e7' ], - 'createsidebar':[{ title: '新建看板',id: 0,url:'newkanban'},{title: '新建文件夹',id: 1,url:'newwenjian'},{title: '创建空间',id: 2,url:'kongjianshezhi'}], + 'createsidebar':[ + { title: '新建看板',id: 0,url:'newkanban'}, + // {title: '新建文件夹',id: 1,url:'newwenjian'}, + {title: '创建空间',id: 2,url:'kongjianshezhi'} + ], 'taboperationdata':{ kanban:[ {'title':'重命名','img':'xiugai.png','click':'modifyname'}, @@ -3348,14 +3352,14 @@ var X = window.X || { layui.form.render(); //叉图标关闭弹窗 - $(".copy-top .copy-cha").click(function(){ - console.log(layer.index) - parent.layer.closeAll(layer.index); - }); - //取消按钮 - $(".copy-but-box .copy-qx").click(function(){ - layer.closeAll(layer.index); - }); + // $(document).off('click','.copy-top .copy-cha').on('click','.copy-top .copy-cha',function(){ + // console.log(layer.index) + // parent.layer.closeAll(layer.index); + // }); + // //取消按钮 + // $(".copy-but-box .copy-qx").click(function(){ + // layer.closeAll(layer.index); + // }); //我的看板,空间切换实践copy-tab $(".copy-tab-box .copy-tab div").click(function(){ $(".copy-tab-box .copy-tab div").removeClass('tabdata'); @@ -3395,100 +3399,33 @@ var X = window.X || { this.parms = parms; this.callback = parms.callback; //选择后执行的回调 var data = parms.extData;//获取到上层弹窗传的数据 - var comboTree1,comboTree2 + console.log(data); X.api("project/","get",{},function(d){ X.laytpldata("#project-list-box-dot",d,".project-list-box"); layui.form.render(); - comboTree1 = $('.yidong-txt-box .justAnotherInputBox1').comboTree({ - source : X.DATA.KanBanData, - isMultiple: false - }); - comboTree2 = $('.yidong-txt-box .justAnotherInputBox2').comboTree({ - source : X.DATA.ProjectData, - isMultiple: false - }); }); - + var dest_project_id;//項目id layui.form.on('select(projectlist)', function(data){ console.log(data); - comboTree1.destroy(); - comboTree2.destroy(); - X.api('project/kanban',"post",{"_id":data.value},function (d){ - X.DATA['KanBanData'] = d.kanban; - X.DATA['ProjectData'] = d.spaces; - comboTree1 = $('.yidong-txt-box .justAnotherInputBox1').comboTree({ - source : d.kanban, - isMultiple: false - }); - comboTree2 = $('.yidong-txt-box .justAnotherInputBox2').comboTree({ - source : d.spaces, - isMultiple: false - }); - }); + dest_project_id = data.value; }); - - - //叉图标关闭弹窗 - $(".yidong-top .yidong-cha").click(function(){ - console.log(layer.index) - parent.layer.closeAll(layer.index); - }); - //取消按钮 - $(".yidong-but-box .yidong-qx").click(function(){ - layer.closeAll(layer.index); - }); - //我的看板,空间切换实践 - $(".yidong-tab-box .yidong-tab div").click(function(){ - $(".yidong-tab-box .yidong-tab div").removeClass('tabdata'); - $(this).addClass('tabdata'); - if($(this).html() == "我的看板"){ - $(".yidong-txt-box .justAnotherInputBox1").show(); - $(".yidong-txt-box .justAnotherInputBox2").hide(); - }else { - $(".yidong-txt-box .justAnotherInputBox1").hide(); - $(".yidong-txt-box .justAnotherInputBox2").show(); - } - $(".yidong-txt-box .justAnotherInputBox1").val(""); - $(".yidong-txt-box .justAnotherInputBox2").val(""); - }) - //确定按钮 - $(".yidong-but-box .yidong-qd").click(function(){ - var type ='kanban'; - var id = '';//没有默认传看板 - if($('#yidongjustAnotherInputBox2').val() != ""){ - var Addlocation = $('#yidongjustAnotherInputBox2').val(); - type = "space" - }else { - var Addlocation = $('#yidongjustAnotherInputBox1').val(); - } - // console.log(Addlocation); - if(Addlocation){ - id = X.pageLogic.newkanban.matchingid(Addlocation,type); - }else { - alert('请选择添加的位置'); - return; - } - // var source_id = data['mykanban'].concat(data['kongjian']); + $(document).off('click','.yidong-but-box .yidong-qd').on('click','.yidong-but-box .yidong-qd',function(){ + var report_ids = []; + report_ids.push(data); var dataArr = { - 'source_ids':data, - 'dest_pid': id, - 'cat':type + 'dest_project_id': dest_project_id, + 'report_ids': report_ids }; console.log(dataArr); - X.api('dashboard/move','post',dataArr,function(d){ - // if(d.code == "ok"){ - X.pageLogic.dashboard.freshMenu(X.DATA.projectid);//刷新侧边栏 - X.pageLogic.adminkanban.updata(X.DATA.projectid);//刷新数据 - console.log(me.parms.layIndex); - layer.closeAll(0); - // } + X.api('report/copy','post',dataArr,function(d){ + + layer.closeAll(0); }) }); - } }; })(); @@ -3503,6 +3440,15 @@ var X = window.X || { layui.element.init(); + var userinfo = localStorage.getItem('loginData'); + if(userinfo){ + X.DATA["userinfo"] = JSON.parse(userinfo); + }else { + layer.msg('登录过期请重新登录!!!'); + X.gourl("login"); + return; + } + // 项目列表 // http://10.0.0.7:6789/ X.api("project/","get",{},function(d){ @@ -3608,8 +3554,8 @@ var X = window.X || { //筛选 $(document).off('click','.tab-right-box .tjsx').on("click",".tab-right-box .tjsx",function(){ - layer.msg('该功能暂未开放'); - return; + // layer.msg('该功能暂未开放'); + // return; X.open({ type: 1, title: false, @@ -3761,12 +3707,23 @@ var X = window.X || { //复制单个报表 $(document).off('click','.model-fuzhi').on('click','.model-fuzhi',function(e) { - X.parametersopen('','copyreport',"auto",function(d) { + e.stopPropagation(); + var id = $(this).attr('data-id') + X.parametersopen(id,'copyreport',"auto",function(d) { + }) + }); + + //删除空间 + $(document).off('click','.nav-space-bar').on('click','.nav-space-bar',function(e){ + e.stopPropagation(); + var id = $(this).attr('data-id'); + X.parametersopen(id,"kongjianshezhi",'auto',function(d){ + }) }) - // 渲染下拉框 + //删除看板 $(document).off('click','.nav-action-bar').on('click','.nav-action-bar',function(e){ e.stopPropagation(); // console.log('更多操作按钮'); @@ -3907,7 +3864,7 @@ var X = window.X || { for(var z in eventdata){ if(id){ //当有id时更新对应id看板内的内容 - X.template("modeltable",id,eventdata[z],function(){ + X.template("modeltable",id,eventdata[z],function(){ X.pageLogic['dashboard'].morefeatures(eventdata[z]); }); }else { @@ -3922,9 +3879,7 @@ var X = window.X || { // $('.layui-row').dad({ // draggable: '.layui-card' // }); - $('.layui-row').dad({ - // draggable - }); + // $('.layui-row').dad(); }) }, @@ -4037,7 +3992,7 @@ var X = window.X || { for(let i in modellist){ for(let z in d){ - if(modellist[i] == d[z]['sort']){ + if(modellist[i]['sort'] == d[z]['sort']){ //渲染模板和数据 console.log(d[z]); X.laytpldata("#kanban-model-box-dot",d[z],null,function(html){ @@ -4053,7 +4008,7 @@ var X = window.X || { //定义一个比较器--降序排列 compare:function(propertyName) { - console.log(propertyName) + // console.log(propertyName) return function(object1, object2) { var value1 = object1[propertyName]; var value2 = object2[propertyName]; @@ -6276,8 +6231,11 @@ var X = window.X || { // srczip/logic/kongjianshezhi.js (function(){ X.pageLogic['kongjianshezhi'] = { - init : function(){ + init : function(parms){ var me = this; + this.parms = parms; + this.callback = parms.callback; + var id = parms.extData; $(".kongjian-mc-box .kongjian-tianjia").click(function(){ $(".kongjian-box .member-box").show(); @@ -6291,14 +6249,49 @@ var X = window.X || { var userinfo = X.DATA.userinfo; $(".gly-firs").html(userinfo.name.substring(0,1)); $(".gly-name").html(userinfo.name); - X.api('user/all_account',"get",{},function(d){ + + if(id){ + + X.api('space/detail','post',{space_id:id},'false',function(d){ + $('.kongjian-mc-box-txt').val(d.name); + X.DATA['adduadaserarr'] = d.members; + adduadaserarr = d.members; + }) + + var listarr = [ + {title:'移交空间',id:'transfer'}, + {title:'删除空间',id:'del'} + ] + X.laydropdown("#kongjian-cz",listarr,function(d){ + console.log(d); + if(d.id == 'del'){ + layer.confirm('确认删除此空间吗?该操作不可恢复', { + btn: ['取消','删除 '] //按钮 + }, function(){ + //取消 + layer.close(layer.index); + }, function(){ + //删除 + X.api("space/delete",'post',{_id:id},function(d){ + layer.msg('删除成功'); + layer.close(layer.index); + X.pageLogic.dashboard.freshMenu(X.DATA.projectid);//刷新侧边栏 + me.updata(X.DATA.projectid);//刷新数据 + }) + }); + } + }) + }else { + adduadaserarr = []; + X.DATA['adduadaserarr'] = []; + } + X.api('user/all_account',"get",{},'false',function(d){ for(let i in d){ d[i]["firs"] = d[i]['name'].substring(0,1); d[i]["authority"] = "r"; } userarr = d; - adduadaserarr = []; - X.DATA['adduadaserarr'] = []; + X.DATA['userarr'] = d; me.updatauserarr(); }); diff --git a/web/srczip/common.js b/web/srczip/common.js index 4b4e452..c73bdfe 100644 --- a/web/srczip/common.js +++ b/web/srczip/common.js @@ -4,7 +4,11 @@ var X = window.X || { pageLogic : {}, DATA : { 'echartscolor': [ '#3ea7fd', '#cdddfd', '#5ad8a6', '#cdf3e4', '#5d7092', '#ced4de', '#f6bd16','#fcebb9','#e86452','#f8d0cb','#6dc8ec', '#d3eef9', '#9270ca', '#d3c6ea', '#ff9d4d', '#ffd8b8', '#269a99','#aad8d8','#ff99c3','#ffd6e7' ], - 'createsidebar':[{ title: '新建看板',id: 0,url:'newkanban'},{title: '新建文件夹',id: 1,url:'newwenjian'},{title: '创建空间',id: 2,url:'kongjianshezhi'}], + 'createsidebar':[ + { title: '新建看板',id: 0,url:'newkanban'}, + // {title: '新建文件夹',id: 1,url:'newwenjian'}, + {title: '创建空间',id: 2,url:'kongjianshezhi'} + ], 'taboperationdata':{ kanban:[ {'title':'重命名','img':'xiugai.png','click':'modifyname'}, diff --git a/web/srczip/logic/copykanban.js b/web/srczip/logic/copykanban.js index ed4ce93..d3fa676 100644 --- a/web/srczip/logic/copykanban.js +++ b/web/srczip/logic/copykanban.js @@ -29,14 +29,14 @@ layui.form.render(); //叉图标关闭弹窗 - $(".copy-top .copy-cha").click(function(){ - console.log(layer.index) - parent.layer.closeAll(layer.index); - }); - //取消按钮 - $(".copy-but-box .copy-qx").click(function(){ - layer.closeAll(layer.index); - }); + // $(document).off('click','.copy-top .copy-cha').on('click','.copy-top .copy-cha',function(){ + // console.log(layer.index) + // parent.layer.closeAll(layer.index); + // }); + // //取消按钮 + // $(".copy-but-box .copy-qx").click(function(){ + // layer.closeAll(layer.index); + // }); //我的看板,空间切换实践copy-tab $(".copy-tab-box .copy-tab div").click(function(){ $(".copy-tab-box .copy-tab div").removeClass('tabdata'); diff --git a/web/srczip/logic/copyreport.js b/web/srczip/logic/copyreport.js index 3cde1fb..0545753 100644 --- a/web/srczip/logic/copyreport.js +++ b/web/srczip/logic/copyreport.js @@ -5,100 +5,33 @@ this.parms = parms; this.callback = parms.callback; //选择后执行的回调 var data = parms.extData;//获取到上层弹窗传的数据 - var comboTree1,comboTree2 + console.log(data); X.api("project/","get",{},function(d){ X.laytpldata("#project-list-box-dot",d,".project-list-box"); layui.form.render(); - comboTree1 = $('.yidong-txt-box .justAnotherInputBox1').comboTree({ - source : X.DATA.KanBanData, - isMultiple: false - }); - comboTree2 = $('.yidong-txt-box .justAnotherInputBox2').comboTree({ - source : X.DATA.ProjectData, - isMultiple: false - }); }); - + var dest_project_id;//項目id layui.form.on('select(projectlist)', function(data){ console.log(data); - comboTree1.destroy(); - comboTree2.destroy(); - X.api('project/kanban',"post",{"_id":data.value},function (d){ - X.DATA['KanBanData'] = d.kanban; - X.DATA['ProjectData'] = d.spaces; - comboTree1 = $('.yidong-txt-box .justAnotherInputBox1').comboTree({ - source : d.kanban, - isMultiple: false - }); - comboTree2 = $('.yidong-txt-box .justAnotherInputBox2').comboTree({ - source : d.spaces, - isMultiple: false - }); - }); + dest_project_id = data.value; }); - - - //叉图标关闭弹窗 - $(".yidong-top .yidong-cha").click(function(){ - console.log(layer.index) - parent.layer.closeAll(layer.index); - }); - //取消按钮 - $(".yidong-but-box .yidong-qx").click(function(){ - layer.closeAll(layer.index); - }); - //我的看板,空间切换实践 - $(".yidong-tab-box .yidong-tab div").click(function(){ - $(".yidong-tab-box .yidong-tab div").removeClass('tabdata'); - $(this).addClass('tabdata'); - if($(this).html() == "我的看板"){ - $(".yidong-txt-box .justAnotherInputBox1").show(); - $(".yidong-txt-box .justAnotherInputBox2").hide(); - }else { - $(".yidong-txt-box .justAnotherInputBox1").hide(); - $(".yidong-txt-box .justAnotherInputBox2").show(); - } - $(".yidong-txt-box .justAnotherInputBox1").val(""); - $(".yidong-txt-box .justAnotherInputBox2").val(""); - }) - //确定按钮 - $(".yidong-but-box .yidong-qd").click(function(){ - var type ='kanban'; - var id = '';//没有默认传看板 - if($('#yidongjustAnotherInputBox2').val() != ""){ - var Addlocation = $('#yidongjustAnotherInputBox2').val(); - type = "space" - }else { - var Addlocation = $('#yidongjustAnotherInputBox1').val(); - } - // console.log(Addlocation); - if(Addlocation){ - id = X.pageLogic.newkanban.matchingid(Addlocation,type); - }else { - alert('请选择添加的位置'); - return; - } - // var source_id = data['mykanban'].concat(data['kongjian']); + $(document).off('click','.yidong-but-box .yidong-qd').on('click','.yidong-but-box .yidong-qd',function(){ + var report_ids = []; + report_ids.push(data); var dataArr = { - 'source_ids':data, - 'dest_pid': id, - 'cat':type + 'dest_project_id': dest_project_id, + 'report_ids': report_ids }; console.log(dataArr); - X.api('dashboard/move','post',dataArr,function(d){ - // if(d.code == "ok"){ - X.pageLogic.dashboard.freshMenu(X.DATA.projectid);//刷新侧边栏 - X.pageLogic.adminkanban.updata(X.DATA.projectid);//刷新数据 - console.log(me.parms.layIndex); - layer.closeAll(0); - // } + X.api('report/copy','post',dataArr,function(d){ + + layer.closeAll(0); }) }); - } }; })(); \ No newline at end of file diff --git a/web/srczip/logic/dashboard.js b/web/srczip/logic/dashboard.js index 07991a0..3a9d648 100644 --- a/web/srczip/logic/dashboard.js +++ b/web/srczip/logic/dashboard.js @@ -8,6 +8,15 @@ layui.element.init(); + var userinfo = localStorage.getItem('loginData'); + if(userinfo){ + X.DATA["userinfo"] = JSON.parse(userinfo); + }else { + layer.msg('登录过期请重新登录!!!'); + X.gourl("login"); + return; + } + // 项目列表 // http://10.0.0.7:6789/ X.api("project/","get",{},function(d){ @@ -113,8 +122,8 @@ //筛选 $(document).off('click','.tab-right-box .tjsx').on("click",".tab-right-box .tjsx",function(){ - layer.msg('该功能暂未开放'); - return; + // layer.msg('该功能暂未开放'); + // return; X.open({ type: 1, title: false, @@ -266,12 +275,23 @@ //复制单个报表 $(document).off('click','.model-fuzhi').on('click','.model-fuzhi',function(e) { - X.parametersopen('','copyreport',"auto",function(d) { + e.stopPropagation(); + var id = $(this).attr('data-id') + X.parametersopen(id,'copyreport',"auto",function(d) { + }) + }); + + //删除空间 + $(document).off('click','.nav-space-bar').on('click','.nav-space-bar',function(e){ + e.stopPropagation(); + var id = $(this).attr('data-id'); + X.parametersopen(id,"kongjianshezhi",'auto',function(d){ + }) }) - // 渲染下拉框 + //删除看板 $(document).off('click','.nav-action-bar').on('click','.nav-action-bar',function(e){ e.stopPropagation(); // console.log('更多操作按钮'); @@ -427,9 +447,7 @@ // $('.layui-row').dad({ // draggable: '.layui-card' // }); - $('.layui-row').dad({ - // draggable - }); + // $('.layui-row').dad(); }) }, @@ -542,7 +560,7 @@ for(let i in modellist){ for(let z in d){ - if(modellist[i] == d[z]['sort']){ + if(modellist[i]['sort'] == d[z]['sort']){ //渲染模板和数据 console.log(d[z]); X.laytpldata("#kanban-model-box-dot",d[z],null,function(html){ diff --git a/web/srczip/logic/kongjianshezhi.js b/web/srczip/logic/kongjianshezhi.js index ebe6e7e..8f2af3d 100644 --- a/web/srczip/logic/kongjianshezhi.js +++ b/web/srczip/logic/kongjianshezhi.js @@ -1,7 +1,10 @@ (function(){ X.pageLogic['kongjianshezhi'] = { - init : function(){ + init : function(parms){ var me = this; + this.parms = parms; + this.callback = parms.callback; + var id = parms.extData; $(".kongjian-mc-box .kongjian-tianjia").click(function(){ $(".kongjian-box .member-box").show(); @@ -15,14 +18,49 @@ var userinfo = X.DATA.userinfo; $(".gly-firs").html(userinfo.name.substring(0,1)); $(".gly-name").html(userinfo.name); + + if(id){ + + X.api('space/detail','post',{space_id:id},function(d){ + $('.kongjian-mc-box-txt').val(d.name); + X.DATA['adduadaserarr'] = d.members; + adduadaserarr = d.members; + }) + + var listarr = [ + {title:'移交空间',id:'transfer'}, + {title:'删除空间',id:'del'} + ] + X.laydropdown("#kongjian-cz",listarr,function(d){ + console.log(d); + if(d.id == 'del'){ + layer.confirm('确认删除此空间吗?该操作不可恢复', { + btn: ['取消','删除 '] //按钮 + }, function(){ + //取消 + layer.close(layer.index); + }, function(){ + //删除 + X.api("space/delete",'post',{_id:id},function(d){ + layer.msg('删除成功'); + layer.close(layer.index); + X.pageLogic.dashboard.freshMenu(X.DATA.projectid);//刷新侧边栏 + me.updata(X.DATA.projectid);//刷新数据 + }) + }); + } + }) + }else { + adduadaserarr = []; + X.DATA['adduadaserarr'] = []; + } X.api('user/all_account',"get",{},function(d){ for(let i in d){ d[i]["firs"] = d[i]['name'].substring(0,1); d[i]["authority"] = "r"; } userarr = d; - adduadaserarr = []; - X.DATA['adduadaserarr'] = []; + X.DATA['userarr'] = d; me.updatauserarr(); }); diff --git a/web/static/css/style.css b/web/static/css/style.css index bb04b9f..0aac46f 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -236,7 +236,7 @@ input::-webkit-input-placeholder{ color:#a7b5c3;} /* 移动看板 */ .yidong-bg { display: none; background-color: rgba(0, 0, 0, 0.3); width: 100%; height: 100%; position: fixed; top: 0; z-index: 9999; } .yidong-box { width: 396px; height: 242px; background-color: #ffffff; border-radius: 2px; } -.copyreport-box { width: 396px; height: 300px; background-color: #ffffff; border-radius: 2px; } +.copyreport-box { width: 396px; height: 190px; background-color: #ffffff; border-radius: 2px; } .yidong-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; color: #202d3f; font-size: 16px; } .yidong-top img { cursor: pointer; } .yidong-txt-box { height: 32px; padding: 10px 28px; position: fixed; width: 345px; } @@ -322,7 +322,7 @@ span.comboTreeItemTitle{display: block;padding: 2px 4px;} .chuangjiankongjian-box { padding: 16px 14px; background: linear-gradient(270deg,rgba(61,144,255,.04),rgba(61,144,255,.1)); } .chuangjiankongjian-tit { font-size: 16px; color: #202d3f; font-weight: 500; } .chuangjiankongjian-tit2 { margin-top: 4px; color: #67729d; font-weight: 400; font-size: 12px; } -.kongjian-but-box .kongjian-cz { background-color: #f6f8fa !important; } +.kongjian-but-box .kongjian-cz { background-color: #f6f8fa !important; color: #666; padding: 0 12px !important; height: 32px; line-height: 32px; background-color: #f6f8fa; cursor: pointer; } .kongjian-renyuan-box .kongjian-renyuan { display: flex; padding: 8px; justify-content: space-between; align-items: center; } .kongjian-renyuan:hover { background-color: #f6f8fa; }