Newer
Older
smartwell_front_dz / smartwell / static / js / 7335.ea68ce59.js
wangxitong on 11 Sep 2023 11 KB first commit
"use strict";(self["webpackChunknewfront"]=self["webpackChunknewfront"]||[]).push([[7335],{96437:(e,t,a)=>{a.r(t),a.d(t,{default:()=>w});var n=function(){var e=this,t=e._self._c;return t("app-container",[t("search-area",{attrs:{size:"small"},on:{search:e.fetchData}},[t("search-item",[t("el-input",{attrs:{size:"small",placeholder:"项目名称",clearable:""},model:{value:e.listQuery.tenantName,callback:function(t){e.$set(e.listQuery,"tenantName",t)},expression:"listQuery.tenantName"}})],1)],1),t("normal-table",{ref:"normalTable",attrs:{data:e.list,query:e.listQuery,columns:e.columns,"list-loading":e.listLoading,options:e.options,size:"small"}},[t("template",{slot:"btns"},[t("el-button",{attrs:{size:"small"},on:{click:e.add}},[e._v(" 新增 ")])],1),t("template",{slot:"columns"},[t("el-table-column",{attrs:{label:"操作",width:"140",align:"center"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.edit(a.row)}}},[e._v(" 修改 ")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.del(a.row)}}},[e._v(" 删除 ")]),t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e.makeDep(a.row)}}},[e._v(" 关联组织 ")])]}}])})],1)],2),t("edit-tenant",{ref:"editTenant",on:{watchChild:e.fetchData}}),t("relate-dept",{ref:"relateDept",on:{watchChild:e.fetchData}})],1)},l=[],r=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{"append-to-body":"",title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[t("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.deviceForm,"label-width":"100px","label-well-code":"right"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"项目编码",prop:"tenantCode"}},[t("el-input",{attrs:{clearable:"",placeholder:"请输入与项目编码",disabled:"create"!==e.dialogStatus},model:{value:e.deviceForm.tenantCode,callback:function(t){e.$set(e.deviceForm,"tenantCode",t)},expression:"deviceForm.tenantCode"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"项目名称",prop:"tenantName"}},[t("el-input",{attrs:{placeholder:"请输入项目名称",clearable:"",disabled:"create"!==e.dialogStatus},model:{value:e.deviceForm.tenantName,callback:function(t){e.$set(e.deviceForm,"tenantName",t)},expression:"deviceForm.tenantName"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"项目联系人",prop:"linkPerson"}},[t("el-input",{attrs:{placeholder:"请输入项目联系人",clearable:"",disabled:"detail"===e.dialogStatus||"makeDep"===e.dialogStatus},model:{value:e.deviceForm.linkPerson,callback:function(t){e.$set(e.deviceForm,"linkPerson",t)},expression:"deviceForm.linkPerson"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"联系电话",prop:"tel"}},[t("el-input",{attrs:{placeholder:"请输入联系电话",clearable:"",disabled:"detail"===e.dialogStatus||"makeDep"===e.dialogStatus},model:{value:e.deviceForm.tel,callback:function(t){e.$set(e.deviceForm,"tel",t)},expression:"deviceForm.tel"}})],1)],1)],1),t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"历史保存天数",prop:"clearday"}},[t("el-input",{attrs:{placeholder:"请输入历史数据保存天数",clearable:"",disabled:"detail"===e.dialogStatus||"makeDep"===e.dialogStatus},model:{value:e.deviceForm.clearday,callback:function(t){e.$set(e.deviceForm,"clearday",t)},expression:"deviceForm.clearday"}})],1)],1),"makeDep"===e.dialogStatus?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"组织名称",prop:"deptName"}},[t("dept-select",{attrs:{"need-top":e.deptShowTop,"dept-type":"03",placeholder:"选择权属单位"},model:{value:e.deviceForm.deptName,callback:function(t){e.$set(e.deviceForm,"deptName",t)},expression:"deviceForm.deptName"}})],1)],1):e._e()],1)],1),t("div",{directives:[{name:"show",rawName:"v-show",value:"detail"!==e.dialogStatus,expression:"dialogStatus === 'detail' ? false : true"}],staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveData}},[e._v(" 保存 ")]),t("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")])],1)],1)},i=[],o=a(91267),s=a(81037);const d={name:"EditTenant",components:{DeptSelect:s.Z},data:function(){return{dialogFormVisible:!1,dialogStatus:"",deptShowTop:!1,textMap:{update:"编辑",create:"新增",detail:"详情",makeDep:"绑定组织"},deviceForm:{id:"",tenantCode:"",tenantName:"",linkPerson:"",tel:"",clearday:""},rules:{tenantCode:[{required:!0,message:"项目编码不能为空",trigger:["blur","change"]}],tenantName:[{required:!0,message:"项目名称不能为空",trigger:["blur","change"]}]}}},created:function(){},methods:{resetForm:function(){this.deviceForm={tenantCode:"",tenantName:"",linkPerson:"",tel:"",clearday:"",deptName:""}},initDialog:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.dialogFormVisible=!0,this.dialogStatus=e,"create"===this.dialogStatus?(this.resetForm(),this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))):"update"!==this.dialogStatus&&"detail"!==this.dialogStatus&&"makeDep"!==this.dialogStatus||(this.deviceForm={id:a.id,tenantCode:a.tenantCode,tenantName:a.tenantName,linkPerson:a.linkPerson,tel:a.tel,clearday:a.clearday})},saveData:function(){"update"===this.dialogStatus?this.updateData():"create"===this.dialogStatus&&this.createData()},updateData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(0,o.Jq)(e.deviceForm).then((function(t){200===t.code&&(e.$message.success("修改成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)}))}))},createData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(0,o.Gc)(e.deviceForm).then((function(t){200===t.code&&(e.$message.success("新增成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)}))}))}}},c=d;var u=a(1001),m=(0,u.Z)(c,r,i,!1,null,null,null);const p=m.exports;var f=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{"append-to-body":"",title:"绑定组织",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[t("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.dataForm,"label-width":"100px","label-well-code":"right"}},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:24}},[t("el-form-item",{attrs:{label:"绑定组织",prop:"deptId"}},[t("dept-select",{attrs:{"need-top":e.deptShowTop,"dept-type":"03",placeholder:"选择组织机构"},model:{value:e.dataForm.deptId,callback:function(t){e.$set(e.dataForm,"deptId",t)},expression:"dataForm.deptId"}})],1)],1)],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.saveData}},[e._v(" 保存 ")]),t("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")])],1)],1)},h=[];const v={name:"RelateDept",components:{DeptSelect:s.Z},data:function(){return{dialogFormVisible:!1,deptShowTop:!1,dataForm:{tenantId:"",deptId:""},rules:{deptId:[{required:!0,message:"\t组织机构必选",trigger:["blur","change"]}]}}},methods:{resetForm:function(){this.dataForm={tenantId:"",deptId:""}},initDialog:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.dialogFormVisible=!0,e&&(this.dataForm={tenantId:e.id,deptId:e.deptId})},saveData:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&(0,o.YK)(e.dataForm).then((function(t){200===t.code&&(e.$message.success("绑定成功"),e.$emit("watchChild"),e.dialogFormVisible=!1)}))}))}}},g=v;var b=(0,u.Z)(g,f,h,!1,null,null,null);const F=b.exports,y={name:"TenantList",components:{RelateDept:F,EditTenant:p},data:function(){return{listQuery:{tenantName:"",offset:1,sort:"id",order:"asc"},columns:[{text:"项目编码",value:"tenantCode",align:"center"},{text:"项目名称",value:"tenantName",align:"center"},{text:"项目联系人",value:"linkPerson",align:"center"},{text:"联系人电话",value:"tel",align:"center"},{text:"历史数据保存天数",value:"clearday",align:"center"},{text:"关联组织",value:"deptName",align:"center"}],listLoading:!1,deviceModelList:[],list:[],options:{needIndex:!1}}},created:function(){this.fetchData()},mounted:function(){this.$refs.normalTable.initColumnsState(!1)},methods:{fetchData:function(){var e=this;this.listLoading=!0,(0,o.fY)(this.listQuery).then((function(t){e.list=t.data,e.listLoading=!1}))},del:function(e){var t=this;this.$confirm("确定要删除所选项目吗?","确认操作",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){(0,o.b4)(e.id).then((function(e){200===e.code&&(t.$message.success("删除成功"),t.fetchData())}))}))},add:function(){this.$refs.editTenant.initDialog("create")},edit:function(e){this.$refs.editTenant.initDialog("update",e)},makeDep:function(e){this.$refs.relateDept.initDialog(e)}}},k=y;var D=(0,u.Z)(k,n,l,!1,null,null,null);const w=D.exports},79053:(e,t,a)=>{a.d(t,{CZ:()=>o,MB:()=>s,U4:()=>l,cd:()=>i,mv:()=>d,t5:()=>r});var n=a(84471);function l(e){return(0,n.Z)({url:"sys/dept/list",method:"get",params:e})}function r(e){return(0,n.Z)({url:"sys/dept/tree",method:"get",params:e})}function i(e){return(0,n.Z)({url:"sys/role/treeByRoleId",method:"get",params:{roleId:e}})}function o(e){return(0,n.Z)({url:"sys/dept/add",method:"post",data:e})}function s(e){return(0,n.Z)({url:"sys/dept/update",method:"post",data:e})}function d(e){return(0,n.Z)({url:"sys/dept/delete",method:"post",data:{id:e}})}},91267:(e,t,a)=>{a.d(t,{Gc:()=>o,Jq:()=>s,YK:()=>d,b4:()=>c,fY:()=>i});var n=a(84471),l=a(80129),r=a.n(l);function i(e){return(0,n.Z)({url:"bus/tenant/list",method:"get",params:e})}function o(e){return(0,n.Z)({url:"sys/tenant/add",method:"post",data:e})}function s(e){return(0,n.Z)({url:"sys/tenant/update",method:"post",data:e})}function d(e){return(0,n.Z)({url:"bus/tenant/relateTenant",method:"post",data:e})}function c(e){return(0,n.Z)({url:"sys/tenant/delete",method:"post",params:{ids:e},paramsSerializer:function(e){return r().stringify(e,{indices:!1})}})}},50275:(e,t,a)=>{a.d(t,{P7:()=>c,WP:()=>i,qd:()=>r});var n=a(89584),l=a(66347);a(21249),a(41539),a(70189),a(78783),a(33948),a(40561);function r(e){if(e&&e.length>0){var t,a=!1,n=e[0].pid,r=(0,l.Z)(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(i.pid!==n){a=!0;break}}}catch(o){r.e(o)}finally{r.f()}return a}return!1}function i(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=d(e);if(a.length>1)return e;var n=s(o(e,a[0],t));return n}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0",a=arguments.length>2?arguments[2]:void 0,n=function t(a){for(var n=[],l=0;l<e.length;l++){var r=e[l],i=""+r.id,o=""+r.pid;o===a&&(r.children=t(i),n.push(r))}return n};if(!a)return n(t);var r,i=1,o=[],s=(0,l.Z)(e);try{for(s.s();!(r=s.n()).done;){var d=r.value,c=""+d.id;if(c===t)return d.children=n(t),i=0,o.push(d),o}}catch(u){s.e(u)}finally{s.f()}return 1===i?n(t):void 0}function s(e){var t=function e(t){return t.map((function(t){return t&&t.children&&t.children.length?e(t.children):delete t.children,t})),t};return t(e)}function d(e){var t=new Set;if(e){var a,r=(0,l.Z)(e);try{for(r.s();!(a=r.n()).done;){var i=a.value;t.add(i.pid)}}catch(u){r.e(u)}finally{r.f()}var o,s=(0,l.Z)(e);try{for(s.s();!(o=s.n()).done;){var d=o.value;t.has(d.id)&&t["delete"](d.id)}}catch(u){s.e(u)}finally{s.f()}var c=(0,n.Z)(t);return c}return null}function c(e){for(var t=[],a=[],n=0;n<e.length;n++)"true"!==e[n].open&&!0!==e[n].open||t.push(e[n].id),"true"!==e[n].checked&&!0!==e[n].checked||a.push(e[n].id);return[t,a]}}}]);