@newview/permission-service 1.2.23 → 1.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/permission-service.js +579 -134
- package/dist/permission-service.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@newview/base-vue"),require("vue"),require("@newview/permission-api"),require("@newview/infrastructure"),require("view-ui-plus"),require("@newview/permission-ui"),require("@newview/casign-api"),require("@newview/basics-api"),require("@newview/file-ui"),require("@newview/map")):"function"==typeof define&&define.amd?define(["@newview/base-vue","vue","@newview/permission-api","@newview/infrastructure","view-ui-plus","@newview/permission-ui","@newview/casign-api","@newview/basics-api","@newview/file-ui","@newview/map"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).permissionservice=t(e.baseVue,e.Vue,e.permissionApi,e.infrastructure,e.viewUiPlus,e.permissionUi,e.casignApi,e.basicsApi,e.fileUi,e.map)}(this,(function(e,t,i,o,s,r,l,a,n,d){"use strict";var u=Object.defineProperty,h=(e,t,i)=>(((e,t,i)=>{t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);const p={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},m=t.defineComponent({name:"Platform",components:{},emits:[""],props:p,setup:(e,t)=>new c(e,t)});let c=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"platformGroupApi",new i.PlatformGroupApi),h(this,"currentGroupRow",t.ref({})),h(this,"groupData",t.ref()),h(this,"groupOption",t.reactive({api:this.platformGroupApi,keyField:"Id",titleField:"GroupName"})),h(this,"showEditGroup",t.ref(!1)),h(this,"refGroupForm",t.ref()),h(this,"saveingGroupform",t.ref(!1)),h(this,"editGroupformModalTitle",t.ref("新增 - 平台目录")),h(this,"groupFormModel",t.reactive({Id:0,SKey:this.utilities.getUniqueCode(),GroupNo:"",GroupName:"",OrderNo:"",CreateDate:this.utilities.getCurrentDate()})),h(this,"groupFormItems",t.reactive([{model:"GroupName",label:"组名称",prop:"GroupName",type:"Input",span:24,rules:[{required:!0,message:"组名称不能为空",trigger:"blur"}]},{model:"GroupNo",label:"平台目录代号",prop:"GroupNo",type:"Input",span:24,rules:[{required:!0,message:"平台目录代号不能为空",trigger:"blur"}]},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doRefresh",(()=>{this.loadGroupData()})),h(this,"groupSelect",(e=>{var t;this.currentGroupRow.value=e,null==(t=this.platformGrid.value)||t.setPageIndex(1),this.loadPlatformGrid()})),h(this,"handleGroupAdd",(()=>{this.showEditGroup.value=!0})),h(this,"doSaveGroupform",(async()=>{if(!(await this.refGroupForm.value.validate()))return;this.saveingGroupform.value=!0;let e=await this.platformGroupApi.save(this.groupFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingGroupform.value=!1);this.message.success("保存成功!"),this.doRefresh(),this.saveingGroupform.value=!1,this.showEditGroup.value=!1})),h(this,"upList",t.reactive(Array())),h(this,"platformGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"SKey",title:"唯一KEY",type:"Input"},{field:"PlatformName",title:"系统名称",type:"Input"},{field:"PlatformAbbreviation",title:"系统简称",type:"Input"},{field:"PlatformNo",title:"系统代号",type:"Input"},{field:"PlatformGroup",title:"系统组",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddPlatform()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"SKey",title:"唯一KEY",width:240},{colType:"ed",field:"PlatformName",title:"系统名称",minWidth:250},{colType:"ed",field:"PlatformAbbreviation",title:"系统简称",width:150},{colType:"select",field:"PId",title:"上级平台",width:150,select:{data:this.upList,clearable:!0,multiple:!1},format:(e,t)=>{const i=this.upList.find((e=>e.value==t.row.PId));return e("span",0==t.row.PId?"/":i.text)}},{colType:"ed",field:"PlatformNo",title:"系统代号",width:100},{colType:"ed",field:"PlatformUrl",title:"系统URL",width:230},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:140,rowButtons:[{name:"edit",text:"编辑",onclick:e=>{this.doEditPlatform(e)}},{name:"delete"}]}],event:{event_search:e=>{this.platformGrid.value.setPageIndex(1);const t=Object.keys(e),i=o.QueryWrapper.create();i.eq("1","1");for(const o of t){const t=e[o];this.utilities.isNull(t)||i.like(o,t)}this.platformGrid.value.loadDataByQuery(i)}}})),h(this,"platformGrid",t.ref()),h(this,"refPlatformForm",t.ref()),h(this,"saveingPlatform",t.ref(!1)),h(this,"showEditPlatform",t.ref(!1)),h(this,"editPlatformModalTitle",t.ref("新增 - 系统平台")),h(this,"platformFormModel",t.reactive({Id:0,SKey:"",PlatformNo:"",PlatformName:"",PlatformAbbreviation:"",OssRootPath:"",PlatformGroup:this.currentGroupRow.value.Id,PlatformUrl:"",OrderNo:0,CABusinessKey:"",PId:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:"",DefaultPwd:""})),h(this,"platformFormItems",t.reactive([{model:"PlatformName",label:"系统名称",prop:"PlatformName",type:"Input",span:24,rules:[{required:!0,message:"系统名称不能为空",trigger:"blur"}]},{model:"PlatformNo",label:"系统编号",prop:"PlatformNo",type:"Input",span:24,rules:[{required:!0,message:"系统编号不能为空",trigger:"blur"}]},{model:"PlatformAbbreviation",label:"系统简称",prop:"PlatformAbbreviation",type:"Input",span:24},{model:"OssRootPath",label:"Oss根路径",prop:"OssRootPath",type:"Input",span:24},{model:"PId",label:"上级平台",prop:"PId",type:"Select",span:24,selectProp:{datas:[],transfer:!0,clearable:!0,multiple:!1}},{model:"PlatformUrl",label:"系统URL",prop:"PlatformUrl",type:"Input",span:24},{model:"CABusinessKey",label:"CAKey",prop:"CABusinessKey",type:"Input",span:24},{model:"DefaultPwd",label:"用户默认密码",prop:"DefaultPwd",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSavePlatform",(async()=>{if(!(await this.refPlatformForm.value.validate()))return;this.saveingPlatform.value=!0;let e=await this.platformApi.save(this.platformFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingPlatform.value=!1);this.message.success("保存成功!"),this.platformGrid.value.refreshData(),this.saveingPlatform.value=!1,this.showEditPlatform.value=!1})),this.props=e,this.ctx=s,this.usePlatform()}loadGroupData(){this.groupData.value.loadDataByQuery(o.QueryWrapper.create().orderBy(["OrderNo"]))}usePlatform(){t.onMounted((()=>{this.loadGroupData()}))}async loadPlatformGrid(){const e=this.storageInfo.getUser();this.platformGrid.value.setGloablValue("LastUpdateUserId",e.Id),this.platformGrid.value.setGloablValue("LastUpdateUserName",e.UserName),this.platformGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.platformGrid.value.setGloablValue("SKey",(()=>this.utilities.getUniqueCode()),!0),this.platformGrid.value.loadData((async e=>{const t=await this.platformApi.getEntitiesPageDynamic(e.page,e.pageSize,o.QueryWrapper.create().eq("PlatformGroup",this.currentGroupRow.value.Id).orderBy(["OrderNo"]).eq("1","1")),i=this.utilities.parseApiResult(t);e.success(i),this.upList.splice(0,this.upList.length);for(const o of i.Datas)this.upList.push({value:o.Id,text:o.PlatformAbbreviation})}))}doEditPlatform(e){var t;const i=this.storageInfo.getUser();this.platformFormModel.Id=e.Id,this.platformFormModel.SKey=e.SKey,this.platformFormModel.PlatformNo=e.PlatformNo,this.platformFormModel.PlatformName=e.PlatformName,this.platformFormModel.PlatformAbbreviation=e.PlatformAbbreviation,this.platformFormModel.OssRootPath=e.OssRootPath,this.platformFormModel.PlatformGroup=e.PlatformGroup,this.platformFormModel.PlatformUrl=e.PlatformUrl,this.platformFormModel.CABusinessKey=e.CABusinessKey,this.platformFormModel.OrderNo=e.OrderNo,this.platformFormModel.LastUpdateUserId=i.Id,this.platformFormModel.LastUpdateUserName=i.UserName,this.platformFormModel.PId=e.PId,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd=e.DefaultPwd,this.editPlatformModalTitle.value=`编辑 - ${e.PlatformName}`;const o=null==(t=this.platformGrid.value)?void 0:t.getDatas();this.platformFormItems[4].selectProp.datas=o.length>0?null==o?void 0:o.map((e=>({value:e.Id,text:e.PlatformName}))):[],this.showEditPlatform.value=!0}doAddPlatform(){var e;const t=this.storageInfo.getUser();this.platformFormModel.Id=0,this.platformFormModel.SKey=this.utilities.getUniqueCode(),this.platformFormModel.PlatformNo="",this.platformFormModel.PlatformName="",this.platformFormModel.PlatformAbbreviation="",this.platformFormModel.OssRootPath="",this.platformFormModel.PlatformGroup=this.currentGroupRow.value.Id,this.platformFormModel.PlatformUrl="",this.platformFormModel.CABusinessKey="",this.platformFormModel.OrderNo=0,this.platformFormModel.LastUpdateUserId=t.Id,this.platformFormModel.LastUpdateUserName=t.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editPlatformModalTitle.value="新增 - 系统平台";const i=null==(e=this.platformGrid.value)?void 0:e.getDatas();this.platformFormItems[4].selectProp.datas=i.length>0?null==i?void 0:i.map((e=>({value:e.Id,text:e.PlatformName}))):[],this.showEditPlatform.value=!0}};const f=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i},g={class:"nv-flex",style:{"justify-content":"space-between"}},I={style:{height:"550px","overflow-y":"auto"}},v={style:{height:"400px","overflow-y":"auto"}};const w=f(m,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvList"),n=t.resolveComponent("Icon"),d=t.resolveComponent("Space"),u=t.resolveComponent("Button"),h=t.resolveComponent("NvBox"),p=t.resolveComponent("NvGrid"),m=t.resolveComponent("NvComForm"),c=t.resolveComponent("Form"),f=t.resolveComponent("Modal"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"platform nv-flex"},{default:t.withCtx((()=>[t.createVNode(h,{width:"200px",title:"平台目录","show-arrow":!0},{footer:t.withCtx((()=>[t.createElementVNode("div",g,[t.createVNode(d,null,{default:t.withCtx((()=>[t.createVNode(n,{type:"md-add",class:"nv-c-p",size:"25",onClick:e.handleGroupAdd},null,8,["onClick"])])),_:1}),t.createVNode(d,null,{default:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:e.doRefresh},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])])),default:t.withCtx((()=>[t.createVNode(a,{ref:"groupData",option:e.groupOption,onSelect:e.groupSelect},null,8,["option","onSelect"])])),_:1}),t.createVNode(h,{class:"nv-flex-1",title:"系统平台"},{default:t.withCtx((()=>[t.createVNode(p,{ref:"platformGrid",option:e.platformGridOption},null,8,["option"])])),_:1}),t.createVNode(f,{modelValue:e.showEditPlatform,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditPlatform=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editPlatformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditPlatform=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingPlatform,onClick:e.doSavePlatform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",I,[t.createVNode(c,{ref:"refPlatformForm",model:e.platformFormModel,"label-width":120},{default:t.withCtx((()=>[t.createVNode(m,{formModel:e.platformFormModel,formItems:e.platformFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(f,{modelValue:e.showEditGroup,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showEditGroup=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editGroupformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[2]||(i[2]=t=>e.showEditGroup=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingGroupform,onClick:e.doSaveGroupform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",v,[t.createVNode(c,{ref:"refGroupForm",model:e.groupFormModel,"label-width":115},{default:t.withCtx((()=>[t.createVNode(m,{formModel:e.groupFormModel,formItems:e.groupFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-f58b0adc"]]),y={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},C=t.defineComponent({name:"Module",components:{SelectPlatform:r.SelectPlatform},emits:["change"],props:y,setup:(e,t)=>new N(e,t)});let N=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"moduleApi",new i.ModuleApi),h(this,"selectedPlatform"),h(this,"moduleWidth",t.ref("calc(100% - 300px)")),h(this,"webOrApp",t.ref(0)),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!1,isCurrent:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],toolbars:[{name:"addModule",type:"primary",icon:"md-add",text:"新增",onclick:()=>{this.doAddModule()}},{name:"importModule",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportModule()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"ModuleName",title:"模块名称",minWidth:250,treeNode:!0},{colType:"ro",field:"ModuleAlias",title:"别名",width:250,align:"center"},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"ModuleStatus",title:"状态",width:70,align:"center",format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"正常",color:"green"},2:{text:"沙盒",color:"default"}}[this.utilities.getValueNotNull(t.row.ModuleStatus,0)];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"LoadMode",title:"加载模式",width:120,align:"center",format:(e,t)=>({0:"路由",1:"链接",2:"低代码"}[t.row.LoadMode])},{colType:"ro",field:"ModuleUrl",title:"路径",width:260},{title:"操作",width:240,rowButtons:[{name:"editModule",text:"编辑",onclick:e=>{this.doEditModule(e)}},{name:"addModuleChild",text:"新增子项",onclick:e=>{this.doAddChildModule(e)}},{name:"deleteModule",text:"删除",type:"error",onclick:e=>{this.doDeleteModule(e)}}]}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.moduleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformChange",(e=>{this.selectedPlatform=e,this.loadModuleGridData()})),h(this,"handleModuleTypeChange",(()=>{this.setModuleFormItems(),this.loadModuleGridData()})),h(this,"loadModuleGridData",(()=>{this.moduleGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]))})),h(this,"doChangeModuleWidth",(e=>{this.moduleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"parentModule"),h(this,"editModulePId",0),h(this,"editModuleChildData",[]),h(this,"saveingModule",t.ref(!1)),h(this,"moduleComForm",t.ref()),h(this,"showEditModule",t.ref(!1)),h(this,"editMoudelModalTitle",t.ref("新增 - 模块")),h(this,"moduleFormModel",t.reactive({Id:0,PlatformId:0,RootId:0,PId:0,ParentPath:"",HasChild:0,NodeLevel:0,ModuleName:"",ModuleAlias:"",ModuleUrl:"",ModuleType:"",WebOrApp:0,OrderNo:0,IconUrl:"",AttachParams:"",Operates:"",LoadMode:0,ModuleStatus:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"moduleFormItems",t.reactive([{model:"",label:"模块信息",span:24,children:[{model:"PId",label:"上级菜单",span:24,prop:"PId",type:"TreeSelect",isShow:!1,treeSelectProp:{data:[],onChange:(e,t)=>{this.setEditMoudelPId(e)}}},{model:"ModuleName",label:"模块名称",prop:"ModuleName",type:"Input"},{model:"ModuleAlias",label:"模块别名",prop:"ModuleAlias",type:"Input"},{model:"ModuleType",label:"模块类型",prop:"ModuleType",type:"Select",selectProp:{datas:[{text:"顶栏业务组",value:"Business"},{text:"左侧菜单组",value:"MenuGroup"},{text:"左侧菜单项",value:"MenuItem"}],transfer:!0}},{model:"IconUrl",label:"模块图标",prop:"IconUrl",type:"IconSelect",iconSelectProp:{placeholder:"模块图标"}},{model:"ModuleStatus",label:"模块状态",prop:"ModuleStatus",type:"Select",selectProp:{datas:[{text:"禁用",value:0},{text:"正常",value:1},{text:"沙盒",value:2}],transfer:!0}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber"}]},{model:"",label:"路由信息",span:24,children:[{model:"LoadMode",label:"加载模式",span:24,prop:"LoadMode",type:"Radio",radioProp:{datas:[{text:"路由",value:0},{text:"链接",value:1},{text:"低代码",value:3}]}},{model:"ModuleUrl",label:"路由地址",span:24,prop:"ModuleUrl",type:"Input"},{model:"AttachParams",label:"路由参数",span:24,prop:"AttachParams",type:"Input"},{model:"Operates",label:"功能点",span:24,prop:"Operates",type:"Input",inputProp:{type:"textarea",rows:4,placeholder:"例如: [{ code:'Edit', name: '编辑' }]"}}]}])),h(this,"doSaveModule",(async()=>{this.saveingModule.value=!0;let e=await this.moduleApi.save(this.moduleFormModel),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingModule.value=!1);if(0==this.moduleFormModel.Id){const e=[{Id:t,RootId:this.utilities.isNull(this.parentModule)?t:this.parentModule.RootId}];this.utilities.isNull(this.parentModule)||0!=this.parentModule.HasChild||e.push({Id:this.parentModule.Id,HasChild:1}),await this.moduleApi.saves(e)}else if(this.editModulePId!=this.moduleFormModel.PId){let i=this.editModuleChildData;this.editModulePId>0&&(e=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",this.editModulePId)),t=this.utilities.parseApiResult(e),i.push({Id:this.editModulePId,HasChild:t>0?1:0})),await this.moduleApi.saves(i)}this.message.success("保存成功!"),this.moduleGrid.value.refreshData(),this.saveingModule.value=!1,this.showEditModule.value=!1})),h(this,"showImportModule",t.ref(!1)),h(this,"saveingImportModule",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originModuleGrid",t.ref()),h(this,"originModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input",span:24}],rightToolbars:[{name:"refresh"}],columns:[{colType:"checkbox"},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.originModuleGrid.value.loadDataByQuery(t)}}})),h(this,"targetPlatform",t.reactive({Id:0,PlatformName:""})),h(this,"targetModuleGrid",t.ref()),h(this,"targetModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0,isCurrent:!0},treeConfig:{expandAll:!0}},toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return this.utilities.isNull(i)?"":e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.targetModuleGrid.value.loadDataByQuery(t)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginModuleGridData()})),h(this,"doImportOriginToTargetModule",(async()=>{const e=this.originModuleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台模块菜单");const t=this.targetModuleGrid.value.getCurrentRecord();if(this.utilities.isNull(t))return void this.message.warning("请选择目标平台模块菜单");this.saveingImportModule.value=!0;const i=await this.moduleApi.importModules(e,t),o=this.utilities.parseApiResult(i);this.saveingImportModule.value=!1,o>0?(this.originModuleGrid.value.refreshData(),this.targetModuleGrid.value.refreshData(),this.moduleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r}setModuleFormItems(){0===this.webOrApp.value?this.moduleFormItems[0].children&&(this.moduleFormItems[0].children[4].type="IconSelect"):this.moduleFormItems[0].children&&(this.moduleFormItems[0].children[4].type="Input")}setEditMoudelPId(e){this.editModuleChildData=[];const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e))[0];this.moduleFormModel.RootId=i?i.RootId:this.moduleFormModel.Id,this.moduleFormModel.PId=i?i.Id:0,this.moduleFormModel.ParentPath=i?`${i.ParentPath}${i.Id}/`:"/",this.moduleFormModel.NodeLevel=i?i.NodeLevel+1:1;((e,t)=>{const i=e.filter((e=>e.PId==t.Id));for(const o of i)this.editModuleChildData.push({Id:o.Id,RootId:t.RootId,ParentPath:`${t.ParentPath}${t.Id}/`,NodeLevel:t.NodeLevel+1})})(t,this.moduleFormModel)}setParentModuleTreeItem(e){const t=this.moduleFormItems[0].children[0];if(t.isShow=e,0==e)return;const i=this.moduleGrid.value.getDatas(),o=this.moduleComForm.value.convertTreeData({datas:i,titleField:"ModuleName",rootTitle:"主目录",rootValue:0});t.treeSelectProp.data=o}doEditModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=e.Id,this.moduleFormModel.PlatformId=e.PlatformId,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.PId,this.moduleFormModel.ParentPath=e.ParentPath,this.moduleFormModel.HasChild=e.HasChild,this.moduleFormModel.NodeLevel=e.NodeLevel,this.moduleFormModel.ModuleName=e.ModuleName,this.moduleFormModel.ModuleAlias=e.ModuleAlias,this.moduleFormModel.ModuleUrl=e.ModuleUrl,this.moduleFormModel.ModuleType=e.ModuleType,this.moduleFormModel.WebOrApp=e.WebOrApp,this.moduleFormModel.OrderNo=e.OrderNo,this.moduleFormModel.IconUrl=e.IconUrl,this.moduleFormModel.AttachParams=e.AttachParams,this.moduleFormModel.Operates=e.Operates,this.moduleFormModel.LoadMode=e.LoadMode,this.moduleFormModel.ModuleStatus=e.ModuleStatus,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.editModulePId=e.PId,this.editModuleChildData=[],this.editMoudelModalTitle.value=`编辑 - 模块 - ${e.ModuleName}`,this.setParentModuleTreeItem(!0),this.showEditModule.value=!0}doAddModule(){const e=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=0,this.moduleFormModel.PId=0,this.moduleFormModel.ParentPath="/",this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates='[{"code":"Edit", "name": "编辑"},{"code":"Delete", "name": "删除"},{"code":"Add", "name": "新增"},{"code":"Save", "name": "保存"}]',this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=e.Id,this.moduleFormModel.LastUpdateUserName=e.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value="新增 - 模块",this.showEditModule.value=!0}doAddChildModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.Id,this.moduleFormModel.ParentPath=`${e.ParentPath}${e.Id}/`,this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=e.NodeLevel+1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business"==e.ModuleType?"MenuGroup":"MenuItem",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates="",this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=e,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value=`新增子项 - 父模块 - ${e.ModuleName}`,this.showEditModule.value=!0}async doDeleteModule(e){1!=e.HasChild?this.modal.confirm({title:"提示",content:`数据删除后不可恢复, 确定要删除[ ${e.ModuleName} ]模块吗?`,onOk:async()=>{const t=e.PId;let i=await this.moduleApi.delete(e.Id),s=this.utilities.parseApiResult(i);s<=0?this.message.warning("删除失败,请稍后重试!"):(i=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",t)),s=this.utilities.parseApiResult(i),s<=0&&await this.moduleApi.save({Id:t,HasChild:0}),this.message.success("删除成功!"),this.moduleGrid.value.refreshData())}}):this.message.warning("该模块存在子模板, 不能删除, 请先删除子模块!")}doShowImportModule(){this.targetPlatform.Id=this.selectedPlatform.Id,this.targetPlatform.PlatformName=this.selectedPlatform.PlatformName,this.showImportModule.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginModuleGridData(),this.loadTargetModuleGridData()}))}loadOriginModuleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.originModuleGrid.value.loadDataByQuery(e)}loadTargetModuleGridData(){this.targetModuleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.targetPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]),i=await this.moduleApi.getEntities(t),s=this.utilities.parseApiResult(i),r={Id:0,PId:-1,ModuleName:"根节点",ModuleType:"",PlatformId:this.targetPlatform.Id,IconUrl:""};s.push(r),e.success(s)}))}};const M={style:{height:"650px","overflow-y":"auto"}},x={class:"import-module",style:{height:"650px",position:"relative"}},P={style:{width:"100%",height:"100%"}},U={style:{width:"560px",height:"100%",float:"left"}},T={style:{height:"calc(100% - 0px)"}},A={style:{width:"calc(100% - 570px)",height:"100%","margin-left":"10px",display:"inline-block"}},b={style:{height:"calc(100% - 0px)"}},F=(e=>(t.pushScopeId("data-v-e41c07fc"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"点击选择要放置的位置!",-1)));const S=f(C,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("Radio"),d=t.resolveComponent("RadioGroup"),u=t.resolveComponent("NvGrid"),h=t.resolveComponent("NvComForm"),p=t.resolveComponent("Form"),m=t.resolveComponent("Button"),c=t.resolveComponent("Modal"),f=t.resolveComponent("Option"),g=t.resolveComponent("Select"),I=t.resolveComponent("Card"),v=t.resolveComponent("Spin"),w=t.resolveComponent("NvBox"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"module"},{default:t.withCtx((()=>[t.createVNode(w,{width:"100%",title:"模块列表"},{default:t.withCtx((()=>[t.createVNode(u,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformChange},null,8,["onSelect"]),t.createVNode(d,{modelValue:e.webOrApp,"onUpdate:modelValue":i[0]||(i[0]=t=>e.webOrApp=t),type:"button",onOnChange:e.handleModuleTypeChange},{default:t.withCtx((()=>[t.createVNode(n,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(n,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.createVNode(c,{modelValue:e.showEditModule,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditModule=t),draggable:"",mask:!0,"mask-closable":!1,width:700,title:e.editMoudelModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(m,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(m,{type:"primary",loading:e.saveingModule,onClick:e.doSaveModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",M,[t.createVNode(p,{model:e.moduleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(h,{ref:"moduleComForm",formModel:e.moduleFormModel,formItems:e.moduleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(c,{modelValue:e.showImportModule,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"引入模块",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(m,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(m,{type:"primary",loading:e.saveingImportModule,onClick:e.doImportOriginToTargetModule},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",x,[t.createElementVNode("div",P,[t.createElementVNode("div",U,[t.createVNode(I,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("源平台 - ["+t.toDisplayString(e.originPlatform.selectedItem.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",T,[t.createVNode(u,{ref:"originModuleGrid",option:e.originModuleGridOption},{default:t.withCtx((()=>[t.createVNode(g,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[3]||(i[3]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((e,i)=>(t.openBlock(),t.createBlock(f,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1})]),t.createElementVNode("div",A,[t.createVNode(I,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("目标平台 - ["+t.toDisplayString(e.targetPlatform.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",b,[t.createVNode(u,{ref:"targetModuleGrid",option:e.targetModuleGridOption},{default:t.withCtx((()=>[F])),_:1},8,["option"])])])),_:1})]),t.withDirectives(t.createVNode(v,{fix:""},null,512),[[t.vShow,e.saveingImportModule]])])])])),_:1},8,["modelValue"])])),_:1})])),_:1})}],["__scopeId","data-v-e41c07fc"]]),R={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},V=t.defineComponent({name:"Role",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:R,setup:(e,t)=>new k(e,t)});let k=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"roleApi",new i.RoleApi),h(this,"moduleApi",new i.ModuleApi),h(this,"roleModuleApi",new i.RoleModuleApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionRoleApi",new i.InstitutionRoleApi),h(this,"selectedPlatform"),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"RoleName",title:"角色名称",type:"Input"},{field:"RoleCode",title:"角色编码",type:"Input"},{field:"RoleStatus",title:"状态",type:"Radio",data:[{text:"启用",value:1},{text:"禁用",value:0}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}},{name:"importRole",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"RoleName",title:"角色名称",width:250},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"select",field:"RoleStatus",title:"角色状态",width:100,align:"center",defaultValue:1,select:{data:[{text:"启用",value:1},{text:"禁用",value:0}]},format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"启用",color:"green"}}[t.row.RoleStatus];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"FrontEndVisible",title:"角色类型",width:120,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:0}]},format:(e,t)=>{const i={0:{text:"前台不可见",color:"blue"},1:{text:"前台可见",color:"green"}}[t.row.FrontEndVisible];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",minWidth:200},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200},{colType:"ed",field:"WelcomeUrl",title:"欢迎页面",width:200},{title:"操作",width:200,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"moduleRole",text:"模块权限",onclick:(e,t)=>{this.doShowRoleModule(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).orderBy(["OrderNo"]);this.utilities.isNull(e.RoleName)||t.like("RoleName",e.RoleName),this.utilities.isNull(e.RoleCode)||t.like("RoleCode",e.RoleCode),this.utilities.isNull(e.RoleStatus)||t.eq("RoleStatus",e.RoleStatus),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformListSelect",(e=>{this.selectedPlatform=e;const t=this.storageInfo.getUser();this.roleGrid.value.setGloablValue("PlatformId",this.selectedPlatform.Id),this.roleGrid.value.setGloablValue("LastUpdateUserId",t.Id),this.roleGrid.value.setGloablValue("LastUpdateUserName",t.UserName),this.roleGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.loadRoleGridData()})),h(this,"loadRoleGridData",(async()=>{const e=await this.institutionRoleApi.getEntities(o.QueryWrapper.create()),t=this.utilities.parseApiResult(e),i=[];for(let o of t)i.some((e=>e==o.RoleId))||i.push(o.RoleId);const s=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).orderBy(["OrderNo"]);i.length>0&&s.notIn("Id",i),this.roleGrid.value.loadDataByQuery(s)})),h(this,"doChangeRoleWidth",(e=>{this.roleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 角色")),h(this,"roleFormModel",t.reactive({Id:0,PlatformId:0,RoleName:"",RoleCode:"",RoleDesc:"",RoleStatus:1,FrontEndVisible:0,DefaultUrl:"",WelcomeUrl:"",OrderNo:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"roleFormItems",t.reactive([{model:"RoleName",label:"角色名称",prop:"RoleName",type:"Input",span:24,rules:[{required:!0,message:"角色名称不能为空",trigger:"blur"}]},{model:"RoleCode",label:"角色编码",prop:"RoleCode",type:"Input",span:24,rules:[{required:!0,message:"角色编码不能为空",trigger:"blur"}]},{model:"RoleDesc",label:"角色描述",prop:"RoleDesc",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"RoleStatus",label:"角色状态",prop:"RoleStatus",type:"Radio",span:12,radioProp:{datas:[{text:"启用",value:1},{text:"禁用",value:0}],type:"button"}},{model:"FrontEndVisible",label:"角色类型",prop:"FrontEndVisible",type:"Radio",span:12,radioProp:{datas:[{text:"前台可见",value:1},{text:"前台不可见",value:0}],type:"button"}},{model:"DefaultUrl",label:"默认页面",prop:"DefaultUrl",type:"Input",span:24},{model:"WelcomeUrl",label:"欢迎页面",prop:"WelcomeUrl",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.roleApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"selectRole"),h(this,"saveRoleModuleing",t.ref(!1)),h(this,"showRoleModule",t.ref(!1)),h(this,"roleModuleTitle",t.ref("")),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0},pageSize:15},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row)}})},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0,width:260},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"Operates",title:"功能点权限",format:(e,t)=>{const i=this.utilities.isNull(t.row.Operates)?[]:JSON.parse(t.row.Operates);if(0==i.length)return"";const o=[],r=e(s.Checkbox,{label:"all","model-value":t.row.IsAllChk,"onUpdate:model-value":e=>{t.row.IsAllChk=e,t.row.RoleOperates=t.row.IsAllChk?o:[],this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>"全选")),l=e(s.Divider,{type:"vertical"}),a=[];for(const d of i)o.push(d.code),a.push(e(s.Checkbox,{label:d.code},(()=>d.name)));const n=e(s.CheckboxGroup,{"model-value":t.row.RoleOperates,"onUpdate:model-value":e=>{t.row.RoleOperates=e,this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>a));return e(s.Space,(()=>[r,l,n]))}}],event:{event_search:e=>{this.loadModuleGridData(e)}}})),h(this,"loadModuleGridData",(e=>{this.moduleGrid.value.loadData((async t=>{const i=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).ne("ModuleStatus",0).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||i.like("ModuleName",e.ModuleName);let s=await this.moduleApi.getEntities(i),r=this.utilities.parseApiResult(s);const l=o.QueryWrapper.create().eq("RoleId",this.selectRole.Id);s=await this.roleModuleApi.getEntities(l);let a=this.utilities.parseApiResult(s);for(const e of r){const t=a.filter((t=>t.ModuleId==e.Id));if(t.length>0){const i=t[0];e.IsChk=!0,e.RoleModuleId=i.Id,e.RoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.OrgIsChk=!0,e.OrgRoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.IsChange=!1,e.IsAllChk=!1}else e.IsChk=!1,e.RoleModuleId=0,e.RoleOperates=[],e.OrgIsChk=!1,e.OrgRoleOperates=[],e.IsChange=!1,e.IsAllChk=!1}t.success(r)}))})),h(this,"doSaveRoleModule",(async()=>{const e=this.moduleGrid.value.getDatas().filter((e=>1==e.IsChange));if(0==e.length)return void this.message.warning("没有需要保存的数据");this.saveRoleModuleing.value=!0;const t=[],i=[],o=[];for(const r of e)0==r.RoleModuleId?t.push({Id:0,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):0!=r.RoleModuleId&&1==r.IsChk?i.push({Id:r.RoleModuleId,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):o.push(r.RoleModuleId);const s=[...t,...i];s.length>0&&await this.roleModuleApi.saves(s),o.length>0&&await this.roleModuleApi.deleteByIds(o.join(",")),this.message.success("操作完成"),this.saveRoleModuleing.value=!1,this.showRoleModule.value=!1})),h(this,"showImportRole",t.ref(!1)),h(this,"saveingImportRole",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformAbbreviation:""},selectedId:0})),h(this,"originRoleGrid",t.ref()),h(this,"originRoleGridOption",t.reactive({api:this.roleApi,setting:{border:!1,searchConfig:{btnSpan:24,labelWidth:80,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ed",field:"RoleName",title:"角色名称",minWidth:160},{colType:"ed",field:"RoleCode",title:"角色编码",width:120,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",width:200}]})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.loadOriginRoleGridData()})),h(this,"doImportRole",(async()=>{const e=this.originRoleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台角色");this.saveingImportRole.value=!0;let t=[];for(const s of e)t.push(s.Id);const i=await this.roleApi.importRoles(this.selectedPlatform.Id,t),o=this.utilities.parseApiResult(i);this.saveingImportRole.value=!1,o?(this.showImportRole.value=!1,this.roleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 删除角色配置的模块权限。 <br/> 2. 删除用户关联该角色的索引。 <br/> 3. 删除该角色。 <br/> 确定要执行该操作吗?",onOk:async()=>{await this.roleModuleApi.deleteRoleModuleByRoleId(e.Id);const t=await this.roleApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}doEditRole(e){const t=this.storageInfo.getUser();this.roleFormModel.Id=e.Id,this.roleFormModel.PlatformId=e.PlatformId,this.roleFormModel.RoleName=e.RoleName,this.roleFormModel.RoleCode=e.RoleCode,this.roleFormModel.RoleDesc=e.RoleDesc,this.roleFormModel.RoleStatus=e.RoleStatus,this.roleFormModel.FrontEndVisible=e.FrontEndVisible,this.roleFormModel.DefaultUrl=e.DefaultUrl,this.roleFormModel.WelcomeUrl=e.WelcomeUrl,this.roleFormModel.OrderNo=e.OrderNo,this.roleFormModel.LastUpdateUserId=t.Id,this.roleFormModel.LastUpdateUserName=t.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value=`编辑 - ${e.RoleName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.PlatformId=this.selectedPlatform.Id,this.roleFormModel.RoleName="",this.roleFormModel.RoleCode="",this.roleFormModel.RoleDesc="",this.roleFormModel.RoleStatus=1,this.roleFormModel.FrontEndVisible=0,this.roleFormModel.DefaultUrl="",this.roleFormModel.WelcomeUrl="",this.roleFormModel.OrderNo=0,this.roleFormModel.LastUpdateUserId=e.Id,this.roleFormModel.LastUpdateUserName=e.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value="新增 - 角色",this.showEditRole.value=!0}doShowRoleModule(e){this.selectRole=e,this.roleModuleTitle.value=`模块权限 - ${this.selectRole.RoleName}`,this.showRoleModule.value=!0,t.nextTick((()=>{this.loadModuleGridData({})}))}setRoleModuleIsChange(e){let t=!1;if(e.OrgIsChk!=e.IsChk&&(t=!0),e.OrgRoleOperates.length!=e.RoleOperates.length)t=!0;else{for(const i of e.OrgRoleOperates)if(0==e.RoleOperates.filter((e=>e==i)).length){t=!0;break}for(const i of e.RoleOperates)if(0==e.OrgRoleOperates.filter((e=>e==i)).length){t=!0;break}}e.IsChange=t}changeParentRoleModuleStatus(e){const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e.PId&&t.IsChk==!e.IsChk));for(const o of i)o.IsChk=0!=e.IsChk||t.filter((e=>e.PId==o.Id&&1==e.IsChk)).length>0,this.setRoleModuleIsChange(o),this.changeParentRoleModuleStatus(o)}doShowImportRole(){this.showImportRole.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginRoleGridData()}))}loadOriginRoleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("RoleStatus",1).orderBy(["OrderNo"]);this.originRoleGrid.value.loadDataByQuery(e)}};const D={style:{height:"650px","overflow-y":"auto",position:"relative"}},E={class:"import-role",style:{height:"610px",position:"relative"}},O={style:{width:"100%",height:"100%"}},G={style:{height:"530px","overflow-y":"auto"}};const L=f(V,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("Button"),h=t.resolveComponent("Modal"),p=t.resolveComponent("Option"),m=t.resolveComponent("Select"),c=t.resolveComponent("Spin"),f=t.resolveComponent("NvComForm"),g=t.resolveComponent("Form"),I=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(I,{gutter:8,class:"role"},{default:t.withCtx((()=>[t.createVNode(d,{width:"100%",title:"角色列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"roleGrid",option:e.roleGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformListSelect},null,8,["onSelect"])])),_:1},8,["option"])])),_:1}),t.createVNode(h,{modelValue:e.showRoleModule,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showRoleModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"模块权限",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showRoleModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveRoleModuleing,onClick:e.doSaveRoleModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",D,[t.createVNode(n,{ref:"moduleGrid",option:e.moduleGridOption},null,8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(h,{modelValue:e.showImportRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showImportRole=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[3]||(i[3]=t=>e.showImportRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingImportRole,onClick:e.doImportRole},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",E,[t.createElementVNode("div",O,[t.createVNode(n,{ref:"originRoleGrid",option:e.originRoleGridOption},{default:t.withCtx((()=>[t.createVNode(m,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[2]||(i[2]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(p,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.withDirectives(t.createVNode(c,{fix:""},null,512),[[t.vShow,e.saveingImportRole]])])])])),_:1},8,["modelValue"]),t.createVNode(h,{modelValue:e.showEditRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[5]||(i[5]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",G,[t.createVNode(g,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(f,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-0f25fe31"]]),B={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},_=t.defineComponent({name:"InstitutionType",components:{},emits:[""],props:B,setup:(e,t)=>new W(e,t)});class W extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutionTypeGrid",t.ref()),h(this,"institutionTypeGridOption",t.reactive({api:this.institutionTypeApi,setting:{isPagination:!0,pageSize:12,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"Name",title:"机构类型",type:"Input"},{field:"Code",title:"类型编码",type:"Input"}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddInstitutionType()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"Name",title:"机构类型",width:300},{colType:"ed",field:"Code",title:"类型编码",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"Summary",title:"描述"},{title:"操作",width:140,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitutionType(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.institutionTypeGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]);this.utilities.isNull(e.Name)||t.like("Name",e.Name),this.utilities.isNull(e.Code)||t.like("Code",e.Code),this.institutionTypeGrid.value.loadDataByQuery(t)}}})),h(this,"refInstitutionTypeForm",t.ref()),h(this,"saveingInstitutionType",t.ref(!1)),h(this,"showEditInstitutionType",t.ref(!1)),h(this,"editInstitutionTypeModalTitle",t.ref("新增 - 机构类型")),h(this,"institutionTypeFormModel",t.reactive({Id:0,Code:"",Name:"",Summary:"",OrderNo:0})),h(this,"institutionTypeFormItems",t.reactive([{model:"Name",label:"类型名称",prop:"Name",type:"Input",span:24,rules:[{required:!0,message:"类型名称不能为空",trigger:"blur"}]},{model:"Code",label:"类型编码",prop:"Code",type:"Input",span:24,rules:[{required:!0,message:"类型编码不能为空",trigger:"blur"}]},{model:"Summary",label:"描述",prop:"Summary",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitutionType",(async()=>{if(!(await this.refInstitutionTypeForm.value.validate()))return;this.saveingInstitutionType.value=!0;let e=await this.institutionTypeApi.save(this.institutionTypeFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitutionType.value=!1);this.message.success("保存成功!"),this.institutionTypeGrid.value.refreshData(),this.saveingInstitutionType.value=!1,this.showEditInstitutionType.value=!1})),this.props=e,this.ctx=s,this.useBusinessInstitutionType()}useBusinessInstitutionType(){t.onMounted((()=>{this.loadInstitutionTypes()})),t.onUnmounted((()=>{}))}loadInstitutionTypes(){this.institutionTypeGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]))}doEditInstitutionType(e){this.institutionTypeFormModel.Id=e.Id,this.institutionTypeFormModel.Code=e.Code,this.institutionTypeFormModel.Name=e.Name,this.institutionTypeFormModel.Summary=e.Summary,this.institutionTypeFormModel.OrderNo=e.OrderNo,this.editInstitutionTypeModalTitle.value=`编辑 - ${e.Name}`,this.showEditInstitutionType.value=!0}doAddInstitutionType(){this.institutionTypeFormModel.Id=0,this.institutionTypeFormModel.Code="",this.institutionTypeFormModel.Name="",this.institutionTypeFormModel.Summary="",this.institutionTypeFormModel.OrderNo=0,this.editInstitutionTypeModalTitle.value="新增 - 机构类型",this.showEditInstitutionType.value=!0}}const q={style:{height:"350px","overflow-y":"auto"}};const K=f(_,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComForm"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(m,{gutter:8,class:"institutiontype"},{default:t.withCtx((()=>[t.createVNode(n,{title:"机构类型"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"institutionTypeGrid",option:e.institutionTypeGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditInstitutionType,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditInstitutionType=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTypeModalTitle},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditInstitutionType=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingInstitutionType,onClick:e.doSaveInstitutionType},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",q,[t.createVNode(u,{ref:"refInstitutionTypeForm",model:e.institutionTypeFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.institutionTypeFormModel,formItems:e.institutionTypeFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-947fe129"]]),Q={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Y=t.defineComponent({name:"Institution",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Q,setup:(e,t)=>new H(e,t)});let H=class extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutioninforApi",new i.InstitutioninforApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"roleApi",new i.RoleApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"selectedPlatform"),h(this,"institutionTypes",t.ref([])),h(this,"enterprises",[]),h(this,"institutionWidth",t.ref("calc(100% - 45px)")),h(this,"institutionGrid",t.ref()),h(this,"institutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input"},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input"},{field:"InstitutionCode",title:"机构编码",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddInstitution()}},{name:"importInstitution",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportInstitution()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:80,align:"center"},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:250},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",minWidth:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:140},{colType:"ro",field:"EnterpriseId",title:"所属企业",align:"center",width:220,format:(e,t)=>{const i=t.row.EnterpriseId;if(this.utilities.isNull(i))return"";const o=this.enterprises.filter((e=>e.Id==i));return 0==o.length?`${i}`:o[0].EnterpriseName}},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:240,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitution(e)}},{name:"roles",text:"绑定角色",onclick:(e,t)=>{this.doShowBindRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doRemoveInstitution(e)}},{name:"import",text:"->",onclick:(e,t)=>{this.doAddNode(e)}}]}],event:{event_search:e=>{this.loadInstitutionGridData(this.selectedPlatform.Id,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doPlatformListSelect",(async e=>{this.selectedPlatform=e,await this.loadEnterprises(),this.loadInstitutionGridData(this.selectedPlatform.Id,"","",""),this.loadInstitutionTree()})),h(this,"doWidthChange",(e=>{this.institutionWidth.value=e?"calc(100% - 350px)":"calc(100% - 45px)"})),h(this,"saveingInstitution",t.ref(!1)),h(this,"showEditInstitution",t.ref(!1)),h(this,"editInstitutionTitle",t.ref("新增 - 机构")),h(this,"institutionFormModel",t.reactive({Id:0,EnterpriseId:0,InstitutionPlatformId:0,InstitutionCode:"",InstitutionName:"",InstitutionAbbreviation:"",InstitutionTypeCode:"",OrderNo:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"institutionFormItems",t.reactive([{model:"InstitutionName",label:"机构名称",prop:"InstitutionName",type:"Input",span:24,inputProp:{placeholder:"请输入机构名称"}},{model:"InstitutionAbbreviation",label:"机构简称",prop:"InstitutionAbbreviation",type:"Input",span:24,inputProp:{placeholder:"请输入机构简称"}},{model:"InstitutionTypeCode",label:"机构类型",prop:"InstitutionTypeCode",type:"Select",span:24,selectProp:{datas:[],transfer:!0,onChange:(e,t)=>{this.utilities.isNull(e)||(this.institutionFormModel.InstitutionCode=e+"-")}}},{model:"EnterpriseId",label:"所属企业",prop:"EnterpriseId",type:"Select",span:24,selectProp:{datas:[],transfer:!0}},{model:"InstitutionCode",label:"机构编码",prop:"InstitutionCode",type:"Input",span:24,inputProp:{placeholder:"请输入机构编码"}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitution",(async()=>{this.saveingInstitution.value=!0;let e=await this.institutioninforApi.save({Id:this.institutionFormModel.Id,EnterpriseId:this.institutionFormModel.EnterpriseId,InstitutionName:this.institutionFormModel.InstitutionName,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitution.value=!1);await this.institutionPlatformApi.save({Id:this.institutionFormModel.InstitutionPlatformId,InstitutionId:this.institutionFormModel.Id<=0?t:this.institutionFormModel.Id,PlatformId:this.selectedPlatform.Id,InstitutionCode:this.institutionFormModel.InstitutionCode,InstitutionAbbreviation:this.institutionFormModel.InstitutionAbbreviation,InstitutionTypeCode:this.institutionFormModel.InstitutionTypeCode,OrderNo:this.institutionFormModel.OrderNo,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),this.message.success("保存成功!"),this.institutionGrid.value.refreshData(),this.saveingInstitution.value=!1,this.showEditInstitution.value=!1})),h(this,"showImportInstitution",t.ref(!1)),h(this,"saveingImportInstitution",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originInstitutionGrid",t.ref()),h(this,"originInstitutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input",span:12},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input",span:12},{field:"InstitutionCode",title:"机构编码",type:"Input",span:12}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"Id",title:"ID",width:80},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:200},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",width:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:180},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}}],event:{event_search:e=>{this.loadOriginInstitutionGridData(this.selectedPlatform.Id,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")})),h(this,"doImportInstitution",(async()=>{const e=this.originInstitutionGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台机构信息");this.saveingImportInstitution.value=!0;let t=[];const i=this.storageInfo.getUser();for(const r of e)t.push({InstitutionId:r.Id,PlatformId:this.selectedPlatform.Id,InstitutionCode:r.InstitutionCode,InstitutionAbbreviation:r.InstitutionAbbreviation,InstitutionTypeCode:r.InstitutionTypeCode,OrderNo:r.OrderNo,LastUpdateUserId:i.Id,LastUpdateUserName:i.UserName,LastUpdateDate:this.utilities.getCurrentDate()});const o=await this.institutionPlatformApi.saves(t),s=this.utilities.parseApiResult(o);this.saveingImportInstitution.value=!1,s?(this.showImportInstitution.value=!1,this.institutionGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),h(this,"selectedInstitutionTree"),h(this,"insertRecords",[]),h(this,"institutionTree",t.ref([])),h(this,"saveingInstitutionTree",t.ref(!1)),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"renderContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",width:"100%",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))]),e("span",{style:{display:"inline-block",float:"right",marginRight:"8px"}},[e(s.Icon,{type:"md-trash",style:{fontSize:"18px",color:"rgb(225, 76, 23)"},onClick:()=>{this.doDeleteNode(t,i,o)}})])]))),h(this,"doTreeSelectChange",(e=>{e.length>0?this.selectedInstitutionTree=e[0]:this.selectedInstitutionTree=void 0})),h(this,"loadInstitutionTree",(async()=>{this.insertRecords=[],this.selectedInstitutionTree=void 0,this.loadingInstitutionTree.value=!0;const e=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),t=this.utilities.parseApiResult(e);this.loadingInstitutionTree.value=!1;const i=e=>{const o=t.filter((t=>t.PId==e));for(const t of o){t.title=t.InstitutionAbbreviation,t.expand=!0;const e=i(t.Id);e.length>0&&(t.children=e)}return o};this.institutionTree.value=i(0)})),h(this,"doSaveInstitutionTree",(async()=>{if(0==this.insertRecords.length)return void this.message.warning("没有需要保存的数据!");this.saveingInstitutionTree.value=!0;let e=await this.institutionTreeApi.saveInstitutionTrees(this.insertRecords),t=this.utilities.parseApiResult(e);this.saveingInstitutionTree.value=!1,t>0?(this.message.success("保存成功"),this.loadInstitutionTree()):this.message.error("操作异常, 请稍后重试!")})),h(this,"selectInstitution"),h(this,"showBindRole",t.ref(!1)),h(this,"saveingBindRole",t.ref(!1)),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称",width:200},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveBindRole",(async()=>{const e=this.roleGrid.value.getDatas().filter((e=>1==e.IsChk)).map((e=>e.Id)).join(",");this.saveingBindRole.value=!0;const t=await this.institutionPlatformApi.save({Id:this.selectInstitution.InstitutionPlatformId,RoleIds:e}),i=this.utilities.parseApiResult(t);this.saveingBindRole.value=!1,i>0?(this.message.success("保存成功"),this.showBindRole.value=!1,this.institutionGrid.value.refreshData()):this.message.error("保存失败,稍后重试!")})),this.props=e,this.ctx=o,this.useBusinessInstitutionType(),this.useBusinessInstitution()}useBusinessInstitutionType(){t.onMounted((()=>{})),t.onUnmounted((()=>{})),this.getInstitutionTypes()}async getInstitutionTypes(){const e=await this.institutionTypeApi.getEntities(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]));this.institutionTypes.value=this.utilities.parseApiResult(e),this.setInstitutionTypeCodeDatas()}async loadEnterprises(){const e=await this.enterpriseApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.enterprises=this.utilities.parseApiResult(e),this.setEnterpriseDatas()}useBusinessInstitution(){t.onMounted((()=>{})),t.onUnmounted((()=>{}))}loadInstitutionGridData(e,t,i,o){this.institutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}async doRemoveInstitution(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 移除平台与机构的关联。 <br/> 2. 如果机构不存在于其他平台的关联,则会删除该机构。 <br/> 3. 移除该机构对应的机构树。 <br/> 确定要执行该操作吗?",onOk:async()=>{let t=await this.institutionPlatformApi.deleteByInsIdAndPlatformId(e.Id,this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);i<=0?this.message.error("操作失败, 请稍后重试!"):(t=await this.institutionPlatformApi.getCount(o.QueryWrapper.create().eq("InstitutionId",e.Id)),i=this.utilities.parseApiResult(t),0==i&&(t=await this.institutioninforApi.delete(e.Id),i=this.utilities.parseApiResult(t)),t=await this.institutionTreeApi.deleteInstitutionTreeByInstitutionIdAndPlatformId(e.Id,this.selectedPlatform.Id),i=this.utilities.parseApiResult(t),this.message.success("操作成功"),this.institutionGrid.value.refreshData(),i>0&&this.loadInstitutionTree())}})}setInstitutionTypeCodeDatas(){const e=[];for(const t of this.institutionTypes.value)e.push({text:t.Name,value:t.Code});this.institutionFormItems[2].selectProp.datas=e}setEnterpriseDatas(){const e=[];for(const t of this.enterprises.filter((e=>e.PlatformId==this.selectedPlatform.Id)))e.push({text:t.EnterpriseName,value:t.Id});this.institutionFormItems[3].selectProp.datas=e}doEditInstitution(e){const t=this.storageInfo.getUser();this.institutionFormModel.Id=e.Id,this.institutionFormModel.EnterpriseId=e.EnterpriseId,this.institutionFormModel.InstitutionPlatformId=e.InstitutionPlatformId,this.institutionFormModel.InstitutionCode=e.InstitutionCode,this.institutionFormModel.InstitutionName=e.InstitutionName,this.institutionFormModel.InstitutionAbbreviation=e.InstitutionAbbreviation,this.institutionFormModel.InstitutionTypeCode=e.InstitutionTypeCode,this.institutionFormModel.OrderNo=e.OrderNo,this.institutionFormModel.LastUpdateUserId=t.Id,this.institutionFormModel.LastUpdateUserName=t.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="编辑 - "+e.InstitutionName,this.showEditInstitution.value=!0}doAddInstitution(){const e=this.storageInfo.getUser();this.institutionFormModel.Id=0,this.institutionFormModel.EnterpriseId=0,this.institutionFormModel.InstitutionPlatformId=0,this.institutionFormModel.InstitutionCode="",this.institutionFormModel.InstitutionName="",this.institutionFormModel.InstitutionAbbreviation="",this.institutionFormModel.InstitutionTypeCode="",this.institutionFormModel.OrderNo=1,this.institutionFormModel.LastUpdateUserId=e.Id,this.institutionFormModel.LastUpdateUserName=e.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="新增 - 机构",this.showEditInstitution.value=!0}doShowImportInstitution(){this.showImportInstitution.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")}))}loadOriginInstitutionGridData(e,t,i,o){this.originInstitutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}doAddNode(e){if(this.utilities.isNull(this.selectedInstitutionTree)){const t={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:0,PId:0,NodeLevel:1,ParentPath:"/",FakeId:this.utilities.getUniqueCode(),FakePId:null,PlatformId:this.selectedPlatform.Id,InstitutionId:e.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};this.institutionTree.value.push(t),this.insertRecords.push(t)}else{this.utilities.isNull(this.selectedInstitutionTree.children)&&(this.selectedInstitutionTree.children=[]);const t=this.selectedInstitutionTree,i={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:t.RootId,PId:t.Id,NodeLevel:t.NodeLevel+1,ParentPath:t.ParentPath+t.Id+"/",FakeId:this.utilities.getUniqueCode(),FakePId:t.Id>0?null:t.FakeId,InstitutionId:e.Id,PlatformId:this.selectedPlatform.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};t.children.push(i),this.insertRecords.push(i)}}doDeleteNode(e,t,i){this.modal.confirm({title:"提示",content:i.Id>0?"该操作将执行以下步骤 <br/> 1. 将该节点的子节点移动到该节点的父节点下 <br/> 2. 删除该节点 <br/> 确定要执行该操作吗?":"确定要移除该节点及其子节点吗?",onOk:async()=>{if(i.Id>0){const e=await this.institutionTreeApi.deleteInstitutionTree(i.Id);this.utilities.parseApiResult(e)>0?(this.message.success("操作成功"),this.loadInstitutionTree()):this.message.error("操作失败, 请稍后重试!")}else{const o=e.find((e=>e===t)).parent;if(this.utilities.isNull(o)){const e=this.institutionTree.value.indexOf(i);this.institutionTree.value.splice(e,1)}else{const t=e.find((e=>e.nodeKey===o)).node,s=t.children.indexOf(i);t.children.splice(s,1)}const s=e=>{for(const t of e){const e=this.insertRecords.findIndex((e=>e.FakeId==i.FakeId));this.insertRecords.splice(e,1),!this.utilities.isNull(t.children)&&t.children.length>0&&s(t.children)}};s([i])}}})}doShowBindRole(e){this.selectInstitution=e,this.showBindRole.value=!0,this.loadBindRole()}loadBindRole(){this.roleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("RoleStatus",1).orderBy(["OrderNo"]),i=await this.roleApi.getEntities(t),s=this.utilities.parseApiResult(i),r=this.selectInstitution.RoleIds,l=this.utilities.isNull(r)?[]:r.split(",");for(const o of s)o.IsChk=-1!=l.findIndex((e=>e==o.Id));e.success(s)}))}};const z={style:{width:"100%",height:"100%",position:"relative"}},Z={style:{height:"500px","overflow-y":"auto"}},$={class:"import-institution",style:{height:"600px","overflow-y":"auto",position:"relative"}},j={style:{width:"100%",height:"100%"}},J={style:{height:"calc(100%)"}},X={style:{height:"610px","overflow-y":"auto",position:"relative"}};const ee=f(Y,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("Tree"),h=t.resolveComponent("Spin"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Modal"),I=t.resolveComponent("Option"),v=t.resolveComponent("Select"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"institution"},{default:t.withCtx((()=>[t.createVNode(d,{width:e.institutionWidth,title:"机构列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"institutionGrid",option:e.institutionGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformListSelect},null,8,["onSelect"])])),_:1},8,["option"])])),_:1},8,["width"]),t.createVNode(d,{width:"350px",title:"组织机构树",showArrow:!0,expand:!1,onChange:e.doWidthChange},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.loadInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"]),t.createVNode(p,{type:"primary",loading:e.saveingInstitutionTree,onClick:e.doSaveInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",z,[t.createVNode(u,{data:e.institutionTree,render:e.renderContent,class:"tree-render",onOnSelectChange:e.doTreeSelectChange},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(h,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("正在保存中")])),_:1},512),[[t.vShow,e.saveingInstitutionTree]]),t.withDirectives(t.createVNode(h,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(g,{modelValue:e.showEditInstitution,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingInstitution,onClick:e.doSaveInstitution},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Z,[t.createVNode(f,{model:e.institutionFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(c,{ref:"institutionComForm",formModel:e.institutionFormModel,formItems:e.institutionFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(g,{modelValue:e.showImportInstitution,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showImportInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:1200,title:"引入机构",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showImportInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingImportInstitution,onClick:e.doImportInstitution},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",$,[t.createElementVNode("div",j,[t.createElementVNode("div",J,[t.createVNode(n,{ref:"originInstitutionGrid",option:e.originInstitutionGridOption},{default:t.withCtx((()=>[t.createVNode(v,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[2]||(i[2]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(I,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])]),t.withDirectives(t.createVNode(h,{fix:""},null,512),[[t.vShow,e.saveingImportInstitution]])])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showBindRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showBindRole=t),draggable:"",mask:!0,"mask-closable":!1,width:900,title:"绑定角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showBindRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingBindRole,onClick:e.doSaveBindRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",X,[t.createVNode(n,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"]),t.withDirectives(t.createVNode(h,{fix:""},null,512),[[t.vShow,e.saveingBindRole]])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-42799ba1"]]),te=t.defineComponent({name:"LoginLog",components:{},emits:[""],props:{},setup:(e,t)=>new ie(e,t)});let ie=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"loginLogApi",new i.LoginLogApi),h(this,"platformId",0),h(this,"userId",0),h(this,"loginLogGrid",t.ref()),h(this,"loginLogGridOption",t.reactive({api:this.loginLogApi,setting:{border:!0,searchConfig:{btnSpan:12,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"LoginDate",title:"登录日期",type:"DatePicker",span:12},{field:"IPAddress",title:"登录IP",type:"Input",span:12}],toolbars:[{name:"refresh",type:"primary"}],columns:[{colType:"seq"},{colType:"ro",field:"LoginType",title:"登录方式",align:"center"},{colType:"ro",field:"LoginDate",title:"登录日期",align:"center",format:(e,t)=>{const i=t.row.LoginDate;return this.utilities.isNull(i)?"":i}},{colType:"ro",field:"IPAddress",title:"登录IP",align:"center"}],event:{event_search:e=>{this.loadLoginLog(this.platformId,this.userId,e)}}})),h(this,"loadLoginLog",((e,t,i={})=>{this.platformId=e,this.userId=t;const s=o.QueryWrapper.create();s.eq("PlatformId",this.platformId).eq("UserId",this.userId).orderBy(["Id"],!1),this.utilities.isNull(i.IPAddress)||s.like("IPAddress",i.IPAddress);const r=this.utilities.dateHelper.format(i.LoginDate,"YYYY-MM-DD");this.utilities.isNull(i.LoginDate)||s.between("LoginDate",`${r} 00:00:00`,`${r} 23:59:59`),this.loginLogGrid.value.loadDataByQuery(s)})),this.props=e,this.ctx=s}};const oe={class:"loginLog"};const se=f(te,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid");return t.openBlock(),t.createElementBlock("div",oe,[t.createVNode(a,{ref:"loginLogGrid",option:e.loginLogGridOption},null,8,["option"])])}],["__scopeId","data-v-4e2e0184"]]),re={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},le=t.defineComponent({name:"Userinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:se,BaseLogin:r.BaseLogin},emits:[""],props:re,setup:(e,t)=>new ae(e,t)});let ae=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{this.selectedPlatform=e,this.loadInsTree()})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}},{name:"import",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:180,rowButtons:[{name:"login",text:"登录",onclick:(e,t)=>{this.devOpsLogin(e)}},{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountType",label:"账号类型",type:"Radio",radioProp:{type:"button","button-style":"solid",datas:[{text:"用户账号",value:0},{text:"内部账号",value:1}]}},{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"姓名不能为空",trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,7,8]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=1,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.deleteUser(e.UserId,e.InstitutionUserId);this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}doShowImportUser(){this.showImportUser.value=!0,t.nextTick((()=>{this.loadImportUserGrid({})}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}};const ne=e=>(t.pushScopeId("data-v-3969fae6"),e=e(),t.popScopeId(),e),de={class:"instree-search"},ue={class:"instree-list"},he={style:{height:"600px","overflow-y":"auto"}},pe=ne((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),me={style:{height:"600px","overflow-y":"auto"}},ce=ne((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),fe={style:{height:"650px","overflow-y":"auto"}},ge=ne((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选需要引入的用户!",-1))),Ie={style:{height:"650px","overflow-y":"auto"}},ve={style:{display:"none"}},we={style:{height:"400px","overflow-y":"auto"}},ye=["src"],Ce=["src"];const Ne=f(le,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("Tree"),d=t.resolveComponent("Spin"),u=t.resolveComponent("Button"),h=t.resolveComponent("Space"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("NvGrid"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Modal"),I=t.resolveComponent("LoginLog"),v=t.resolveComponent("BaseLogin"),w=t.resolveComponent("FormItem"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(p,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(h,null,{default:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",de,[t.createVNode(a,{onSelect:e.doChangePlatform,width:"100%",showLabel:!1},null,8,["onSelect"])]),t.createElementVNode("div",ue,[t.createVNode(n,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(p,{width:e.userBoxWidth,title:"用户列表"},{default:t.withCtx((()=>[t.createVNode(m,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(g,{modelValue:e.showEditUser,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",he,[t.createVNode(f,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(c,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),pe])])),_:1},8,["modelValue","title"]),t.createVNode(g,{modelValue:e.showUserRole,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[2]||(i[2]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",me,[t.createVNode(m,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[ce])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showImportUser,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportUser=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入用户",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingImportUser,onClick:e.doImportUser},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",fe,[t.createVNode(m,{ref:"otherUserGrid",option:e.otherUserGridOption},{default:t.withCtx((()=>[ge])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[7]||(i[7]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[6]||(i[6]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Ie,[t.createVNode(I,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",ve,[t.createVNode(v,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(g,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[9]||(i[9]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[8]||(i[8]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",we,[t.createVNode(f,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(c,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(w,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,ye)):t.createCommentVNode("",!0),t.createVNode(u,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(w,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Ce)):t.createCommentVNode("",!0),t.createVNode(u,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-3969fae6"]]),Me={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},xe=t.defineComponent({name:"Enterprise",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Me,setup:(e,t)=>new Pe(e,t)});let Pe=class extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"provinceApi",new a.ProvinceApi),h(this,"cityApi",new a.CityApi),h(this,"areaApi",new a.AreaApi),h(this,"selectedPlatform"),h(this,"provinces",[]),h(this,"cities",[]),h(this,"areas",[]),h(this,"refSelectPlatform",t.ref()),h(this,"onlyView",t.ref(!1)),h(this,"enterpriseGrid",t.ref()),h(this,"enterpriseGridOption",t.reactive({api:this.enterpriseApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"EnterpriseName",title:"企业名称",type:"Input",span:6}],toolbars:[{name:"add",onclick:()=>{this.doAddEnterprise()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:70,align:"center"},{colType:"ed",field:"EnterpriseName",title:"企业名称",minWidth:300},{colType:"ed",field:"EnterpriseCode",title:"企业代码",align:"center",minWidth:160},{colType:"ro",field:"Province",title:"省 市 区",align:"center",width:220,format:(e,t)=>{const i=t.row;let o=[],s=this.provinces.filter((e=>e.ProvinceCode==i.Province)),r=this.cities.filter((e=>e.CityCode==i.City)),l=this.areas.filter((e=>e.AreaCode==i.Area));return s.length>0&&o.push(s[0].ProvinceName),r.length>0&&o.push(r[0].CityName),l.length>0&&o.push(l[0].AreaName),e("span",o.join("-"))}},{colType:"ro",field:"Contact",title:"联系人",align:"center",width:120},{colType:"ro",field:"TelPhone",title:"联系电话",align:"center",width:140},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",align:"center",width:140},{colType:"ro",field:"LastUpdateTime",title:"最后修改时间",align:"center",width:160},{title:"操作",width:180,rowButtons:[{name:"view",text:"预览",onclick:(e,t)=>{this.doViewEnterprise(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditEnterprise(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.enterpriseGrid.value.setPageIndex(1),this.loadEnterpriseGridData(e)}}})),h(this,"doPlatformChange",(e=>{this.selectedPlatform=e,this.loadEnterpriseGridData({})})),h(this,"saveingEnterprise",t.ref(!1)),h(this,"showEditEnterprise",t.ref(!1)),h(this,"editEnterpriseTitle",t.ref("新增 - 企业")),h(this,"enterpriseFormModel",t.reactive({Id:0,PlatformId:0,EnterpriseName:"",EnterpriseCode:"",LegalPerson:"",RegisteredCapital:0,Province:"",City:"",Area:"",Address:"",Contact:"",TelPhone:"",LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateTime:"",PostalCode:"",Fax:"",Email:""})),h(this,"enterpriseFormItems",t.reactive([{model:"",label:"基本信息",span:24,children:[{model:"EnterpriseName",label:"企业名称",type:"Input",prop:"EnterpriseName",span:12,inputProp:{placeholder:"请输入企业名称"}},{model:"EnterpriseCode",label:"企业代码",type:"Input",prop:"EnterpriseCode",span:12,inputProp:{placeholder:"请输入企业代码"}},{model:"LegalPerson",label:"企业法人",type:"Input",span:12,inputProp:{placeholder:"请输入企业法人"}},{model:"RegisteredCapital",label:"注册资金",type:"Input",span:12,inputProp:{placeholder:"请输入注册资金",append:"万元"}}]},{model:"",label:"联系信息",span:24,children:[{model:"Province",label:"省份",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setCityDatas(e),this.setAreaDatas("")},transfer:!0,filterable:!0}},{model:"City",label:"城市",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setAreaDatas(e)},transfer:!0,filterable:!0}},{model:"Area",label:"区县",type:"Select",span:8,selectProp:{datas:[],transfer:!0,filterable:!0}},{model:"Address",label:"地址",type:"Input",span:24,inputProp:{rows:4,type:"textarea",placeholder:"请输入联系地址"}},{model:"Contact",label:"联系人",type:"Input",span:12,inputProp:{placeholder:"请输入联系人"}},{model:"TelPhone",label:"联系电话",type:"Input",span:12,inputProp:{placeholder:"请输入联系电话"}},{model:"PostalCode",label:"邮政编码",type:"Input",span:12,inputProp:{placeholder:"请输入邮政编码"}},{model:"Email",label:"Email",type:"Input",span:12,inputProp:{placeholder:"请输入Email地址"}},{model:"Fax",label:"传真",type:"Input",span:12,inputProp:{placeholder:"请输入传真"}}]}])),h(this,"doSaveEnterprise",(async()=>{this.saveingEnterprise.value=!0;let e=await this.enterpriseApi.save(this.enterpriseFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingEnterprise.value=!1);this.message.success("保存成功!"),this.enterpriseGrid.value.refreshData(),this.saveingEnterprise.value=!1,this.showEditEnterprise.value=!1})),this.props=e,this.ctx=o,this.useArea()}async useArea(){let e=await this.provinceApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.provinces=this.utilities.parseApiResult(e),e=await this.cityApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.cities=this.utilities.parseApiResult(e),e=await this.areaApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.areas=this.utilities.parseApiResult(e),this.setProvinceDatas(),this.refSelectPlatform.value.loadPlatforms()}loadEnterpriseGridData(e){const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id);for(const i of Object.keys(e)){const o=e[i];this.utilities.isNull(o)||t.like(i,o)}this.enterpriseGrid.value.loadDataByQuery(t)}setProvinceDatas(){this.enterpriseFormItems[1].children[0].selectProp.datas=this.provinces.map((e=>({text:e.ProvinceName,value:e.ProvinceCode})))}setCityDatas(e){this.enterpriseFormItems[1].children[1].selectProp.datas=this.cities.filter((t=>t.ProvinceCode==e)).map((e=>({text:e.CityName,value:e.CityCode})))}setAreaDatas(e){this.enterpriseFormItems[1].children[2].selectProp.datas=this.areas.filter((t=>t.CityCode==e)).map((e=>({text:e.AreaName,value:e.AreaCode})))}doAddEnterprise(){const e=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=0,this.enterpriseFormModel.PlatformId=this.selectedPlatform.Id,this.enterpriseFormModel.EnterpriseName="",this.enterpriseFormModel.EnterpriseCode="",this.enterpriseFormModel.LegalPerson="",this.enterpriseFormModel.RegisteredCapital=0,this.enterpriseFormModel.Province="",this.enterpriseFormModel.City="",this.enterpriseFormModel.Area="",this.enterpriseFormModel.Address="",this.enterpriseFormModel.Contact="",this.enterpriseFormModel.TelPhone="",this.enterpriseFormModel.PostalCode="",this.enterpriseFormModel.Fax="",this.enterpriseFormModel.Email="",this.enterpriseFormModel.LastUpdateUserId=e.Id,this.enterpriseFormModel.LastUpdateUserName=e.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(""),this.setAreaDatas(""),this.editEnterpriseTitle.value="新增 - 企业",this.showEditEnterprise.value=!0}doEditEnterprise(e){const t=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=e.Id,this.enterpriseFormModel.PlatformId=e.InstitutionId,this.enterpriseFormModel.EnterpriseName=e.EnterpriseName,this.enterpriseFormModel.EnterpriseCode=e.EnterpriseCode,this.enterpriseFormModel.LegalPerson=e.LegalPerson,this.enterpriseFormModel.RegisteredCapital=e.RegisteredCapital,this.enterpriseFormModel.Province=e.Province,this.enterpriseFormModel.City=e.City,this.enterpriseFormModel.Area=e.Area,this.enterpriseFormModel.Address=e.Address,this.enterpriseFormModel.Contact=e.Contact,this.enterpriseFormModel.TelPhone=e.TelPhone,this.enterpriseFormModel.PostalCode=e.PostalCode,this.enterpriseFormModel.Fax=e.Fax,this.enterpriseFormModel.Email=e.Email,this.enterpriseFormModel.LastUpdateUserId=t.Id,this.enterpriseFormModel.LastUpdateUserName=t.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(e.Province),this.setAreaDatas(e.City),this.editEnterpriseTitle.value="编辑 - "+e.EnterpriseName,this.showEditEnterprise.value=!0}doViewEnterprise(e){this.doEditEnterprise(e),this.onlyView.value=!0,this.editEnterpriseTitle.value="预览 - "+e.EnterpriseName}};const Ue={style:{height:"650px","overflow-y":"auto"}};const Te=f(xe,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("NvComForm"),h=t.resolveComponent("Form"),p=t.resolveComponent("Button"),m=t.resolveComponent("Modal"),c=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(c,{gutter:8,class:""},{default:t.withCtx((()=>[t.createVNode(d,{width:"100%",title:"企业列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"enterpriseGrid",option:e.enterpriseGridOption},{default:t.withCtx((()=>[t.createVNode(a,{ref:"refSelectPlatform",onSelect:e.doPlatformChange,defaultLoad:!1},null,8,["onSelect"])])),_:1},8,["option"])])),_:1}),t.createVNode(m,{modelValue:e.showEditEnterprise,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditEnterprise=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editEnterpriseTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditEnterprise=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),e.onlyView?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(p,{key:0,type:"primary",loading:e.saveingEnterprise,onClick:e.doSaveEnterprise},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"]))])),default:t.withCtx((()=>[t.createElementVNode("div",Ue,[t.createVNode(h,{model:e.enterpriseFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(u,{ref:"enterpriseComForm",onlyView:e.onlyView,formModel:e.enterpriseFormModel,formItems:e.enterpriseFormItems},null,8,["onlyView","formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-58aa3e77"]]);class Ae extends o.BaseApi{get ProxyName(){return"CalcPythonApi"}constructor(){super(),this.addHeader("projectid",0),this.addHeader("devprod","prod"),this.addHeader("dbSkey","08fb72ad2cf661088849ef17fdaab21a")}}class be extends Ae{get ControllerName(){return"currency"}constructor(){super(),this.addHeader("tableName","core_partner")}}class Fe extends Ae{get ControllerName(){return"currency"}constructor(){super(),this.addHeader("tableName","core_platform_config")}}const Se={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Re=t.defineComponent({name:"Information",components:{NvComFormUp:n.NvComFormUp},emits:[""],props:Se,setup:(e,t)=>new Ve(e,t)});class Ve extends e.BaseInstance{constructor(e,i){super(),h(this,"props"),h(this,"ctx"),h(this,"corePartnerApi",new be),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.corePartnerApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:130,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"UnitName",title:"第三方单位名称",type:"Input"}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"UnitName",title:"第三方单位名称",align:"left",minWidth:250},{colType:"ed",field:"Contact",title:"联系人",width:200,align:"center"},{colType:"ed",field:"ContactPhone",title:"联系电话",width:200,align:"center"},{colType:"select",field:"IsAuthorize",title:"授权状态",width:140,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:2}]},format:(e,t)=>{const i={1:{text:"是",color:"green"},2:{text:"否",color:"red"}}[t.row.IsAuthorize];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"BusinessType",title:"业务类型",width:140,align:"center",defaultValue:1,select:{data:[{text:"接收",value:1},{text:"推送",value:2}]},format:(e,t)=>{const i={1:{text:"接收",color:"green"},2:{text:"推送",color:"blue"}}[t.row.BusinessType];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"ed",field:"CreateUserName",title:"创建人名称",width:200,align:"center"},{title:"操作",width:200,rowButtons:[{name:"view",text:"开启",isShow:e=>2===e.IsAuthorize,onclick:(e,t)=>{e.IsAuthorize=1,this.doSaveRole2(e)}},{name:"view",text:"禁用",isShow:e=>1===e.IsAuthorize,onclick:(e,t)=>{e.IsAuthorize=2,this.doSaveRole2(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().orderBy(["CreateDate"]);this.utilities.isNull(e.UnitName)||t.like("UnitName",e.UnitName),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 第三方信息")),h(this,"roleFormModel",t.reactive({Id:0,UnitName:"",Contact:"",ContactPhone:"",UniqueKey:"",IsAuthorize:2,BusinessType:1,CreateDate:"",CreateUserId:0,CreateUserName:"",Token:""})),h(this,"roleFormItems",t.reactive([{label:"第三方单位名称","label-width":130,model:"UnitName",prop:"UnitName",type:"Input",span:24,rules:[{required:!0,message:"第三方单位名称不能为空",trigger:"blur"}]},{label:"联系人","label-width":130,model:"Contact",prop:"Contact",type:"Input",span:12},{label:"联系电话","label-width":130,model:"ContactPhone",prop:"ContactPhone",type:"Input",span:12},{model:"BusinessType","label-width":130,label:"业务类型",prop:"BusinessType",type:"Radio",span:12,radioProp:{datas:[{text:"接收",value:1},{text:"推送",value:2}],type:"button"}},{label:"唯一标识","label-width":130,model:"UniqueKey",prop:"UniqueKey",type:"Input",span:24,isShow:!1,inputProp:{disabled:!0}},{label:"附件","label-width":130,model:"Token",prop:"Token",type:"UploadFile",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.corePartnerApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"doSaveRole2",(async e=>{let t=await this.corePartnerApi.save(e);this.utilities.parseApiResult(t)<=0?this.message.warning("变更失败,请稍后重试!"):(this.message.success("变更成功!"),this.roleGrid.value.refreshData())})),this.props=e,this.ctx=i,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{this.loadMainData()})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:`确定要删除${e.UnitName}吗`,onOk:async()=>{const t=await this.corePartnerApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}async loadMainData(){const e=o.QueryWrapper.create().orderBy(["CreateDate"]);this.roleGrid.value.loadDataByQuery(e)}doEditRole(e){this.storageInfo.getUser(),this.roleFormModel.Id=e.Id,this.roleFormModel.UnitName=e.UnitName,this.roleFormModel.Contact=e.Contact,this.roleFormModel.ContactPhone=e.ContactPhone,this.roleFormModel.UniqueKey=e.UniqueKey,this.roleFormModel.IsAuthorize=e.IsAuthorize,this.roleFormModel.BusinessType=e.BusinessType,this.roleFormModel.CreateDate=e.CreateDate,this.roleFormModel.CreateUserId=e.CreateUserId,this.roleFormModel.CreateUserName=e.CreateUserName,this.roleFormModel.Token=e.Token,this.roleFormItems[4].isShow=!0,this.editRoleModalTitle.value=`编辑 - ${e.UnitName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.UnitName="",this.roleFormModel.Contact="",this.roleFormModel.ContactPhone="",this.roleFormModel.UniqueKey=this.utilities.getUniqueCode(),this.roleFormModel.IsAuthorize=2,this.roleFormModel.BusinessType=1,this.roleFormModel.CreateDate=this.utilities.getCurrentDate(),this.roleFormModel.CreateUserId=e.Id,this.roleFormModel.CreateUserName=e.UserName,this.roleFormModel.Token=this.utilities.getUniqueCode(),this.roleFormItems[4].isShow=!1,this.editRoleModalTitle.value="新增 - 第三方信息",this.showEditRole.value=!0}}const ke={style:{"overflow-y":"auto"}};const De=f(Re,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComFormUp"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(m,{gutter:8,class:"information"},{default:t.withCtx((()=>[t.createVNode(n,{width:"100%",title:"第三方信息"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditRole,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ke,[t.createVNode(u,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}]]),Ee={linkParam:{type:String,default:""},operates:{type:String,default:"-"},platformInfo:{type:Object,default:{}},configType:{type:String,default:"BD"}},Oe=t.defineComponent({name:"GeneralConfiguration",components:{},emits:[""],props:Ee,setup:(e,t)=>new Ge(e,t)});class Ge extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"dictionaryDetailApi",new a.DictionaryDetailApi),h(this,"dictionaryTypeApi",new a.DictionaryTypeApi),h(this,"corePlatformConfigApi",new Fe),h(this,"nowRow",t.reactive({Id:0,PlatformId:0,ProjectConfig:"[]",ConstructConfig:"[]",LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()})),h(this,"generalConfGrid",t.ref()),h(this,"generalConfGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},editConfig:{trigger:"click",mode:"row",showStatus:!0},isPagination:!1,pageSize:10},searchOptions:[],toolbars:[{name:"add",onclick:()=>{this.doAddFormData()}},{name:"save",onclick:()=>{this.saveFormData()}},{name:"delete",text:"删除",onclick:()=>{this.deleteFormData()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"label",title:"标签文本",align:"left",minWidth:250},{colType:"ro",field:"prop",title:"属性字段",align:"left",minWidth:250},{colType:"ro",field:"model",title:"表单字段",align:"left",minWidth:250},{colType:"select",field:"seltype",title:"类型",minWidth:240,align:"center",select:{data:[{value:"Input",text:"文字输入框"},{value:"InputNumber",text:"数字输入框"},{value:"Textarea",text:"多行文本"},{value:"TextEditor",text:"富文本"},{value:"DatePicker",text:"日期选择"},{value:"TimePicker",text:"时间选择"},{value:"UploadFile",text:"附件"},{value:"region",text:"地区选择"}]},change:e=>{switch(e.seltype){case"Input":e.type="Input";break;case"InputNumber":e.type="InputNumber",e.rules=[{required:!0,type:"number",message:e.message,trigger:"blur"}];break;case"Textarea":e.type="Input",e.inputProp={type:"textarea",rows:4};break;case"DatePicker":e.type="DatePicker",e.rules=[{required:!0,type:"date",message:e.message,trigger:"change"}];break;case"TimePicker":e.type="TimePicker",e.rules=[{required:!0,type:"date",message:e.message,trigger:"change"}];break;case"UploadFile":e.type="UploadFile";break;case"TextEditor":e.type="TextEditor",e.textHeight=160;break;case"region":e.type="region"}}},{colType:"ed",field:"append",title:"输入框单位",minWidth:120,align:"center",change:e=>{e.append&&"Input"==e.seltype?(e.type="Input",e.inputProp={type:"text",append:e.append}):(e.type=e.seltype,e.inputProp={})}},{colType:"select",field:"span",title:"占位格数",minWidth:120,align:"right",select:{data:[{value:8,text:"8"},{value:12,text:"12"},{value:24,text:"24"}]}},{colType:"select",field:"requiredd",title:"必填项",minWidth:120,align:"center",select:{data:[{value:1,text:"必填"},{value:0,text:"可空"}]},change:e=>{1==e.requiredd?e.rules=[{required:!0,message:e.message,trigger:"blur"}]:e.rules=[]}},{colType:"ed",field:"message",title:"提示信息",minWidth:200,align:"left",change:e=>{e.message?e.rules=[{required:!0,message:e.message,trigger:"blur"}]:e.rules=[]}},{colType:"num",field:"orderNum",title:"排序号",minWidth:80,align:"right"}],event:{}})),h(this,"saveFormData",(async()=>{const e=this.generalConfGrid.value.getSaveDatas();if(0==e.length)return void this.message.warning("没有需要保存的数据");let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig));t.forEach((t=>{e.forEach((e=>{t.model==e.model&&Object.assign(t,e)}))}));let i={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(t):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(t):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(i))>0?(this.message.success("保存成功"),this.loadGeneralSituationData()):this.message.warning("保存失败")})),h(this,"deleteFormData",(async()=>{const e=this.generalConfGrid.value.getCheckboxDatas();0!=e.length?this.modal.confirm({title:"提示",content:"确定删除所选数据吗?",onOk:async()=>{let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig));e.forEach((e=>{t.forEach(((i,o)=>{e.prop==i.prop&&t.splice(o,1)}))}));let i={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(t):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(t):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(i))>0?(this.message.success("删除成功"),this.loadGeneralSituationData()):this.message.error("删除失败")}}):this.message.warning("未勾选数据")})),h(this,"isShowDicModal",t.ref(!1)),h(this,"dicModalTitle",t.ref("概况选择")),h(this,"isShowDicModalLoading",t.ref(!1)),h(this,"dicModalGrid",t.ref()),h(this,"dicModalGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!0,isHover:!0},isPagination:!1,pageSize:10},searchOptions:[],toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"DetailInfor",title:"标签文本",minWidth:200,align:"left"},{colType:"ro",field:"DetailValue",title:"属性字段",minWidth:200,align:"left"}],event:{}})),h(this,"doSaveDicModal",(async()=>{const e=this.dicModalGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("请先勾选数据");this.isShowDicModalLoading.value=!0;let t=[];e.forEach(((e,i)=>{t.push({label:e.DetailInfor,prop:e.DetailValue,model:e.DetailValue,type:"Input",seltype:"Input",append:"",span:8,orderNum:i,requiredd:1,message:e.DetailInfor+"不能为空",rules:[{required:!0,message:e.DetailInfor+"不能为空",trigger:"blur"}]})}));let i="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig)),o=[...t,...i].reduce(((e,t)=>{let i=e.find((e=>e.model==t.model));return i?Object.assign(i,t):e.push(t),e}),[]),s={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(o):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(o):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(s))>0?(this.message.success("保存成功"),this.loadGeneralSituationData(),this.isShowDicModal.value=!1):this.message.warning("保存失败"),this.isShowDicModalLoading.value=!1})),this.props=e,this.ctx=o,this.loadGeneralSituationData()}doAddFormData(){this.isShowDicModal.value=!0,this.loadDicData()}async loadGeneralSituationData(){let e=this.utilities.parseApiResult(await this.corePlatformConfigApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.props.platformInfo.Id})));if(e&&e.length>0){Object.assign(this.nowRow,e[0]);let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(e[0].ProjectConfig)):this.utilities.deepCopy(JSON.parse(e[0].ConstructConfig));t&&t.length>0&&(t=t.sort(((e,t)=>e.orderNum-t.orderNum))),this.loadMainData(t)}}async loadMainData(e){this.generalConfGrid.value.loadData((async t=>{t.success(e)}))}async loadDicData(){let e="GC"==this.props.configType?"ProjectProfileConfiguration":"SectionGeneralConfiguration",t=this.utilities.parseApiResult(await this.dictionaryTypeApi.getEntitiesDynamic(o.QueryWrapper.create().allEq({PlatformId:this.props.platformInfo.PId>0?this.props.platformInfo.PId:this.props.platformInfo.Id,OptionCode:e})));t&&t.length>0&&this.dicModalGrid.value.loadData((async e=>{let i=this.utilities.parseApiResult(await this.dictionaryDetailApi.getEntities(o.QueryWrapper.create().eq("MainId",t[0].Id)));e.success(i)}))}}const Le={style:{height:"600px","overflow-y":"auto"}};const Be=f(Oe,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("Button"),u=t.resolveComponent("Modal"),h=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(h,{gutter:8,class:"platform"},{default:t.withCtx((()=>[t.createVNode(n,{width:"100%"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"generalConfGrid",option:e.generalConfGridOption},null,8,["option"])])),_:1}),t.createVNode(u,{modelValue:e.isShowDicModal,"onUpdate:modelValue":i[1]||(i[1]=t=>e.isShowDicModal=t),draggable:"",mask:!0,"mask-closable":!1,width:600,title:e.dicModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(d,{type:"text",onClick:i[0]||(i[0]=t=>e.isShowDicModal=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(d,{type:"primary",loading:e.isShowDicModalLoading,onClick:e.doSaveDicModal},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Le,[t.createVNode(a,{ref:"dicModalGrid",option:e.dicModalGridOption},null,8,["option"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-a01b6a2e"]]),_e={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},We=t.defineComponent({name:"Platform",components:{GeneralConfiguration:Be},emits:[""],props:_e,setup:(e,t)=>new qe(e,t)});class qe extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"isShowGeneralConfig",t.ref(!1)),h(this,"generalConfigTitle",t.ref("概况配置")),h(this,"platformInfo",t.reactive({})),h(this,"configType",t.ref("GC")),h(this,"upList",t.reactive(Array())),h(this,"platformGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"SKey",title:"唯一KEY",type:"Input"},{field:"PlatformName",title:"系统名称",type:"Input"},{field:"PlatformAbbreviation",title:"系统简称",type:"Input"},{field:"PlatformNo",title:"系统代号",type:"Input"},{field:"PlatformGroup",title:"系统组",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddPlatform()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"SKey",title:"唯一KEY",width:240},{colType:"ed",field:"PlatformName",title:"系统名称",minWidth:250},{colType:"ed",field:"PlatformAbbreviation",title:"系统简称",width:150},{colType:"select",field:"PId",title:"上级平台",width:150,format:(e,t)=>{const i=this.upList.find((e=>e.value==t.row.PId));return e("span",0==t.row.PId?"/":i.text)},select:{data:this.upList,clearable:!0,multiple:!1}},{colType:"ed",field:"PlatformNo",title:"系统代号",width:100},{colType:"ed",field:"PlatformUrl",title:"系统URL",width:230},{colType:"num",field:"OrderNo",title:"排序号",width:80,align:"center"},{title:"概况配置",width:140,fixed:"right",rowButtons:[{name:"view",text:"项目",onclick:e=>{this.configType.value="GC",Object.assign(this.platformInfo,e),this.generalConfigTitle.value=`${e.PlatformName}-项目概况配置`,this.isShowGeneralConfig.value=!0}},{name:"view-",text:"标段",onclick:e=>{this.configType.value="BD",Object.assign(this.platformInfo,e),this.generalConfigTitle.value=`${e.PlatformName}-标段概况配置`,this.isShowGeneralConfig.value=!0}}]},{title:"操作",width:140,fixed:"right",rowButtons:[{name:"edit",text:"编辑",onclick:e=>{this.doEditPlatform(e)}},{name:"delete"}]}],event:{event_search:e=>{this.platformGrid.value.setPageIndex(1);const t=Object.keys(e),i=o.QueryWrapper.create();i.eq("1","1");for(const o of t){const t=e[o];this.utilities.isNull(t)||i.like(o,t)}this.platformGrid.value.loadDataByQuery(i)}}})),h(this,"platformGrid",t.ref()),h(this,"refPlatformForm",t.ref()),h(this,"saveingPlatform",t.ref(!1)),h(this,"showEditPlatform",t.ref(!1)),h(this,"editPlatformModalTitle",t.ref("新增 - 系统平台")),h(this,"platformFormModel",t.reactive({Id:0,SKey:"",PlatformNo:"",PlatformName:"",PlatformAbbreviation:"",OssRootPath:"",PlatformGroup:"0",PlatformUrl:"",OrderNo:0,CABusinessKey:"",PId:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:"",DefaultPwd:""})),h(this,"platformFormItems",t.reactive([{model:"PlatformName",label:"系统名称",prop:"PlatformName",type:"Input",span:24,rules:[{required:!0,message:"系统名称不能为空",trigger:"blur"}]},{model:"PlatformNo",label:"系统编号",prop:"PlatformNo",type:"Input",span:24,rules:[{required:!0,message:"系统编号不能为空",trigger:"blur"}]},{model:"PlatformAbbreviation",label:"系统简称",prop:"PlatformAbbreviation",type:"Input",span:24},{model:"OssRootPath",label:"Oss根路径",prop:"OssRootPath",type:"Input",span:24},{model:"PId",label:"上级平台",prop:"PId",type:"Select",span:24,selectProp:{datas:[],transfer:!0,clearable:!0,multiple:!1,onChange:(e,t)=>{const i=t.selectProp.datas.find((t=>t.value==e));this.platformFormModel.PlatformGroup=this.utilities.isNull(i.PlatformGroup)?"0":i.PlatformGroup}}},{model:"PlatformUrl",label:"系统URL",prop:"PlatformUrl",type:"Input",span:24},{model:"CABusinessKey",label:"CAKey",prop:"CABusinessKey",type:"Input",span:24},{model:"DefaultPwd",label:"用户默认密码",prop:"DefaultPwd",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSavePlatform",(async()=>{if(!(await this.refPlatformForm.value.validate()))return;this.saveingPlatform.value=!0;let e=await this.platformApi.save(this.platformFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingPlatform.value=!1);this.message.success("保存成功!"),this.platformGrid.value.refreshData(),this.saveingPlatform.value=!1,this.showEditPlatform.value=!1})),this.props=e,this.ctx=s,this.usePlatform()}usePlatform(){t.onMounted((()=>{this.loadPlatformGrid()}))}async loadPlatformGrid(){var e;const t=this.storageInfo.getUser();this.platformGrid.value.setGloablValue("LastUpdateUserId",t.Id),this.platformGrid.value.setGloablValue("LastUpdateUserName",t.UserName),this.platformGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.platformGrid.value.setGloablValue("SKey",(()=>this.utilities.getUniqueCode()),!0);const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id;this.platformGrid.value.loadData((async e=>{const t=await this.platformApi.getEntitiesPageDynamic(e.page,e.pageSize,o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"])),s=this.utilities.parseApiResult(t);e.success(s),this.upList.splice(0,this.upList.length);for(const i of s.Datas)this.upList.push({value:i.Id,text:i.PlatformAbbreviation})}))}doEditPlatform(e){var t;const i=this.storageInfo.getUser();this.platformFormModel.Id=e.Id,this.platformFormModel.SKey=e.SKey,this.platformFormModel.PlatformNo=e.PlatformNo,this.platformFormModel.PlatformName=e.PlatformName,this.platformFormModel.PlatformAbbreviation=e.PlatformAbbreviation,this.platformFormModel.OssRootPath=e.OssRootPath,this.platformFormModel.PlatformGroup=e.PlatformGroup,this.platformFormModel.PlatformUrl=e.PlatformUrl,this.platformFormModel.CABusinessKey=e.CABusinessKey,this.platformFormModel.OrderNo=e.OrderNo,this.platformFormModel.LastUpdateUserId=i.Id,this.platformFormModel.LastUpdateUserName=i.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd=e.DefaultPwd;const o=null==(t=this.platformGrid.value)?void 0:t.getDatas();this.platformFormItems[4].selectProp.datas=o.length>0?null==o?void 0:o.map((e=>({value:e.Id,text:e.PlatformAbbreviation,PlatformGroup:e.PlatformGroup}))):[],this.platformFormModel.PId=e.PId,this.editPlatformModalTitle.value=`编辑 - ${e.PlatformName}`,this.showEditPlatform.value=!0}doAddPlatform(){var e;const t=this.storageInfo.getUser();this.platformFormModel.Id=0,this.platformFormModel.SKey=this.utilities.getUniqueCode(),this.platformFormModel.PlatformNo="",this.platformFormModel.PlatformName="",this.platformFormModel.PlatformAbbreviation="",this.platformFormModel.OssRootPath="",this.platformFormModel.PlatformUrl="",this.platformFormModel.CABusinessKey="",this.platformFormModel.OrderNo=0,this.platformFormModel.LastUpdateUserId=t.Id,this.platformFormModel.LastUpdateUserName=t.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd="",this.editPlatformModalTitle.value="新增 - 系统平台";const i=null==(e=this.platformGrid.value)?void 0:e.getDatas();this.platformFormItems[4].selectProp.datas=i.length>0?null==i?void 0:i.map((e=>({value:e.Id,text:e.PlatformAbbreviation,PlatformGroup:e.PlatformGroup}))):[],this.platformFormModel.PId=i.length>0?i[0].Id:0,this.platformFormModel.PlatformGroup=i.length>0?i[0].PlatformGroup:0,this.showEditPlatform.value=!0}}const Ke={style:{height:"550px","overflow-y":"auto"}};const Qe=f(We,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComForm"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("GeneralConfiguration"),c=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(c,{gutter:8,class:"platform"},{default:t.withCtx((()=>[t.createVNode(n,{title:"系统平台"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"platformGrid",option:e.platformGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditPlatform,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditPlatform=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editPlatformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditPlatform=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingPlatform,onClick:e.doSavePlatform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ke,[t.createVNode(u,{ref:"refPlatformForm",model:e.platformFormModel,"label-width":120},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.platformFormModel,formItems:e.platformFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(p,{modelValue:e.isShowGeneralConfig,"onUpdate:modelValue":i[3]||(i[3]=t=>e.isShowGeneralConfig=t),fullscreen:"",title:e.generalConfigTitle},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[2]||(i[2]=t=>e.isShowGeneralConfig=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[e.isShowGeneralConfig?(t.openBlock(),t.createBlock(m,{key:0,platformInfo:e.platformInfo,configType:e.configType},null,8,["platformInfo","configType"])):t.createCommentVNode("",!0)])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-fbc0e7f2"]]),Ye={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},He=t.defineComponent({name:"Role",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Ye,setup:(e,t)=>new ze(e,t)});class ze extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"roleApi",new i.RoleApi),h(this,"moduleApi",new i.ModuleApi),h(this,"roleModuleApi",new i.RoleModuleApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionRoleApi",new i.InstitutionRoleApi),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"webOrApp",t.ref(0)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doPlatformListSelect()}))})),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"RoleName",title:"角色名称",type:"Input"},{field:"RoleCode",title:"角色编码",type:"Input"},{field:"RoleStatus",title:"状态",type:"Radio",data:[{text:"启用",value:1},{text:"禁用",value:0}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}},{name:"importRole",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"RoleName",title:"角色名称",width:250},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"select",field:"RoleStatus",title:"角色状态",width:100,align:"center",defaultValue:1,select:{data:[{text:"启用",value:1},{text:"禁用",value:0}]},format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"启用",color:"green"}}[t.row.RoleStatus];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"FrontEndVisible",title:"角色类型",width:120,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:0}]},format:(e,t)=>{const i={0:{text:"前台不可见",color:"blue"},1:{text:"前台可见",color:"green"}}[t.row.FrontEndVisible];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",minWidth:200},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200},{colType:"ed",field:"WelcomeUrl",title:"欢迎页面",width:200},{title:"操作",width:200,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"moduleRole",text:"模块权限",onclick:(e,t)=>{this.doShowRoleModule(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value).orderBy(["OrderNo"]);this.utilities.isNull(e.RoleName)||t.like("RoleName",e.RoleName),this.utilities.isNull(e.RoleCode)||t.like("RoleCode",e.RoleCode),this.utilities.isNull(e.RoleStatus)||t.eq("RoleStatus",e.RoleStatus),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformListSelect",(()=>{const e=this.storageInfo.getUser();this.roleGrid.value.setGloablValue("PlatformId",this.platId.value),this.roleGrid.value.setGloablValue("LastUpdateUserId",e.Id),this.roleGrid.value.setGloablValue("LastUpdateUserName",e.UserName),this.roleGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.loadRoleGridData()})),h(this,"loadRoleGridData",(async()=>{const e=await this.institutionRoleApi.getEntities(o.QueryWrapper.create()),t=this.utilities.parseApiResult(e),i=[];for(let o of t)i.some((e=>e==o.RoleId))||i.push(o.RoleId);const s=o.QueryWrapper.create().eq("PlatformId",this.platId.value).orderBy(["OrderNo"]);i.length>0&&s.notIn("Id",i),this.roleGrid.value.loadDataByQuery(s)})),h(this,"doChangeRoleWidth",(e=>{this.roleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 角色")),h(this,"roleFormModel",t.reactive({Id:0,PlatformId:0,RoleName:"",RoleCode:"",RoleDesc:"",RoleStatus:1,FrontEndVisible:0,DefaultUrl:"",WelcomeUrl:"",OrderNo:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"roleFormItems",t.reactive([{model:"RoleName",label:"角色名称",prop:"RoleName",type:"Input",span:24,rules:[{required:!0,message:"角色名称不能为空",trigger:"blur"}]},{model:"RoleCode",label:"角色编码",prop:"RoleCode",type:"Input",span:24,rules:[{required:!0,message:"角色编码不能为空",trigger:"blur"}]},{model:"RoleDesc",label:"角色描述",prop:"RoleDesc",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"RoleStatus",label:"角色状态",prop:"RoleStatus",type:"Radio",span:12,radioProp:{datas:[{text:"启用",value:1},{text:"禁用",value:0}],type:"button"}},{model:"FrontEndVisible",label:"角色类型",prop:"FrontEndVisible",type:"Radio",span:12,radioProp:{datas:[{text:"前台可见",value:1},{text:"前台不可见",value:0}],type:"button"}},{model:"DefaultUrl",label:"默认页面",prop:"DefaultUrl",type:"Input",span:24},{model:"WelcomeUrl",label:"欢迎页面",prop:"WelcomeUrl",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.roleApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"selectRole"),h(this,"saveRoleModuleing",t.ref(!1)),h(this,"showRoleModule",t.ref(!1)),h(this,"roleModuleTitle",t.ref("")),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row)}})},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0,width:260},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"Operates",title:"功能点权限",format:(e,t)=>{const i=this.utilities.isNull(t.row.Operates)?[]:JSON.parse(t.row.Operates);if(0==i.length)return"";const o=[],r=e(s.Checkbox,{label:"all","model-value":t.row.IsAllChk,"onUpdate:model-value":e=>{t.row.IsAllChk=e,t.row.RoleOperates=t.row.IsAllChk?o:[],this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>"全选")),l=e(s.Divider,{type:"vertical"}),a=[];for(const d of i)o.push(d.code),a.push(e(s.Checkbox,{label:d.code},(()=>d.name)));const n=e(s.CheckboxGroup,{"model-value":t.row.RoleOperates,"onUpdate:model-value":e=>{t.row.RoleOperates=e,this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>a));return e(s.Space,(()=>[r,l,n]))}}],event:{event_search:e=>{this.loadModuleGridData(e)}}})),h(this,"loadModuleGridData",(e=>{this.moduleGrid.value.loadData((async t=>{const i=o.QueryWrapper.create().allEq({PlatformId:this.platId.value,WebOrApp:this.webOrApp.value}).ne("ModuleStatus",0).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||i.like("ModuleName",e.ModuleName);let s=await this.moduleApi.getEntities(i),r=this.utilities.parseApiResult(s);const l=o.QueryWrapper.create().eq("RoleId",this.selectRole.Id);s=await this.roleModuleApi.getEntities(l);let a=this.utilities.parseApiResult(s);for(const e of r){const t=a.filter((t=>t.ModuleId==e.Id));if(t.length>0){const i=t[0];e.IsChk=!0,e.RoleModuleId=i.Id,e.RoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.OrgIsChk=!0,e.OrgRoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.IsChange=!1,e.IsAllChk=!1}else e.IsChk=!1,e.RoleModuleId=0,e.RoleOperates=[],e.OrgIsChk=!1,e.OrgRoleOperates=[],e.IsChange=!1,e.IsAllChk=!1}t.success(r)}))})),h(this,"doSaveRoleModule",(async()=>{const e=this.moduleGrid.value.getDatas().filter((e=>1==e.IsChange));if(0==e.length)return void this.message.warning("没有需要保存的数据");this.saveRoleModuleing.value=!0;const t=[],i=[],o=[];for(const r of e)0==r.RoleModuleId?t.push({Id:0,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):0!=r.RoleModuleId&&1==r.IsChk?i.push({Id:r.RoleModuleId,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):o.push(r.RoleModuleId);const s=[...t,...i];s.length>0&&await this.roleModuleApi.saves(s),o.length>0&&await this.roleModuleApi.deleteByIds(o.join(",")),this.message.success("操作完成"),this.saveRoleModuleing.value=!1,this.showRoleModule.value=!1})),h(this,"showImportRole",t.ref(!1)),h(this,"saveingImportRole",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformAbbreviation:""},selectedId:0})),h(this,"originRoleGrid",t.ref()),h(this,"originRoleGridOption",t.reactive({api:this.roleApi,setting:{border:!1,searchConfig:{btnSpan:24,labelWidth:80,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ed",field:"RoleName",title:"角色名称",minWidth:160},{colType:"ed",field:"RoleCode",title:"角色编码",width:120,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",width:200}]})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.loadOriginRoleGridData()})),h(this,"doImportRole",(async()=>{const e=this.originRoleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台角色");this.saveingImportRole.value=!0;let t=[];for(const s of e)t.push(s.Id);const i=await this.roleApi.importRoles(this.platId.value,t),o=this.utilities.parseApiResult(i);this.saveingImportRole.value=!1,o?(this.showImportRole.value=!1,this.roleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 删除角色配置的模块权限。 <br/> 2. 删除用户关联该角色的索引。 <br/> 3. 删除该角色。 <br/> 确定要执行该操作吗?",onOk:async()=>{await this.roleModuleApi.deleteRoleModuleByRoleId(e.Id);const t=await this.roleApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}doEditRole(e){const t=this.storageInfo.getUser();this.roleFormModel.Id=e.Id,this.roleFormModel.PlatformId=e.PlatformId,this.roleFormModel.RoleName=e.RoleName,this.roleFormModel.RoleCode=e.RoleCode,this.roleFormModel.RoleDesc=e.RoleDesc,this.roleFormModel.RoleStatus=e.RoleStatus,this.roleFormModel.FrontEndVisible=e.FrontEndVisible,this.roleFormModel.DefaultUrl=e.DefaultUrl,this.roleFormModel.WelcomeUrl=e.WelcomeUrl,this.roleFormModel.OrderNo=e.OrderNo,this.roleFormModel.LastUpdateUserId=t.Id,this.roleFormModel.LastUpdateUserName=t.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value=`编辑 - ${e.RoleName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.PlatformId=this.platId.value,this.roleFormModel.RoleName="",this.roleFormModel.RoleCode="",this.roleFormModel.RoleDesc="",this.roleFormModel.RoleStatus=1,this.roleFormModel.FrontEndVisible=0,this.roleFormModel.DefaultUrl="",this.roleFormModel.WelcomeUrl="",this.roleFormModel.OrderNo=0,this.roleFormModel.LastUpdateUserId=e.Id,this.roleFormModel.LastUpdateUserName=e.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value="新增 - 角色",this.showEditRole.value=!0}doShowRoleModule(e){this.selectRole=e,this.roleModuleTitle.value=`模块权限 - ${this.selectRole.RoleName}`,this.showRoleModule.value=!0,t.nextTick((()=>{this.loadModuleGridData({})}))}setRoleModuleIsChange(e){let t=!1;if(e.OrgIsChk!=e.IsChk&&(t=!0),e.OrgRoleOperates.length!=e.RoleOperates.length)t=!0;else{for(const i of e.OrgRoleOperates)if(0==e.RoleOperates.filter((e=>e==i)).length){t=!0;break}for(const i of e.RoleOperates)if(0==e.OrgRoleOperates.filter((e=>e==i)).length){t=!0;break}}e.IsChange=t}changeParentRoleModuleStatus(e){const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e.PId&&t.IsChk==!e.IsChk));for(const o of i)o.IsChk=0!=e.IsChk||t.filter((e=>e.PId==o.Id&&1==e.IsChk)).length>0,this.setRoleModuleIsChange(o),this.changeParentRoleModuleStatus(o)}doShowImportRole(){this.showImportRole.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.platId.value).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginRoleGridData()}))}loadOriginRoleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("RoleStatus",1).orderBy(["OrderNo"]);this.originRoleGrid.value.loadDataByQuery(e)}}const Ze={style:{height:"650px","overflow-y":"auto",position:"relative"}},$e={class:"import-role",style:{height:"610px",position:"relative"}},je={style:{width:"100%",height:"100%"}},Je={style:{height:"530px","overflow-y":"auto"}};const Xe=f(He,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("Radio"),c=t.resolveComponent("RadioGroup"),f=t.resolveComponent("Button"),g=t.resolveComponent("Modal"),I=t.resolveComponent("NvComForm"),v=t.resolveComponent("Form"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"role"},{default:t.withCtx((()=>[t.createVNode(p,{width:"100%",title:"角色列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"roleGrid",option:e.roleGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformListSelect,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1}),t.createVNode(g,{modelValue:e.showRoleModule,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showRoleModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"模块权限",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[2]||(i[2]=t=>e.showRoleModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveRoleModuleing,onClick:e.doSaveRoleModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ze,[t.createVNode(h,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(c,{modelValue:e.webOrApp,"onUpdate:modelValue":i[1]||(i[1]=t=>e.webOrApp=t),type:"button",onOnChange:e.loadModuleGridData},{default:t.withCtx((()=>[t.createVNode(m,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(m,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showImportRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportRole=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveingImportRole,onClick:e.doImportRole},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",$e,[t.createElementVNode("div",je,[t.createVNode(h,{ref:"originRoleGrid",option:e.originRoleGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[4]||(i[4]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(a,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportRole]])])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showEditRole,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[7]||(i[7]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Je,[t.createVNode(v,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(I,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-414834fa"]]),et={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},tt=t.defineComponent({name:"Enterprise",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:et,setup:(e,t)=>new it(e,t)});class it extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"provinceApi",new a.ProvinceApi),h(this,"cityApi",new a.CityApi),h(this,"areaApi",new a.AreaApi),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doPlatformChange()}))})),h(this,"provinces",[]),h(this,"cities",[]),h(this,"areas",[]),h(this,"refSelectPlatform",t.ref()),h(this,"onlyView",t.ref(!1)),h(this,"enterpriseGrid",t.ref()),h(this,"enterpriseGridOption",t.reactive({api:this.enterpriseApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"EnterpriseName",title:"企业名称",type:"Input",span:6}],toolbars:[{name:"add",onclick:()=>{this.doAddEnterprise()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:70,align:"center"},{colType:"ed",field:"EnterpriseName",title:"企业名称",minWidth:300},{colType:"ed",field:"EnterpriseCode",title:"企业代码",align:"center",minWidth:160},{colType:"ro",field:"Province",title:"省 市 区",align:"center",width:220,format:(e,t)=>{const i=t.row;let o=[],s=this.provinces.filter((e=>e.ProvinceCode==i.Province)),r=this.cities.filter((e=>e.CityCode==i.City)),l=this.areas.filter((e=>e.AreaCode==i.Area));return s.length>0&&o.push(s[0].ProvinceName),r.length>0&&o.push(r[0].CityName),l.length>0&&o.push(l[0].AreaName),e("span",o.join("-"))}},{colType:"ro",field:"Contact",title:"联系人",align:"center",width:120},{colType:"ro",field:"TelPhone",title:"联系电话",align:"center",width:140},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",align:"center",width:140},{colType:"ro",field:"LastUpdateTime",title:"最后修改时间",align:"center",width:160},{title:"操作",width:180,rowButtons:[{name:"view",text:"预览",onclick:(e,t)=>{this.doViewEnterprise(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditEnterprise(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.enterpriseGrid.value.setPageIndex(1),this.loadEnterpriseGridData(e)}}})),h(this,"doPlatformChange",(()=>{this.loadEnterpriseGridData({})})),h(this,"saveingEnterprise",t.ref(!1)),h(this,"showEditEnterprise",t.ref(!1)),h(this,"editEnterpriseTitle",t.ref("新增 - 企业")),h(this,"enterpriseFormModel",t.reactive({Id:0,PlatformId:0,EnterpriseName:"",EnterpriseCode:"",LegalPerson:"",RegisteredCapital:0,Province:"",City:"",Area:"",Address:"",Contact:"",TelPhone:"",LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateTime:"",PostalCode:"",Fax:"",Email:""})),h(this,"enterpriseFormItems",t.reactive([{model:"",label:"基本信息",span:24,children:[{model:"EnterpriseName",label:"企业名称",type:"Input",prop:"EnterpriseName",span:12,inputProp:{placeholder:"请输入企业名称"}},{model:"EnterpriseCode",label:"企业代码",type:"Input",prop:"EnterpriseCode",span:12,inputProp:{placeholder:"请输入企业代码"}},{model:"LegalPerson",label:"企业法人",type:"Input",span:12,inputProp:{placeholder:"请输入企业法人"}},{model:"RegisteredCapital",label:"注册资金",type:"Input",span:12,inputProp:{placeholder:"请输入注册资金",append:"万元"}}]},{model:"",label:"联系信息",span:24,children:[{model:"Province",label:"省份",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setCityDatas(e),this.setAreaDatas("")},transfer:!0,filterable:!0}},{model:"City",label:"城市",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setAreaDatas(e)},transfer:!0,filterable:!0}},{model:"Area",label:"区县",type:"Select",span:8,selectProp:{datas:[],transfer:!0,filterable:!0}},{model:"Address",label:"地址",type:"Input",span:24,inputProp:{rows:4,type:"textarea",placeholder:"请输入联系地址"}},{model:"Contact",label:"联系人",type:"Input",span:12,inputProp:{placeholder:"请输入联系人"}},{model:"TelPhone",label:"联系电话",type:"Input",span:12,inputProp:{placeholder:"请输入联系电话"}},{model:"PostalCode",label:"邮政编码",type:"Input",span:12,inputProp:{placeholder:"请输入邮政编码"}},{model:"Email",label:"Email",type:"Input",span:12,inputProp:{placeholder:"请输入Email地址"}},{model:"Fax",label:"传真",type:"Input",span:12,inputProp:{placeholder:"请输入传真"}}]}])),h(this,"doSaveEnterprise",(async()=>{this.saveingEnterprise.value=!0;let e=await this.enterpriseApi.save(this.enterpriseFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingEnterprise.value=!1);this.message.success("保存成功!"),this.enterpriseGrid.value.refreshData(),this.saveingEnterprise.value=!1,this.showEditEnterprise.value=!1})),this.props=e,this.ctx=s,this.useArea(),this.getPlatData()}async useArea(){let e=await this.provinceApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.provinces=this.utilities.parseApiResult(e),e=await this.cityApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.cities=this.utilities.parseApiResult(e),e=await this.areaApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.areas=this.utilities.parseApiResult(e),this.setProvinceDatas(),this.refSelectPlatform.value.loadPlatforms()}loadEnterpriseGridData(e){const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value);for(const i of Object.keys(e)){const o=e[i];this.utilities.isNull(o)||t.like(i,o)}this.enterpriseGrid.value.loadDataByQuery(t)}setProvinceDatas(){this.enterpriseFormItems[1].children[0].selectProp.datas=this.provinces.map((e=>({text:e.ProvinceName,value:e.ProvinceCode})))}setCityDatas(e){this.enterpriseFormItems[1].children[1].selectProp.datas=this.cities.filter((t=>t.ProvinceCode==e)).map((e=>({text:e.CityName,value:e.CityCode})))}setAreaDatas(e){this.enterpriseFormItems[1].children[2].selectProp.datas=this.areas.filter((t=>t.CityCode==e)).map((e=>({text:e.AreaName,value:e.AreaCode})))}doAddEnterprise(){const e=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=0,this.enterpriseFormModel.PlatformId=this.platId.value,this.enterpriseFormModel.EnterpriseName="",this.enterpriseFormModel.EnterpriseCode="",this.enterpriseFormModel.LegalPerson="",this.enterpriseFormModel.RegisteredCapital=0,this.enterpriseFormModel.Province="",this.enterpriseFormModel.City="",this.enterpriseFormModel.Area="",this.enterpriseFormModel.Address="",this.enterpriseFormModel.Contact="",this.enterpriseFormModel.TelPhone="",this.enterpriseFormModel.PostalCode="",this.enterpriseFormModel.Fax="",this.enterpriseFormModel.Email="",this.enterpriseFormModel.LastUpdateUserId=e.Id,this.enterpriseFormModel.LastUpdateUserName=e.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(""),this.setAreaDatas(""),this.editEnterpriseTitle.value="新增 - 企业",this.showEditEnterprise.value=!0}doEditEnterprise(e){const t=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=e.Id,this.enterpriseFormModel.PlatformId=e.InstitutionId,this.enterpriseFormModel.EnterpriseName=e.EnterpriseName,this.enterpriseFormModel.EnterpriseCode=e.EnterpriseCode,this.enterpriseFormModel.LegalPerson=e.LegalPerson,this.enterpriseFormModel.RegisteredCapital=e.RegisteredCapital,this.enterpriseFormModel.Province=e.Province,this.enterpriseFormModel.City=e.City,this.enterpriseFormModel.Area=e.Area,this.enterpriseFormModel.Address=e.Address,this.enterpriseFormModel.Contact=e.Contact,this.enterpriseFormModel.TelPhone=e.TelPhone,this.enterpriseFormModel.PostalCode=e.PostalCode,this.enterpriseFormModel.Fax=e.Fax,this.enterpriseFormModel.Email=e.Email,this.enterpriseFormModel.LastUpdateUserId=t.Id,this.enterpriseFormModel.LastUpdateUserName=t.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(e.Province),this.setAreaDatas(e.City),this.editEnterpriseTitle.value="编辑 - "+e.EnterpriseName,this.showEditEnterprise.value=!0}doViewEnterprise(e){this.doEditEnterprise(e),this.onlyView.value=!0,this.editEnterpriseTitle.value="预览 - "+e.EnterpriseName}}const ot={style:{height:"650px","overflow-y":"auto"}};const st=f(tt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("NvComForm"),c=t.resolveComponent("Form"),f=t.resolveComponent("Button"),g=t.resolveComponent("Modal"),I=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(I,{gutter:8,class:""},{default:t.withCtx((()=>[t.createVNode(p,{width:"100%",title:"企业列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"enterpriseGrid",option:e.enterpriseGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformChange,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1}),t.createVNode(g,{modelValue:e.showEditEnterprise,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditEnterprise=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editEnterpriseTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditEnterprise=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),e.onlyView?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(f,{key:0,type:"primary",loading:e.saveingEnterprise,onClick:e.doSaveEnterprise},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"]))])),default:t.withCtx((()=>[t.createElementVNode("div",ot,[t.createVNode(c,{model:e.enterpriseFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(m,{ref:"enterpriseComForm",onlyView:e.onlyView,formModel:e.enterpriseFormModel,formItems:e.enterpriseFormItems},null,8,["onlyView","formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-57711b94"]]),rt={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},lt=t.defineComponent({name:"Institution",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:rt,setup:(e,t)=>new at(e,t)});class at extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutioninforApi",new i.InstitutioninforApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"roleApi",new i.RoleApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"platId",t.ref(0)),h(this,"selectPlat",t.ref({})),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id,t.nextTick((()=>{this.doPlatformListSelect(this.platId.value)})))})),h(this,"institutionTypes",t.ref([])),h(this,"enterprises",[]),h(this,"institutionWidth",t.ref("calc(100% - 45px)")),h(this,"institutionGrid",t.ref()),h(this,"institutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input"},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input"},{field:"InstitutionCode",title:"机构编码",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddInstitution()}},{name:"importInstitution",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportInstitution()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:80,align:"center"},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:250},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",minWidth:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:140},{colType:"ro",field:"EnterpriseId",title:"所属企业",align:"center",width:220,format:(e,t)=>{const i=t.row.EnterpriseId;if(this.utilities.isNull(i))return"";const o=this.enterprises.filter((e=>e.Id==i));return 0==o.length?`${i}`:o[0].EnterpriseName}},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:240,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitution(e)}},{name:"roles",text:"绑定角色",onclick:(e,t)=>{this.doShowBindRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doRemoveInstitution(e)}},{name:"import",text:"->",onclick:(e,t)=>{this.doAddNode(e)}}]}],event:{event_search:e=>{this.loadInstitutionGridData(this.platId.value,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doPlatformListSelect",(async e=>{const t=this.platData.value.find((t=>t.Id==e));this.selectPlat.value=t,await this.loadEnterprises(),this.loadInstitutionGridData(this.platId.value,"","",""),this.loadInstitutionTree()})),h(this,"doWidthChange",(e=>{this.institutionWidth.value=e?"calc(100% - 350px)":"calc(100% - 45px)"})),h(this,"saveingInstitution",t.ref(!1)),h(this,"showEditInstitution",t.ref(!1)),h(this,"editInstitutionTitle",t.ref("新增 - 机构")),h(this,"institutionFormModel",t.reactive({Id:0,EnterpriseId:0,InstitutionPlatformId:0,InstitutionCode:"",InstitutionName:"",InstitutionAbbreviation:"",InstitutionTypeCode:"",OrderNo:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"institutionFormItems",t.reactive([{model:"InstitutionName",label:"机构名称",prop:"InstitutionName",type:"Input",span:24,inputProp:{placeholder:"请输入机构名称"}},{model:"InstitutionAbbreviation",label:"机构简称",prop:"InstitutionAbbreviation",type:"Input",span:24,inputProp:{placeholder:"请输入机构简称"}},{model:"InstitutionTypeCode",label:"机构类型",prop:"InstitutionTypeCode",type:"Select",span:24,selectProp:{datas:[],transfer:!0,onChange:(e,t)=>{this.utilities.isNull(e)||(this.institutionFormModel.InstitutionCode=e+"-")}}},{model:"EnterpriseId",label:"所属企业",prop:"EnterpriseId",type:"Select",span:24,selectProp:{datas:[],transfer:!0}},{model:"InstitutionCode",label:"机构编码",prop:"InstitutionCode",type:"Input",span:24,inputProp:{placeholder:"请输入机构编码"}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitution",(async()=>{this.saveingInstitution.value=!0;let e=await this.institutioninforApi.save({Id:this.institutionFormModel.Id,EnterpriseId:this.institutionFormModel.EnterpriseId,InstitutionName:this.institutionFormModel.InstitutionName,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitution.value=!1);await this.institutionPlatformApi.save({Id:this.institutionFormModel.InstitutionPlatformId,InstitutionId:this.institutionFormModel.Id<=0?t:this.institutionFormModel.Id,PlatformId:this.platId.value,InstitutionCode:this.institutionFormModel.InstitutionCode,InstitutionAbbreviation:this.institutionFormModel.InstitutionAbbreviation,InstitutionTypeCode:this.institutionFormModel.InstitutionTypeCode,OrderNo:this.institutionFormModel.OrderNo,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),this.message.success("保存成功!"),this.institutionGrid.value.refreshData(),this.saveingInstitution.value=!1,this.showEditInstitution.value=!1})),h(this,"showImportInstitution",t.ref(!1)),h(this,"saveingImportInstitution",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originInstitutionGrid",t.ref()),h(this,"originInstitutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input",span:12},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input",span:12},{field:"InstitutionCode",title:"机构编码",type:"Input",span:12}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"Id",title:"ID",width:80},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:200},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",width:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:180},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}}],event:{event_search:e=>{this.loadOriginInstitutionGridData(this.platId.value,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")})),h(this,"doImportInstitution",(async()=>{const e=this.originInstitutionGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台机构信息");this.saveingImportInstitution.value=!0;let t=[];const i=this.storageInfo.getUser();for(const r of e)t.push({InstitutionId:r.Id,PlatformId:this.platId.value,InstitutionCode:r.InstitutionCode,InstitutionAbbreviation:r.InstitutionAbbreviation,InstitutionTypeCode:r.InstitutionTypeCode,OrderNo:r.OrderNo,LastUpdateUserId:i.Id,LastUpdateUserName:i.UserName,LastUpdateDate:this.utilities.getCurrentDate()});const o=await this.institutionPlatformApi.saves(t),s=this.utilities.parseApiResult(o);this.saveingImportInstitution.value=!1,s?(this.showImportInstitution.value=!1,this.institutionGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),h(this,"selectedInstitutionTree"),h(this,"insertRecords",[]),h(this,"institutionTree",t.ref([])),h(this,"saveingInstitutionTree",t.ref(!1)),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"renderContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",width:"100%",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))]),e("span",{style:{display:"inline-block",float:"right",marginRight:"8px"}},[e(s.Icon,{type:"md-trash",style:{fontSize:"18px",color:"rgb(225, 76, 23)"},onClick:()=>{this.doDeleteNode(t,i,o)}})])]))),h(this,"doTreeSelectChange",(e=>{e.length>0?this.selectedInstitutionTree=e[0]:this.selectedInstitutionTree=void 0})),h(this,"loadInstitutionTree",(async()=>{this.insertRecords=[],this.selectedInstitutionTree=void 0,this.loadingInstitutionTree.value=!0;const e=await this.institutionTreeApi.getInstitutionTrees(this.platId.value),t=this.utilities.parseApiResult(e);this.loadingInstitutionTree.value=!1;const i=e=>{const o=t.filter((t=>t.PId==e));for(const t of o){t.title=t.InstitutionAbbreviation,t.expand=!0;const e=i(t.Id);e.length>0&&(t.children=e)}return o};this.institutionTree.value=i(0)})),h(this,"doSaveInstitutionTree",(async()=>{if(0==this.insertRecords.length)return void this.message.warning("没有需要保存的数据!");this.saveingInstitutionTree.value=!0;let e=await this.institutionTreeApi.saveInstitutionTrees(this.insertRecords),t=this.utilities.parseApiResult(e);this.saveingInstitutionTree.value=!1,t>0?(this.message.success("保存成功"),this.loadInstitutionTree()):this.message.error("操作异常, 请稍后重试!")})),h(this,"selectInstitution"),h(this,"showBindRole",t.ref(!1)),h(this,"saveingBindRole",t.ref(!1)),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称",width:200},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveBindRole",(async()=>{const e=this.roleGrid.value.getDatas().filter((e=>1==e.IsChk)).map((e=>e.Id)).join(",");this.saveingBindRole.value=!0;const t=await this.institutionPlatformApi.save({Id:this.selectInstitution.InstitutionPlatformId,RoleIds:e}),i=this.utilities.parseApiResult(t);this.saveingBindRole.value=!1,i>0?(this.message.success("保存成功"),this.showBindRole.value=!1,this.institutionGrid.value.refreshData()):this.message.error("保存失败,稍后重试!")})),this.props=e,this.ctx=r,this.useBusinessInstitutionType(),this.useBusinessInstitution()}useBusinessInstitutionType(){t.onMounted((()=>{})),t.onUnmounted((()=>{})),this.getInstitutionTypes()}async getInstitutionTypes(){const e=await this.institutionTypeApi.getEntities(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]));this.institutionTypes.value=this.utilities.parseApiResult(e),this.setInstitutionTypeCodeDatas()}async loadEnterprises(){const e=await this.enterpriseApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.enterprises=this.utilities.parseApiResult(e),this.setEnterpriseDatas()}useBusinessInstitution(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}loadInstitutionGridData(e,t,i,o){this.institutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}async doRemoveInstitution(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 移除平台与机构的关联。 <br/> 2. 如果机构不存在于其他平台的关联,则会删除该机构。 <br/> 3. 移除该机构对应的机构树。 <br/> 确定要执行该操作吗?",onOk:async()=>{let t=await this.institutionPlatformApi.deleteByInsIdAndPlatformId(e.Id,this.platId.value),i=this.utilities.parseApiResult(t);i<=0?this.message.error("操作失败, 请稍后重试!"):(t=await this.institutionPlatformApi.getCount(o.QueryWrapper.create().eq("InstitutionId",e.Id)),i=this.utilities.parseApiResult(t),0==i&&(t=await this.institutioninforApi.delete(e.Id),i=this.utilities.parseApiResult(t)),t=await this.institutionTreeApi.deleteInstitutionTreeByInstitutionIdAndPlatformId(e.Id,this.platId.value),i=this.utilities.parseApiResult(t),this.message.success("操作成功"),this.institutionGrid.value.refreshData(),i>0&&this.loadInstitutionTree())}})}setInstitutionTypeCodeDatas(){const e=[];for(const t of this.institutionTypes.value)e.push({text:t.Name,value:t.Code});this.institutionFormItems[2].selectProp.datas=e}setEnterpriseDatas(){const e=[];let t=[];t=0!==this.selectPlat.PId?this.platData.value.filter((e=>e.Id==this.selectPlat.value.PId||this.selectPlat.value.Id==e.Id)):this.platData.value.filter((e=>e.Id==this.selectPlat.value.Id));const i=this.enterprises.filter((e=>t.some((t=>t.Id==e.PlatformId))));for(const o of i)e.push({text:o.EnterpriseName,value:o.Id});this.institutionFormItems[3].selectProp.datas=e}doEditInstitution(e){const t=this.storageInfo.getUser();this.institutionFormModel.Id=e.Id,this.institutionFormModel.EnterpriseId=e.EnterpriseId,this.institutionFormModel.InstitutionPlatformId=e.InstitutionPlatformId,this.institutionFormModel.InstitutionCode=e.InstitutionCode,this.institutionFormModel.InstitutionName=e.InstitutionName,this.institutionFormModel.InstitutionAbbreviation=e.InstitutionAbbreviation,this.institutionFormModel.InstitutionTypeCode=e.InstitutionTypeCode,this.institutionFormModel.OrderNo=e.OrderNo,this.institutionFormModel.LastUpdateUserId=t.Id,this.institutionFormModel.LastUpdateUserName=t.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="编辑 - "+e.InstitutionName,this.showEditInstitution.value=!0}doAddInstitution(){const e=this.storageInfo.getUser();this.institutionFormModel.Id=0,this.institutionFormModel.EnterpriseId=0,this.institutionFormModel.InstitutionPlatformId=0,this.institutionFormModel.InstitutionCode="",this.institutionFormModel.InstitutionName="",this.institutionFormModel.InstitutionAbbreviation="",this.institutionFormModel.InstitutionTypeCode="",this.institutionFormModel.OrderNo=1,this.institutionFormModel.LastUpdateUserId=e.Id,this.institutionFormModel.LastUpdateUserName=e.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="新增 - 机构",this.showEditInstitution.value=!0}doShowImportInstitution(){this.showImportInstitution.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.platId.value).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")}))}loadOriginInstitutionGridData(e,t,i,o){this.originInstitutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}doAddNode(e){if(this.utilities.isNull(this.selectedInstitutionTree)){const t={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:0,PId:0,NodeLevel:1,ParentPath:"/",FakeId:this.utilities.getUniqueCode(),FakePId:null,PlatformId:this.platId.value,InstitutionId:e.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};this.institutionTree.value.push(t),this.insertRecords.push(t)}else{this.utilities.isNull(this.selectedInstitutionTree.children)&&(this.selectedInstitutionTree.children=[]);const t=this.selectedInstitutionTree,i={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:t.RootId,PId:t.Id,NodeLevel:t.NodeLevel+1,ParentPath:t.ParentPath+t.Id+"/",FakeId:this.utilities.getUniqueCode(),FakePId:t.Id>0?null:t.FakeId,InstitutionId:e.Id,PlatformId:this.platId.value,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};t.children.push(i),this.insertRecords.push(i)}}doDeleteNode(e,t,i){this.modal.confirm({title:"提示",content:i.Id>0?"该操作将执行以下步骤 <br/> 1. 将该节点的子节点移动到该节点的父节点下 <br/> 2. 删除该节点 <br/> 确定要执行该操作吗?":"确定要移除该节点及其子节点吗?",onOk:async()=>{if(i.Id>0){const e=await this.institutionTreeApi.deleteInstitutionTree(i.Id);this.utilities.parseApiResult(e)>0?(this.message.success("操作成功"),this.loadInstitutionTree()):this.message.error("操作失败, 请稍后重试!")}else{const o=e.find((e=>e===t)).parent;if(this.utilities.isNull(o)){const e=this.institutionTree.value.indexOf(i);this.institutionTree.value.splice(e,1)}else{const t=e.find((e=>e.nodeKey===o)).node,s=t.children.indexOf(i);t.children.splice(s,1)}const s=e=>{for(const t of e){const e=this.insertRecords.findIndex((e=>e.FakeId==i.FakeId));this.insertRecords.splice(e,1),!this.utilities.isNull(t.children)&&t.children.length>0&&s(t.children)}};s([i])}}})}doShowBindRole(e){this.selectInstitution=e,this.showBindRole.value=!0,this.loadBindRole()}loadBindRole(){this.roleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value).eq("RoleStatus",1).orderBy(["OrderNo"]),i=await this.roleApi.getEntities(t),s=this.utilities.parseApiResult(i),r=this.selectInstitution.RoleIds,l=this.utilities.isNull(r)?[]:r.split(",");for(const o of s)o.IsChk=-1!=l.findIndex((e=>e==o.Id));e.success(s)}))}}const nt={style:{width:"100%",height:"100%",position:"relative"}},dt={style:{height:"500px","overflow-y":"auto"}},ut={class:"import-institution",style:{height:"600px","overflow-y":"auto",position:"relative"}},ht={style:{width:"100%",height:"100%"}},pt={style:{height:"calc(100%)"}},mt={style:{height:"610px","overflow-y":"auto",position:"relative"}};const ct=f(lt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("Tree"),c=t.resolveComponent("Button"),f=t.resolveComponent("Space"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"institution"},{default:t.withCtx((()=>[t.createVNode(p,{width:e.institutionWidth,title:"机构列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"institutionGrid",option:e.institutionGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformListSelect,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1},8,["width"]),t.createVNode(p,{width:"350px",title:"组织机构树",showArrow:!0,expand:!1,onChange:e.doWidthChange},{footer:t.withCtx((()=>[t.createVNode(f,null,{default:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:e.loadInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"]),t.createVNode(c,{type:"primary",loading:e.saveingInstitutionTree,onClick:e.doSaveInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",nt,[t.createVNode(m,{data:e.institutionTree,render:e.renderContent,class:"tree-render",onOnSelectChange:e.doTreeSelectChange},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("正在保存中")])),_:1},512),[[t.vShow,e.saveingInstitutionTree]]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(v,{modelValue:e.showEditInstitution,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingInstitution,onClick:e.doSaveInstitution},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",dt,[t.createVNode(I,{model:e.institutionFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(g,{ref:"institutionComForm",formModel:e.institutionFormModel,formItems:e.institutionFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showImportInstitution,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:1200,title:"引入机构",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingImportInstitution,onClick:e.doImportInstitution},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ut,[t.createElementVNode("div",ht,[t.createElementVNode("div",pt,[t.createVNode(h,{ref:"originInstitutionGrid",option:e.originInstitutionGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[3]||(i[3]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(a,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportInstitution]])])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showBindRole,"onUpdate:modelValue":i[7]||(i[7]=t=>e.showBindRole=t),draggable:"",mask:!0,"mask-closable":!1,width:900,title:"绑定角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[6]||(i[6]=t=>e.showBindRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingBindRole,onClick:e.doSaveBindRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",mt,[t.createVNode(h,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingBindRole]])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-ed65a91d"]]),ft=t.defineComponent({name:"LoginLog",components:{},emits:[""],props:{},setup:(e,t)=>new gt(e,t)});class gt extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"loginLogApi",new i.LoginLogApi),h(this,"platformId",0),h(this,"userId",0),h(this,"loginLogGrid",t.ref()),h(this,"loginLogGridOption",t.reactive({api:this.loginLogApi,setting:{border:!0,searchConfig:{btnSpan:12,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"LoginDate",title:"登录日期",type:"DatePicker",span:12},{field:"IPAddress",title:"登录IP",type:"Input",span:12}],toolbars:[{name:"refresh",type:"primary"}],columns:[{colType:"seq"},{colType:"ro",field:"LoginType",title:"登录方式",align:"center"},{colType:"ro",field:"LoginDate",title:"登录日期",align:"center",format:(e,t)=>{const i=t.row.LoginDate;return this.utilities.isNull(i)?"":i}},{colType:"ro",field:"IPAddress",title:"登录IP",align:"center"}],event:{event_search:e=>{this.loadLoginLog(this.platformId,this.userId,e)}}})),h(this,"loadLoginLog",((e,t,i={})=>{this.platformId=e,this.userId=t;const s=o.QueryWrapper.create();s.eq("PlatformId",this.platformId).eq("UserId",this.userId).orderBy(["Id"],!1),this.utilities.isNull(i.IPAddress)||s.like("IPAddress",i.IPAddress);const r=this.utilities.dateHelper.format(i.LoginDate,"YYYY-MM-DD");this.utilities.isNull(i.LoginDate)||s.between("LoginDate",`${r} 00:00:00`,`${r} 23:59:59`),this.loginLogGrid.value.loadDataByQuery(s)})),this.props=e,this.ctx=s}}const It={class:"loginLog"};const vt=f(ft,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid");return t.openBlock(),t.createElementBlock("div",It,[t.createVNode(a,{ref:"loginLogGrid",option:e.loginLogGridOption},null,8,["option"])])}],["__scopeId","data-v-a0d5af5b"]]),wt={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},yt=t.defineComponent({name:"Userinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:vt,BaseLogin:r.BaseLogin},emits:[""],props:wt,setup:(e,t)=>new Ct(e,t)});class Ct extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:13},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}},{name:"import",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:180,rowButtons:[{name:"login",text:"登录",onclick:(e,t)=>{this.devOpsLogin(e)}},{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountType",label:"账号类型",type:"Radio",radioProp:{type:"button","button-style":"solid",datas:[{text:"用户账号",value:0},{text:"内部账号",value:1}]}},{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"姓名不能为空",trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,6,7,8,9]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=1,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.deleteUser(e.UserId,e.InstitutionUserId);this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}doShowImportUser(){this.showImportUser.value=!0,t.nextTick((()=>{this.loadImportUserGrid({})}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}}const Nt=e=>(t.pushScopeId("data-v-4827d4a9"),e=e(),t.popScopeId(),e),Mt={class:"instree-search"},xt={class:"instree-list"},Pt={style:{height:"600px","overflow-y":"auto"}},Ut=Nt((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),Tt={style:{height:"600px","overflow-y":"auto"}},At=Nt((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),bt={style:{height:"650px","overflow-y":"auto"}},Ft=Nt((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选需要引入的用户!",-1))),St={style:{height:"650px","overflow-y":"auto"}},Rt={style:{display:"none"}},Vt={style:{height:"400px","overflow-y":"auto"}},kt=["src"],Dt=["src"];const Et=f(yt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvGrid"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),w=t.resolveComponent("LoginLog"),y=t.resolveComponent("BaseLogin"),C=t.resolveComponent("FormItem"),N=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(N,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Mt,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",xt,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(c,{width:e.userBoxWidth,title:"用户列表"},{default:t.withCtx((()=>[t.createVNode(f,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(v,{modelValue:e.showEditUser,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Pt,[t.createVNode(I,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),Ut])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showUserRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Tt,[t.createVNode(f,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[At])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showImportUser,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportUser=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入用户",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingImportUser,onClick:e.doImportUser},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",bt,[t.createVNode(f,{ref:"otherUserGrid",option:e.otherUserGridOption},{default:t.withCtx((()=>[Ft])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[7]||(i[7]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",St,[t.createVNode(w,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",Rt,[t.createVNode(y,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(v,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[10]||(i[10]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[9]||(i[9]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Vt,[t.createVNode(I,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(C,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,kt)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(C,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Dt)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-4827d4a9"]]),Ot={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Gt=t.defineComponent({name:"Module",components:{SelectPlatform:r.SelectPlatform},emits:["change"],props:Ot,setup:(e,t)=>new Lt(e,t)});class Lt extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"moduleApi",new i.ModuleApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id,t.nextTick((()=>{this.doPlatformChange(this.platData.value[0])})))})),h(this,"moduleWidth",t.ref("calc(100% - 300px)")),h(this,"webOrApp",t.ref(0)),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!1,isCurrent:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],toolbars:[{name:"addModule",type:"primary",icon:"md-add",text:"新增",onclick:()=>{this.doAddModule()}},{name:"importModule",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportModule()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"ModuleName",title:"模块名称",minWidth:250,treeNode:!0},{colType:"ro",field:"ModuleAlias",title:"别名",width:250,align:"center"},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"ModuleStatus",title:"状态",width:70,align:"center",format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"正常",color:"green"},2:{text:"沙盒",color:"default"}}[this.utilities.getValueNotNull(t.row.ModuleStatus,0)];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"LoadMode",title:"加载模式",width:120,align:"center",format:(e,t)=>({0:"路由",1:"链接",2:"低代码"}[t.row.LoadMode])},{colType:"ro",field:"ModuleUrl",title:"路径",width:260},{title:"操作",width:240,rowButtons:[{name:"editModule",text:"编辑",onclick:e=>{this.doEditModule(e)}},{name:"addModuleChild",text:"新增子项",onclick:e=>{this.doAddChildModule(e)}},{name:"deleteModule",text:"删除",type:"error",onclick:e=>{this.doDeleteModule(e)}}]}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.moduleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformChange",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(t)||(this.selectedPlatform=t,this.loadModuleGridData())})),h(this,"loadModuleGridData",(()=>{this.moduleGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]))})),h(this,"doChangeModuleWidth",(e=>{this.moduleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"parentModule"),h(this,"editModulePId",0),h(this,"editModuleChildData",[]),h(this,"saveingModule",t.ref(!1)),h(this,"moduleComForm",t.ref()),h(this,"showEditModule",t.ref(!1)),h(this,"editMoudelModalTitle",t.ref("新增 - 模块")),h(this,"moduleFormModel",t.reactive({Id:0,PlatformId:0,RootId:0,PId:0,ParentPath:"",HasChild:0,NodeLevel:0,ModuleName:"",ModuleAlias:"",ModuleUrl:"",ModuleType:"",WebOrApp:0,OrderNo:0,IconUrl:"",AttachParams:"",Operates:"",LoadMode:0,ModuleStatus:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"moduleFormItems",t.reactive([{model:"",label:"模块信息",span:24,children:[{model:"PId",label:"上级菜单",span:24,prop:"PId",type:"TreeSelect",isShow:!1,treeSelectProp:{data:[],onChange:(e,t)=>{this.setEditMoudelPId(e)}}},{model:"ModuleName",label:"模块名称",prop:"ModuleName",type:"Input"},{model:"ModuleAlias",label:"模块别名",prop:"ModuleAlias",type:"Input"},{model:"ModuleType",label:"模块类型",prop:"ModuleType",type:"Select",selectProp:{datas:[{text:"顶栏业务组",value:"Business"},{text:"左侧菜单组",value:"MenuGroup"},{text:"左侧菜单项",value:"MenuItem"}],transfer:!0}},{model:"IconUrl",label:"模块图标",prop:"IconUrl",type:"IconSelect",iconSelectProp:{placeholder:"模块图标"}},{model:"ModuleStatus",label:"模块状态",prop:"ModuleStatus",type:"Select",selectProp:{datas:[{text:"禁用",value:0},{text:"正常",value:1},{text:"沙盒",value:2}],transfer:!0}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber"}]},{model:"",label:"路由信息",span:24,children:[{model:"LoadMode",label:"加载模式",span:24,prop:"LoadMode",type:"Radio",radioProp:{datas:[{text:"路由",value:0},{text:"链接",value:1},{text:"低代码",value:3}]}},{model:"ModuleUrl",label:"路由地址",span:24,prop:"ModuleUrl",type:"Input"},{model:"AttachParams",label:"路由参数",span:24,prop:"AttachParams",type:"Input"},{model:"Operates",label:"功能点",span:24,prop:"Operates",type:"Input",inputProp:{type:"textarea",rows:4,placeholder:"例如: [{ code:'Edit', name: '编辑' }]"}}]}])),h(this,"doSaveModule",(async()=>{this.saveingModule.value=!0;let e=await this.moduleApi.save(this.moduleFormModel),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingModule.value=!1);if(0==this.moduleFormModel.Id){const e=[{Id:t,RootId:this.utilities.isNull(this.parentModule)?t:this.parentModule.RootId}];this.utilities.isNull(this.parentModule)||0!=this.parentModule.HasChild||e.push({Id:this.parentModule.Id,HasChild:1}),await this.moduleApi.saves(e)}else if(this.editModulePId!=this.moduleFormModel.PId){let i=this.editModuleChildData;this.editModulePId>0&&(e=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",this.editModulePId)),t=this.utilities.parseApiResult(e),i.push({Id:this.editModulePId,HasChild:t>0?1:0})),await this.moduleApi.saves(i)}this.message.success("保存成功!"),this.moduleGrid.value.refreshData(),this.saveingModule.value=!1,this.showEditModule.value=!1})),h(this,"showImportModule",t.ref(!1)),h(this,"saveingImportModule",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originModuleGrid",t.ref()),h(this,"originModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input",span:24}],rightToolbars:[{name:"refresh"}],columns:[{colType:"checkbox"},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.originModuleGrid.value.loadDataByQuery(t)}}})),h(this,"targetPlatform",t.reactive({Id:0,PlatformName:""})),h(this,"targetModuleGrid",t.ref()),h(this,"targetModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0,isCurrent:!0},treeConfig:{expandAll:!0}},toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return this.utilities.isNull(i)?"":e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.targetModuleGrid.value.loadDataByQuery(t)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginModuleGridData()})),h(this,"doImportOriginToTargetModule",(async()=>{const e=this.originModuleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台模块菜单");const t=this.targetModuleGrid.value.getCurrentRecord();if(this.utilities.isNull(t))return void this.message.warning("请选择目标平台模块菜单");this.saveingImportModule.value=!0;const i=await this.moduleApi.importModules(e,t),o=this.utilities.parseApiResult(i);this.saveingImportModule.value=!1,o>0?(this.originModuleGrid.value.refreshData(),this.targetModuleGrid.value.refreshData(),this.moduleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}setEditMoudelPId(e){this.editModuleChildData=[];const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e))[0];this.moduleFormModel.RootId=i?i.RootId:this.moduleFormModel.Id,this.moduleFormModel.PId=i?i.Id:0,this.moduleFormModel.ParentPath=i?`${i.ParentPath}${i.Id}/`:"/",this.moduleFormModel.NodeLevel=i?i.NodeLevel+1:1;((e,t)=>{const i=e.filter((e=>e.PId==t.Id));for(const o of i)this.editModuleChildData.push({Id:o.Id,RootId:t.RootId,ParentPath:`${t.ParentPath}${t.Id}/`,NodeLevel:t.NodeLevel+1})})(t,this.moduleFormModel)}setParentModuleTreeItem(e){const t=this.moduleFormItems[0].children[0];if(t.isShow=e,0==e)return;const i=this.moduleGrid.value.getDatas(),o=this.moduleComForm.value.convertTreeData({datas:i,titleField:"ModuleName",rootTitle:"主目录",rootValue:0});t.treeSelectProp.data=o}doEditModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=e.Id,this.moduleFormModel.PlatformId=e.PlatformId,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.PId,this.moduleFormModel.ParentPath=e.ParentPath,this.moduleFormModel.HasChild=e.HasChild,this.moduleFormModel.NodeLevel=e.NodeLevel,this.moduleFormModel.ModuleName=e.ModuleName,this.moduleFormModel.ModuleAlias=e.ModuleAlias,this.moduleFormModel.ModuleUrl=e.ModuleUrl,this.moduleFormModel.ModuleType=e.ModuleType,this.moduleFormModel.WebOrApp=e.WebOrApp,this.moduleFormModel.OrderNo=e.OrderNo,this.moduleFormModel.IconUrl=e.IconUrl,this.moduleFormModel.AttachParams=e.AttachParams,this.moduleFormModel.Operates=e.Operates,this.moduleFormModel.LoadMode=e.LoadMode,this.moduleFormModel.ModuleStatus=e.ModuleStatus,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.editModulePId=e.PId,this.editModuleChildData=[],this.editMoudelModalTitle.value=`编辑 - 模块 - ${e.ModuleName}`,this.setParentModuleTreeItem(!0),this.showEditModule.value=!0}doAddModule(){const e=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=0,this.moduleFormModel.PId=0,this.moduleFormModel.ParentPath="/",this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates='[{"code":"Edit", "name": "编辑"},{"code":"Delete", "name": "删除"},{"code":"Add", "name": "新增"},{"code":"Save", "name": "保存"}]',this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=e.Id,this.moduleFormModel.LastUpdateUserName=e.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value="新增 - 模块",this.showEditModule.value=!0}doAddChildModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.Id,this.moduleFormModel.ParentPath=`${e.ParentPath}${e.Id}/`,this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=e.NodeLevel+1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business"==e.ModuleType?"MenuGroup":"MenuItem",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates="",this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=e,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value=`新增子项 - 父模块 - ${e.ModuleName}`,this.showEditModule.value=!0}async doDeleteModule(e){1!=e.HasChild?this.modal.confirm({title:"提示",content:`数据删除后不可恢复, 确定要删除[ ${e.ModuleName} ]模块吗?`,onOk:async()=>{const t=e.PId;let i=await this.moduleApi.delete(e.Id),s=this.utilities.parseApiResult(i);s<=0?this.message.warning("删除失败,请稍后重试!"):(i=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",t)),s=this.utilities.parseApiResult(i),s<=0&&await this.moduleApi.save({Id:t,HasChild:0}),this.message.success("删除成功!"),this.moduleGrid.value.refreshData())}}):this.message.warning("该模块存在子模板, 不能删除, 请先删除子模块!")}doShowImportModule(){this.targetPlatform.Id=this.selectedPlatform.Id,this.targetPlatform.PlatformName=this.selectedPlatform.PlatformName,this.showImportModule.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.selectedPlatform.Id).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginModuleGridData(),this.loadTargetModuleGridData()}))}loadOriginModuleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.originModuleGrid.value.loadDataByQuery(e)}loadTargetModuleGridData(){this.targetModuleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.targetPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]),i=await this.moduleApi.getEntities(t),s=this.utilities.parseApiResult(i),r={Id:0,PId:-1,ModuleName:"根节点",ModuleType:"",PlatformId:this.targetPlatform.Id,IconUrl:""};s.push(r),e.success(s)}))}}const Bt={style:{height:"650px","overflow-y":"auto"}},_t={class:"import-module",style:{height:"650px",position:"relative"}},Wt={style:{width:"100%",height:"100%"}},qt={style:{width:"560px",height:"100%",float:"left"}},Kt={style:{height:"calc(100% - 0px)"}},Qt={style:{width:"calc(100% - 570px)",height:"100%","margin-left":"10px",display:"inline-block"}},Yt={style:{height:"calc(100% - 0px)"}},Ht=(e=>(t.pushScopeId("data-v-23a8ab5f"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"点击选择要放置的位置!",-1)));const zt=f(Gt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Radio"),p=t.resolveComponent("RadioGroup"),m=t.resolveComponent("NvGrid"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Button"),I=t.resolveComponent("Modal"),v=t.resolveComponent("Card"),w=t.resolveComponent("NvBox"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"module"},{default:t.withCtx((()=>[t.createVNode(w,{width:"100%",title:"模块列表"},{default:t.withCtx((()=>[t.createVNode(m,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformChange,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"]),t.createVNode(p,{modelValue:e.webOrApp,"onUpdate:modelValue":i[1]||(i[1]=t=>e.webOrApp=t),type:"button",onOnChange:e.loadModuleGridData},{default:t.withCtx((()=>[t.createVNode(h,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(h,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.createVNode(I,{modelValue:e.showEditModule,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showEditModule=t),draggable:"",mask:!0,"mask-closable":!1,width:700,title:e.editMoudelModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(g,{type:"text",onClick:i[2]||(i[2]=t=>e.showEditModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(g,{type:"primary",loading:e.saveingModule,onClick:e.doSaveModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Bt,[t.createVNode(f,{model:e.moduleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(c,{ref:"moduleComForm",formModel:e.moduleFormModel,formItems:e.moduleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(I,{modelValue:e.showImportModule,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"引入模块",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(g,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(g,{type:"primary",loading:e.saveingImportModule,onClick:e.doImportOriginToTargetModule},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",_t,[t.createElementVNode("div",Wt,[t.createElementVNode("div",qt,[t.createVNode(v,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("源平台 - ["+t.toDisplayString(e.originPlatform.selectedItem.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",Kt,[t.createVNode(m,{ref:"originModuleGrid",option:e.originModuleGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[4]||(i[4]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1})]),t.createElementVNode("div",Qt,[t.createVNode(v,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("目标平台 - ["+t.toDisplayString(e.targetPlatform.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",Yt,[t.createVNode(m,{ref:"targetModuleGrid",option:e.targetModuleGridOption},{default:t.withCtx((()=>[Ht])),_:1},8,["option"])])])),_:1})]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportModule]])])])])),_:1},8,["modelValue"])])),_:1})])),_:1})}],["__scopeId","data-v-23a8ab5f"]]),Zt={type:"FeatureCollection",features:[{type:"Feature",properties:{name:"西安",center:[108.948024,34.263161],centroid:[108.797426,34.10671],childrenNum:13,level:"city",code:610100,filename:"610000/610100",fullname:"西安市",bbox:[[107.663753,34.743104],[109.822433,33.693877]],offset:[.5252,.6065]},geometry:{type:"MultiPolygon",coordinates:[[[[109.754502,34.212239],[109.745465,34.187491],[109.778102,34.183392],[109.801415,34.160887],[109.822194,34.155742],[109.789787,34.145049],[109.78098,34.160083],[109.755078,34.127197],[109.742184,34.12189],[109.739824,34.09792],[109.694753,34.109101],[109.669886,34.099931],[109.658835,34.105481],[109.634313,34.075633],[109.584235,34.072092],[109.567139,34.064688],[109.552806,34.044727],[109.56121,34.034181],[109.545496,34.025244],[109.533235,33.982077],[109.562994,33.960726],[109.603633,33.940982],[109.592984,33.896804],[109.576118,33.897691],[109.540142,33.875513],[109.537322,33.862042],[109.508541,33.848004],[109.470263,33.851796],[109.442518,33.843566],[109.399059,33.845422],[109.355945,33.867608],[109.316918,33.85462],[109.299823,33.856556],[109.289462,33.87027],[109.251874,33.880675],[109.207379,33.867043],[109.18493,33.874303],[109.164207,33.871319],[109.120576,33.876481],[109.107682,33.907609],[109.070555,33.906641],[109.051502,33.923169],[109.007985,33.883256],[108.944265,33.86664],[108.922161,33.869383],[108.913239,33.848649],[108.874788,33.824522],[108.854238,33.826539],[108.84002,33.815966],[108.805771,33.817177],[108.778487,33.798046],[108.756038,33.812657],[108.755923,33.839048],[108.741014,33.841468],[108.697843,33.828315],[108.650067,33.841549],[108.617717,33.825974],[108.602579,33.791426],[108.585425,33.780122],[108.584274,33.764536],[108.560444,33.765101],[108.544557,33.788438],[108.484405,33.804262],[108.466445,33.800629],[108.443709,33.781979],[108.404855,33.763324],[108.369454,33.793202],[108.345969,33.793848],[108.307,33.76292],[108.288292,33.767282],[108.259281,33.754763],[108.233148,33.726649],[108.191761,33.725276],[108.180191,33.711862],[108.149281,33.712347],[108.132243,33.721882],[108.113823,33.712589],[108.098396,33.723498],[108.073818,33.723417],[108.054247,33.709842],[108.008312,33.728993],[107.96612,33.734648],[107.951672,33.745797],[107.931583,33.731255],[107.90309,33.748947],[107.854278,33.694081],[107.830102,33.69788],[107.763503,33.719781],[107.737427,33.717923],[107.719353,33.725761],[107.695868,33.72366],[107.687924,33.744746],[107.665821,33.760013],[107.68591,33.796996],[107.679463,33.808298],[107.697422,33.817903],[107.708589,33.846794],[107.704387,33.857282],[107.717626,33.910431],[107.71377,33.92736],[107.76736,33.954521],[107.784455,33.980626],[107.8103,33.995045],[107.846564,33.975148],[107.87759,33.993918],[107.908213,33.999314],[107.915638,33.986104],[107.949887,33.985379],[107.941944,34.006079],[107.943038,34.042312],[107.972567,34.062113],[107.976481,34.075069],[108.00106,34.103953],[108.003074,34.155742],[108.011421,34.161047],[108.030013,34.208623],[108.027941,34.228144],[108.086769,34.231036],[108.143928,34.218585],[108.156534,34.225092],[108.20195,34.221718],[108.237638,34.199625],[108.264865,34.199464],[108.293185,34.209989],[108.328585,34.195928],[108.351495,34.196812],[108.37452,34.207659],[108.418266,34.20549],[108.425922,34.200348],[108.457351,34.209186],[108.468115,34.205731],[108.529706,34.23216],[108.56407,34.22959],[108.593369,34.239308],[108.619444,34.25826],[108.650125,34.265808],[108.669753,34.243966],[108.692087,34.238987],[108.700952,34.273675],[108.744756,34.276886],[108.750282,34.296151],[108.796792,34.296713],[108.794316,34.334185],[108.803239,34.359531],[108.828048,34.365947],[108.859879,34.388638],[108.89292,34.390802],[108.913469,34.406033],[108.929817,34.40443],[108.961015,34.424787],[108.955834,34.444979],[108.976441,34.44594],[108.971146,34.502962],[108.974081,34.541383],[108.955201,34.565866],[108.998315,34.576426],[109.011842,34.586184],[109.06123,34.593542],[109.092889,34.588983],[109.108891,34.577705],[109.138823,34.588823],[109.139053,34.639514],[109.156034,34.644709],[109.168237,34.666525],[109.173072,34.691931],[109.203407,34.697682],[109.243873,34.687297],[109.254176,34.6988],[109.280424,34.697442],[109.286641,34.687697],[109.340749,34.69872],[109.358651,34.716929],[109.365098,34.739285],[109.410859,34.743117],[109.429854,34.713814],[109.421163,34.706866],[109.430775,34.688016],[109.42335,34.679548],[109.437222,34.595621],[109.449771,34.553625],[109.429106,34.549385],[109.418054,34.536741],[109.391346,34.529138],[109.399692,34.49976],[109.391346,34.468529],[109.413277,34.46068],[109.424501,34.441934],[109.423753,34.423505],[109.442633,34.414128],[109.445799,34.397376],[109.461859,34.394169],[109.458981,34.350869],[109.450577,34.326724],[109.456045,34.298237],[109.477688,34.294465],[109.500252,34.268698],[109.523622,34.255851],[109.575831,34.262516],[109.627751,34.240031],[109.659122,34.245894],[109.668562,34.238586],[109.691069,34.243003],[109.731074,34.236337],[109.739996,34.217219],[109.754502,34.212239]]],[[[109.174166,33.808702],[109.154019,33.791103],[109.147284,33.799337],[109.162366,33.812657],[109.174166,33.808702]]]]}},{type:"Feature",properties:{name:"铜川",center:[108.979608,34.916582],centroid:[109.038368,35.195996],childrenNum:4,level:"city",code:610200,filename:"610000/610200",fullname:"铜川市",bbox:[[108.583512,35.580992],[109.496263,34.804856]],offset:[.4983,.496]},geometry:{type:"MultiPolygon",coordinates:[[[[108.868629,35.344653],[108.89787,35.350437],[108.923139,35.363114],[108.943689,35.393373],[108.987148,35.436444],[108.979204,35.448316],[108.992559,35.473004],[109.014893,35.497448],[109.014547,35.509311],[109.035845,35.518642],[109.032852,35.52979],[109.051559,35.548763],[109.091622,35.543625],[109.116086,35.565597],[109.179922,35.580769],[109.20358,35.580137],[109.243758,35.523702],[109.266494,35.519512],[109.342188,35.522595],[109.405909,35.520777],[109.406024,35.511762],[109.431293,35.500849],[109.448389,35.511604],[109.466694,35.509074],[109.468248,35.483763],[109.478379,35.473795],[109.45852,35.454568],[109.473601,35.453143],[109.4774,35.438977],[109.467097,35.421878],[109.493575,35.395986],[109.495647,35.357251],[109.476019,35.340215],[109.444475,35.343385],[109.411838,35.322699],[109.39785,35.329357],[109.382711,35.314059],[109.382481,35.298282],[109.368897,35.286071],[109.318703,35.274254],[109.283533,35.251012],[109.303564,35.246648],[109.30909,35.216414],[109.319278,35.200142],[109.344203,35.18998],[109.362162,35.164411],[109.381733,35.157184],[109.433538,35.167429],[109.44482,35.148684],[109.441021,35.104586],[109.444187,35.088848],[109.426746,35.06921],[109.415349,35.071993],[109.408384,35.09163],[109.359514,35.101009],[109.339425,35.092504],[109.296657,35.086145],[109.290728,35.09942],[109.27415,35.099579],[109.28313,35.084952],[109.261659,35.050761],[109.223726,35.04758],[109.20663,35.018625],[109.212559,35.003745],[109.176929,35.001597],[109.164438,34.983689],[109.144176,34.991728],[109.127886,34.975093],[109.105207,34.97167],[109.084542,34.955906],[109.097263,34.932892],[109.095479,34.919271],[109.062323,34.908357],[109.061748,34.888836],[109.034003,34.901107],[109.013914,34.891386],[108.983291,34.889951],[108.967347,34.88007],[108.977823,34.835348],[108.973736,34.821711],[108.957158,34.829766],[108.918189,34.83455],[108.898561,34.823545],[108.902302,34.810146],[108.855504,34.82219],[108.82327,34.804881],[108.81383,34.830643],[108.780559,34.852729],[108.766399,34.87202],[108.726509,34.866839],[108.689036,34.880707],[108.66699,34.916563],[108.665148,34.933608],[108.643217,34.975093],[108.631532,34.978993],[108.62048,35.011782],[108.599067,35.021966],[108.583526,35.043524],[108.60891,35.06762],[108.626812,35.099897],[108.591297,35.101645],[108.616278,35.11746],[108.644138,35.119288],[108.662673,35.128585],[108.655708,35.156866],[108.633432,35.164093],[108.65473,35.178467],[108.656629,35.194267],[108.676545,35.196729],[108.670674,35.210462],[108.696865,35.222764],[108.720292,35.254979],[108.739921,35.268464],[108.750627,35.293366],[108.79777,35.306448],[108.807843,35.300819],[108.824824,35.316279],[108.873349,35.326108],[108.868629,35.344653]]]]}},{type:"Feature",properties:{name:"宝鸡",center:[107.14487,34.369315],centroid:[107.205191,34.380063],childrenNum:12,level:"city",code:610300,filename:"610000/610300",fullname:"宝鸡市",bbox:[[106.313336,35.105585],[108.053089,33.57935]],offset:[.5126,.4754]},geometry:{type:"MultiPolygon",coordinates:[[[[108.027941,34.228144],[108.030013,34.208623],[108.011421,34.161047],[108.003074,34.155742],[108.00106,34.103953],[107.976481,34.075069],[107.972567,34.062113],[107.943038,34.042312],[107.941944,34.006079],[107.949887,33.985379],[107.915638,33.986104],[107.908213,33.999314],[107.87759,33.993918],[107.846564,33.975148],[107.8103,33.995045],[107.784455,33.980626],[107.76736,33.954521],[107.71377,33.92736],[107.717626,33.910431],[107.704387,33.857282],[107.708589,33.846794],[107.697422,33.817903],[107.679463,33.808298],[107.68591,33.796996],[107.665821,33.760013],[107.687924,33.744746],[107.695868,33.72366],[107.673764,33.699497],[107.650682,33.700628],[107.628694,33.714448],[107.586846,33.697719],[107.562555,33.70273],[107.517082,33.678318],[107.492503,33.679854],[107.467694,33.660612],[107.423601,33.649371],[107.400347,33.651312],[107.376516,33.682845],[107.336165,33.68907],[107.3056,33.710165],[107.314177,33.728831],[107.304334,33.733517],[107.305543,33.766878],[107.32212,33.774469],[107.328279,33.797642],[107.342037,33.81411],[107.322581,33.818872],[107.299499,33.792798],[107.276762,33.801194],[107.27279,33.790699],[107.231173,33.766797],[107.212581,33.74927],[107.187369,33.751774],[107.181612,33.769462],[107.163135,33.788035],[107.145233,33.794251],[107.128368,33.777618],[107.136945,33.81411],[107.112078,33.812818],[107.105746,33.822504],[107.080477,33.8221],[107.066432,33.838725],[107.063093,33.870431],[107.044904,33.873819],[107.038514,33.85462],[107.043234,33.805069],[107.028153,33.794574],[106.978247,33.800952],[106.930701,33.827266],[106.909691,33.847762],[106.890063,33.848327],[106.888681,33.860993],[106.855583,33.874384],[106.854375,33.848649],[106.839409,33.827023],[106.817823,33.834448],[106.80585,33.809832],[106.803835,33.72366],[106.797273,33.682441],[106.789215,33.67751],[106.71427,33.701356],[106.674955,33.701437],[106.705693,33.676944],[106.687043,33.665544],[106.64226,33.658994],[106.647325,33.634813],[106.629827,33.619605],[106.617911,33.591933],[106.596729,33.579389],[106.581475,33.590638],[106.575546,33.631658],[106.53485,33.695132],[106.482642,33.707336],[106.48811,33.758236],[106.479821,33.780768],[106.461804,33.789649],[106.468712,33.820083],[106.491391,33.834529],[106.493406,33.846148],[106.475331,33.875755],[106.428246,33.866479],[106.41092,33.909221],[106.443557,33.934615],[106.476022,33.973779],[106.479533,33.994401],[106.47159,34.024037],[106.505494,34.056479],[106.501867,34.104918],[106.56081,34.113203],[106.584871,34.149471],[106.572265,34.16997],[106.558565,34.227421],[106.551255,34.242601],[106.532087,34.254085],[106.512919,34.239389],[106.496053,34.238345],[106.496514,34.255129],[106.526446,34.291977],[106.5771,34.2809],[106.589246,34.253764],[106.602485,34.250873],[106.633626,34.259866],[106.663903,34.243163],[106.684107,34.259946],[106.705117,34.299522],[106.690324,34.334024],[106.710989,34.344372],[106.717378,34.369234],[106.697289,34.370598],[106.680078,34.383747],[106.662176,34.381663],[106.637252,34.392005],[106.613709,34.44626],[106.591606,34.456514],[106.599434,34.465966],[106.567948,34.474857],[106.552406,34.489191],[106.543657,34.47854],[106.536059,34.493034],[106.511825,34.502482],[106.487765,34.523375],[106.453861,34.531299],[106.407811,34.523135],[106.401365,34.511128],[106.379031,34.520654],[106.366137,34.512329],[106.33442,34.517852],[106.343803,34.536581],[106.340982,34.568026],[106.314044,34.578745],[106.323138,34.589863],[106.368151,34.610334],[106.419496,34.64343],[106.421741,34.654939],[106.44868,34.636396],[106.467215,34.640952],[106.470784,34.65374],[106.445687,34.669482],[106.44137,34.681705],[106.459617,34.705589],[106.486901,34.715172],[106.505839,34.746869],[106.539628,34.745671],[106.54855,34.761635],[106.575028,34.770095],[106.578367,34.789006],[106.554306,34.813735],[106.555918,34.861339],[106.528,34.876483],[106.517927,34.892422],[106.510214,34.925086],[106.493118,34.941095],[106.48316,34.980108],[106.502155,34.995548],[106.48857,35.02125],[106.503536,35.03374],[106.520978,35.027615],[106.545959,35.070562],[106.543542,35.085032],[106.575834,35.089325],[106.615379,35.071119],[106.661601,35.069687],[106.666206,35.076605],[106.706441,35.081852],[106.7145,35.105619],[106.777818,35.094253],[106.83843,35.079785],[106.856965,35.091232],[106.90169,35.094492],[106.912569,35.079546],[106.944401,35.080103],[106.950157,35.066905],[106.990796,35.068495],[107.012439,35.029365],[107.031031,35.029126],[107.051005,35.04074],[107.048242,35.028331],[107.082606,35.024035],[107.096076,35.010111],[107.089629,34.976685],[107.103041,34.960046],[107.135621,34.945873],[107.162387,34.944121],[107.179886,34.928272],[107.189556,34.893298],[107.201011,34.881664],[107.222999,34.878157],[107.230943,34.891864],[107.252528,34.881185],[107.262371,34.907481],[107.282978,34.911783],[107.28672,34.931856],[107.322351,34.938148],[107.35021,34.934086],[107.371969,34.917997],[107.392921,34.932414],[107.426019,34.92875],[107.455548,34.916802],[107.474774,34.91943],[107.524047,34.909871],[107.536653,34.915368],[107.537861,34.932493],[107.551158,34.940298],[107.562037,34.966495],[107.572168,34.971351],[107.605611,34.958693],[107.619714,34.964664],[107.633414,34.953915],[107.625815,34.918952],[107.63986,34.918793],[107.637731,34.93329],[107.654366,34.933529],[107.67434,34.951208],[107.741572,34.953517],[107.778584,34.964664],[107.804775,34.956782],[107.799997,34.966813],[107.820028,34.973739],[107.822791,34.953358],[107.84973,34.891466],[107.841269,34.890669],[107.857501,34.863172],[107.857961,34.844438],[107.90804,34.842684],[107.951787,34.863332],[107.94983,34.821552],[107.963127,34.79842],[107.992023,34.782782],[107.99916,34.750301],[108.015335,34.726032],[108.015623,34.695445],[108.032143,34.626644],[107.995822,34.612573],[107.980453,34.575866],[108.002441,34.552105],[108.004053,34.527938],[107.997606,34.487189],[108.017637,34.479101],[108.011881,34.457956],[108.019825,34.430797],[108.041698,34.390001],[108.027711,34.38503],[108.029438,34.370838],[108.053095,34.325761],[108.035884,34.315972],[108.009118,34.317015],[107.995764,34.332901],[107.987878,34.313485],[107.953744,34.32183],[107.950808,34.287803],[107.96825,34.286519],[107.973603,34.268858],[107.995131,34.265647],[107.990181,34.22212],[108.027941,34.228144]]]]}},{type:"Feature",properties:{name:"咸阳",center:[108.705117,34.333439],centroid:[108.394642,34.785702],childrenNum:14,level:"city",code:610400,filename:"610000/610400",fullname:"咸阳市",bbox:[[107.651841,35.544246],[109.177963,34.194981]],offset:[.4867,.5622]},geometry:{type:"MultiPolygon",coordinates:[[[[107.820028,34.973739],[107.858595,34.986873],[107.863372,34.999209],[107.843629,35.002313],[107.848349,35.023876],[107.827511,35.022205],[107.802069,35.032388],[107.759474,35.071198],[107.762006,35.084316],[107.722519,35.114917],[107.728563,35.127314],[107.715784,35.168144],[107.687291,35.216653],[107.670311,35.21443],[107.651948,35.239746],[107.662597,35.255375],[107.692357,35.251171],[107.720159,35.269257],[107.737312,35.267433],[107.736794,35.296141],[107.716648,35.302326],[107.745716,35.311601],[107.75176,35.305101],[107.79142,35.295903],[107.829814,35.273143],[107.841844,35.276395],[107.866193,35.256407],[107.904702,35.261166],[107.936073,35.253947],[107.937799,35.267353],[107.960594,35.261484],[107.949772,35.2453],[107.979301,35.245458],[108.048663,35.253789],[108.094885,35.280043],[108.123954,35.281788],[108.174666,35.305101],[108.193776,35.306607],[108.221463,35.296855],[108.239365,35.256248],[108.256921,35.267433],[108.298078,35.268385],[108.345336,35.300661],[108.352819,35.285753],[108.400134,35.282819],[108.402379,35.278061],[108.449062,35.273699],[108.489125,35.275285],[108.525043,35.289005],[108.543463,35.303911],[108.568272,35.290908],[108.602982,35.312315],[108.615357,35.331656],[108.610752,35.356459],[108.62215,35.3807],[108.631129,35.418632],[108.619444,35.442934],[108.616566,35.477276],[108.605975,35.502826],[108.622898,35.540779],[108.659162,35.537775],[108.690303,35.505436],[108.702563,35.511288],[108.727084,35.505831],[108.741993,35.491595],[108.767378,35.486769],[108.775494,35.459316],[108.791956,35.437631],[108.791611,35.421957],[108.808246,35.392898],[108.803584,35.379195],[108.835876,35.380304],[108.846467,35.349803],[108.868629,35.344653],[108.873349,35.326108],[108.824824,35.316279],[108.807843,35.300819],[108.79777,35.306448],[108.750627,35.293366],[108.739921,35.268464],[108.720292,35.254979],[108.696865,35.222764],[108.670674,35.210462],[108.676545,35.196729],[108.656629,35.194267],[108.65473,35.178467],[108.633432,35.164093],[108.655708,35.156866],[108.662673,35.128585],[108.644138,35.119288],[108.616278,35.11746],[108.591297,35.101645],[108.626812,35.099897],[108.60891,35.06762],[108.583526,35.043524],[108.599067,35.021966],[108.62048,35.011782],[108.631532,34.978993],[108.643217,34.975093],[108.665148,34.933608],[108.66699,34.916563],[108.689036,34.880707],[108.726509,34.866839],[108.766399,34.87202],[108.780559,34.852729],[108.81383,34.830643],[108.82327,34.804881],[108.855504,34.82219],[108.902302,34.810146],[108.898561,34.823545],[108.918189,34.83455],[108.957158,34.829766],[108.973736,34.821711],[108.997682,34.808551],[109.015986,34.781825],[109.034406,34.771451],[109.04517,34.752297],[109.030492,34.727948],[109.029053,34.70503],[109.046436,34.687058],[109.068655,34.713176],[109.090356,34.700876],[109.128174,34.699838],[109.173187,34.705589],[109.173072,34.691931],[109.168237,34.666525],[109.156034,34.644709],[109.139053,34.639514],[109.138823,34.588823],[109.108891,34.577705],[109.092889,34.588983],[109.06123,34.593542],[109.011842,34.586184],[108.998315,34.576426],[108.955201,34.565866],[108.974081,34.541383],[108.971146,34.502962],[108.976441,34.44594],[108.955834,34.444979],[108.961015,34.424787],[108.929817,34.40443],[108.913469,34.406033],[108.89292,34.390802],[108.859879,34.388638],[108.828048,34.365947],[108.803239,34.359531],[108.794316,34.334185],[108.796792,34.296713],[108.750282,34.296151],[108.744756,34.276886],[108.700952,34.273675],[108.692087,34.238987],[108.669753,34.243966],[108.650125,34.265808],[108.619444,34.25826],[108.593369,34.239308],[108.56407,34.22959],[108.529706,34.23216],[108.468115,34.205731],[108.457351,34.209186],[108.425922,34.200348],[108.418266,34.20549],[108.37452,34.207659],[108.351495,34.196812],[108.328585,34.195928],[108.293185,34.209989],[108.264865,34.199464],[108.237638,34.199625],[108.20195,34.221718],[108.156534,34.225092],[108.143928,34.218585],[108.086769,34.231036],[108.027941,34.228144],[107.990181,34.22212],[107.995131,34.265647],[107.973603,34.268858],[107.96825,34.286519],[107.950808,34.287803],[107.953744,34.32183],[107.987878,34.313485],[107.995764,34.332901],[108.009118,34.317015],[108.035884,34.315972],[108.053095,34.325761],[108.029438,34.370838],[108.027711,34.38503],[108.041698,34.390001],[108.019825,34.430797],[108.011881,34.457956],[108.017637,34.479101],[107.997606,34.487189],[108.004053,34.527938],[108.002441,34.552105],[107.980453,34.575866],[107.995822,34.612573],[108.032143,34.626644],[108.015623,34.695445],[108.015335,34.726032],[107.99916,34.750301],[107.992023,34.782782],[107.963127,34.79842],[107.94983,34.821552],[107.951787,34.863332],[107.90804,34.842684],[107.857961,34.844438],[107.857501,34.863172],[107.841269,34.890669],[107.84973,34.891466],[107.822791,34.953358],[107.820028,34.973739]]]]}},{type:"Feature",properties:{name:"渭南",center:[109.502882,34.499381],centroid:[109.856208,34.950969],childrenNum:11,level:"city",code:610500,filename:"610000/610500",fullname:"渭南市",bbox:[[108.967335,35.854156],[110.609331,34.20976]],offset:[.5413,.5493]},geometry:{type:"MultiPolygon",coordinates:[[[[110.430966,34.40948],[110.388716,34.408117],[110.377549,34.398338],[110.284357,34.391364],[110.251834,34.406754],[110.194215,34.414769],[110.162326,34.432159],[110.132164,34.42687],[110.103383,34.428874],[110.075178,34.413888],[110.059982,34.413247],[110.058485,34.396975],[110.03736,34.377814],[110.007197,34.368593],[110.024236,34.338998],[110.040526,34.324156],[110.030855,34.30217],[110.007255,34.303213],[110.024063,34.240352],[109.997642,34.221638],[109.964372,34.209748],[109.94929,34.219549],[109.95614,34.243645],[109.920395,34.230313],[109.883555,34.24742],[109.873655,34.270785],[109.853335,34.266048],[109.825591,34.288205],[109.792147,34.263078],[109.80199,34.224048],[109.775972,34.251997],[109.757322,34.252961],[109.743565,34.240352],[109.754502,34.212239],[109.739996,34.217219],[109.731074,34.236337],[109.691069,34.243003],[109.668562,34.238586],[109.659122,34.245894],[109.627751,34.240031],[109.575831,34.262516],[109.523622,34.255851],[109.500252,34.268698],[109.477688,34.294465],[109.456045,34.298237],[109.450577,34.326724],[109.458981,34.350869],[109.461859,34.394169],[109.445799,34.397376],[109.442633,34.414128],[109.423753,34.423505],[109.424501,34.441934],[109.413277,34.46068],[109.391346,34.468529],[109.399692,34.49976],[109.391346,34.529138],[109.418054,34.536741],[109.429106,34.549385],[109.449771,34.553625],[109.437222,34.595621],[109.42335,34.679548],[109.430775,34.688016],[109.421163,34.706866],[109.429854,34.713814],[109.410859,34.743117],[109.365098,34.739285],[109.358651,34.716929],[109.340749,34.69872],[109.286641,34.687697],[109.280424,34.697442],[109.254176,34.6988],[109.243873,34.687297],[109.203407,34.697682],[109.173072,34.691931],[109.173187,34.705589],[109.128174,34.699838],[109.090356,34.700876],[109.068655,34.713176],[109.046436,34.687058],[109.029053,34.70503],[109.030492,34.727948],[109.04517,34.752297],[109.034406,34.771451],[109.015986,34.781825],[108.997682,34.808551],[108.973736,34.821711],[108.977823,34.835348],[108.967347,34.88007],[108.983291,34.889951],[109.013914,34.891386],[109.034003,34.901107],[109.061748,34.888836],[109.062323,34.908357],[109.095479,34.919271],[109.097263,34.932892],[109.084542,34.955906],[109.105207,34.97167],[109.127886,34.975093],[109.144176,34.991728],[109.164438,34.983689],[109.176929,35.001597],[109.212559,35.003745],[109.20663,35.018625],[109.223726,35.04758],[109.261659,35.050761],[109.28313,35.084952],[109.27415,35.099579],[109.290728,35.09942],[109.296657,35.086145],[109.339425,35.092504],[109.359514,35.101009],[109.408384,35.09163],[109.415349,35.071993],[109.426746,35.06921],[109.444187,35.088848],[109.441021,35.104586],[109.44482,35.148684],[109.433538,35.167429],[109.381733,35.157184],[109.362162,35.164411],[109.344203,35.18998],[109.319278,35.200142],[109.30909,35.216414],[109.303564,35.246648],[109.283533,35.251012],[109.318703,35.274254],[109.368897,35.286071],[109.382481,35.298282],[109.382711,35.314059],[109.39785,35.329357],[109.411838,35.322699],[109.444475,35.343385],[109.476019,35.340215],[109.495647,35.357251],[109.513204,35.38577],[109.521147,35.425441],[109.546935,35.443805],[109.616181,35.442776],[109.698034,35.409052],[109.721059,35.41119],[109.752775,35.434544],[109.81379,35.443409],[109.821504,35.429636],[109.840384,35.432248],[109.85299,35.422195],[109.875727,35.435415],[109.882404,35.421166],[109.90186,35.411823],[109.953608,35.414832],[109.983712,35.410081],[109.996606,35.434702],[110.014105,35.408656],[110.05198,35.416732],[110.087381,35.406677],[110.102404,35.423303],[110.116507,35.425045],[110.138611,35.456071],[110.184487,35.469286],[110.2059,35.485583],[110.213153,35.502905],[110.230421,35.510497],[110.222478,35.546629],[110.273765,35.538803],[110.283033,35.56702],[110.251316,35.586457],[110.25713,35.597912],[110.234739,35.616553],[110.229558,35.634715],[110.211656,35.639295],[110.193927,35.656347],[110.172687,35.657689],[110.1332,35.675132],[110.162787,35.710006],[110.222017,35.721049],[110.232897,35.715133],[110.282227,35.711741],[110.29915,35.731222],[110.328967,35.752591],[110.370296,35.757401],[110.385838,35.784673],[110.411107,35.809967],[110.486628,35.828401],[110.510113,35.845963],[110.54937,35.854074],[110.550752,35.838088],[110.56733,35.819342],[110.563818,35.787668],[110.574007,35.769777],[110.577633,35.701486],[110.592311,35.682313],[110.592369,35.663293],[110.603996,35.658873],[110.60935,35.632189],[110.589088,35.602099],[110.580914,35.563147],[110.567502,35.539514],[110.531699,35.511446],[110.513049,35.483131],[110.48588,35.422828],[110.477591,35.413882],[110.450019,35.327772],[110.40397,35.286467],[110.374844,35.251964],[110.378355,35.210858],[110.364367,35.197999],[110.364713,35.140264],[110.373692,35.134226],[110.346466,35.084316],[110.333111,35.045115],[110.320563,35.038513],[110.320851,35.005178],[110.30151,34.988624],[110.274686,34.947306],[110.262195,34.94436],[110.254367,34.919191],[110.23094,34.880707],[110.238825,34.852012],[110.233702,34.837421],[110.246884,34.788846],[110.2432,34.725792],[110.229616,34.692649],[110.236638,34.67044],[110.269045,34.629442],[110.295524,34.611054],[110.350783,34.606656],[110.379161,34.600499],[110.367188,34.566746],[110.404488,34.557626],[110.372714,34.544343],[110.360626,34.517292],[110.367073,34.496157],[110.392688,34.466046],[110.409496,34.421581],[110.430966,34.40948]]]]}},{type:"Feature",properties:{name:"延安",center:[109.49081,36.596537],centroid:[109.319393,36.442397],childrenNum:13,level:"city",code:610600,filename:"610000/610600",fullname:"延安市",bbox:[[107.659612,37.498481],[110.551528,35.344618]],offset:[.5739,.4903]},geometry:{type:"MultiPolygon",coordinates:[[[[110.54937,35.854074],[110.510113,35.845963],[110.486628,35.828401],[110.411107,35.809967],[110.385838,35.784673],[110.370296,35.757401],[110.328967,35.752591],[110.29915,35.731222],[110.282227,35.711741],[110.232897,35.715133],[110.222017,35.721049],[110.162787,35.710006],[110.1332,35.675132],[110.172687,35.657689],[110.193927,35.656347],[110.211656,35.639295],[110.229558,35.634715],[110.234739,35.616553],[110.25713,35.597912],[110.251316,35.586457],[110.283033,35.56702],[110.273765,35.538803],[110.222478,35.546629],[110.230421,35.510497],[110.213153,35.502905],[110.2059,35.485583],[110.184487,35.469286],[110.138611,35.456071],[110.116507,35.425045],[110.102404,35.423303],[110.087381,35.406677],[110.05198,35.416732],[110.014105,35.408656],[109.996606,35.434702],[109.983712,35.410081],[109.953608,35.414832],[109.90186,35.411823],[109.882404,35.421166],[109.875727,35.435415],[109.85299,35.422195],[109.840384,35.432248],[109.821504,35.429636],[109.81379,35.443409],[109.752775,35.434544],[109.721059,35.41119],[109.698034,35.409052],[109.616181,35.442776],[109.546935,35.443805],[109.521147,35.425441],[109.513204,35.38577],[109.495647,35.357251],[109.493575,35.395986],[109.467097,35.421878],[109.4774,35.438977],[109.473601,35.453143],[109.45852,35.454568],[109.478379,35.473795],[109.468248,35.483763],[109.466694,35.509074],[109.448389,35.511604],[109.431293,35.500849],[109.406024,35.511762],[109.405909,35.520777],[109.342188,35.522595],[109.266494,35.519512],[109.243758,35.523702],[109.20358,35.580137],[109.179922,35.580769],[109.116086,35.565597],[109.091622,35.543625],[109.051559,35.548763],[109.032852,35.52979],[109.035845,35.518642],[109.014547,35.509311],[109.014893,35.497448],[108.992559,35.473004],[108.979204,35.448316],[108.987148,35.436444],[108.943689,35.393373],[108.923139,35.363114],[108.89787,35.350437],[108.868629,35.344653],[108.846467,35.349803],[108.835876,35.380304],[108.803584,35.379195],[108.808246,35.392898],[108.791611,35.421957],[108.791956,35.437631],[108.775494,35.459316],[108.767378,35.486769],[108.741993,35.491595],[108.727084,35.505831],[108.702563,35.511288],[108.690303,35.505436],[108.659162,35.537775],[108.622898,35.540779],[108.618466,35.556983],[108.567639,35.585509],[108.56384,35.597991],[108.539721,35.605575],[108.523259,35.661162],[108.530339,35.680498],[108.517042,35.716001],[108.533908,35.746205],[108.523259,35.759371],[108.527864,35.824226],[108.518942,35.849113],[108.499543,35.872261],[108.518654,35.905475],[108.563034,35.92129],[108.569308,35.939619],[108.588764,35.950394],[108.633777,35.944732],[108.656514,35.952989],[108.661752,35.993873],[108.688633,36.021064],[108.682532,36.055001],[108.690878,36.088766],[108.707456,36.109803],[108.69767,36.117338],[108.712349,36.138759],[108.702851,36.160803],[108.664918,36.214826],[108.646095,36.254163],[108.655075,36.273981],[108.642181,36.311175],[108.641605,36.359148],[108.651276,36.384727],[108.618926,36.433906],[108.593599,36.431483],[108.562631,36.438595],[108.533044,36.454616],[108.510653,36.474461],[108.514682,36.445551],[108.496838,36.422728],[108.485556,36.429451],[108.460574,36.423119],[108.418957,36.448599],[108.401401,36.447036],[108.40802,36.459616],[108.391615,36.50539],[108.365425,36.519679],[108.359611,36.547312],[108.340616,36.558862],[108.306424,36.561203],[108.287429,36.553322],[108.270218,36.567446],[108.262447,36.549341],[108.245466,36.571035],[108.216628,36.571347],[108.204713,36.606371],[108.222902,36.630933],[108.197863,36.629919],[108.182321,36.59007],[108.163614,36.5637],[108.141453,36.562608],[108.139092,36.57673],[108.115607,36.586638],[108.09287,36.58734],[108.094943,36.604499],[108.079977,36.613077],[108.06219,36.592566],[108.046188,36.596232],[108.002096,36.637403],[108.023163,36.648082],[108.023336,36.66967],[108.004744,36.68315],[107.985979,36.674891],[107.980798,36.653383],[107.974409,36.666086],[107.937454,36.658215],[107.940965,36.694835],[107.905507,36.740625],[107.906659,36.75238],[107.881907,36.747164],[107.86625,36.76709],[107.826706,36.785454],[107.819971,36.776817],[107.768223,36.792923],[107.74491,36.811203],[107.720792,36.802336],[107.672095,36.8329],[107.694947,36.849772],[107.723095,36.8591],[107.727124,36.892828],[107.723267,36.920094],[107.706287,36.963033],[107.693335,36.97421],[107.723958,36.985929],[107.748307,36.986317],[107.752739,37.001137],[107.725282,37.016265],[107.702142,37.018126],[107.69512,36.996637],[107.68591,37.022935],[107.674858,37.029916],[107.65995,37.058529],[107.670138,37.064653],[107.696962,37.050078],[107.720217,37.07349],[107.700473,37.091471],[107.692472,37.123856],[107.675779,37.121687],[107.704099,37.142676],[107.734377,37.136946],[107.744738,37.153905],[107.724131,37.16366],[107.749343,37.176511],[107.747616,37.207699],[107.771159,37.230521],[107.78388,37.230521],[107.797694,37.246144],[107.82141,37.243283],[107.820086,37.220697],[107.850594,37.221393],[107.858652,37.212341],[107.866941,37.16397],[107.887145,37.132299],[107.888584,37.083953],[107.930835,37.094028],[107.94252,37.081861],[107.959097,37.081783],[107.982525,37.110299],[108.032316,37.127187],[108.102195,37.130052],[108.11555,37.149646],[108.123954,37.20414],[108.136617,37.191139],[108.173745,37.195705],[108.174723,37.164666],[108.213347,37.171866],[108.230673,37.194235],[108.24915,37.201741],[108.260087,37.216983],[108.251971,37.234775],[108.275571,37.235239],[108.282248,37.26161],[108.261296,37.268491],[108.245524,37.283642],[108.249438,37.298018],[108.21657,37.325139],[108.236659,37.340279],[108.263253,37.341747],[108.319548,37.358814],[108.343436,37.373871],[108.362201,37.405363],[108.361395,37.388461],[108.407445,37.381127],[108.406581,37.406675],[108.418842,37.407215],[108.431736,37.388306],[108.428743,37.356961],[108.438701,37.3144],[108.486419,37.28542],[108.474274,37.26161],[108.452688,37.2538],[108.48665,37.233074],[108.515258,37.231294],[108.512725,37.204217],[108.540527,37.178833],[108.547838,37.163583],[108.536325,37.117117],[108.552097,37.088293],[108.536728,37.060544],[108.542254,37.039842],[108.510135,37.023246],[108.487743,37.026891],[108.501213,37.001292],[108.517503,37.003309],[108.536268,36.988955],[108.558486,36.986549],[108.598607,37.004783],[108.611328,37.029838],[108.621459,37.02627],[108.651218,37.03961],[108.672401,37.020298],[108.688173,36.996637],[108.73664,36.982592],[108.758456,36.98911],[108.768241,36.974831],[108.80485,37.002999],[108.803987,37.023789],[108.815845,37.029916],[108.809052,37.043409],[108.782631,37.05062],[108.770601,37.069072],[108.741245,37.081241],[108.757707,37.099607],[108.750915,37.114405],[108.773249,37.113088],[108.778314,37.121919],[108.79754,37.111694],[108.819528,37.139734],[108.834437,37.136868],[108.853202,37.154601],[108.883019,37.150962],[108.882904,37.177285],[108.862239,37.180149],[108.85349,37.205378],[108.859994,37.236554],[108.868801,37.242123],[108.862354,37.263543],[108.876227,37.252717],[108.889639,37.222321],[108.894646,37.23493],[108.920722,37.238333],[108.950884,37.233383],[108.963778,37.263233],[108.984673,37.267099],[109.002459,37.285807],[109.01449,37.283024],[109.013684,37.303891],[109.049027,37.295468],[109.056567,37.28542],[109.078498,37.312005],[109.111193,37.307214],[109.11787,37.322435],[109.142737,37.318572],[109.173935,37.30451],[109.178713,37.327148],[109.205249,37.32089],[109.231497,37.329311],[109.24347,37.31865],[109.24865,37.337035],[109.282612,37.346072],[109.300744,37.34445],[109.307651,37.354644],[109.342994,37.347385],[109.329812,37.373253],[109.349786,37.379815],[109.362968,37.408913],[109.385877,37.438154],[109.417421,37.446947],[109.434574,37.459672],[109.453397,37.460212],[109.468651,37.487351],[109.492539,37.498451],[109.509002,37.481647],[109.536516,37.477869],[109.564088,37.460135],[109.576291,37.438],[109.634659,37.419407],[109.669599,37.422339],[109.717778,37.435377],[109.738673,37.424808],[109.734758,37.400501],[109.772807,37.393246],[109.77344,37.363756],[109.784434,37.343369],[109.80366,37.347308],[109.812351,37.305051],[109.783801,37.310691],[109.762043,37.270733],[109.797788,37.265476],[109.811948,37.257821],[109.841017,37.279546],[109.879353,37.270887],[109.905601,37.277922],[109.898176,37.294927],[109.919128,37.314091],[109.926784,37.29284],[109.987857,37.26965],[110.011227,37.274212],[110.028323,37.265244],[110.030222,37.245294],[110.013126,37.204913],[109.988375,37.199652],[109.968919,37.213424],[109.954529,37.206306],[109.982101,37.179375],[109.978071,37.151659],[109.990677,37.130207],[110.013644,37.146316],[110.025099,37.132221],[110.011112,37.095345],[110.031546,37.053179],[110.032467,37.029605],[110.066141,37.01099],[110.087554,36.985308],[110.115816,36.973201],[110.170557,36.988567],[110.191107,37.013394],[110.242855,37.00362],[110.269621,36.988955],[110.278601,36.968544],[110.294718,36.965594],[110.324247,36.98492],[110.352222,36.975141],[110.362238,36.943857],[110.375649,36.962024],[110.388313,36.958608],[110.418706,36.973589],[110.425728,36.957211],[110.415655,36.934228],[110.408747,36.892361],[110.376052,36.88226],[110.382902,36.870448],[110.414043,36.865707],[110.424519,36.855524],[110.419511,36.835],[110.407251,36.824891],[110.422908,36.819214],[110.419569,36.798291],[110.4061,36.774483],[110.384111,36.775261],[110.388486,36.764911],[110.420145,36.760786],[110.432002,36.74802],[110.414504,36.728869],[110.421238,36.721549],[110.439946,36.737122],[110.451803,36.726533],[110.436722,36.71127],[110.433269,36.679799],[110.408575,36.696627],[110.393206,36.692498],[110.394472,36.676839],[110.422389,36.661799],[110.447429,36.621109],[110.47149,36.595764],[110.498256,36.578056],[110.489909,36.550746],[110.50217,36.530999],[110.503379,36.488209],[110.495781,36.472976],[110.473159,36.453209],[110.492154,36.423119],[110.487031,36.393877],[110.469245,36.369944],[110.459977,36.327847],[110.473562,36.310548],[110.468209,36.291366],[110.476037,36.279541],[110.473907,36.24813],[110.454164,36.223682],[110.459517,36.194601],[110.447083,36.164332],[110.45048,36.132247],[110.470453,36.094654],[110.467978,36.074634],[110.492212,36.034656],[110.499695,36.008098],[110.49296,35.995916],[110.514258,35.975714],[110.515064,35.958101],[110.503206,35.943237],[110.516675,35.921684],[110.511668,35.879739],[110.551212,35.87541],[110.54937,35.854074]]]]}},{type:"Feature",properties:{name:"汉中",center:[107.028621,33.077668],centroid:[107.106739,33.090936],childrenNum:11,level:"city",code:610700,filename:"610000/610700",fullname:"汉中市",bbox:[[105.491948,33.877432],[108.283384,32.146037]],offset:[.5785,.4543]},geometry:{type:"MultiPolygon",coordinates:[[[[108.054247,33.709842],[108.052117,33.680016],[108.065068,33.651635],[108.058391,33.618796],[108.070364,33.602129],[108.060406,33.578499],[108.066392,33.540692],[108.060463,33.520042],[108.077329,33.504004],[108.101677,33.500358],[108.151641,33.463977],[108.158606,33.432363],[108.143582,33.405604],[108.117507,33.416795],[108.092928,33.4009],[108.10398,33.391492],[108.095518,33.373483],[108.056434,33.349222],[108.042734,33.324061],[108.052923,33.297025],[108.039338,33.283139],[108.033237,33.260965],[108.021839,33.257878],[108.048606,33.237972],[108.046591,33.226677],[108.077502,33.212373],[108.070594,33.203757],[108.107318,33.21091],[108.097993,33.190587],[108.104498,33.134147],[108.090108,33.093461],[108.095115,33.072053],[108.132243,33.023112],[108.137941,33.008857],[108.126832,32.988243],[108.12545,32.943903],[108.078423,32.902314],[108.078192,32.877514],[108.102598,32.850341],[108.112787,32.819567],[108.130228,32.807809],[108.121191,32.79997],[108.128962,32.777021],[108.149914,32.782003],[108.150547,32.76779],[108.189286,32.766728],[108.230961,32.729796],[108.240574,32.716147],[108.228601,32.693994],[108.255137,32.685817],[108.253065,32.673634],[108.265958,32.615308],[108.258878,32.605652],[108.197345,32.620709],[108.187962,32.608188],[108.211678,32.600577],[108.249496,32.571273],[108.251625,32.545071],[108.277931,32.519926],[108.27914,32.497068],[108.247078,32.473303],[108.18612,32.438709],[108.176392,32.42846],[108.156073,32.439611],[108.121133,32.439857],[108.11555,32.433216],[108.135927,32.382692],[108.117046,32.38704],[108.109448,32.372026],[108.126717,32.349541],[108.13679,32.318103],[108.167125,32.291744],[108.180825,32.259053],[108.156649,32.239005],[108.141683,32.218871],[108.12309,32.218378],[108.088208,32.233418],[108.060751,32.220515],[108.034676,32.220761],[108.018616,32.211803],[108.024372,32.177273],[107.995706,32.147173],[107.979359,32.146022],[107.924733,32.197006],[107.890541,32.214433],[107.867517,32.202432],[107.8358,32.223063],[107.788715,32.279836],[107.754581,32.338215],[107.716763,32.328857],[107.694774,32.35701],[107.695292,32.374734],[107.679463,32.398279],[107.650452,32.412879],[107.636349,32.405989],[107.598243,32.411566],[107.571132,32.397705],[107.525255,32.382446],[107.502864,32.395654],[107.48974,32.425262],[107.457217,32.417717],[107.450195,32.430838],[107.461995,32.441333],[107.457793,32.458713],[107.43874,32.465844],[107.429243,32.501083],[107.436323,32.529755],[107.411283,32.538027],[107.377898,32.538928],[107.356888,32.506408],[107.313889,32.490185],[107.286087,32.454532],[107.283784,32.4342],[107.263926,32.403282],[107.230597,32.416077],[107.210048,32.431986],[107.189613,32.468057],[107.127102,32.482482],[107.104653,32.516649],[107.080131,32.542368],[107.091989,32.552604],[107.107761,32.600741],[107.097572,32.627009],[107.099069,32.649506],[107.087672,32.667909],[107.068389,32.669954],[107.059697,32.686144],[107.066835,32.708872],[107.030225,32.712387],[107.012554,32.721542],[106.988436,32.711815],[106.964778,32.717046],[106.917002,32.703313],[106.903417,32.721296],[106.872564,32.725628],[106.845913,32.721051],[106.823119,32.705357],[106.793244,32.712632],[106.784322,32.697264],[106.779429,32.737478],[106.732056,32.73854],[106.684453,32.709281],[106.663443,32.690723],[106.628733,32.681238],[106.588613,32.688597],[106.566797,32.675841],[106.518733,32.668645],[106.498068,32.649343],[106.461977,32.653105],[106.451673,32.660139],[106.450983,32.640181],[106.420533,32.616617],[106.389046,32.626682],[106.38329,32.646561],[106.351171,32.671834],[106.300862,32.679848],[106.278816,32.67069],[106.256424,32.693258],[106.174342,32.697591],[106.169334,32.710017],[106.153677,32.705766],[106.145388,32.720397],[106.120003,32.719662],[106.071652,32.75815],[106.076487,32.759049],[106.076717,32.763787],[106.072688,32.763869],[106.064226,32.782248],[106.094676,32.795969],[106.09364,32.823812],[106.069925,32.824057],[106.04667,32.852299],[106.021688,32.857522],[106.011557,32.82969],[105.99521,32.827975],[105.969307,32.849035],[105.940929,32.829771],[105.886879,32.835159],[105.857753,32.827404],[105.850788,32.818097],[105.831159,32.826098],[105.816941,32.790334],[105.822525,32.770159],[105.811415,32.772283],[105.779584,32.750225],[105.76882,32.767545],[105.750688,32.767954],[105.735952,32.753902],[105.719202,32.759703],[105.678045,32.726527],[105.649264,32.718681],[105.625376,32.702087],[105.596365,32.699226],[105.585198,32.729061],[105.563785,32.724893],[105.557856,32.752921],[105.568102,32.758722],[105.554691,32.773998],[105.556302,32.792049],[105.535868,32.789844],[105.524528,32.847729],[105.495517,32.87319],[105.493503,32.905495],[105.513995,32.919115],[105.534141,32.909491],[105.56557,32.9068],[105.590609,32.87678],[105.644544,32.882735],[105.656575,32.89538],[105.699401,32.903456],[105.735434,32.905331],[105.78557,32.92678],[105.826957,32.950751],[105.861724,32.938929],[105.917444,32.993784],[105.928093,33.041519],[105.9133,33.053164],[105.915084,33.066273],[105.933273,33.077019],[105.91871,33.105425],[105.936785,33.113562],[105.920092,33.132113],[105.92343,33.147732],[105.896376,33.142689],[105.924582,33.167576],[105.916926,33.177741],[105.927747,33.198473],[105.945534,33.188148],[105.9468,33.153507],[105.968328,33.154076],[105.966889,33.20018],[105.921301,33.236266],[105.906565,33.240166],[105.862588,33.234316],[105.828799,33.253897],[105.792823,33.262752],[105.791499,33.278591],[105.767438,33.28257],[105.747752,33.298893],[105.755235,33.32885],[105.734168,33.346544],[105.708956,33.380703],[105.732844,33.391005],[105.743262,33.385327],[105.802609,33.378756],[105.829662,33.382812],[105.837951,33.410795],[105.830986,33.456439],[105.841981,33.490069],[105.868344,33.509269],[105.902708,33.556157],[105.919459,33.554781],[105.953996,33.587159],[105.962112,33.606499],[105.979726,33.612405],[105.998951,33.604152],[106.018983,33.609735],[106.02848,33.595251],[106.045749,33.609735],[106.063881,33.604152],[106.086675,33.617097],[106.131343,33.597193],[106.110851,33.591933],[106.108491,33.569838],[106.1333,33.571861],[106.147518,33.581817],[106.143719,33.5649],[106.187178,33.546522],[106.237429,33.56409],[106.277492,33.59687],[106.303395,33.604395],[106.335169,33.587078],[106.351401,33.587239],[106.384902,33.612081],[106.431354,33.61912],[106.446896,33.613214],[106.45271,33.591852],[106.456048,33.537939],[106.477461,33.519394],[106.494269,33.530489],[106.541124,33.513076],[106.563055,33.543041],[106.559774,33.57089],[106.580554,33.575909],[106.581475,33.590638],[106.596729,33.579389],[106.617911,33.591933],[106.629827,33.619605],[106.647325,33.634813],[106.64226,33.658994],[106.687043,33.665544],[106.705693,33.676944],[106.674955,33.701437],[106.71427,33.701356],[106.789215,33.67751],[106.797273,33.682441],[106.803835,33.72366],[106.80585,33.809832],[106.817823,33.834448],[106.839409,33.827023],[106.854375,33.848649],[106.855583,33.874384],[106.888681,33.860993],[106.890063,33.848327],[106.909691,33.847762],[106.930701,33.827266],[106.978247,33.800952],[107.028153,33.794574],[107.043234,33.805069],[107.038514,33.85462],[107.044904,33.873819],[107.063093,33.870431],[107.066432,33.838725],[107.080477,33.8221],[107.105746,33.822504],[107.112078,33.812818],[107.136945,33.81411],[107.128368,33.777618],[107.145233,33.794251],[107.163135,33.788035],[107.181612,33.769462],[107.187369,33.751774],[107.212581,33.74927],[107.231173,33.766797],[107.27279,33.790699],[107.276762,33.801194],[107.299499,33.792798],[107.322581,33.818872],[107.342037,33.81411],[107.328279,33.797642],[107.32212,33.774469],[107.305543,33.766878],[107.304334,33.733517],[107.314177,33.728831],[107.3056,33.710165],[107.336165,33.68907],[107.376516,33.682845],[107.400347,33.651312],[107.423601,33.649371],[107.467694,33.660612],[107.492503,33.679854],[107.517082,33.678318],[107.562555,33.70273],[107.586846,33.697719],[107.628694,33.714448],[107.650682,33.700628],[107.673764,33.699497],[107.695868,33.72366],[107.719353,33.725761],[107.737427,33.717923],[107.763503,33.719781],[107.830102,33.69788],[107.854278,33.694081],[107.90309,33.748947],[107.931583,33.731255],[107.951672,33.745797],[107.96612,33.734648],[108.008312,33.728993],[108.054247,33.709842]]],[[[106.076717,32.763787],[106.076487,32.759049],[106.071652,32.75815],[106.072688,32.763869],[106.076717,32.763787]]]]}},{type:"Feature",properties:{name:"榆林",center:[109.741193,38.290162],centroid:[109.577105,38.048207],childrenNum:12,level:"city",code:610800,filename:"610000/610800",fullname:"榆林市",bbox:[[107.257494,39.58701],[111.248053,36.813965]],offset:[.5813,.5549]},geometry:{type:"MultiPolygon",coordinates:[[[[110.418706,36.973589],[110.388313,36.958608],[110.375649,36.962024],[110.362238,36.943857],[110.352222,36.975141],[110.324247,36.98492],[110.294718,36.965594],[110.278601,36.968544],[110.269621,36.988955],[110.242855,37.00362],[110.191107,37.013394],[110.170557,36.988567],[110.115816,36.973201],[110.087554,36.985308],[110.066141,37.01099],[110.032467,37.029605],[110.031546,37.053179],[110.011112,37.095345],[110.025099,37.132221],[110.013644,37.146316],[109.990677,37.130207],[109.978071,37.151659],[109.982101,37.179375],[109.954529,37.206306],[109.968919,37.213424],[109.988375,37.199652],[110.013126,37.204913],[110.030222,37.245294],[110.028323,37.265244],[110.011227,37.274212],[109.987857,37.26965],[109.926784,37.29284],[109.919128,37.314091],[109.898176,37.294927],[109.905601,37.277922],[109.879353,37.270887],[109.841017,37.279546],[109.811948,37.257821],[109.797788,37.265476],[109.762043,37.270733],[109.783801,37.310691],[109.812351,37.305051],[109.80366,37.347308],[109.784434,37.343369],[109.77344,37.363756],[109.772807,37.393246],[109.734758,37.400501],[109.738673,37.424808],[109.717778,37.435377],[109.669599,37.422339],[109.634659,37.419407],[109.576291,37.438],[109.564088,37.460135],[109.536516,37.477869],[109.509002,37.481647],[109.492539,37.498451],[109.468651,37.487351],[109.453397,37.460212],[109.434574,37.459672],[109.417421,37.446947],[109.385877,37.438154],[109.362968,37.408913],[109.349786,37.379815],[109.329812,37.373253],[109.342994,37.347385],[109.307651,37.354644],[109.300744,37.34445],[109.282612,37.346072],[109.24865,37.337035],[109.24347,37.31865],[109.231497,37.329311],[109.205249,37.32089],[109.178713,37.327148],[109.173935,37.30451],[109.142737,37.318572],[109.11787,37.322435],[109.111193,37.307214],[109.078498,37.312005],[109.056567,37.28542],[109.049027,37.295468],[109.013684,37.303891],[109.01449,37.283024],[109.002459,37.285807],[108.984673,37.267099],[108.963778,37.263233],[108.950884,37.233383],[108.920722,37.238333],[108.894646,37.23493],[108.889639,37.222321],[108.876227,37.252717],[108.862354,37.263543],[108.868801,37.242123],[108.859994,37.236554],[108.85349,37.205378],[108.862239,37.180149],[108.882904,37.177285],[108.883019,37.150962],[108.853202,37.154601],[108.834437,37.136868],[108.819528,37.139734],[108.79754,37.111694],[108.778314,37.121919],[108.773249,37.113088],[108.750915,37.114405],[108.757707,37.099607],[108.741245,37.081241],[108.770601,37.069072],[108.782631,37.05062],[108.809052,37.043409],[108.815845,37.029916],[108.803987,37.023789],[108.80485,37.002999],[108.768241,36.974831],[108.758456,36.98911],[108.73664,36.982592],[108.688173,36.996637],[108.672401,37.020298],[108.651218,37.03961],[108.621459,37.02627],[108.611328,37.029838],[108.598607,37.004783],[108.558486,36.986549],[108.536268,36.988955],[108.517503,37.003309],[108.501213,37.001292],[108.487743,37.026891],[108.510135,37.023246],[108.542254,37.039842],[108.536728,37.060544],[108.552097,37.088293],[108.536325,37.117117],[108.547838,37.163583],[108.540527,37.178833],[108.512725,37.204217],[108.515258,37.231294],[108.48665,37.233074],[108.452688,37.2538],[108.474274,37.26161],[108.486419,37.28542],[108.438701,37.3144],[108.428743,37.356961],[108.431736,37.388306],[108.418842,37.407215],[108.406581,37.406675],[108.407445,37.381127],[108.361395,37.388461],[108.362201,37.405363],[108.343436,37.373871],[108.319548,37.358814],[108.263253,37.341747],[108.236659,37.340279],[108.21657,37.325139],[108.249438,37.298018],[108.245524,37.283642],[108.261296,37.268491],[108.282248,37.26161],[108.275571,37.235239],[108.251971,37.234775],[108.260087,37.216983],[108.24915,37.201741],[108.230673,37.194235],[108.213347,37.171866],[108.174723,37.164666],[108.173745,37.195705],[108.136617,37.191139],[108.123954,37.20414],[108.11555,37.149646],[108.102195,37.130052],[108.032316,37.127187],[107.982525,37.110299],[107.959097,37.081783],[107.94252,37.081861],[107.930835,37.094028],[107.888584,37.083953],[107.887145,37.132299],[107.866941,37.16397],[107.858652,37.212341],[107.850594,37.221393],[107.820086,37.220697],[107.82141,37.243283],[107.797694,37.246144],[107.78388,37.230521],[107.771159,37.230521],[107.747616,37.207699],[107.749343,37.176511],[107.724131,37.16366],[107.744738,37.153905],[107.734377,37.136946],[107.704099,37.142676],[107.675779,37.121687],[107.692472,37.123856],[107.700473,37.091471],[107.720217,37.07349],[107.696962,37.050078],[107.670138,37.064653],[107.65995,37.058529],[107.674858,37.029916],[107.68591,37.022935],[107.69512,36.996637],[107.702142,37.018126],[107.725282,37.016265],[107.752739,37.001137],[107.748307,36.986317],[107.723958,36.985929],[107.693335,36.97421],[107.706287,36.963033],[107.723267,36.920094],[107.727124,36.892828],[107.723095,36.8591],[107.694947,36.849772],[107.672095,36.8329],[107.639515,36.818514],[107.603597,36.825824],[107.590818,36.836244],[107.540106,36.828624],[107.528479,36.853737],[107.533717,36.867184],[107.47794,36.908443],[107.447202,36.899432],[107.370645,36.904792],[107.332827,36.925608],[107.311702,36.913026],[107.294836,36.929414],[107.304276,36.951699],[107.287411,36.992369],[107.279525,37.041703],[107.285223,37.056435],[107.268703,37.099452],[107.277568,37.102396],[107.278258,37.128194],[107.307039,37.100459],[107.3311,37.13013],[107.337835,37.153982],[107.333978,37.173801],[107.317688,37.199961],[107.270315,37.229129],[107.291382,37.241272],[107.309342,37.238874],[107.293282,37.277458],[107.273135,37.29114],[107.257939,37.336958],[107.261047,37.37086],[107.271063,37.390313],[107.283612,37.440776],[107.284302,37.481955],[107.345663,37.518873],[107.359132,37.540214],[107.372199,37.580029],[107.368918,37.587574],[107.330467,37.584033],[107.312565,37.610127],[107.325056,37.606279],[107.36132,37.613282],[107.39672,37.652443],[107.419918,37.650212],[107.422047,37.665056],[107.389583,37.671208],[107.386877,37.691121],[107.407081,37.692966],[107.430566,37.684202],[107.465449,37.691198],[107.485077,37.706495],[107.490833,37.745376],[107.49918,37.765654],[107.523413,37.772949],[107.571305,37.776712],[107.599222,37.791146],[107.620692,37.775944],[107.646135,37.805194],[107.659259,37.8441],[107.650222,37.864581],[107.675952,37.875778],[107.683435,37.887739],[107.741169,37.845328],[107.815884,37.829062],[107.842708,37.828985],[107.8849,37.808341],[107.894628,37.813637],[107.937109,37.795062],[107.981949,37.787231],[107.979992,37.764732],[107.993692,37.735081],[108.014069,37.725861],[108.02443,37.698655],[108.013205,37.665517],[108.025408,37.649827],[108.060233,37.652058],[108.077041,37.642981],[108.108239,37.637827],[108.133912,37.621978],[108.154001,37.623901],[108.193661,37.638289],[108.205576,37.65575],[108.246502,37.665748],[108.292782,37.656981],[108.301128,37.64075],[108.33296,37.633057],[108.351265,37.641366],[108.422411,37.648827],[108.477037,37.674207],[108.532641,37.690583],[108.55958,37.681742],[108.61127,37.654212],[108.628366,37.652212],[108.699512,37.66967],[108.713442,37.680665],[108.741648,37.685509],[108.777681,37.68351],[108.792014,37.700269],[108.78338,37.737309],[108.784704,37.764655],[108.801397,37.792298],[108.793223,37.815863],[108.792072,37.872864],[108.798231,37.933652],[108.824882,37.98321],[108.826666,37.995155],[108.797655,38.047886],[108.830638,38.049798],[108.855504,38.038322],[108.882961,38.013833],[108.893841,37.978157],[108.917095,37.959776],[108.935803,37.921621],[108.974197,37.931889],[108.97955,37.959316],[109.017483,37.969962],[109.015468,37.982828],[109.028938,37.997452],[109.038032,38.021487],[109.069519,38.023017],[109.050754,38.055],[109.068828,38.091174],[109.06359,38.100196],[109.019785,38.119688],[108.964469,38.154761],[108.947258,38.170725],[108.938508,38.207453],[108.955144,38.218521],[108.976557,38.249503],[108.961878,38.265065],[108.976441,38.296942],[108.989738,38.310893],[109.007813,38.35913],[109.051272,38.385255],[109.059791,38.408705],[109.054265,38.433975],[109.092486,38.45353],[109.128634,38.480533],[109.147112,38.506157],[109.178655,38.520828],[109.196845,38.552668],[109.27674,38.622986],[109.310299,38.60249],[109.331366,38.597935],[109.366537,38.631107],[109.328891,38.660471],[109.325956,38.670029],[109.338734,38.7015],[109.403952,38.720603],[109.412528,38.747581],[109.442576,38.771141],[109.450864,38.788863],[109.489258,38.813317],[109.511189,38.833753],[109.549755,38.805672],[109.624413,38.854485],[109.649279,38.884514],[109.67098,38.926472],[109.683759,38.93554],[109.68537,38.968254],[109.665339,38.981697],[109.672016,38.997026],[109.691242,38.992647],[109.704826,39.016956],[109.725376,39.01839],[109.762388,39.057478],[109.793356,39.074072],[109.815345,39.096167],[109.860128,39.124435],[109.882116,39.116747],[109.890923,39.104007],[109.922121,39.107023],[109.893916,39.141239],[109.960457,39.186735],[109.897255,39.234082],[109.882174,39.233104],[109.868992,39.249732],[109.902723,39.271922],[109.941289,39.239952],[109.962702,39.211881],[110.010997,39.208568],[110.078401,39.230771],[110.110808,39.249732],[110.159851,39.263122],[110.193352,39.280721],[110.210851,39.281473],[110.202792,39.316356],[110.185293,39.3531],[110.158872,39.389599],[110.136769,39.391777],[110.126408,39.416849],[110.133373,39.448289],[110.152483,39.45399],[110.206188,39.437485],[110.217125,39.443262],[110.243488,39.423678],[110.276759,39.420301],[110.257648,39.407091],[110.281018,39.394179],[110.296617,39.376008],[110.34094,39.341531],[110.370008,39.329433],[110.385205,39.310494],[110.429124,39.342057],[110.416576,39.348668],[110.434995,39.380889],[110.469475,39.375182],[110.482599,39.360612],[110.499177,39.360687],[110.521741,39.383217],[110.559156,39.352124],[110.566927,39.318461],[110.596571,39.283052],[110.626273,39.266808],[110.669617,39.275908],[110.688382,39.267485],[110.70283,39.273878],[110.732877,39.308464],[110.738288,39.348518],[110.768565,39.382917],[110.782668,39.388098],[110.806613,39.411295],[110.862909,39.482639],[110.890826,39.508952],[110.959152,39.519445],[110.990177,39.537054],[110.996624,39.547767],[111.017231,39.552037],[111.040947,39.567691],[111.04371,39.554584],[111.100984,39.559452],[111.136787,39.58701],[111.154976,39.568664],[111.148875,39.532633],[111.107143,39.499208],[111.100005,39.483239],[111.108869,39.474165],[111.088032,39.468391],[111.086881,39.45669],[111.05833,39.447689],[111.053841,39.429907],[111.064374,39.400936],[111.086651,39.412721],[111.09776,39.404539],[111.086593,39.380139],[111.108121,39.356556],[111.125562,39.36647],[111.155034,39.368273],[111.161711,39.33552],[111.18842,39.350922],[111.194233,39.340479],[111.17944,39.326803],[111.187959,39.314327],[111.213804,39.301247],[111.247478,39.3023],[111.227159,39.284406],[111.213516,39.25718],[111.218985,39.24567],[111.163093,39.152465],[111.174144,39.135136],[111.162517,39.108455],[111.147321,39.100539],[111.138341,39.064267],[111.088953,39.02707],[111.038241,39.020126],[110.998409,38.998536],[110.979989,38.972257],[110.994552,38.960171],[111.009921,38.932593],[111.015735,38.896234],[111.012339,38.878312],[110.996049,38.868026],[111.010094,38.841623],[110.996509,38.825125],[110.979126,38.787727],[110.956274,38.776746],[110.965023,38.755688],[110.937681,38.718784],[110.915405,38.704305],[110.916211,38.673973],[110.896409,38.657816],[110.88081,38.626933],[110.89664,38.588216],[110.919895,38.582064],[110.909418,38.563152],[110.907692,38.521056],[110.870161,38.508894],[110.874248,38.453682],[110.84069,38.439986],[110.825033,38.449421],[110.796828,38.453454],[110.77766,38.4409],[110.758952,38.400407],[110.750318,38.36949],[110.701621,38.35334],[110.668581,38.313637],[110.638821,38.304718],[110.601291,38.308225],[110.577461,38.297247],[110.567963,38.245764],[110.567272,38.217529],[110.558235,38.210506],[110.523928,38.210506],[110.507869,38.18493],[110.510574,38.147274],[110.521165,38.124427],[110.501882,38.098132],[110.508789,38.061961],[110.501422,38.03901],[110.508099,38.012838],[110.52836,37.990638],[110.516618,37.970728],[110.522489,37.95495],[110.547644,37.940317],[110.587937,37.926602],[110.607277,37.89625],[110.650564,37.840034],[110.660752,37.808034],[110.680381,37.790072],[110.735755,37.770415],[110.755671,37.755055],[110.750721,37.736157],[110.716645,37.728704],[110.70352,37.718638],[110.706571,37.705342],[110.739094,37.68943],[110.775357,37.680896],[110.796137,37.663056],[110.793317,37.65075],[110.76373,37.639596],[110.772249,37.592655],[110.794928,37.56617],[110.771098,37.538365],[110.771271,37.520183],[110.759528,37.503461],[110.758377,37.471161],[110.744965,37.450726],[110.648146,37.438154],[110.631799,37.398803],[110.634044,37.36615],[110.651773,37.357038],[110.695059,37.349625],[110.693965,37.325912],[110.678711,37.317877],[110.690051,37.287043],[110.661903,37.282019],[110.650161,37.254341],[110.584541,37.18069],[110.540276,37.144612],[110.535556,37.115102],[110.495781,37.086743],[110.460495,37.044728],[110.425958,37.04085],[110.424059,37.023944],[110.450307,37.016497],[110.441212,37.00618],[110.412834,37.019212],[110.38319,37.021849],[110.377146,37.010291],[110.40846,36.989032],[110.418706,36.973589]]]]}},{type:"Feature",properties:{name:"安康",center:[109.029273,32.6903],centroid:[108.929995,32.759384],childrenNum:10,level:"city",code:610900,filename:"610000/610900",fullname:"安康市",bbox:[[108.021471,33.841692],[110.206428,31.705059]],offset:[.4158,.5065]},geometry:{type:"MultiPolygon",coordinates:[[[[109.438892,33.152124],[109.468536,33.140248],[109.514009,33.140248],[109.560347,33.125686],[109.576176,33.110226],[109.592236,33.119584],[109.601964,33.108192],[109.633277,33.118038],[109.688076,33.116573],[109.715245,33.099484],[109.768029,33.074496],[109.794507,33.066924],[109.784607,32.985961],[109.764345,32.909328],[109.789902,32.882491],[109.80838,32.878983],[109.847752,32.893259],[109.857077,32.910307],[109.883785,32.901743],[109.915962,32.901009],[109.931274,32.885346],[109.98872,32.886244],[110.004319,32.873271],[110.030452,32.872129],[110.05129,32.851891],[110.0841,32.842995],[110.113802,32.825445],[110.1195,32.812953],[110.14218,32.802828],[110.127501,32.777756],[110.139589,32.764931],[110.159621,32.767218],[110.162326,32.715902],[110.154498,32.690069],[110.187883,32.646316],[110.206418,32.632981],[110.165147,32.593866],[110.153807,32.593129],[110.13343,32.612198],[110.10252,32.619072],[110.085366,32.613099],[110.088187,32.585435],[110.051578,32.558664],[110.028207,32.548428],[109.995743,32.550721],[109.971164,32.577576],[109.944801,32.57684],[109.910552,32.59272],[109.881253,32.591983],[109.849479,32.579787],[109.817071,32.577413],[109.758186,32.589855],[109.7267,32.60827],[109.631838,32.600086],[109.61929,32.593047],[109.620038,32.567425],[109.636788,32.541058],[109.618138,32.524759],[109.587516,32.516075],[109.576003,32.491742],[109.552748,32.477155],[109.541639,32.444285],[109.526903,32.43338],[109.529609,32.405743],[109.506239,32.395326],[109.500425,32.378918],[109.513204,32.342319],[109.510671,32.324588],[109.495417,32.300367],[109.528688,32.270308],[109.550446,32.224871],[109.592754,32.219364],[109.604324,32.199226],[109.587113,32.161484],[109.592581,32.139194],[109.62165,32.106777],[109.617851,32.085132],[109.590969,32.047755],[109.587573,32.025272],[109.601388,31.997676],[109.631263,31.962242],[109.620614,31.928608],[109.594481,31.923331],[109.584983,31.900488],[109.607547,31.881681],[109.638227,31.81104],[109.604554,31.803774],[109.591833,31.788912],[109.592984,31.75191],[109.605993,31.743731],[109.585731,31.726711],[109.549755,31.730016],[109.501116,31.717125],[109.458981,31.715803],[109.457023,31.721587],[109.417882,31.71886],[109.415464,31.710018],[109.390252,31.705224],[109.323193,31.708861],[109.281576,31.716877],[109.28313,31.741749],[109.254694,31.766944],[109.28123,31.777928],[109.273575,31.80105],[109.213595,31.817479],[109.196212,31.817561],[109.198284,31.845789],[109.167028,31.875329],[109.124605,31.892157],[109.087823,31.927371],[109.035097,31.958038],[108.986745,31.979961],[108.955086,31.979137],[108.937127,31.988942],[108.902417,31.984905],[108.867765,32.004102],[108.837891,32.038862],[108.788675,32.048332],[108.751721,32.074184],[108.747749,32.099864],[108.734049,32.106448],[108.679769,32.102992],[108.583986,32.172257],[108.551061,32.176122],[108.510595,32.200212],[108.514509,32.218214],[108.507142,32.245661],[108.483656,32.251413],[108.471741,32.270636],[108.450789,32.2593],[108.431045,32.262586],[108.414985,32.252481],[108.387644,32.262257],[108.347984,32.25396],[108.329276,32.232596],[108.312065,32.232185],[108.287832,32.249359],[108.265152,32.256999],[108.247193,32.274825],[108.212196,32.256999],[108.213289,32.248208],[108.179328,32.221994],[108.156649,32.239005],[108.180825,32.259053],[108.167125,32.291744],[108.13679,32.318103],[108.126717,32.349541],[108.109448,32.372026],[108.117046,32.38704],[108.135927,32.382692],[108.11555,32.433216],[108.121133,32.439857],[108.156073,32.439611],[108.176392,32.42846],[108.18612,32.438709],[108.247078,32.473303],[108.27914,32.497068],[108.277931,32.519926],[108.251625,32.545071],[108.249496,32.571273],[108.211678,32.600577],[108.187962,32.608188],[108.197345,32.620709],[108.258878,32.605652],[108.265958,32.615308],[108.253065,32.673634],[108.255137,32.685817],[108.228601,32.693994],[108.240574,32.716147],[108.230961,32.729796],[108.189286,32.766728],[108.150547,32.76779],[108.149914,32.782003],[108.128962,32.777021],[108.121191,32.79997],[108.130228,32.807809],[108.112787,32.819567],[108.102598,32.850341],[108.078192,32.877514],[108.078423,32.902314],[108.12545,32.943903],[108.126832,32.988243],[108.137941,33.008857],[108.132243,33.023112],[108.095115,33.072053],[108.090108,33.093461],[108.104498,33.134147],[108.097993,33.190587],[108.107318,33.21091],[108.070594,33.203757],[108.077502,33.212373],[108.046591,33.226677],[108.048606,33.237972],[108.021839,33.257878],[108.033237,33.260965],[108.039338,33.283139],[108.052923,33.297025],[108.042734,33.324061],[108.056434,33.349222],[108.095518,33.373483],[108.10398,33.391492],[108.092928,33.4009],[108.117507,33.416795],[108.143582,33.405604],[108.158606,33.432363],[108.151641,33.463977],[108.101677,33.500358],[108.077329,33.504004],[108.060463,33.520042],[108.066392,33.540692],[108.060406,33.578499],[108.070364,33.602129],[108.058391,33.618796],[108.065068,33.651635],[108.052117,33.680016],[108.054247,33.709842],[108.073818,33.723417],[108.098396,33.723498],[108.113823,33.712589],[108.132243,33.721882],[108.149281,33.712347],[108.180191,33.711862],[108.191761,33.725276],[108.233148,33.726649],[108.259281,33.754763],[108.288292,33.767282],[108.307,33.76292],[108.345969,33.793848],[108.369454,33.793202],[108.404855,33.763324],[108.443709,33.781979],[108.466445,33.800629],[108.484405,33.804262],[108.544557,33.788438],[108.560444,33.765101],[108.584274,33.764536],[108.585425,33.780122],[108.602579,33.791426],[108.617717,33.825974],[108.650067,33.841549],[108.697843,33.828315],[108.741014,33.841468],[108.755923,33.839048],[108.756038,33.812657],[108.778487,33.798046],[108.805771,33.817177],[108.84002,33.815966],[108.835588,33.792233],[108.846985,33.777699],[108.903223,33.781091],[108.92337,33.774711],[108.942307,33.747816],[108.945473,33.726569],[108.922909,33.684543],[108.902245,33.678803],[108.879335,33.698527],[108.826493,33.649371],[108.798806,33.654628],[108.792244,33.642497],[108.815039,33.633034],[108.828508,33.617825],[108.805599,33.605366],[108.797367,33.58384],[108.750685,33.536401],[108.724897,33.530651],[108.693296,33.535267],[108.653809,33.54798],[108.625143,33.533161],[108.633086,33.501168],[108.588188,33.459681],[108.597456,33.407226],[108.574201,33.373889],[108.569884,33.318866],[108.583468,33.298487],[108.640166,33.321139],[108.66227,33.323574],[108.691051,33.291828],[108.687252,33.274773],[108.710507,33.270062],[108.740842,33.283788],[108.80698,33.24496],[108.816938,33.225783],[108.863851,33.192782],[108.900863,33.147732],[108.919283,33.151067],[108.931083,33.125035],[108.973218,33.13732],[108.97057,33.160338],[108.988817,33.176928],[109.005107,33.168796],[109.059618,33.214242],[109.124202,33.15985],[109.174569,33.161558],[109.218546,33.193351],[109.232015,33.192376],[109.258206,33.167739],[109.295448,33.173919],[109.313235,33.167576],[109.339195,33.135855],[109.373789,33.147244],[109.438892,33.152124]]]]}},{type:"Feature",properties:{name:"商洛",center:[109.939776,33.868319],centroid:[109.907166,33.647601],childrenNum:7,level:"city",code:611e3,filename:"610000/611000",fullname:"商洛市",bbox:[[108.569247,34.432503],[111.029972,33.095712]],offset:[.5437,.5872]},geometry:{type:"MultiPolygon",coordinates:[[[[109.185793,33.812334],[109.207379,33.867043],[109.251874,33.880675],[109.289462,33.87027],[109.299823,33.856556],[109.316918,33.85462],[109.355945,33.867608],[109.399059,33.845422],[109.442518,33.843566],[109.470263,33.851796],[109.508541,33.848004],[109.537322,33.862042],[109.540142,33.875513],[109.576118,33.897691],[109.592984,33.896804],[109.603633,33.940982],[109.562994,33.960726],[109.533235,33.982077],[109.545496,34.025244],[109.56121,34.034181],[109.552806,34.044727],[109.567139,34.064688],[109.584235,34.072092],[109.634313,34.075633],[109.658835,34.105481],[109.669886,34.099931],[109.694753,34.109101],[109.739824,34.09792],[109.742184,34.12189],[109.755078,34.127197],[109.78098,34.160083],[109.789787,34.145049],[109.822194,34.155742],[109.801415,34.160887],[109.778102,34.183392],[109.745465,34.187491],[109.754502,34.212239],[109.743565,34.240352],[109.757322,34.252961],[109.775972,34.251997],[109.80199,34.224048],[109.792147,34.263078],[109.825591,34.288205],[109.853335,34.266048],[109.873655,34.270785],[109.883555,34.24742],[109.920395,34.230313],[109.95614,34.243645],[109.94929,34.219549],[109.964372,34.209748],[109.997642,34.221638],[110.024063,34.240352],[110.007255,34.303213],[110.030855,34.30217],[110.040526,34.324156],[110.024236,34.338998],[110.007197,34.368593],[110.03736,34.377814],[110.058485,34.396975],[110.059982,34.413247],[110.075178,34.413888],[110.103383,34.428874],[110.132164,34.42687],[110.162326,34.432159],[110.194215,34.414769],[110.251834,34.406754],[110.284357,34.391364],[110.377549,34.398338],[110.388716,34.408117],[110.430966,34.40948],[110.458193,34.402426],[110.475922,34.409159],[110.473734,34.393207],[110.489449,34.35528],[110.502688,34.345174],[110.498141,34.320064],[110.474655,34.323514],[110.449328,34.291496],[110.432635,34.290853],[110.426476,34.276084],[110.442479,34.254004],[110.441385,34.242441],[110.489737,34.232321],[110.507869,34.217621],[110.551443,34.212801],[110.557141,34.193357],[110.589088,34.190223],[110.587706,34.17865],[110.621783,34.177445],[110.641987,34.160887],[110.614012,34.113686],[110.591793,34.101701],[110.595189,34.064769],[110.58834,34.06163],[110.586613,34.024037],[110.612113,34.024278],[110.624143,34.033859],[110.627769,34.019528],[110.649585,33.992307],[110.653442,33.969186],[110.670941,33.966447],[110.675603,33.946624],[110.626043,33.92462],[110.62587,33.90777],[110.591506,33.900191],[110.587304,33.886966],[110.612976,33.867447],[110.612746,33.85107],[110.644808,33.844938],[110.66789,33.852119],[110.684928,33.838805],[110.712615,33.83356],[110.72597,33.807733],[110.741338,33.798772],[110.782207,33.796027],[110.815938,33.753067],[110.816859,33.737395],[110.832228,33.712832],[110.823191,33.692869],[110.841841,33.663199],[110.857728,33.657781],[110.878853,33.634651],[110.94079,33.620091],[110.966577,33.609169],[111.003704,33.57866],[111.009748,33.562552],[111.003532,33.53308],[111.019476,33.520852],[111.026499,33.478563],[111.021664,33.476538],[111.020973,33.471189],[111.026787,33.467705],[111.020858,33.450846],[110.996739,33.43593],[111.011015,33.398873],[111.026153,33.375349],[111.026038,33.330392],[111.000366,33.32398],[111.007964,33.303683],[110.982867,33.270062],[110.997027,33.254709],[110.966174,33.256172],[110.942977,33.236347],[110.94597,33.228627],[110.921621,33.204001],[110.865326,33.21408],[110.830559,33.202537],[110.817377,33.177253],[110.824227,33.160257],[110.795101,33.149928],[110.765917,33.152449],[110.727811,33.133903],[110.717853,33.116899],[110.719926,33.099565],[110.702484,33.097124],[110.669559,33.130161],[110.651082,33.157492],[110.616372,33.145617],[110.594153,33.168552],[110.593923,33.20709],[110.577691,33.250566],[110.540966,33.255603],[110.527785,33.230415],[110.50902,33.221476],[110.470511,33.185059],[110.471029,33.171398],[110.451803,33.179367],[110.422332,33.17026],[110.361662,33.181725],[110.333975,33.159769],[110.297308,33.170585],[110.250338,33.160257],[110.218276,33.163185],[110.165031,33.209284],[110.13061,33.201725],[110.077595,33.20205],[110.040411,33.191238],[109.999139,33.212617],[109.973639,33.203919],[109.916595,33.229684],[109.845219,33.246991],[109.813157,33.236347],[109.762964,33.235778],[109.732456,33.231309],[109.70143,33.241222],[109.692969,33.254303],[109.649797,33.251703],[109.647783,33.268113],[109.616296,33.274124],[109.607374,33.264295],[109.606856,33.236022],[109.587688,33.229765],[109.549755,33.242279],[109.51424,33.237728],[109.498295,33.207333],[109.481948,33.200261],[109.464794,33.172943],[109.438892,33.152124],[109.373789,33.147244],[109.339195,33.135855],[109.313235,33.167576],[109.295448,33.173919],[109.258206,33.167739],[109.232015,33.192376],[109.218546,33.193351],[109.174569,33.161558],[109.124202,33.15985],[109.059618,33.214242],[109.005107,33.168796],[108.988817,33.176928],[108.97057,33.160338],[108.973218,33.13732],[108.931083,33.125035],[108.919283,33.151067],[108.900863,33.147732],[108.863851,33.192782],[108.816938,33.225783],[108.80698,33.24496],[108.740842,33.283788],[108.710507,33.270062],[108.687252,33.274773],[108.691051,33.291828],[108.66227,33.323574],[108.640166,33.321139],[108.583468,33.298487],[108.569884,33.318866],[108.574201,33.373889],[108.597456,33.407226],[108.588188,33.459681],[108.633086,33.501168],[108.625143,33.533161],[108.653809,33.54798],[108.693296,33.535267],[108.724897,33.530651],[108.750685,33.536401],[108.797367,33.58384],[108.805599,33.605366],[108.828508,33.617825],[108.815039,33.633034],[108.792244,33.642497],[108.798806,33.654628],[108.826493,33.649371],[108.879335,33.698527],[108.902245,33.678803],[108.922909,33.684543],[108.945473,33.726569],[108.942307,33.747816],[108.92337,33.774711],[108.903223,33.781091],[108.846985,33.777699],[108.835588,33.792233],[108.84002,33.815966],[108.854238,33.826539],[108.874788,33.824522],[108.913239,33.848649],[108.922161,33.869383],[108.944265,33.86664],[109.007985,33.883256],[109.051502,33.923169],[109.070555,33.906641],[109.107682,33.907609],[109.120576,33.876481],[109.164207,33.871319],[109.162366,33.812657],[109.147284,33.799337],[109.154019,33.791103],[109.174166,33.808702],[109.177562,33.809105],[109.185793,33.812334]]],[[[109.185793,33.812334],[109.177562,33.809105],[109.174166,33.808702],[109.162366,33.812657],[109.164207,33.871319],[109.18493,33.874303],[109.207379,33.867043],[109.185793,33.812334]]],[[[111.026499,33.478563],[111.026787,33.467705],[111.020973,33.471189],[111.021664,33.476538],[111.026499,33.478563]]]]}}],propertity:{name:"陕西",center:[108.948024,34.263161],centroid:[108.887114,35.263661],childrenNum:10,level:"province",code:61e4,filename:"610000",fullname:"陕西省",bbox:[[105.491948,39.58701],[111.248053,31.705059]],offset:[.5898,.5485]},version:"1.4.0",date:"2023-09-11 23:35:34",copyright:"Copyright (c) 2023 GeoJSON.CN",copyrightShort:"GeoJSON.CN",copyrightUrl:"https://geojson.cn",crs:{key:"3d266703d607223d8ebc45d972ca1b4e",type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}},$t={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},jt=t.defineComponent({name:"Sublinepoins",components:{SelectPlatform:r.SelectPlatform,NvMap:d.NvMap},emits:[""],props:$t,setup:(e,t)=>new Jt(e,t)});let Jt=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"institutionLinePointApi",new i.InstitutionLinePointApi),h(this,"institutionPointApi",new i.InstitutionPointApi),h(this,"selectedPlatform"),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"mapTheme",t.ref("light")),h(this,"MapType",t.ref(2)),h(this,"mapOption",t.ref({type:this.MapType.value,zoom:7,maxZoom:18,minZoom:4.5,center:[35.3308118573182,109.53369140625001]})),h(this,"NvMap1",t.ref()),h(this,"shanxiGeoObj",null),h(this,"polyline",null),h(this,"markers",[]),h(this,"isAddType",""),h(this,"pointMapData",[]),h(this,"pointData",t.ref([])),h(this,"lineMapData",[]),h(this,"lineData",[]),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"mapOnLoad",(()=>{this.shanxiGeoObj=this.NvMap1.value.addGeoJSON(Zt,{color:"#9EFFFF",weight:1,fillOpacity:0}),this.polyline=this.NvMap1.value.addPolyline([],{color:"#D8A451",weight:5})})),h(this,"mapClick",(e=>{if("line"==this.isAddType&&this.polyline.addLatLng(e.latlng),"mark"==this.isAddType){const t=this.NvMap1.value.addMarker(e.latlng,{offset:[-35,-11]});this.markers.push(t)}})),h(this,"mapRightClick",(async e=>{if(this.markers.length>0){const e=this.markers.map((e=>({Id:0,Longitude:e.getLatLng().lng,Latitude:e.getLatLng().lat,PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0})));this.utilities.parseApiResult(await this.institutionPointApi.saves(e))>0?(this.message.success("保存成功"),this.doRefreshInsTree(),this.loadMapInfo()):this.message.error("保存失败")}if(this.polyline.getLatLngs().length>0){const e=this.polyline.getLatLngs().map((e=>({Id:0,Longitude:e.lng,Latitude:e.lat,PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0})));this.utilities.parseApiResult(await this.institutionLinePointApi.saves(e))>0?(this.message.success("保存成功"),this.doRefreshInsTree()):this.message.error("保存失败")}})),h(this,"addMapData",(async e=>{this.isAddType=e,0!=this.markers.length||this.message.warning("请先绘制,右键保存数据")})),h(this,"removeLine",(async()=>{this.modal.confirm({title:"提示",content:"确定要删除数据吗?",onOk:async()=>{if(this.lineData.length>0){this.utilities.parseApiResult(await this.institutionLinePointApi.DeleteByFilter(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.Id})))>0?(this.message.success("删除成功"),this.lineMapData.forEach((e=>{e.remove()}))):this.message.error("删除失败")}this.clearMapData(),this.doRefreshInsTree()}})})),h(this,"pointSelect",(e=>{this.NvMap1.value.setCenter([e.Latitude,e.Longitude])})),h(this,"removePoint",(async(e,t)=>{let i;if(t){const e=this.pointData.value.map((e=>e.Id)).join(",");i=this.utilities.parseApiResult(await this.institutionPointApi.deleteByIds(e))}else i=this.utilities.parseApiResult(await this.institutionPointApi.delete(e.Id));i>0?(this.message.success("删除成功"),this.doRefreshInsTree(),this.loadMapInfo()):this.message.error("删除失败")})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>{const s=[];return o.markCount>0&&s.push(e("span",{style:{color:"red",padding:"0 5px",fontWeight:"500"}},"点")),o.lineCount>0&&s.push(e("span",{style:{color:"red",padding:"0 5px",fontWeight:"500"}},"线")),e("div",{style:{display:"flex",justifyContent:"space-between",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))],[e("span",s)])})),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.isAddType="",this.selectedInsTree=e[0],this.loadMapInfo())})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"pointDataRef",t.ref()),h(this,"pointOption",t.reactive({keyField:"Id",titleField:"name"})),h(this,"showImport",t.ref(!1)),h(this,"refExcelImport",t.ref()),h(this,"isImporting",t.ref(!1)),h(this,"importLine",(()=>{this.showImport.value=!0})),h(this,"doImportDepart",(async e=>{this.isImporting.value=!0,this.refExcelImport.value.messageInfo("***数据导入开始***'"),e=e.map((e=>({Id:0,Longitude:e["经度"],Latitude:e["纬度"],PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0}))),this.utilities.parseApiResult(await this.institutionLinePointApi.saves(e)),this.isImporting.value=!1,this.refExcelImport.value.messageInfo("【导入完成】"),this.message.success("导入完成"),this.loadInsTree(),this.loadMapInfo()})),this.props=e,this.ctx=s,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}clearMapData(){!this.utilities.isNull(this.polyline)&&this.polyline.getLatLngs().length>0&&(this.polyline.remove(),this.polyline=null),this.markers.length>0&&(this.markers.forEach((e=>{e.remove()})),this.markers=[])}async loadPoint(){this.pointMapData.length>0&&this.pointMapData.forEach((e=>{e.remove()}));const e=this.utilities.parseApiResult(await this.institutionPointApi.getEntities(o.QueryWrapper.create().eq("platformId",this.selectedPlatform.Id).eq("insTreeId",this.selectedInsTree.Id)));this.pointData.value=e,e.length>0&&e.forEach((e=>{const t=this.NvMap1.value.addMarker({lat:e.Latitude,lng:e.Longitude},{offset:[-35,-11]});this.pointMapData.push(t)}))}async loadLine(){if(this.lineMapData.length>0&&this.lineMapData.forEach((e=>{e.remove()})),this.selectedInsTree.PId>0){let e=this.utilities.parseApiResult(await this.institutionLinePointApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.PId})));if(this.lineData=e,e.length>0){e=e.map((e=>[e.Latitude,e.Longitude]));let t=this.NvMap1.value.addPolyline(e,{color:"#80c342",weight:5});this.lineMapData.push(t)}}else{let e=this.utilities.parseApiResult(await this.institutionLinePointApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.Id})));if(this.lineData=e,e.length>0){e=e.map((e=>[e.Latitude,e.Longitude]));let t=this.NvMap1.value.addPolyline(e,{color:"#D8A451",weight:5});this.lineMapData.push(t)}}}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id);let i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1,i=await Promise.all(i.map((async e=>(e.markCount=this.utilities.parseApiResult(await this.institutionPointApi.getCount(o.QueryWrapper.create().eq("platformId",e.PlatformId).eq("insTreeId",e.Id))),e.lineCount=this.utilities.parseApiResult(await this.institutionLinePointApi.getCount(o.QueryWrapper.create().eq("platformId",e.PlatformId).eq("insTreeId",e.Id))),e))));const s=t=>{const o=i.filter((e=>e.PId==t));for(const i of o){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const o=s(i.Id);o.length>0&&(i.children=o)}return o};if(this.institutionTree.value=s(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}async loadMapInfo(){this.clearMapData(),await this.loadPoint(),await this.loadLine(),this.lineData.length>0?this.NvMap1.value.setCenter([this.lineData[0].Latitude,this.lineData[0].Longitude]):this.pointData.value.length>0?this.NvMap1.value.setCenter([this.pointData.value[0].Latitude,this.pointData.value[0].Longitude]):this.NvMap1.value.setCenter([35.3308118573182,109.53369140625001])}};const Xt={class:"instree-search"},ei={class:"instree-list"},ti={class:"nv-flex-1 nv-flex-col map-box"},ii={class:"nv-flex map-op",style:{"margin-bottom":"10px"}},oi={class:"nv-flex-1"},si=["onClick"],ri={style:{"font-size":"16px"}},li=["onClick"],ai={style:{height:"450px"}};const ni=f(jt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvMap"),g=t.resolveComponent("NvExcelImport"),I=t.resolveComponent("Modal"),v=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(v,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Xt,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",ei,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createElementVNode("div",ti,[t.createElementVNode("div",ii,[t.createVNode(p,{type:"primary",icon:"md-create",onClick:i[1]||(i[1]=t=>e.addMapData("line"))},{default:t.withCtx((()=>[t.createTextVNode("绘制线")])),_:1}),t.createVNode(p,{type:"primary",icon:"md-create",onClick:i[2]||(i[2]=t=>e.addMapData("mark"))},{default:t.withCtx((()=>[t.createTextVNode("绘制点")])),_:1}),t.createVNode(p,{type:"primary",icon:"md-cloud-upload",onClick:e.importLine},{default:t.withCtx((()=>[t.createTextVNode("导入线")])),_:1},8,["onClick"]),t.createVNode(p,{type:"error",ghost:"",onClick:e.removeLine},{default:t.withCtx((()=>[t.createTextVNode("清除线")])),_:1},8,["onClick"])]),t.createElementVNode("div",oi,[t.createVNode(f,{option:e.mapOption,ref:"NvMap1",theme:e.mapTheme,onOnload:e.mapOnLoad,onClick:e.mapClick,onRightClick:e.mapRightClick},null,8,["option","theme","onOnload","onClick","onRightClick"])])]),e.pointData.length>0?(t.openBlock(),t.createBlock(c,{key:0,width:"200px",title:"点列表",showArrow:!0},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"error",ghost:"",onClick:i[3]||(i[3]=t.withModifiers((t=>e.removePoint(e.item,!0)),["stop"]))},{default:t.withCtx((()=>[t.createTextVNode("删除全部")])),_:1})])),_:1})])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.pointData,((i,o)=>(t.openBlock(),t.createElementBlock("div",{class:"nv-flex nv-c-p op-item",style:{"justify-content":"space-between"},key:i.Id,onClick:t.withModifiers((t=>e.pointSelect(i)),["stop"])},[t.createElementVNode("div",ri,t.toDisplayString(`点${o+1}`),1),t.createElementVNode("div",{style:{color:"red"},class:"nv-c-p",onClick:t.withModifiers((t=>e.removePoint(i,!1)),["stop"])},"删除",8,li)],8,si)))),128))])),_:1})):t.createCommentVNode("",!0),t.createVNode(I,{modelValue:e.showImport,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImport=t),transfer:"",draggable:"",mask:!0,"mask-closable":!1,width:900,title:"导入构件"},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[4]||(i[4]=t=>e.showImport=!1)},{default:t.withCtx((()=>[t.createTextVNode("关 闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",ai,[e.showImport?(t.openBlock(),t.createBlock(g,{key:0,ref:"refExcelImport",onImport:e.doImportDepart,isExportTemplete:!0,templeteUrl:"https://nvplanfromoss.oss-cn-beijing.aliyuncs.com/%E7%BB%BC%E5%90%88%E7%AE%A1%E7%90%86/%E7%BA%BF%E8%B7%AF%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/%E7%BA%BF%E8%B7%AF%E6%A8%A1%E6%9D%BF.xlsx",templeteName:"线路导入模板.xlsx",isImporting:e.isImporting},null,8,["onImport","templeteUrl","templeteName","isImporting"])):t.createCommentVNode("",!0)])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-6b0359ae"]]),di={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},ui=t.defineComponent({name:"ProjectUserinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:vt,BaseLogin:r.BaseLogin},emits:[""],props:di,setup:(e,t)=>new hi(e,t)});class hi extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:13},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:150,rowButtons:[{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input",prop:"Phone"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"},{model:"WechatOpenId",label:"微信授权Id",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"账号不能为空",trigger:"blur"}],Phone:[{required:!0,validator:this.validPhone,trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,7,8]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=0,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.save({Id:e.Id,IsDel:1});this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}validPhone(e,t,i){if(!t)return i(new Error("手机号不能为空"));/^1[3456789]\d{9}$/.test(t)?i():i("手机号格式不正确!")}}const pi=e=>(t.pushScopeId("data-v-86385f96"),e=e(),t.popScopeId(),e),mi={class:"instree-search"},ci={class:"instree-list"},fi={style:{height:"600px","overflow-y":"auto"}},gi=pi((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),Ii={style:{height:"600px","overflow-y":"auto"}},vi=pi((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),wi={style:{height:"650px","overflow-y":"auto"}},yi={style:{display:"none"}},Ci={style:{height:"400px","overflow-y":"auto"}},Ni=["src"],Mi=["src"];return[{path:"/permission-service/platform/platform",component:w},{path:"/permission-service/platform/module",component:S},{path:"/permission-service/platform/role",component:L},{path:"/permission-service/institution/institutiontype",component:K},{path:"/permission-service/institution/institution",component:ee},{path:"/permission-service/institution/userinfor",component:Ne},{path:"/permission-service/institution/enterprise",component:Te},{path:"/permission-service/thirdparty/information",component:De},{path:"/permission-service/platform/subplatform",component:Qe},{path:"/permission-service/platform/subrole",component:Xe},{path:"/permission-service/institution/subenterprise",component:st},{path:"/permission-service/institution/subinstitution",component:ct},{path:"/permission-service/institution/subuserinfor",component:Et},{path:"/permission-service/institution/projectUserinfor",component:f(ui,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvGrid"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),w=t.resolveComponent("LoginLog"),y=t.resolveComponent("BaseLogin"),C=t.resolveComponent("FormItem"),N=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(N,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",mi,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",ci,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(c,{width:e.userBoxWidth,title:"用户列表"},{default:t.withCtx((()=>[t.createVNode(f,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(v,{modelValue:e.showEditUser,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",fi,[t.createVNode(I,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),gi])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showUserRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ii,[t.createVNode(f,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[vi])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",wi,[t.createVNode(w,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",yi,[t.createVNode(y,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(v,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[7]||(i[7]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ci,[t.createVNode(I,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(C,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,Ni)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(C,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Mi)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-86385f96"]])},{path:"/permission-service/subplatform/subModule",component:zt},{path:"/permission-service/institution/sublinepoins",component:ni}]}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@newview/base-vue"),require("vue"),require("@newview/permission-api"),require("@newview/infrastructure"),require("view-ui-plus"),require("@newview/permission-ui"),require("@newview/casign-api"),require("@newview/basics-api"),require("@newview/file-ui"),require("@newview/map")):"function"==typeof define&&define.amd?define(["@newview/base-vue","vue","@newview/permission-api","@newview/infrastructure","view-ui-plus","@newview/permission-ui","@newview/casign-api","@newview/basics-api","@newview/file-ui","@newview/map"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).permissionservice=t(e.baseVue,e.Vue,e.permissionApi,e.infrastructure,e.viewUiPlus,e.permissionUi,e.casignApi,e.basicsApi,e.fileUi,e.map)}(this,(function(e,t,i,o,s,r,l,a,n,d){"use strict";var u=Object.defineProperty,h=(e,t,i)=>(((e,t,i)=>{t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);const p={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},m=t.defineComponent({name:"Platform",components:{},emits:[""],props:p,setup:(e,t)=>new c(e,t)});let c=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"platformGroupApi",new i.PlatformGroupApi),h(this,"currentGroupRow",t.ref({})),h(this,"groupData",t.ref()),h(this,"groupOption",t.reactive({api:this.platformGroupApi,keyField:"Id",titleField:"GroupName"})),h(this,"showEditGroup",t.ref(!1)),h(this,"refGroupForm",t.ref()),h(this,"saveingGroupform",t.ref(!1)),h(this,"editGroupformModalTitle",t.ref("新增 - 平台目录")),h(this,"groupFormModel",t.reactive({Id:0,SKey:this.utilities.getUniqueCode(),GroupNo:"",GroupName:"",OrderNo:"",CreateDate:this.utilities.getCurrentDate()})),h(this,"groupFormItems",t.reactive([{model:"GroupName",label:"组名称",prop:"GroupName",type:"Input",span:24,rules:[{required:!0,message:"组名称不能为空",trigger:"blur"}]},{model:"GroupNo",label:"平台目录代号",prop:"GroupNo",type:"Input",span:24,rules:[{required:!0,message:"平台目录代号不能为空",trigger:"blur"}]},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doRefresh",(()=>{this.loadGroupData()})),h(this,"groupSelect",(e=>{var t;this.currentGroupRow.value=e,null==(t=this.platformGrid.value)||t.setPageIndex(1),this.loadPlatformGrid()})),h(this,"handleGroupAdd",(()=>{this.showEditGroup.value=!0})),h(this,"doSaveGroupform",(async()=>{if(!(await this.refGroupForm.value.validate()))return;this.saveingGroupform.value=!0;let e=await this.platformGroupApi.save(this.groupFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingGroupform.value=!1);this.message.success("保存成功!"),this.doRefresh(),this.saveingGroupform.value=!1,this.showEditGroup.value=!1})),h(this,"upList",t.reactive(Array())),h(this,"platformGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"SKey",title:"唯一KEY",type:"Input"},{field:"PlatformName",title:"系统名称",type:"Input"},{field:"PlatformAbbreviation",title:"系统简称",type:"Input"},{field:"PlatformNo",title:"系统代号",type:"Input"},{field:"PlatformGroup",title:"系统组",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddPlatform()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"SKey",title:"唯一KEY",width:240},{colType:"ed",field:"PlatformName",title:"系统名称",minWidth:250},{colType:"ed",field:"PlatformAbbreviation",title:"系统简称",width:150},{colType:"select",field:"PId",title:"上级平台",width:150,select:{data:this.upList,clearable:!0,multiple:!1},format:(e,t)=>{const i=this.upList.find((e=>e.value==t.row.PId));return e("span",0==t.row.PId?"/":i.text)}},{colType:"ed",field:"PlatformNo",title:"系统代号",width:100},{colType:"ed",field:"PlatformUrl",title:"系统URL",width:230},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:140,rowButtons:[{name:"edit",text:"编辑",onclick:e=>{this.doEditPlatform(e)}},{name:"delete"}]}],event:{event_search:e=>{this.platformGrid.value.setPageIndex(1);const t=Object.keys(e),i=o.QueryWrapper.create();i.eq("1","1");for(const o of t){const t=e[o];this.utilities.isNull(t)||i.like(o,t)}this.platformGrid.value.loadDataByQuery(i)}}})),h(this,"platformGrid",t.ref()),h(this,"refPlatformForm",t.ref()),h(this,"saveingPlatform",t.ref(!1)),h(this,"showEditPlatform",t.ref(!1)),h(this,"editPlatformModalTitle",t.ref("新增 - 系统平台")),h(this,"platformFormModel",t.reactive({Id:0,SKey:"",PlatformNo:"",PlatformName:"",PlatformAbbreviation:"",OssRootPath:"",PlatformGroup:this.currentGroupRow.value.Id,PlatformUrl:"",OrderNo:0,CABusinessKey:"",PId:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:"",DefaultPwd:""})),h(this,"platformFormItems",t.reactive([{model:"PlatformName",label:"系统名称",prop:"PlatformName",type:"Input",span:24,rules:[{required:!0,message:"系统名称不能为空",trigger:"blur"}]},{model:"PlatformNo",label:"系统编号",prop:"PlatformNo",type:"Input",span:24,rules:[{required:!0,message:"系统编号不能为空",trigger:"blur"}]},{model:"PlatformAbbreviation",label:"系统简称",prop:"PlatformAbbreviation",type:"Input",span:24},{model:"OssRootPath",label:"Oss根路径",prop:"OssRootPath",type:"Input",span:24},{model:"PId",label:"上级平台",prop:"PId",type:"Select",span:24,selectProp:{datas:[],transfer:!0,clearable:!0,multiple:!1}},{model:"PlatformUrl",label:"系统URL",prop:"PlatformUrl",type:"Input",span:24},{model:"CABusinessKey",label:"CAKey",prop:"CABusinessKey",type:"Input",span:24},{model:"DefaultPwd",label:"用户默认密码",prop:"DefaultPwd",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSavePlatform",(async()=>{if(!(await this.refPlatformForm.value.validate()))return;this.saveingPlatform.value=!0;let e=await this.platformApi.save(this.platformFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingPlatform.value=!1);this.message.success("保存成功!"),this.platformGrid.value.refreshData(),this.saveingPlatform.value=!1,this.showEditPlatform.value=!1})),this.props=e,this.ctx=s,this.usePlatform()}loadGroupData(){this.groupData.value.loadDataByQuery(o.QueryWrapper.create().orderBy(["OrderNo"]))}usePlatform(){t.onMounted((()=>{this.loadGroupData()}))}async loadPlatformGrid(){const e=this.storageInfo.getUser();this.platformGrid.value.setGloablValue("LastUpdateUserId",e.Id),this.platformGrid.value.setGloablValue("LastUpdateUserName",e.UserName),this.platformGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.platformGrid.value.setGloablValue("SKey",(()=>this.utilities.getUniqueCode()),!0),this.platformGrid.value.loadData((async e=>{const t=await this.platformApi.getEntitiesPageDynamic(e.page,e.pageSize,o.QueryWrapper.create().eq("PlatformGroup",this.currentGroupRow.value.Id).orderBy(["OrderNo"]).eq("1","1")),i=this.utilities.parseApiResult(t);e.success(i),this.upList.splice(0,this.upList.length);for(const o of i.Datas)this.upList.push({value:o.Id,text:o.PlatformAbbreviation})}))}doEditPlatform(e){var t;const i=this.storageInfo.getUser();this.platformFormModel.Id=e.Id,this.platformFormModel.SKey=e.SKey,this.platformFormModel.PlatformNo=e.PlatformNo,this.platformFormModel.PlatformName=e.PlatformName,this.platformFormModel.PlatformAbbreviation=e.PlatformAbbreviation,this.platformFormModel.OssRootPath=e.OssRootPath,this.platformFormModel.PlatformGroup=e.PlatformGroup,this.platformFormModel.PlatformUrl=e.PlatformUrl,this.platformFormModel.CABusinessKey=e.CABusinessKey,this.platformFormModel.OrderNo=e.OrderNo,this.platformFormModel.LastUpdateUserId=i.Id,this.platformFormModel.LastUpdateUserName=i.UserName,this.platformFormModel.PId=e.PId,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd=e.DefaultPwd,this.editPlatformModalTitle.value=`编辑 - ${e.PlatformName}`;const o=null==(t=this.platformGrid.value)?void 0:t.getDatas();this.platformFormItems[4].selectProp.datas=o.length>0?null==o?void 0:o.map((e=>({value:e.Id,text:e.PlatformName}))):[],this.showEditPlatform.value=!0}doAddPlatform(){var e;const t=this.storageInfo.getUser();this.platformFormModel.Id=0,this.platformFormModel.SKey=this.utilities.getUniqueCode(),this.platformFormModel.PlatformNo="",this.platformFormModel.PlatformName="",this.platformFormModel.PlatformAbbreviation="",this.platformFormModel.OssRootPath="",this.platformFormModel.PlatformGroup=this.currentGroupRow.value.Id,this.platformFormModel.PlatformUrl="",this.platformFormModel.CABusinessKey="",this.platformFormModel.OrderNo=0,this.platformFormModel.LastUpdateUserId=t.Id,this.platformFormModel.LastUpdateUserName=t.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editPlatformModalTitle.value="新增 - 系统平台";const i=null==(e=this.platformGrid.value)?void 0:e.getDatas();this.platformFormItems[4].selectProp.datas=i.length>0?null==i?void 0:i.map((e=>({value:e.Id,text:e.PlatformName}))):[],this.showEditPlatform.value=!0}};const f=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i},g={class:"nv-flex",style:{"justify-content":"space-between"}},I={style:{height:"550px","overflow-y":"auto"}},v={style:{height:"400px","overflow-y":"auto"}};const y=f(m,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvList"),n=t.resolveComponent("Icon"),d=t.resolveComponent("Space"),u=t.resolveComponent("Button"),h=t.resolveComponent("NvBox"),p=t.resolveComponent("NvGrid"),m=t.resolveComponent("NvComForm"),c=t.resolveComponent("Form"),f=t.resolveComponent("Modal"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"platform nv-flex"},{default:t.withCtx((()=>[t.createVNode(h,{width:"200px",title:"平台目录","show-arrow":!0},{footer:t.withCtx((()=>[t.createElementVNode("div",g,[t.createVNode(d,null,{default:t.withCtx((()=>[t.createVNode(n,{type:"md-add",class:"nv-c-p",size:"25",onClick:e.handleGroupAdd},null,8,["onClick"])])),_:1}),t.createVNode(d,null,{default:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:e.doRefresh},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])])),default:t.withCtx((()=>[t.createVNode(a,{ref:"groupData",option:e.groupOption,onSelect:e.groupSelect},null,8,["option","onSelect"])])),_:1}),t.createVNode(h,{class:"nv-flex-1",title:"系统平台"},{default:t.withCtx((()=>[t.createVNode(p,{ref:"platformGrid",option:e.platformGridOption},null,8,["option"])])),_:1}),t.createVNode(f,{modelValue:e.showEditPlatform,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditPlatform=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editPlatformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditPlatform=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingPlatform,onClick:e.doSavePlatform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",I,[t.createVNode(c,{ref:"refPlatformForm",model:e.platformFormModel,"label-width":120},{default:t.withCtx((()=>[t.createVNode(m,{formModel:e.platformFormModel,formItems:e.platformFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(f,{modelValue:e.showEditGroup,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showEditGroup=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editGroupformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[2]||(i[2]=t=>e.showEditGroup=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingGroupform,onClick:e.doSaveGroupform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",v,[t.createVNode(c,{ref:"refGroupForm",model:e.groupFormModel,"label-width":115},{default:t.withCtx((()=>[t.createVNode(m,{formModel:e.groupFormModel,formItems:e.groupFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-f58b0adc"]]),w={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},C=t.defineComponent({name:"Module",components:{SelectPlatform:r.SelectPlatform},emits:["change"],props:w,setup:(e,t)=>new N(e,t)});let N=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"moduleApi",new i.ModuleApi),h(this,"selectedPlatform"),h(this,"moduleWidth",t.ref("calc(100% - 300px)")),h(this,"webOrApp",t.ref(0)),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!1,isCurrent:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],toolbars:[{name:"addModule",type:"primary",icon:"md-add",text:"新增",onclick:()=>{this.doAddModule()}},{name:"importModule",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportModule()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"ModuleName",title:"模块名称",minWidth:250,treeNode:!0},{colType:"ro",field:"ModuleAlias",title:"别名",width:250,align:"center"},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"ModuleStatus",title:"状态",width:70,align:"center",format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"正常",color:"green"},2:{text:"沙盒",color:"default"}}[this.utilities.getValueNotNull(t.row.ModuleStatus,0)];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"LoadMode",title:"加载模式",width:120,align:"center",format:(e,t)=>({0:"路由",1:"链接",2:"低代码"}[t.row.LoadMode])},{colType:"ro",field:"ModuleUrl",title:"路径",width:260},{title:"操作",width:240,rowButtons:[{name:"editModule",text:"编辑",onclick:e=>{this.doEditModule(e)}},{name:"addModuleChild",text:"新增子项",onclick:e=>{this.doAddChildModule(e)}},{name:"deleteModule",text:"删除",type:"error",onclick:e=>{this.doDeleteModule(e)}}]}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.moduleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformChange",(e=>{this.selectedPlatform=e,this.loadModuleGridData()})),h(this,"handleModuleTypeChange",(()=>{this.setModuleFormItems(),this.loadModuleGridData()})),h(this,"loadModuleGridData",(()=>{this.moduleGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]))})),h(this,"doChangeModuleWidth",(e=>{this.moduleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"parentModule"),h(this,"editModulePId",0),h(this,"editModuleChildData",[]),h(this,"saveingModule",t.ref(!1)),h(this,"moduleComForm",t.ref()),h(this,"showEditModule",t.ref(!1)),h(this,"editMoudelModalTitle",t.ref("新增 - 模块")),h(this,"moduleFormModel",t.reactive({Id:0,PlatformId:0,RootId:0,PId:0,ParentPath:"",HasChild:0,NodeLevel:0,ModuleName:"",ModuleAlias:"",ModuleUrl:"",ModuleType:"",WebOrApp:0,OrderNo:0,IconUrl:"",AttachParams:"",Operates:"",LoadMode:0,ModuleStatus:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"moduleFormItems",t.reactive([{model:"",label:"模块信息",span:24,children:[{model:"PId",label:"上级菜单",span:24,prop:"PId",type:"TreeSelect",isShow:!1,treeSelectProp:{data:[],onChange:(e,t)=>{this.setEditMoudelPId(e)}}},{model:"ModuleName",label:"模块名称",prop:"ModuleName",type:"Input"},{model:"ModuleAlias",label:"模块别名",prop:"ModuleAlias",type:"Input"},{model:"ModuleType",label:"模块类型",prop:"ModuleType",type:"Select",selectProp:{datas:[{text:"顶栏业务组",value:"Business"},{text:"左侧菜单组",value:"MenuGroup"},{text:"左侧菜单项",value:"MenuItem"}],transfer:!0}},{model:"IconUrl",label:"模块图标",prop:"IconUrl",type:"IconSelect",iconSelectProp:{placeholder:"模块图标"}},{model:"ModuleStatus",label:"模块状态",prop:"ModuleStatus",type:"Select",selectProp:{datas:[{text:"禁用",value:0},{text:"正常",value:1},{text:"沙盒",value:2}],transfer:!0}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber"}]},{model:"",label:"路由信息",span:24,children:[{model:"LoadMode",label:"加载模式",span:24,prop:"LoadMode",type:"Radio",radioProp:{datas:[{text:"路由",value:0},{text:"链接",value:1},{text:"低代码",value:3}]}},{model:"ModuleUrl",label:"路由地址",span:24,prop:"ModuleUrl",type:"Input"},{model:"AttachParams",label:"路由参数",span:24,prop:"AttachParams",type:"Input"},{model:"Operates",label:"功能点",span:24,prop:"Operates",type:"Input",inputProp:{type:"textarea",rows:4,placeholder:"例如: [{ code:'Edit', name: '编辑' }]"}}]}])),h(this,"doSaveModule",(async()=>{this.saveingModule.value=!0;let e=await this.moduleApi.save(this.moduleFormModel),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingModule.value=!1);if(0==this.moduleFormModel.Id){const e=[{Id:t,RootId:this.utilities.isNull(this.parentModule)?t:this.parentModule.RootId}];this.utilities.isNull(this.parentModule)||0!=this.parentModule.HasChild||e.push({Id:this.parentModule.Id,HasChild:1}),await this.moduleApi.saves(e)}else if(this.editModulePId!=this.moduleFormModel.PId){let i=this.editModuleChildData;this.editModulePId>0&&(e=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",this.editModulePId)),t=this.utilities.parseApiResult(e),i.push({Id:this.editModulePId,HasChild:t>0?1:0})),await this.moduleApi.saves(i)}this.message.success("保存成功!"),this.moduleGrid.value.refreshData(),this.saveingModule.value=!1,this.showEditModule.value=!1})),h(this,"showImportModule",t.ref(!1)),h(this,"saveingImportModule",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originModuleGrid",t.ref()),h(this,"originModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input",span:24}],rightToolbars:[{name:"refresh"}],columns:[{colType:"checkbox"},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.originModuleGrid.value.loadDataByQuery(t)}}})),h(this,"targetPlatform",t.reactive({Id:0,PlatformName:""})),h(this,"targetModuleGrid",t.ref()),h(this,"targetModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0,isCurrent:!0},treeConfig:{expandAll:!0}},toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return this.utilities.isNull(i)?"":e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.targetModuleGrid.value.loadDataByQuery(t)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginModuleGridData()})),h(this,"doImportOriginToTargetModule",(async()=>{const e=this.originModuleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台模块菜单");const t=this.targetModuleGrid.value.getCurrentRecord();if(this.utilities.isNull(t))return void this.message.warning("请选择目标平台模块菜单");this.saveingImportModule.value=!0;const i=await this.moduleApi.importModules(e,t),o=this.utilities.parseApiResult(i);this.saveingImportModule.value=!1,o>0?(this.originModuleGrid.value.refreshData(),this.targetModuleGrid.value.refreshData(),this.moduleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r}setModuleFormItems(){0===this.webOrApp.value?this.moduleFormItems[0].children&&(this.moduleFormItems[0].children[4].type="IconSelect"):this.moduleFormItems[0].children&&(this.moduleFormItems[0].children[4].type="Input")}setEditMoudelPId(e){this.editModuleChildData=[];const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e))[0];this.moduleFormModel.RootId=i?i.RootId:this.moduleFormModel.Id,this.moduleFormModel.PId=i?i.Id:0,this.moduleFormModel.ParentPath=i?`${i.ParentPath}${i.Id}/`:"/",this.moduleFormModel.NodeLevel=i?i.NodeLevel+1:1;((e,t)=>{const i=e.filter((e=>e.PId==t.Id));for(const o of i)this.editModuleChildData.push({Id:o.Id,RootId:t.RootId,ParentPath:`${t.ParentPath}${t.Id}/`,NodeLevel:t.NodeLevel+1})})(t,this.moduleFormModel)}setParentModuleTreeItem(e){const t=this.moduleFormItems[0].children[0];if(t.isShow=e,0==e)return;const i=this.moduleGrid.value.getDatas(),o=this.moduleComForm.value.convertTreeData({datas:i,titleField:"ModuleName",rootTitle:"主目录",rootValue:0});t.treeSelectProp.data=o}doEditModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=e.Id,this.moduleFormModel.PlatformId=e.PlatformId,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.PId,this.moduleFormModel.ParentPath=e.ParentPath,this.moduleFormModel.HasChild=e.HasChild,this.moduleFormModel.NodeLevel=e.NodeLevel,this.moduleFormModel.ModuleName=e.ModuleName,this.moduleFormModel.ModuleAlias=e.ModuleAlias,this.moduleFormModel.ModuleUrl=e.ModuleUrl,this.moduleFormModel.ModuleType=e.ModuleType,this.moduleFormModel.WebOrApp=e.WebOrApp,this.moduleFormModel.OrderNo=e.OrderNo,this.moduleFormModel.IconUrl=e.IconUrl,this.moduleFormModel.AttachParams=e.AttachParams,this.moduleFormModel.Operates=e.Operates,this.moduleFormModel.LoadMode=e.LoadMode,this.moduleFormModel.ModuleStatus=e.ModuleStatus,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.editModulePId=e.PId,this.editModuleChildData=[],this.editMoudelModalTitle.value=`编辑 - 模块 - ${e.ModuleName}`,this.setParentModuleTreeItem(!0),this.showEditModule.value=!0}doAddModule(){const e=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=0,this.moduleFormModel.PId=0,this.moduleFormModel.ParentPath="/",this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates='[{"code":"Edit", "name": "编辑"},{"code":"Delete", "name": "删除"},{"code":"Add", "name": "新增"},{"code":"Save", "name": "保存"}]',this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=e.Id,this.moduleFormModel.LastUpdateUserName=e.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value="新增 - 模块",this.showEditModule.value=!0}doAddChildModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.Id,this.moduleFormModel.ParentPath=`${e.ParentPath}${e.Id}/`,this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=e.NodeLevel+1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business"==e.ModuleType?"MenuGroup":"MenuItem",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates="",this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=e,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value=`新增子项 - 父模块 - ${e.ModuleName}`,this.showEditModule.value=!0}async doDeleteModule(e){1!=e.HasChild?this.modal.confirm({title:"提示",content:`数据删除后不可恢复, 确定要删除[ ${e.ModuleName} ]模块吗?`,onOk:async()=>{const t=e.PId;let i=await this.moduleApi.delete(e.Id),s=this.utilities.parseApiResult(i);s<=0?this.message.warning("删除失败,请稍后重试!"):(i=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",t)),s=this.utilities.parseApiResult(i),s<=0&&await this.moduleApi.save({Id:t,HasChild:0}),this.message.success("删除成功!"),this.moduleGrid.value.refreshData())}}):this.message.warning("该模块存在子模板, 不能删除, 请先删除子模块!")}doShowImportModule(){this.targetPlatform.Id=this.selectedPlatform.Id,this.targetPlatform.PlatformName=this.selectedPlatform.PlatformName,this.showImportModule.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginModuleGridData(),this.loadTargetModuleGridData()}))}loadOriginModuleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.originModuleGrid.value.loadDataByQuery(e)}loadTargetModuleGridData(){this.targetModuleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.targetPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]),i=await this.moduleApi.getEntities(t),s=this.utilities.parseApiResult(i),r={Id:0,PId:-1,ModuleName:"根节点",ModuleType:"",PlatformId:this.targetPlatform.Id,IconUrl:""};s.push(r),e.success(s)}))}};const M={style:{height:"650px","overflow-y":"auto"}},x={class:"import-module",style:{height:"650px",position:"relative"}},P={style:{width:"100%",height:"100%"}},U={style:{width:"560px",height:"100%",float:"left"}},A={style:{height:"calc(100% - 0px)"}},T={style:{width:"calc(100% - 570px)",height:"100%","margin-left":"10px",display:"inline-block"}},b={style:{height:"calc(100% - 0px)"}},F=(e=>(t.pushScopeId("data-v-e41c07fc"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"点击选择要放置的位置!",-1)));const S=f(C,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("Radio"),d=t.resolveComponent("RadioGroup"),u=t.resolveComponent("NvGrid"),h=t.resolveComponent("NvComForm"),p=t.resolveComponent("Form"),m=t.resolveComponent("Button"),c=t.resolveComponent("Modal"),f=t.resolveComponent("Option"),g=t.resolveComponent("Select"),I=t.resolveComponent("Card"),v=t.resolveComponent("Spin"),y=t.resolveComponent("NvBox"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"module"},{default:t.withCtx((()=>[t.createVNode(y,{width:"100%",title:"模块列表"},{default:t.withCtx((()=>[t.createVNode(u,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformChange},null,8,["onSelect"]),t.createVNode(d,{modelValue:e.webOrApp,"onUpdate:modelValue":i[0]||(i[0]=t=>e.webOrApp=t),type:"button",onOnChange:e.handleModuleTypeChange},{default:t.withCtx((()=>[t.createVNode(n,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(n,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.createVNode(c,{modelValue:e.showEditModule,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditModule=t),draggable:"",mask:!0,"mask-closable":!1,width:700,title:e.editMoudelModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(m,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(m,{type:"primary",loading:e.saveingModule,onClick:e.doSaveModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",M,[t.createVNode(p,{model:e.moduleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(h,{ref:"moduleComForm",formModel:e.moduleFormModel,formItems:e.moduleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(c,{modelValue:e.showImportModule,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"引入模块",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(m,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(m,{type:"primary",loading:e.saveingImportModule,onClick:e.doImportOriginToTargetModule},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",x,[t.createElementVNode("div",P,[t.createElementVNode("div",U,[t.createVNode(I,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("源平台 - ["+t.toDisplayString(e.originPlatform.selectedItem.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",A,[t.createVNode(u,{ref:"originModuleGrid",option:e.originModuleGridOption},{default:t.withCtx((()=>[t.createVNode(g,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[3]||(i[3]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((e,i)=>(t.openBlock(),t.createBlock(f,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1})]),t.createElementVNode("div",T,[t.createVNode(I,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("目标平台 - ["+t.toDisplayString(e.targetPlatform.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",b,[t.createVNode(u,{ref:"targetModuleGrid",option:e.targetModuleGridOption},{default:t.withCtx((()=>[F])),_:1},8,["option"])])])),_:1})]),t.withDirectives(t.createVNode(v,{fix:""},null,512),[[t.vShow,e.saveingImportModule]])])])])),_:1},8,["modelValue"])])),_:1})])),_:1})}],["__scopeId","data-v-e41c07fc"]]),R={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},V=t.defineComponent({name:"Role",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:R,setup:(e,t)=>new k(e,t)});let k=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"roleApi",new i.RoleApi),h(this,"moduleApi",new i.ModuleApi),h(this,"roleModuleApi",new i.RoleModuleApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionRoleApi",new i.InstitutionRoleApi),h(this,"selectedPlatform"),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"RoleName",title:"角色名称",type:"Input"},{field:"RoleCode",title:"角色编码",type:"Input"},{field:"RoleStatus",title:"状态",type:"Radio",data:[{text:"启用",value:1},{text:"禁用",value:0}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}},{name:"importRole",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"RoleName",title:"角色名称",width:250},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"select",field:"RoleStatus",title:"角色状态",width:100,align:"center",defaultValue:1,select:{data:[{text:"启用",value:1},{text:"禁用",value:0}]},format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"启用",color:"green"}}[t.row.RoleStatus];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"FrontEndVisible",title:"角色类型",width:120,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:0}]},format:(e,t)=>{const i={0:{text:"前台不可见",color:"blue"},1:{text:"前台可见",color:"green"}}[t.row.FrontEndVisible];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",minWidth:200},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200},{colType:"ed",field:"WelcomeUrl",title:"欢迎页面",width:200},{title:"操作",width:200,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"moduleRole",text:"模块权限",onclick:(e,t)=>{this.doShowRoleModule(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).orderBy(["OrderNo"]);this.utilities.isNull(e.RoleName)||t.like("RoleName",e.RoleName),this.utilities.isNull(e.RoleCode)||t.like("RoleCode",e.RoleCode),this.utilities.isNull(e.RoleStatus)||t.eq("RoleStatus",e.RoleStatus),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformListSelect",(e=>{this.selectedPlatform=e;const t=this.storageInfo.getUser();this.roleGrid.value.setGloablValue("PlatformId",this.selectedPlatform.Id),this.roleGrid.value.setGloablValue("LastUpdateUserId",t.Id),this.roleGrid.value.setGloablValue("LastUpdateUserName",t.UserName),this.roleGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.loadRoleGridData()})),h(this,"loadRoleGridData",(async()=>{const e=await this.institutionRoleApi.getEntities(o.QueryWrapper.create()),t=this.utilities.parseApiResult(e),i=[];for(let o of t)i.some((e=>e==o.RoleId))||i.push(o.RoleId);const s=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).orderBy(["OrderNo"]);i.length>0&&s.notIn("Id",i),this.roleGrid.value.loadDataByQuery(s)})),h(this,"doChangeRoleWidth",(e=>{this.roleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 角色")),h(this,"roleFormModel",t.reactive({Id:0,PlatformId:0,RoleName:"",RoleCode:"",RoleDesc:"",RoleStatus:1,FrontEndVisible:0,DefaultUrl:"",WelcomeUrl:"",OrderNo:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"roleFormItems",t.reactive([{model:"RoleName",label:"角色名称",prop:"RoleName",type:"Input",span:24,rules:[{required:!0,message:"角色名称不能为空",trigger:"blur"}]},{model:"RoleCode",label:"角色编码",prop:"RoleCode",type:"Input",span:24,rules:[{required:!0,message:"角色编码不能为空",trigger:"blur"}]},{model:"RoleDesc",label:"角色描述",prop:"RoleDesc",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"RoleStatus",label:"角色状态",prop:"RoleStatus",type:"Radio",span:12,radioProp:{datas:[{text:"启用",value:1},{text:"禁用",value:0}],type:"button"}},{model:"FrontEndVisible",label:"角色类型",prop:"FrontEndVisible",type:"Radio",span:12,radioProp:{datas:[{text:"前台可见",value:1},{text:"前台不可见",value:0}],type:"button"}},{model:"DefaultUrl",label:"默认页面",prop:"DefaultUrl",type:"Input",span:24},{model:"WelcomeUrl",label:"欢迎页面",prop:"WelcomeUrl",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.roleApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"selectRole"),h(this,"saveRoleModuleing",t.ref(!1)),h(this,"showRoleModule",t.ref(!1)),h(this,"roleModuleTitle",t.ref("")),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0},pageSize:15},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row)}})},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0,width:260},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"Operates",title:"功能点权限",format:(e,t)=>{const i=this.utilities.isNull(t.row.Operates)?[]:JSON.parse(t.row.Operates);if(0==i.length)return"";const o=[],r=e(s.Checkbox,{label:"all","model-value":t.row.IsAllChk,"onUpdate:model-value":e=>{t.row.IsAllChk=e,t.row.RoleOperates=t.row.IsAllChk?o:[],this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>"全选")),l=e(s.Divider,{type:"vertical"}),a=[];for(const d of i)o.push(d.code),a.push(e(s.Checkbox,{label:d.code},(()=>d.name)));const n=e(s.CheckboxGroup,{"model-value":t.row.RoleOperates,"onUpdate:model-value":e=>{t.row.RoleOperates=e,this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>a));return e(s.Space,(()=>[r,l,n]))}}],event:{event_search:e=>{this.loadModuleGridData(e)}}})),h(this,"loadModuleGridData",(e=>{this.moduleGrid.value.loadData((async t=>{const i=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).ne("ModuleStatus",0).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||i.like("ModuleName",e.ModuleName);let s=await this.moduleApi.getEntities(i),r=this.utilities.parseApiResult(s);const l=o.QueryWrapper.create().eq("RoleId",this.selectRole.Id);s=await this.roleModuleApi.getEntities(l);let a=this.utilities.parseApiResult(s);for(const e of r){const t=a.filter((t=>t.ModuleId==e.Id));if(t.length>0){const i=t[0];e.IsChk=!0,e.RoleModuleId=i.Id,e.RoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.OrgIsChk=!0,e.OrgRoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.IsChange=!1,e.IsAllChk=!1}else e.IsChk=!1,e.RoleModuleId=0,e.RoleOperates=[],e.OrgIsChk=!1,e.OrgRoleOperates=[],e.IsChange=!1,e.IsAllChk=!1}t.success(r)}))})),h(this,"doSaveRoleModule",(async()=>{const e=this.moduleGrid.value.getDatas().filter((e=>1==e.IsChange));if(0==e.length)return void this.message.warning("没有需要保存的数据");this.saveRoleModuleing.value=!0;const t=[],i=[],o=[];for(const r of e)0==r.RoleModuleId?t.push({Id:0,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):0!=r.RoleModuleId&&1==r.IsChk?i.push({Id:r.RoleModuleId,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):o.push(r.RoleModuleId);const s=[...t,...i];s.length>0&&await this.roleModuleApi.saves(s),o.length>0&&await this.roleModuleApi.deleteByIds(o.join(",")),this.message.success("操作完成"),this.saveRoleModuleing.value=!1,this.showRoleModule.value=!1})),h(this,"showImportRole",t.ref(!1)),h(this,"saveingImportRole",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformAbbreviation:""},selectedId:0})),h(this,"originRoleGrid",t.ref()),h(this,"originRoleGridOption",t.reactive({api:this.roleApi,setting:{border:!1,searchConfig:{btnSpan:24,labelWidth:80,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ed",field:"RoleName",title:"角色名称",minWidth:160},{colType:"ed",field:"RoleCode",title:"角色编码",width:120,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",width:200}]})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.loadOriginRoleGridData()})),h(this,"doImportRole",(async()=>{const e=this.originRoleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台角色");this.saveingImportRole.value=!0;let t=[];for(const s of e)t.push(s.Id);const i=await this.roleApi.importRoles(this.selectedPlatform.Id,t),o=this.utilities.parseApiResult(i);this.saveingImportRole.value=!1,o?(this.showImportRole.value=!1,this.roleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 删除角色配置的模块权限。 <br/> 2. 删除用户关联该角色的索引。 <br/> 3. 删除该角色。 <br/> 确定要执行该操作吗?",onOk:async()=>{await this.roleModuleApi.deleteRoleModuleByRoleId(e.Id);const t=await this.roleApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}doEditRole(e){const t=this.storageInfo.getUser();this.roleFormModel.Id=e.Id,this.roleFormModel.PlatformId=e.PlatformId,this.roleFormModel.RoleName=e.RoleName,this.roleFormModel.RoleCode=e.RoleCode,this.roleFormModel.RoleDesc=e.RoleDesc,this.roleFormModel.RoleStatus=e.RoleStatus,this.roleFormModel.FrontEndVisible=e.FrontEndVisible,this.roleFormModel.DefaultUrl=e.DefaultUrl,this.roleFormModel.WelcomeUrl=e.WelcomeUrl,this.roleFormModel.OrderNo=e.OrderNo,this.roleFormModel.LastUpdateUserId=t.Id,this.roleFormModel.LastUpdateUserName=t.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value=`编辑 - ${e.RoleName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.PlatformId=this.selectedPlatform.Id,this.roleFormModel.RoleName="",this.roleFormModel.RoleCode="",this.roleFormModel.RoleDesc="",this.roleFormModel.RoleStatus=1,this.roleFormModel.FrontEndVisible=0,this.roleFormModel.DefaultUrl="",this.roleFormModel.WelcomeUrl="",this.roleFormModel.OrderNo=0,this.roleFormModel.LastUpdateUserId=e.Id,this.roleFormModel.LastUpdateUserName=e.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value="新增 - 角色",this.showEditRole.value=!0}doShowRoleModule(e){this.selectRole=e,this.roleModuleTitle.value=`模块权限 - ${this.selectRole.RoleName}`,this.showRoleModule.value=!0,t.nextTick((()=>{this.loadModuleGridData({})}))}setRoleModuleIsChange(e){let t=!1;if(e.OrgIsChk!=e.IsChk&&(t=!0),e.OrgRoleOperates.length!=e.RoleOperates.length)t=!0;else{for(const i of e.OrgRoleOperates)if(0==e.RoleOperates.filter((e=>e==i)).length){t=!0;break}for(const i of e.RoleOperates)if(0==e.OrgRoleOperates.filter((e=>e==i)).length){t=!0;break}}e.IsChange=t}changeParentRoleModuleStatus(e){const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e.PId&&t.IsChk==!e.IsChk));for(const o of i)o.IsChk=0!=e.IsChk||t.filter((e=>e.PId==o.Id&&1==e.IsChk)).length>0,this.setRoleModuleIsChange(o),this.changeParentRoleModuleStatus(o)}doShowImportRole(){this.showImportRole.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginRoleGridData()}))}loadOriginRoleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("RoleStatus",1).orderBy(["OrderNo"]);this.originRoleGrid.value.loadDataByQuery(e)}};const D={style:{height:"650px","overflow-y":"auto",position:"relative"}},E={class:"import-role",style:{height:"610px",position:"relative"}},O={style:{width:"100%",height:"100%"}},G={style:{height:"530px","overflow-y":"auto"}};const L=f(V,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("Button"),h=t.resolveComponent("Modal"),p=t.resolveComponent("Option"),m=t.resolveComponent("Select"),c=t.resolveComponent("Spin"),f=t.resolveComponent("NvComForm"),g=t.resolveComponent("Form"),I=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(I,{gutter:8,class:"role"},{default:t.withCtx((()=>[t.createVNode(d,{width:"100%",title:"角色列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"roleGrid",option:e.roleGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformListSelect},null,8,["onSelect"])])),_:1},8,["option"])])),_:1}),t.createVNode(h,{modelValue:e.showRoleModule,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showRoleModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"模块权限",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showRoleModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveRoleModuleing,onClick:e.doSaveRoleModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",D,[t.createVNode(n,{ref:"moduleGrid",option:e.moduleGridOption},null,8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(h,{modelValue:e.showImportRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showImportRole=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[3]||(i[3]=t=>e.showImportRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingImportRole,onClick:e.doImportRole},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",E,[t.createElementVNode("div",O,[t.createVNode(n,{ref:"originRoleGrid",option:e.originRoleGridOption},{default:t.withCtx((()=>[t.createVNode(m,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[2]||(i[2]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(p,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.withDirectives(t.createVNode(c,{fix:""},null,512),[[t.vShow,e.saveingImportRole]])])])])),_:1},8,["modelValue"]),t.createVNode(h,{modelValue:e.showEditRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[5]||(i[5]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",G,[t.createVNode(g,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(f,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-0f25fe31"]]),B={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},_=t.defineComponent({name:"InstitutionType",components:{},emits:[""],props:B,setup:(e,t)=>new W(e,t)});class W extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutionTypeGrid",t.ref()),h(this,"institutionTypeGridOption",t.reactive({api:this.institutionTypeApi,setting:{isPagination:!0,pageSize:12,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"Name",title:"机构类型",type:"Input"},{field:"Code",title:"类型编码",type:"Input"}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddInstitutionType()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"Name",title:"机构类型",width:300},{colType:"ed",field:"Code",title:"类型编码",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"Summary",title:"描述"},{title:"操作",width:140,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitutionType(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.institutionTypeGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]);this.utilities.isNull(e.Name)||t.like("Name",e.Name),this.utilities.isNull(e.Code)||t.like("Code",e.Code),this.institutionTypeGrid.value.loadDataByQuery(t)}}})),h(this,"refInstitutionTypeForm",t.ref()),h(this,"saveingInstitutionType",t.ref(!1)),h(this,"showEditInstitutionType",t.ref(!1)),h(this,"editInstitutionTypeModalTitle",t.ref("新增 - 机构类型")),h(this,"institutionTypeFormModel",t.reactive({Id:0,Code:"",Name:"",Summary:"",OrderNo:0})),h(this,"institutionTypeFormItems",t.reactive([{model:"Name",label:"类型名称",prop:"Name",type:"Input",span:24,rules:[{required:!0,message:"类型名称不能为空",trigger:"blur"}]},{model:"Code",label:"类型编码",prop:"Code",type:"Input",span:24,rules:[{required:!0,message:"类型编码不能为空",trigger:"blur"}]},{model:"Summary",label:"描述",prop:"Summary",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitutionType",(async()=>{if(!(await this.refInstitutionTypeForm.value.validate()))return;this.saveingInstitutionType.value=!0;let e=await this.institutionTypeApi.save(this.institutionTypeFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitutionType.value=!1);this.message.success("保存成功!"),this.institutionTypeGrid.value.refreshData(),this.saveingInstitutionType.value=!1,this.showEditInstitutionType.value=!1})),this.props=e,this.ctx=s,this.useBusinessInstitutionType()}useBusinessInstitutionType(){t.onMounted((()=>{this.loadInstitutionTypes()})),t.onUnmounted((()=>{}))}loadInstitutionTypes(){this.institutionTypeGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]))}doEditInstitutionType(e){this.institutionTypeFormModel.Id=e.Id,this.institutionTypeFormModel.Code=e.Code,this.institutionTypeFormModel.Name=e.Name,this.institutionTypeFormModel.Summary=e.Summary,this.institutionTypeFormModel.OrderNo=e.OrderNo,this.editInstitutionTypeModalTitle.value=`编辑 - ${e.Name}`,this.showEditInstitutionType.value=!0}doAddInstitutionType(){this.institutionTypeFormModel.Id=0,this.institutionTypeFormModel.Code="",this.institutionTypeFormModel.Name="",this.institutionTypeFormModel.Summary="",this.institutionTypeFormModel.OrderNo=0,this.editInstitutionTypeModalTitle.value="新增 - 机构类型",this.showEditInstitutionType.value=!0}}const q={style:{height:"350px","overflow-y":"auto"}};const K=f(_,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComForm"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(m,{gutter:8,class:"institutiontype"},{default:t.withCtx((()=>[t.createVNode(n,{title:"机构类型"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"institutionTypeGrid",option:e.institutionTypeGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditInstitutionType,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditInstitutionType=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTypeModalTitle},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditInstitutionType=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingInstitutionType,onClick:e.doSaveInstitutionType},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",q,[t.createVNode(u,{ref:"refInstitutionTypeForm",model:e.institutionTypeFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.institutionTypeFormModel,formItems:e.institutionTypeFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-947fe129"]]),Q={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Y=t.defineComponent({name:"Institution",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Q,setup:(e,t)=>new H(e,t)});let H=class extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutioninforApi",new i.InstitutioninforApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"roleApi",new i.RoleApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"selectedPlatform"),h(this,"institutionTypes",t.ref([])),h(this,"enterprises",[]),h(this,"institutionWidth",t.ref("calc(100% - 45px)")),h(this,"institutionGrid",t.ref()),h(this,"institutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input"},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input"},{field:"InstitutionCode",title:"机构编码",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddInstitution()}},{name:"importInstitution",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportInstitution()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:80,align:"center"},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:250},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",minWidth:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:140},{colType:"ro",field:"EnterpriseId",title:"所属企业",align:"center",width:220,format:(e,t)=>{const i=t.row.EnterpriseId;if(this.utilities.isNull(i))return"";const o=this.enterprises.filter((e=>e.Id==i));return 0==o.length?`${i}`:o[0].EnterpriseName}},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:240,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitution(e)}},{name:"roles",text:"绑定角色",onclick:(e,t)=>{this.doShowBindRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doRemoveInstitution(e)}},{name:"import",text:"->",onclick:(e,t)=>{this.doAddNode(e)}}]}],event:{event_search:e=>{this.loadInstitutionGridData(this.selectedPlatform.Id,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doPlatformListSelect",(async e=>{this.selectedPlatform=e,await this.loadEnterprises(),this.loadInstitutionGridData(this.selectedPlatform.Id,"","",""),this.loadInstitutionTree()})),h(this,"doWidthChange",(e=>{this.institutionWidth.value=e?"calc(100% - 350px)":"calc(100% - 45px)"})),h(this,"saveingInstitution",t.ref(!1)),h(this,"showEditInstitution",t.ref(!1)),h(this,"editInstitutionTitle",t.ref("新增 - 机构")),h(this,"institutionFormModel",t.reactive({Id:0,EnterpriseId:0,InstitutionPlatformId:0,InstitutionCode:"",InstitutionName:"",InstitutionAbbreviation:"",InstitutionTypeCode:"",OrderNo:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"institutionFormItems",t.reactive([{model:"InstitutionName",label:"机构名称",prop:"InstitutionName",type:"Input",span:24,inputProp:{placeholder:"请输入机构名称"}},{model:"InstitutionAbbreviation",label:"机构简称",prop:"InstitutionAbbreviation",type:"Input",span:24,inputProp:{placeholder:"请输入机构简称"}},{model:"InstitutionTypeCode",label:"机构类型",prop:"InstitutionTypeCode",type:"Select",span:24,selectProp:{datas:[],transfer:!0,onChange:(e,t)=>{this.utilities.isNull(e)||(this.institutionFormModel.InstitutionCode=e+"-")}}},{model:"EnterpriseId",label:"所属企业",prop:"EnterpriseId",type:"Select",span:24,selectProp:{datas:[],transfer:!0}},{model:"InstitutionCode",label:"机构编码",prop:"InstitutionCode",type:"Input",span:24,inputProp:{placeholder:"请输入机构编码"}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitution",(async()=>{this.saveingInstitution.value=!0;let e=await this.institutioninforApi.save({Id:this.institutionFormModel.Id,EnterpriseId:this.institutionFormModel.EnterpriseId,InstitutionName:this.institutionFormModel.InstitutionName,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitution.value=!1);await this.institutionPlatformApi.save({Id:this.institutionFormModel.InstitutionPlatformId,InstitutionId:this.institutionFormModel.Id<=0?t:this.institutionFormModel.Id,PlatformId:this.selectedPlatform.Id,InstitutionCode:this.institutionFormModel.InstitutionCode,InstitutionAbbreviation:this.institutionFormModel.InstitutionAbbreviation,InstitutionTypeCode:this.institutionFormModel.InstitutionTypeCode,OrderNo:this.institutionFormModel.OrderNo,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),this.message.success("保存成功!"),this.institutionGrid.value.refreshData(),this.saveingInstitution.value=!1,this.showEditInstitution.value=!1})),h(this,"showImportInstitution",t.ref(!1)),h(this,"saveingImportInstitution",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originInstitutionGrid",t.ref()),h(this,"originInstitutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input",span:12},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input",span:12},{field:"InstitutionCode",title:"机构编码",type:"Input",span:12}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"Id",title:"ID",width:80},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:200},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",width:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:180},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}}],event:{event_search:e=>{this.loadOriginInstitutionGridData(this.selectedPlatform.Id,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")})),h(this,"doImportInstitution",(async()=>{const e=this.originInstitutionGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台机构信息");this.saveingImportInstitution.value=!0;let t=[];const i=this.storageInfo.getUser();for(const r of e)t.push({InstitutionId:r.Id,PlatformId:this.selectedPlatform.Id,InstitutionCode:r.InstitutionCode,InstitutionAbbreviation:r.InstitutionAbbreviation,InstitutionTypeCode:r.InstitutionTypeCode,OrderNo:r.OrderNo,LastUpdateUserId:i.Id,LastUpdateUserName:i.UserName,LastUpdateDate:this.utilities.getCurrentDate()});const o=await this.institutionPlatformApi.saves(t),s=this.utilities.parseApiResult(o);this.saveingImportInstitution.value=!1,s?(this.showImportInstitution.value=!1,this.institutionGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),h(this,"selectedInstitutionTree"),h(this,"insertRecords",[]),h(this,"institutionTree",t.ref([])),h(this,"saveingInstitutionTree",t.ref(!1)),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"renderContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",width:"100%",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))]),e("span",{style:{display:"inline-block",float:"right",marginRight:"8px"}},[e(s.Icon,{type:"md-trash",style:{fontSize:"18px",color:"rgb(225, 76, 23)"},onClick:()=>{this.doDeleteNode(t,i,o)}})])]))),h(this,"doTreeSelectChange",(e=>{e.length>0?this.selectedInstitutionTree=e[0]:this.selectedInstitutionTree=void 0})),h(this,"loadInstitutionTree",(async()=>{this.insertRecords=[],this.selectedInstitutionTree=void 0,this.loadingInstitutionTree.value=!0;const e=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),t=this.utilities.parseApiResult(e);this.loadingInstitutionTree.value=!1;const i=e=>{const o=t.filter((t=>t.PId==e));for(const t of o){t.title=t.InstitutionAbbreviation,t.expand=!0;const e=i(t.Id);e.length>0&&(t.children=e)}return o};this.institutionTree.value=i(0)})),h(this,"doSaveInstitutionTree",(async()=>{if(0==this.insertRecords.length)return void this.message.warning("没有需要保存的数据!");this.saveingInstitutionTree.value=!0;let e=await this.institutionTreeApi.saveInstitutionTrees(this.insertRecords),t=this.utilities.parseApiResult(e);this.saveingInstitutionTree.value=!1,t>0?(this.message.success("保存成功"),this.loadInstitutionTree()):this.message.error("操作异常, 请稍后重试!")})),h(this,"selectInstitution"),h(this,"showBindRole",t.ref(!1)),h(this,"saveingBindRole",t.ref(!1)),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称",width:200},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveBindRole",(async()=>{const e=this.roleGrid.value.getDatas().filter((e=>1==e.IsChk)).map((e=>e.Id)).join(",");this.saveingBindRole.value=!0;const t=await this.institutionPlatformApi.save({Id:this.selectInstitution.InstitutionPlatformId,RoleIds:e}),i=this.utilities.parseApiResult(t);this.saveingBindRole.value=!1,i>0?(this.message.success("保存成功"),this.showBindRole.value=!1,this.institutionGrid.value.refreshData()):this.message.error("保存失败,稍后重试!")})),this.props=e,this.ctx=o,this.useBusinessInstitutionType(),this.useBusinessInstitution()}useBusinessInstitutionType(){t.onMounted((()=>{})),t.onUnmounted((()=>{})),this.getInstitutionTypes()}async getInstitutionTypes(){const e=await this.institutionTypeApi.getEntities(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]));this.institutionTypes.value=this.utilities.parseApiResult(e),this.setInstitutionTypeCodeDatas()}async loadEnterprises(){const e=await this.enterpriseApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.enterprises=this.utilities.parseApiResult(e),this.setEnterpriseDatas()}useBusinessInstitution(){t.onMounted((()=>{})),t.onUnmounted((()=>{}))}loadInstitutionGridData(e,t,i,o){this.institutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}async doRemoveInstitution(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 移除平台与机构的关联。 <br/> 2. 如果机构不存在于其他平台的关联,则会删除该机构。 <br/> 3. 移除该机构对应的机构树。 <br/> 确定要执行该操作吗?",onOk:async()=>{let t=await this.institutionPlatformApi.deleteByInsIdAndPlatformId(e.Id,this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);i<=0?this.message.error("操作失败, 请稍后重试!"):(t=await this.institutionPlatformApi.getCount(o.QueryWrapper.create().eq("InstitutionId",e.Id)),i=this.utilities.parseApiResult(t),0==i&&(t=await this.institutioninforApi.delete(e.Id),i=this.utilities.parseApiResult(t)),t=await this.institutionTreeApi.deleteInstitutionTreeByInstitutionIdAndPlatformId(e.Id,this.selectedPlatform.Id),i=this.utilities.parseApiResult(t),this.message.success("操作成功"),this.institutionGrid.value.refreshData(),i>0&&this.loadInstitutionTree())}})}setInstitutionTypeCodeDatas(){const e=[];for(const t of this.institutionTypes.value)e.push({text:t.Name,value:t.Code});this.institutionFormItems[2].selectProp.datas=e}setEnterpriseDatas(){const e=[];for(const t of this.enterprises.filter((e=>e.PlatformId==this.selectedPlatform.Id)))e.push({text:t.EnterpriseName,value:t.Id});this.institutionFormItems[3].selectProp.datas=e}doEditInstitution(e){const t=this.storageInfo.getUser();this.institutionFormModel.Id=e.Id,this.institutionFormModel.EnterpriseId=e.EnterpriseId,this.institutionFormModel.InstitutionPlatformId=e.InstitutionPlatformId,this.institutionFormModel.InstitutionCode=e.InstitutionCode,this.institutionFormModel.InstitutionName=e.InstitutionName,this.institutionFormModel.InstitutionAbbreviation=e.InstitutionAbbreviation,this.institutionFormModel.InstitutionTypeCode=e.InstitutionTypeCode,this.institutionFormModel.OrderNo=e.OrderNo,this.institutionFormModel.LastUpdateUserId=t.Id,this.institutionFormModel.LastUpdateUserName=t.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="编辑 - "+e.InstitutionName,this.showEditInstitution.value=!0}doAddInstitution(){const e=this.storageInfo.getUser();this.institutionFormModel.Id=0,this.institutionFormModel.EnterpriseId=0,this.institutionFormModel.InstitutionPlatformId=0,this.institutionFormModel.InstitutionCode="",this.institutionFormModel.InstitutionName="",this.institutionFormModel.InstitutionAbbreviation="",this.institutionFormModel.InstitutionTypeCode="",this.institutionFormModel.OrderNo=1,this.institutionFormModel.LastUpdateUserId=e.Id,this.institutionFormModel.LastUpdateUserName=e.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="新增 - 机构",this.showEditInstitution.value=!0}doShowImportInstitution(){this.showImportInstitution.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){const e=await this.platformApi.getEntities(o.QueryWrapper.create().ne("Id",this.selectedPlatform.Id));this.originPlatform.list=this.utilities.parseApiResult(e),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")}))}loadOriginInstitutionGridData(e,t,i,o){this.originInstitutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}doAddNode(e){if(this.utilities.isNull(this.selectedInstitutionTree)){const t={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:0,PId:0,NodeLevel:1,ParentPath:"/",FakeId:this.utilities.getUniqueCode(),FakePId:null,PlatformId:this.selectedPlatform.Id,InstitutionId:e.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};this.institutionTree.value.push(t),this.insertRecords.push(t)}else{this.utilities.isNull(this.selectedInstitutionTree.children)&&(this.selectedInstitutionTree.children=[]);const t=this.selectedInstitutionTree,i={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:t.RootId,PId:t.Id,NodeLevel:t.NodeLevel+1,ParentPath:t.ParentPath+t.Id+"/",FakeId:this.utilities.getUniqueCode(),FakePId:t.Id>0?null:t.FakeId,InstitutionId:e.Id,PlatformId:this.selectedPlatform.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};t.children.push(i),this.insertRecords.push(i)}}doDeleteNode(e,t,i){this.modal.confirm({title:"提示",content:i.Id>0?"该操作将执行以下步骤 <br/> 1. 将该节点的子节点移动到该节点的父节点下 <br/> 2. 删除该节点 <br/> 确定要执行该操作吗?":"确定要移除该节点及其子节点吗?",onOk:async()=>{if(i.Id>0){const e=await this.institutionTreeApi.deleteInstitutionTree(i.Id);this.utilities.parseApiResult(e)>0?(this.message.success("操作成功"),this.loadInstitutionTree()):this.message.error("操作失败, 请稍后重试!")}else{const o=e.find((e=>e===t)).parent;if(this.utilities.isNull(o)){const e=this.institutionTree.value.indexOf(i);this.institutionTree.value.splice(e,1)}else{const t=e.find((e=>e.nodeKey===o)).node,s=t.children.indexOf(i);t.children.splice(s,1)}const s=e=>{for(const t of e){const e=this.insertRecords.findIndex((e=>e.FakeId==i.FakeId));this.insertRecords.splice(e,1),!this.utilities.isNull(t.children)&&t.children.length>0&&s(t.children)}};s([i])}}})}doShowBindRole(e){this.selectInstitution=e,this.showBindRole.value=!0,this.loadBindRole()}loadBindRole(){this.roleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("RoleStatus",1).orderBy(["OrderNo"]),i=await this.roleApi.getEntities(t),s=this.utilities.parseApiResult(i),r=this.selectInstitution.RoleIds,l=this.utilities.isNull(r)?[]:r.split(",");for(const o of s)o.IsChk=-1!=l.findIndex((e=>e==o.Id));e.success(s)}))}};const j={style:{width:"100%",height:"100%",position:"relative"}},z={style:{height:"500px","overflow-y":"auto"}},Z={class:"import-institution",style:{height:"600px","overflow-y":"auto",position:"relative"}},$={style:{width:"100%",height:"100%"}},J={style:{height:"calc(100%)"}},X={style:{height:"610px","overflow-y":"auto",position:"relative"}};const ee=f(Y,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("Tree"),h=t.resolveComponent("Spin"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Modal"),I=t.resolveComponent("Option"),v=t.resolveComponent("Select"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"institution"},{default:t.withCtx((()=>[t.createVNode(d,{width:e.institutionWidth,title:"机构列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"institutionGrid",option:e.institutionGridOption},{default:t.withCtx((()=>[t.createVNode(a,{onSelect:e.doPlatformListSelect},null,8,["onSelect"])])),_:1},8,["option"])])),_:1},8,["width"]),t.createVNode(d,{width:"350px",title:"组织机构树",showArrow:!0,expand:!1,onChange:e.doWidthChange},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.loadInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"]),t.createVNode(p,{type:"primary",loading:e.saveingInstitutionTree,onClick:e.doSaveInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",j,[t.createVNode(u,{data:e.institutionTree,render:e.renderContent,class:"tree-render",onOnSelectChange:e.doTreeSelectChange},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(h,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("正在保存中")])),_:1},512),[[t.vShow,e.saveingInstitutionTree]]),t.withDirectives(t.createVNode(h,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(g,{modelValue:e.showEditInstitution,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingInstitution,onClick:e.doSaveInstitution},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",z,[t.createVNode(f,{model:e.institutionFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(c,{ref:"institutionComForm",formModel:e.institutionFormModel,formItems:e.institutionFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(g,{modelValue:e.showImportInstitution,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showImportInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:1200,title:"引入机构",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showImportInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingImportInstitution,onClick:e.doImportInstitution},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Z,[t.createElementVNode("div",$,[t.createElementVNode("div",J,[t.createVNode(n,{ref:"originInstitutionGrid",option:e.originInstitutionGridOption},{default:t.withCtx((()=>[t.createVNode(v,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[2]||(i[2]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(I,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])]),t.withDirectives(t.createVNode(h,{fix:""},null,512),[[t.vShow,e.saveingImportInstitution]])])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showBindRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showBindRole=t),draggable:"",mask:!0,"mask-closable":!1,width:900,title:"绑定角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showBindRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingBindRole,onClick:e.doSaveBindRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",X,[t.createVNode(n,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"]),t.withDirectives(t.createVNode(h,{fix:""},null,512),[[t.vShow,e.saveingBindRole]])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-42799ba1"]]),te=t.defineComponent({name:"LoginLog",components:{},emits:[""],props:{},setup:(e,t)=>new ie(e,t)});let ie=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"loginLogApi",new i.LoginLogApi),h(this,"platformId",0),h(this,"userId",0),h(this,"loginLogGrid",t.ref()),h(this,"loginLogGridOption",t.reactive({api:this.loginLogApi,setting:{border:!0,searchConfig:{btnSpan:12,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"LoginDate",title:"登录日期",type:"DatePicker",span:12},{field:"IPAddress",title:"登录IP",type:"Input",span:12}],toolbars:[{name:"refresh",type:"primary"}],columns:[{colType:"seq"},{colType:"ro",field:"LoginType",title:"登录方式",align:"center"},{colType:"ro",field:"LoginDate",title:"登录日期",align:"center",format:(e,t)=>{const i=t.row.LoginDate;return this.utilities.isNull(i)?"":i}},{colType:"ro",field:"IPAddress",title:"登录IP",align:"center"}],event:{event_search:e=>{this.loadLoginLog(this.platformId,this.userId,e)}}})),h(this,"loadLoginLog",((e,t,i={})=>{this.platformId=e,this.userId=t;const s=o.QueryWrapper.create();s.eq("PlatformId",this.platformId).eq("UserId",this.userId).orderBy(["Id"],!1),this.utilities.isNull(i.IPAddress)||s.like("IPAddress",i.IPAddress);const r=this.utilities.dateHelper.format(i.LoginDate,"YYYY-MM-DD");this.utilities.isNull(i.LoginDate)||s.between("LoginDate",`${r} 00:00:00`,`${r} 23:59:59`),this.loginLogGrid.value.loadDataByQuery(s)})),this.props=e,this.ctx=s}};const oe={class:"loginLog"};const se=f(te,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid");return t.openBlock(),t.createElementBlock("div",oe,[t.createVNode(a,{ref:"loginLogGrid",option:e.loginLogGridOption},null,8,["option"])])}],["__scopeId","data-v-4e2e0184"]]),re={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},le=t.defineComponent({name:"Userinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:se,BaseLogin:r.BaseLogin},emits:[""],props:re,setup:(e,t)=>new ae(e,t)});let ae=class extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{this.selectedPlatform=e,this.loadInsTree()})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}},{name:"import",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:180,rowButtons:[{name:"login",text:"登录",onclick:(e,t)=>{this.devOpsLogin(e)}},{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountType",label:"账号类型",type:"Radio",radioProp:{type:"button","button-style":"solid",datas:[{text:"用户账号",value:0},{text:"内部账号",value:1}]}},{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"姓名不能为空",trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,7,8]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=1,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.deleteUser(e.UserId,e.InstitutionUserId);this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}doShowImportUser(){this.showImportUser.value=!0,t.nextTick((()=>{this.loadImportUserGrid({})}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}};const ne=e=>(t.pushScopeId("data-v-3969fae6"),e=e(),t.popScopeId(),e),de={class:"instree-search"},ue={class:"instree-list"},he={style:{height:"600px","overflow-y":"auto"}},pe=ne((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),me={style:{height:"600px","overflow-y":"auto"}},ce=ne((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),fe={style:{height:"650px","overflow-y":"auto"}},ge=ne((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选需要引入的用户!",-1))),Ie={style:{height:"650px","overflow-y":"auto"}},ve={style:{display:"none"}},ye={style:{height:"400px","overflow-y":"auto"}},we=["src"],Ce=["src"];const Ne=f(le,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("Tree"),d=t.resolveComponent("Spin"),u=t.resolveComponent("Button"),h=t.resolveComponent("Space"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("NvGrid"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Modal"),I=t.resolveComponent("LoginLog"),v=t.resolveComponent("BaseLogin"),y=t.resolveComponent("FormItem"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(p,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(h,null,{default:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",de,[t.createVNode(a,{onSelect:e.doChangePlatform,width:"100%",showLabel:!1},null,8,["onSelect"])]),t.createElementVNode("div",ue,[t.createVNode(n,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(p,{width:e.userBoxWidth,title:"用户列表"},{default:t.withCtx((()=>[t.createVNode(m,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(g,{modelValue:e.showEditUser,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",he,[t.createVNode(f,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(c,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),pe])])),_:1},8,["modelValue","title"]),t.createVNode(g,{modelValue:e.showUserRole,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[2]||(i[2]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",me,[t.createVNode(m,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[ce])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showImportUser,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportUser=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入用户",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingImportUser,onClick:e.doImportUser},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",fe,[t.createVNode(m,{ref:"otherUserGrid",option:e.otherUserGridOption},{default:t.withCtx((()=>[ge])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[7]||(i[7]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[6]||(i[6]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Ie,[t.createVNode(I,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",ve,[t.createVNode(v,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(g,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[9]||(i[9]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(u,{type:"text",onClick:i[8]||(i[8]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(u,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ye,[t.createVNode(f,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(c,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(y,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,we)):t.createCommentVNode("",!0),t.createVNode(u,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(y,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Ce)):t.createCommentVNode("",!0),t.createVNode(u,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-3969fae6"]]),Me={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},xe=t.defineComponent({name:"Enterprise",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Me,setup:(e,t)=>new Pe(e,t)});let Pe=class extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"provinceApi",new a.ProvinceApi),h(this,"cityApi",new a.CityApi),h(this,"areaApi",new a.AreaApi),h(this,"selectedPlatform"),h(this,"provinces",[]),h(this,"cities",[]),h(this,"areas",[]),h(this,"refSelectPlatform",t.ref()),h(this,"onlyView",t.ref(!1)),h(this,"enterpriseGrid",t.ref()),h(this,"enterpriseGridOption",t.reactive({api:this.enterpriseApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"EnterpriseName",title:"企业名称",type:"Input",span:6}],toolbars:[{name:"add",onclick:()=>{this.doAddEnterprise()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:70,align:"center"},{colType:"ed",field:"EnterpriseName",title:"企业名称",minWidth:300},{colType:"ed",field:"EnterpriseCode",title:"企业代码",align:"center",minWidth:160},{colType:"ro",field:"Province",title:"省 市 区",align:"center",width:220,format:(e,t)=>{const i=t.row;let o=[],s=this.provinces.filter((e=>e.ProvinceCode==i.Province)),r=this.cities.filter((e=>e.CityCode==i.City)),l=this.areas.filter((e=>e.AreaCode==i.Area));return s.length>0&&o.push(s[0].ProvinceName),r.length>0&&o.push(r[0].CityName),l.length>0&&o.push(l[0].AreaName),e("span",o.join("-"))}},{colType:"ro",field:"Contact",title:"联系人",align:"center",width:120},{colType:"ro",field:"TelPhone",title:"联系电话",align:"center",width:140},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",align:"center",width:140},{colType:"ro",field:"LastUpdateTime",title:"最后修改时间",align:"center",width:160},{title:"操作",width:180,rowButtons:[{name:"view",text:"预览",onclick:(e,t)=>{this.doViewEnterprise(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditEnterprise(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.enterpriseGrid.value.setPageIndex(1),this.loadEnterpriseGridData(e)}}})),h(this,"doPlatformChange",(e=>{this.selectedPlatform=e,this.loadEnterpriseGridData({})})),h(this,"saveingEnterprise",t.ref(!1)),h(this,"showEditEnterprise",t.ref(!1)),h(this,"editEnterpriseTitle",t.ref("新增 - 企业")),h(this,"enterpriseFormModel",t.reactive({Id:0,PlatformId:0,EnterpriseName:"",EnterpriseCode:"",LegalPerson:"",RegisteredCapital:0,Province:"",City:"",Area:"",Address:"",Contact:"",TelPhone:"",LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateTime:"",PostalCode:"",Fax:"",Email:""})),h(this,"enterpriseFormItems",t.reactive([{model:"",label:"基本信息",span:24,children:[{model:"EnterpriseName",label:"企业名称",type:"Input",prop:"EnterpriseName",span:12,inputProp:{placeholder:"请输入企业名称"}},{model:"EnterpriseCode",label:"企业代码",type:"Input",prop:"EnterpriseCode",span:12,inputProp:{placeholder:"请输入企业代码"}},{model:"LegalPerson",label:"企业法人",type:"Input",span:12,inputProp:{placeholder:"请输入企业法人"}},{model:"RegisteredCapital",label:"注册资金",type:"Input",span:12,inputProp:{placeholder:"请输入注册资金",append:"万元"}}]},{model:"",label:"联系信息",span:24,children:[{model:"Province",label:"省份",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setCityDatas(e),this.setAreaDatas("")},transfer:!0,filterable:!0}},{model:"City",label:"城市",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setAreaDatas(e)},transfer:!0,filterable:!0}},{model:"Area",label:"区县",type:"Select",span:8,selectProp:{datas:[],transfer:!0,filterable:!0}},{model:"Address",label:"地址",type:"Input",span:24,inputProp:{rows:4,type:"textarea",placeholder:"请输入联系地址"}},{model:"Contact",label:"联系人",type:"Input",span:12,inputProp:{placeholder:"请输入联系人"}},{model:"TelPhone",label:"联系电话",type:"Input",span:12,inputProp:{placeholder:"请输入联系电话"}},{model:"PostalCode",label:"邮政编码",type:"Input",span:12,inputProp:{placeholder:"请输入邮政编码"}},{model:"Email",label:"Email",type:"Input",span:12,inputProp:{placeholder:"请输入Email地址"}},{model:"Fax",label:"传真",type:"Input",span:12,inputProp:{placeholder:"请输入传真"}}]}])),h(this,"doSaveEnterprise",(async()=>{this.saveingEnterprise.value=!0;let e=await this.enterpriseApi.save(this.enterpriseFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingEnterprise.value=!1);this.message.success("保存成功!"),this.enterpriseGrid.value.refreshData(),this.saveingEnterprise.value=!1,this.showEditEnterprise.value=!1})),this.props=e,this.ctx=o,this.useArea()}async useArea(){let e=await this.provinceApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.provinces=this.utilities.parseApiResult(e),e=await this.cityApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.cities=this.utilities.parseApiResult(e),e=await this.areaApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.areas=this.utilities.parseApiResult(e),this.setProvinceDatas(),this.refSelectPlatform.value.loadPlatforms()}loadEnterpriseGridData(e){const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id);for(const i of Object.keys(e)){const o=e[i];this.utilities.isNull(o)||t.like(i,o)}this.enterpriseGrid.value.loadDataByQuery(t)}setProvinceDatas(){this.enterpriseFormItems[1].children[0].selectProp.datas=this.provinces.map((e=>({text:e.ProvinceName,value:e.ProvinceCode})))}setCityDatas(e){this.enterpriseFormItems[1].children[1].selectProp.datas=this.cities.filter((t=>t.ProvinceCode==e)).map((e=>({text:e.CityName,value:e.CityCode})))}setAreaDatas(e){this.enterpriseFormItems[1].children[2].selectProp.datas=this.areas.filter((t=>t.CityCode==e)).map((e=>({text:e.AreaName,value:e.AreaCode})))}doAddEnterprise(){const e=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=0,this.enterpriseFormModel.PlatformId=this.selectedPlatform.Id,this.enterpriseFormModel.EnterpriseName="",this.enterpriseFormModel.EnterpriseCode="",this.enterpriseFormModel.LegalPerson="",this.enterpriseFormModel.RegisteredCapital=0,this.enterpriseFormModel.Province="",this.enterpriseFormModel.City="",this.enterpriseFormModel.Area="",this.enterpriseFormModel.Address="",this.enterpriseFormModel.Contact="",this.enterpriseFormModel.TelPhone="",this.enterpriseFormModel.PostalCode="",this.enterpriseFormModel.Fax="",this.enterpriseFormModel.Email="",this.enterpriseFormModel.LastUpdateUserId=e.Id,this.enterpriseFormModel.LastUpdateUserName=e.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(""),this.setAreaDatas(""),this.editEnterpriseTitle.value="新增 - 企业",this.showEditEnterprise.value=!0}doEditEnterprise(e){const t=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=e.Id,this.enterpriseFormModel.PlatformId=e.InstitutionId,this.enterpriseFormModel.EnterpriseName=e.EnterpriseName,this.enterpriseFormModel.EnterpriseCode=e.EnterpriseCode,this.enterpriseFormModel.LegalPerson=e.LegalPerson,this.enterpriseFormModel.RegisteredCapital=e.RegisteredCapital,this.enterpriseFormModel.Province=e.Province,this.enterpriseFormModel.City=e.City,this.enterpriseFormModel.Area=e.Area,this.enterpriseFormModel.Address=e.Address,this.enterpriseFormModel.Contact=e.Contact,this.enterpriseFormModel.TelPhone=e.TelPhone,this.enterpriseFormModel.PostalCode=e.PostalCode,this.enterpriseFormModel.Fax=e.Fax,this.enterpriseFormModel.Email=e.Email,this.enterpriseFormModel.LastUpdateUserId=t.Id,this.enterpriseFormModel.LastUpdateUserName=t.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(e.Province),this.setAreaDatas(e.City),this.editEnterpriseTitle.value="编辑 - "+e.EnterpriseName,this.showEditEnterprise.value=!0}doViewEnterprise(e){this.doEditEnterprise(e),this.onlyView.value=!0,this.editEnterpriseTitle.value="预览 - "+e.EnterpriseName}};const Ue={style:{height:"650px","overflow-y":"auto"}};const Ae=f(xe,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("SelectPlatform"),n=t.resolveComponent("NvGrid"),d=t.resolveComponent("NvBox"),u=t.resolveComponent("NvComForm"),h=t.resolveComponent("Form"),p=t.resolveComponent("Button"),m=t.resolveComponent("Modal"),c=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(c,{gutter:8,class:""},{default:t.withCtx((()=>[t.createVNode(d,{width:"100%",title:"企业列表"},{default:t.withCtx((()=>[t.createVNode(n,{ref:"enterpriseGrid",option:e.enterpriseGridOption},{default:t.withCtx((()=>[t.createVNode(a,{ref:"refSelectPlatform",onSelect:e.doPlatformChange,defaultLoad:!1},null,8,["onSelect"])])),_:1},8,["option"])])),_:1}),t.createVNode(m,{modelValue:e.showEditEnterprise,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditEnterprise=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editEnterpriseTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditEnterprise=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),e.onlyView?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(p,{key:0,type:"primary",loading:e.saveingEnterprise,onClick:e.doSaveEnterprise},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"]))])),default:t.withCtx((()=>[t.createElementVNode("div",Ue,[t.createVNode(h,{model:e.enterpriseFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(u,{ref:"enterpriseComForm",onlyView:e.onlyView,formModel:e.enterpriseFormModel,formItems:e.enterpriseFormItems},null,8,["onlyView","formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-58aa3e77"]]);class Te extends o.BaseApi{get ProxyName(){return"CalcPythonApi"}constructor(){super(),this.addHeader("projectid",0),this.addHeader("devprod","prod"),this.addHeader("dbSkey","08fb72ad2cf661088849ef17fdaab21a")}}class be extends Te{get ControllerName(){return"currency"}constructor(){super(),this.addHeader("tableName","core_partner")}}class Fe extends Te{get ControllerName(){return"currency"}constructor(){super(),this.addHeader("tableName","core_platform_config")}}const Se={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Re=t.defineComponent({name:"Information",components:{NvComFormUp:n.NvComFormUp},emits:[""],props:Se,setup:(e,t)=>new Ve(e,t)});class Ve extends e.BaseInstance{constructor(e,i){super(),h(this,"props"),h(this,"ctx"),h(this,"corePartnerApi",new be),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.corePartnerApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:130,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"UnitName",title:"第三方单位名称",type:"Input"}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"UnitName",title:"第三方单位名称",align:"left",minWidth:250},{colType:"ed",field:"Contact",title:"联系人",width:200,align:"center"},{colType:"ed",field:"ContactPhone",title:"联系电话",width:200,align:"center"},{colType:"select",field:"IsAuthorize",title:"授权状态",width:140,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:2}]},format:(e,t)=>{const i={1:{text:"是",color:"green"},2:{text:"否",color:"red"}}[t.row.IsAuthorize];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"BusinessType",title:"业务类型",width:140,align:"center",defaultValue:1,select:{data:[{text:"接收",value:1},{text:"推送",value:2}]},format:(e,t)=>{const i={1:{text:"接收",color:"green"},2:{text:"推送",color:"blue"}}[t.row.BusinessType];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"ed",field:"CreateUserName",title:"创建人名称",width:200,align:"center"},{title:"操作",width:200,rowButtons:[{name:"view",text:"开启",isShow:e=>2===e.IsAuthorize,onclick:(e,t)=>{e.IsAuthorize=1,this.doSaveRole2(e)}},{name:"view",text:"禁用",isShow:e=>1===e.IsAuthorize,onclick:(e,t)=>{e.IsAuthorize=2,this.doSaveRole2(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().orderBy(["CreateDate"]);this.utilities.isNull(e.UnitName)||t.like("UnitName",e.UnitName),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 第三方信息")),h(this,"roleFormModel",t.reactive({Id:0,UnitName:"",Contact:"",ContactPhone:"",UniqueKey:"",IsAuthorize:2,BusinessType:1,CreateDate:"",CreateUserId:0,CreateUserName:"",Token:""})),h(this,"roleFormItems",t.reactive([{label:"第三方单位名称","label-width":130,model:"UnitName",prop:"UnitName",type:"Input",span:24,rules:[{required:!0,message:"第三方单位名称不能为空",trigger:"blur"}]},{label:"联系人","label-width":130,model:"Contact",prop:"Contact",type:"Input",span:12},{label:"联系电话","label-width":130,model:"ContactPhone",prop:"ContactPhone",type:"Input",span:12},{model:"BusinessType","label-width":130,label:"业务类型",prop:"BusinessType",type:"Radio",span:12,radioProp:{datas:[{text:"接收",value:1},{text:"推送",value:2}],type:"button"}},{label:"唯一标识","label-width":130,model:"UniqueKey",prop:"UniqueKey",type:"Input",span:24,isShow:!1,inputProp:{disabled:!0}},{label:"附件","label-width":130,model:"Token",prop:"Token",type:"UploadFile",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.corePartnerApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"doSaveRole2",(async e=>{let t=await this.corePartnerApi.save(e);this.utilities.parseApiResult(t)<=0?this.message.warning("变更失败,请稍后重试!"):(this.message.success("变更成功!"),this.roleGrid.value.refreshData())})),this.props=e,this.ctx=i,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{this.loadMainData()})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:`确定要删除${e.UnitName}吗`,onOk:async()=>{const t=await this.corePartnerApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}async loadMainData(){const e=o.QueryWrapper.create().orderBy(["CreateDate"]);this.roleGrid.value.loadDataByQuery(e)}doEditRole(e){this.storageInfo.getUser(),this.roleFormModel.Id=e.Id,this.roleFormModel.UnitName=e.UnitName,this.roleFormModel.Contact=e.Contact,this.roleFormModel.ContactPhone=e.ContactPhone,this.roleFormModel.UniqueKey=e.UniqueKey,this.roleFormModel.IsAuthorize=e.IsAuthorize,this.roleFormModel.BusinessType=e.BusinessType,this.roleFormModel.CreateDate=e.CreateDate,this.roleFormModel.CreateUserId=e.CreateUserId,this.roleFormModel.CreateUserName=e.CreateUserName,this.roleFormModel.Token=e.Token,this.roleFormItems[4].isShow=!0,this.editRoleModalTitle.value=`编辑 - ${e.UnitName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.UnitName="",this.roleFormModel.Contact="",this.roleFormModel.ContactPhone="",this.roleFormModel.UniqueKey=this.utilities.getUniqueCode(),this.roleFormModel.IsAuthorize=2,this.roleFormModel.BusinessType=1,this.roleFormModel.CreateDate=this.utilities.getCurrentDate(),this.roleFormModel.CreateUserId=e.Id,this.roleFormModel.CreateUserName=e.UserName,this.roleFormModel.Token=this.utilities.getUniqueCode(),this.roleFormItems[4].isShow=!1,this.editRoleModalTitle.value="新增 - 第三方信息",this.showEditRole.value=!0}}const ke={style:{"overflow-y":"auto"}};const De=f(Re,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComFormUp"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(m,{gutter:8,class:"information"},{default:t.withCtx((()=>[t.createVNode(n,{width:"100%",title:"第三方信息"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditRole,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ke,[t.createVNode(u,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}]]),Ee={linkParam:{type:String,default:""},operates:{type:String,default:"-"},platformInfo:{type:Object,default:{}},configType:{type:String,default:"BD"}},Oe=t.defineComponent({name:"GeneralConfiguration",components:{},emits:[""],props:Ee,setup:(e,t)=>new Ge(e,t)});class Ge extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"dictionaryDetailApi",new a.DictionaryDetailApi),h(this,"dictionaryTypeApi",new a.DictionaryTypeApi),h(this,"corePlatformConfigApi",new Fe),h(this,"nowRow",t.reactive({Id:0,PlatformId:0,ProjectConfig:"[]",ConstructConfig:"[]",LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()})),h(this,"generalConfGrid",t.ref()),h(this,"generalConfGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},editConfig:{trigger:"click",mode:"row",showStatus:!0},isPagination:!1,pageSize:10},searchOptions:[],toolbars:[{name:"add",onclick:()=>{this.doAddFormData()}},{name:"save",onclick:()=>{this.saveFormData()}},{name:"delete",text:"删除",onclick:()=>{this.deleteFormData()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"label",title:"标签文本",align:"left",minWidth:250},{colType:"ro",field:"prop",title:"属性字段",align:"left",minWidth:250},{colType:"ro",field:"model",title:"表单字段",align:"left",minWidth:250},{colType:"select",field:"seltype",title:"类型",minWidth:240,align:"center",select:{data:[{value:"Input",text:"文字输入框"},{value:"InputNumber",text:"数字输入框"},{value:"Textarea",text:"多行文本"},{value:"TextEditor",text:"富文本"},{value:"DatePicker",text:"日期选择"},{value:"TimePicker",text:"时间选择"},{value:"UploadFile",text:"附件"},{value:"region",text:"地区选择"}]},change:e=>{switch(e.seltype){case"Input":e.type="Input";break;case"InputNumber":e.type="InputNumber",e.rules=[{required:!0,type:"number",message:e.message,trigger:"blur"}];break;case"Textarea":e.type="Input",e.inputProp={type:"textarea",rows:4};break;case"DatePicker":e.type="DatePicker",e.rules=[{required:!0,type:"date",message:e.message,trigger:"change"}];break;case"TimePicker":e.type="TimePicker",e.rules=[{required:!0,type:"date",message:e.message,trigger:"change"}];break;case"UploadFile":e.type="UploadFile";break;case"TextEditor":e.type="TextEditor",e.textHeight=160;break;case"region":e.type="region"}}},{colType:"ed",field:"append",title:"输入框单位",minWidth:120,align:"center",change:e=>{e.append&&"Input"==e.seltype?(e.type="Input",e.inputProp={type:"text",append:e.append}):(e.type=e.seltype,e.inputProp={})}},{colType:"select",field:"span",title:"占位格数",minWidth:120,align:"right",select:{data:[{value:8,text:"8"},{value:12,text:"12"},{value:24,text:"24"}]}},{colType:"select",field:"requiredd",title:"必填项",minWidth:120,align:"center",select:{data:[{value:1,text:"必填"},{value:0,text:"可空"}]},change:e=>{1==e.requiredd?e.rules=[{required:!0,message:e.message,trigger:"blur"}]:e.rules=[]}},{colType:"ed",field:"message",title:"提示信息",minWidth:200,align:"left",change:e=>{e.message?e.rules=[{required:!0,message:e.message,trigger:"blur"}]:e.rules=[]}},{colType:"num",field:"orderNum",title:"排序号",minWidth:80,align:"right"}],event:{}})),h(this,"saveFormData",(async()=>{const e=this.generalConfGrid.value.getSaveDatas();if(0==e.length)return void this.message.warning("没有需要保存的数据");let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig));t.forEach((t=>{e.forEach((e=>{t.model==e.model&&Object.assign(t,e)}))}));let i={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(t):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(t):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(i))>0?(this.message.success("保存成功"),this.loadGeneralSituationData()):this.message.warning("保存失败")})),h(this,"deleteFormData",(async()=>{const e=this.generalConfGrid.value.getCheckboxDatas();0!=e.length?this.modal.confirm({title:"提示",content:"确定删除所选数据吗?",onOk:async()=>{let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig));e.forEach((e=>{t.forEach(((i,o)=>{e.prop==i.prop&&t.splice(o,1)}))}));let i={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(t):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(t):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(i))>0?(this.message.success("删除成功"),this.loadGeneralSituationData()):this.message.error("删除失败")}}):this.message.warning("未勾选数据")})),h(this,"isShowDicModal",t.ref(!1)),h(this,"dicModalTitle",t.ref("概况选择")),h(this,"isShowDicModalLoading",t.ref(!1)),h(this,"dicModalGrid",t.ref()),h(this,"dicModalGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!0,isHover:!0},isPagination:!1,pageSize:10},searchOptions:[],toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"DetailInfor",title:"标签文本",minWidth:200,align:"left"},{colType:"ro",field:"DetailValue",title:"属性字段",minWidth:200,align:"left"}],event:{}})),h(this,"doSaveDicModal",(async()=>{const e=this.dicModalGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("请先勾选数据");this.isShowDicModalLoading.value=!0;let t=[];e.forEach(((e,i)=>{t.push({label:e.DetailInfor,prop:e.DetailValue,model:e.DetailValue,type:"Input",seltype:"Input",append:"",span:8,orderNum:i,requiredd:1,message:e.DetailInfor+"不能为空",rules:[{required:!0,message:e.DetailInfor+"不能为空",trigger:"blur"}]})}));let i="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(this.nowRow.ProjectConfig)):this.utilities.deepCopy(JSON.parse(this.nowRow.ConstructConfig)),o=[...t,...i].reduce(((e,t)=>{let i=e.find((e=>e.model==t.model));return i?Object.assign(i,t):e.push(t),e}),[]),s={Id:this.nowRow.Id>0?this.nowRow.Id:0,PlatformId:this.props.platformInfo.Id,ProjectConfig:"GC"==this.props.configType?JSON.stringify(o):this.nowRow.ProjectConfig,ConstructConfig:"BD"==this.props.configType?JSON.stringify(o):this.nowRow.ConstructConfig,LastUpdateUserId:this.storageInfo.getUser().Id,LastUpdateUserName:this.storageInfo.getUser().UserName,LastUpdateDate:this.utilities.getCurrentDate()};this.utilities.parseApiResult(await this.corePlatformConfigApi.save(s))>0?(this.message.success("保存成功"),this.loadGeneralSituationData(),this.isShowDicModal.value=!1):this.message.warning("保存失败"),this.isShowDicModalLoading.value=!1})),this.props=e,this.ctx=o,this.loadGeneralSituationData()}doAddFormData(){this.isShowDicModal.value=!0,this.loadDicData()}async loadGeneralSituationData(){let e=this.utilities.parseApiResult(await this.corePlatformConfigApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.props.platformInfo.Id})));if(e&&e.length>0){Object.assign(this.nowRow,e[0]);let t="GC"==this.props.configType?this.utilities.deepCopy(JSON.parse(e[0].ProjectConfig)):this.utilities.deepCopy(JSON.parse(e[0].ConstructConfig));t&&t.length>0&&(t=t.sort(((e,t)=>e.orderNum-t.orderNum))),this.loadMainData(t)}}async loadMainData(e){this.generalConfGrid.value.loadData((async t=>{t.success(e)}))}async loadDicData(){let e="GC"==this.props.configType?"ProjectProfileConfiguration":"SectionGeneralConfiguration",t=this.utilities.parseApiResult(await this.dictionaryTypeApi.getEntitiesDynamic(o.QueryWrapper.create().allEq({PlatformId:this.props.platformInfo.PId>0?this.props.platformInfo.PId:this.props.platformInfo.Id,OptionCode:e})));t&&t.length>0&&this.dicModalGrid.value.loadData((async e=>{let i=this.utilities.parseApiResult(await this.dictionaryDetailApi.getEntities(o.QueryWrapper.create().eq("MainId",t[0].Id)));e.success(i)}))}}const Le={style:{height:"600px","overflow-y":"auto"}};const Be=f(Oe,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("Button"),u=t.resolveComponent("Modal"),h=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(h,{gutter:8,class:"platform"},{default:t.withCtx((()=>[t.createVNode(n,{width:"100%"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"generalConfGrid",option:e.generalConfGridOption},null,8,["option"])])),_:1}),t.createVNode(u,{modelValue:e.isShowDicModal,"onUpdate:modelValue":i[1]||(i[1]=t=>e.isShowDicModal=t),draggable:"",mask:!0,"mask-closable":!1,width:600,title:e.dicModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(d,{type:"text",onClick:i[0]||(i[0]=t=>e.isShowDicModal=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(d,{type:"primary",loading:e.isShowDicModalLoading,onClick:e.doSaveDicModal},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Le,[t.createVNode(a,{ref:"dicModalGrid",option:e.dicModalGridOption},null,8,["option"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-a01b6a2e"]]),_e={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},We=t.defineComponent({name:"Platform",components:{GeneralConfiguration:Be},emits:[""],props:_e,setup:(e,t)=>new qe(e,t)});class qe extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"isShowGeneralConfig",t.ref(!1)),h(this,"generalConfigTitle",t.ref("概况配置")),h(this,"platformInfo",t.reactive({})),h(this,"configType",t.ref("GC")),h(this,"upList",t.reactive(Array())),h(this,"platformGridOption",t.reactive({api:this.platformApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isCurrent:!1,isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"SKey",title:"唯一KEY",type:"Input"},{field:"PlatformName",title:"系统名称",type:"Input"},{field:"PlatformAbbreviation",title:"系统简称",type:"Input"},{field:"PlatformNo",title:"系统代号",type:"Input"},{field:"PlatformGroup",title:"系统组",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddPlatform()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"SKey",title:"唯一KEY",width:240},{colType:"ed",field:"PlatformName",title:"系统名称",minWidth:250},{colType:"ed",field:"PlatformAbbreviation",title:"系统简称",width:150},{colType:"select",field:"PId",title:"上级平台",width:150,format:(e,t)=>{const i=this.upList.find((e=>e.value==t.row.PId));return e("span",0==t.row.PId?"/":i.text)},select:{data:this.upList,clearable:!0,multiple:!1}},{colType:"ed",field:"PlatformNo",title:"系统代号",width:100},{colType:"ed",field:"PlatformUrl",title:"系统URL",width:230},{colType:"num",field:"OrderNo",title:"排序号",width:80,align:"center"},{title:"概况配置",width:140,fixed:"right",rowButtons:[{name:"view",text:"项目",onclick:e=>{this.configType.value="GC",Object.assign(this.platformInfo,e),this.generalConfigTitle.value=`${e.PlatformName}-项目概况配置`,this.isShowGeneralConfig.value=!0}},{name:"view-",text:"标段",onclick:e=>{this.configType.value="BD",Object.assign(this.platformInfo,e),this.generalConfigTitle.value=`${e.PlatformName}-标段概况配置`,this.isShowGeneralConfig.value=!0}}]},{title:"操作",width:140,fixed:"right",rowButtons:[{name:"edit",text:"编辑",onclick:e=>{this.doEditPlatform(e)}},{name:"delete"}]}],event:{event_search:e=>{this.platformGrid.value.setPageIndex(1);const t=Object.keys(e),i=o.QueryWrapper.create();i.eq("1","1");for(const o of t){const t=e[o];this.utilities.isNull(t)||i.like(o,t)}this.platformGrid.value.loadDataByQuery(i)}}})),h(this,"platformGrid",t.ref()),h(this,"refPlatformForm",t.ref()),h(this,"saveingPlatform",t.ref(!1)),h(this,"showEditPlatform",t.ref(!1)),h(this,"editPlatformModalTitle",t.ref("新增 - 系统平台")),h(this,"platformFormModel",t.reactive({Id:0,SKey:"",PlatformNo:"",PlatformName:"",PlatformAbbreviation:"",OssRootPath:"",PlatformGroup:"0",PlatformUrl:"",OrderNo:0,CABusinessKey:"",PId:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:"",DefaultPwd:""})),h(this,"platformFormItems",t.reactive([{model:"PlatformName",label:"系统名称",prop:"PlatformName",type:"Input",span:24,rules:[{required:!0,message:"系统名称不能为空",trigger:"blur"}]},{model:"PlatformNo",label:"系统编号",prop:"PlatformNo",type:"Input",span:24,rules:[{required:!0,message:"系统编号不能为空",trigger:"blur"}]},{model:"PlatformAbbreviation",label:"系统简称",prop:"PlatformAbbreviation",type:"Input",span:24},{model:"OssRootPath",label:"Oss根路径",prop:"OssRootPath",type:"Input",span:24},{model:"PId",label:"上级平台",prop:"PId",type:"Select",span:24,selectProp:{datas:[],transfer:!0,clearable:!0,multiple:!1,onChange:(e,t)=>{const i=t.selectProp.datas.find((t=>t.value==e));this.platformFormModel.PlatformGroup=this.utilities.isNull(i.PlatformGroup)?"0":i.PlatformGroup}}},{model:"PlatformUrl",label:"系统URL",prop:"PlatformUrl",type:"Input",span:24},{model:"CABusinessKey",label:"CAKey",prop:"CABusinessKey",type:"Input",span:24},{model:"DefaultPwd",label:"用户默认密码",prop:"DefaultPwd",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSavePlatform",(async()=>{if(!(await this.refPlatformForm.value.validate()))return;this.saveingPlatform.value=!0;let e=await this.platformApi.save(this.platformFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingPlatform.value=!1);this.message.success("保存成功!"),this.platformGrid.value.refreshData(),this.saveingPlatform.value=!1,this.showEditPlatform.value=!1})),this.props=e,this.ctx=s,this.usePlatform()}usePlatform(){t.onMounted((()=>{this.loadPlatformGrid()}))}async loadPlatformGrid(){var e;const t=this.storageInfo.getUser();this.platformGrid.value.setGloablValue("LastUpdateUserId",t.Id),this.platformGrid.value.setGloablValue("LastUpdateUserName",t.UserName),this.platformGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.platformGrid.value.setGloablValue("SKey",(()=>this.utilities.getUniqueCode()),!0);const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id;this.platformGrid.value.loadData((async e=>{const t=await this.platformApi.getEntitiesPageDynamic(e.page,e.pageSize,o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"])),s=this.utilities.parseApiResult(t);e.success(s),this.upList.splice(0,this.upList.length);for(const i of s.Datas)this.upList.push({value:i.Id,text:i.PlatformAbbreviation})}))}doEditPlatform(e){var t;const i=this.storageInfo.getUser();this.platformFormModel.Id=e.Id,this.platformFormModel.SKey=e.SKey,this.platformFormModel.PlatformNo=e.PlatformNo,this.platformFormModel.PlatformName=e.PlatformName,this.platformFormModel.PlatformAbbreviation=e.PlatformAbbreviation,this.platformFormModel.OssRootPath=e.OssRootPath,this.platformFormModel.PlatformGroup=e.PlatformGroup,this.platformFormModel.PlatformUrl=e.PlatformUrl,this.platformFormModel.CABusinessKey=e.CABusinessKey,this.platformFormModel.OrderNo=e.OrderNo,this.platformFormModel.LastUpdateUserId=i.Id,this.platformFormModel.LastUpdateUserName=i.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd=e.DefaultPwd;const o=null==(t=this.platformGrid.value)?void 0:t.getDatas();this.platformFormItems[4].selectProp.datas=o.length>0?null==o?void 0:o.map((e=>({value:e.Id,text:e.PlatformAbbreviation,PlatformGroup:e.PlatformGroup}))):[],this.platformFormModel.PId=e.PId,this.editPlatformModalTitle.value=`编辑 - ${e.PlatformName}`,this.showEditPlatform.value=!0}doAddPlatform(){var e;const t=this.storageInfo.getUser();this.platformFormModel.Id=0,this.platformFormModel.SKey=this.utilities.getUniqueCode(),this.platformFormModel.PlatformNo="",this.platformFormModel.PlatformName="",this.platformFormModel.PlatformAbbreviation="",this.platformFormModel.OssRootPath="",this.platformFormModel.PlatformUrl="",this.platformFormModel.CABusinessKey="",this.platformFormModel.OrderNo=0,this.platformFormModel.LastUpdateUserId=t.Id,this.platformFormModel.LastUpdateUserName=t.UserName,this.platformFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.platformFormModel.DefaultPwd="",this.editPlatformModalTitle.value="新增 - 系统平台";const i=null==(e=this.platformGrid.value)?void 0:e.getDatas();this.platformFormItems[4].selectProp.datas=i.length>0?null==i?void 0:i.map((e=>({value:e.Id,text:e.PlatformAbbreviation,PlatformGroup:e.PlatformGroup}))):[],this.platformFormModel.PId=i.length>0?i[0].Id:0,this.platformFormModel.PlatformGroup=i.length>0?i[0].PlatformGroup:0,this.showEditPlatform.value=!0}}const Ke={style:{height:"550px","overflow-y":"auto"}};const Qe=f(We,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid"),n=t.resolveComponent("NvBox"),d=t.resolveComponent("NvComForm"),u=t.resolveComponent("Form"),h=t.resolveComponent("Button"),p=t.resolveComponent("Modal"),m=t.resolveComponent("GeneralConfiguration"),c=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(c,{gutter:8,class:"platform"},{default:t.withCtx((()=>[t.createVNode(n,{title:"系统平台"},{default:t.withCtx((()=>[t.createVNode(a,{ref:"platformGrid",option:e.platformGridOption},null,8,["option"])])),_:1}),t.createVNode(p,{modelValue:e.showEditPlatform,"onUpdate:modelValue":i[1]||(i[1]=t=>e.showEditPlatform=t),draggable:"",mask:!0,"mask-closable":!1,width:500,title:e.editPlatformModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[0]||(i[0]=t=>e.showEditPlatform=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(h,{type:"primary",loading:e.saveingPlatform,onClick:e.doSavePlatform},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ke,[t.createVNode(u,{ref:"refPlatformForm",model:e.platformFormModel,"label-width":120},{default:t.withCtx((()=>[t.createVNode(d,{formModel:e.platformFormModel,formItems:e.platformFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(p,{modelValue:e.isShowGeneralConfig,"onUpdate:modelValue":i[3]||(i[3]=t=>e.isShowGeneralConfig=t),fullscreen:"",title:e.generalConfigTitle},{footer:t.withCtx((()=>[t.createVNode(h,{type:"text",onClick:i[2]||(i[2]=t=>e.isShowGeneralConfig=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[e.isShowGeneralConfig?(t.openBlock(),t.createBlock(m,{key:0,platformInfo:e.platformInfo,configType:e.configType},null,8,["platformInfo","configType"])):t.createCommentVNode("",!0)])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-fbc0e7f2"]]),Ye={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},He=t.defineComponent({name:"Role",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:Ye,setup:(e,t)=>new je(e,t)});class je extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"roleApi",new i.RoleApi),h(this,"moduleApi",new i.ModuleApi),h(this,"roleModuleApi",new i.RoleModuleApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionRoleApi",new i.InstitutionRoleApi),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"webOrApp",t.ref(0)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doPlatformListSelect()}))})),h(this,"roleWidth",t.ref("calc(100% - 300px)")),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"RoleName",title:"角色名称",type:"Input"},{field:"RoleCode",title:"角色编码",type:"Input"},{field:"RoleStatus",title:"状态",type:"Radio",data:[{text:"启用",value:1},{text:"禁用",value:0}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddRole()}},{name:"importRole",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportRole()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ed",field:"RoleName",title:"角色名称",width:250},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"select",field:"RoleStatus",title:"角色状态",width:100,align:"center",defaultValue:1,select:{data:[{text:"启用",value:1},{text:"禁用",value:0}]},format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"启用",color:"green"}}[t.row.RoleStatus];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"select",field:"FrontEndVisible",title:"角色类型",width:120,align:"center",defaultValue:1,select:{data:[{text:"是",value:1},{text:"否",value:0}]},format:(e,t)=>{const i={0:{text:"前台不可见",color:"blue"},1:{text:"前台可见",color:"green"}}[t.row.FrontEndVisible];return e(s.Tag,{color:null==i?void 0:i.color},(()=>null==i?void 0:i.text))}},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",minWidth:200},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200},{colType:"ed",field:"WelcomeUrl",title:"欢迎页面",width:200},{title:"操作",width:200,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditRole(e)}},{name:"moduleRole",text:"模块权限",onclick:(e,t)=>{this.doShowRoleModule(e)}},{name:"delete",text:"删除",onclick:(e,t)=>{this.doDeleteRole(e)}}]}],event:{event_search:e=>{this.roleGrid.value.setPageIndex(1);const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value).orderBy(["OrderNo"]);this.utilities.isNull(e.RoleName)||t.like("RoleName",e.RoleName),this.utilities.isNull(e.RoleCode)||t.like("RoleCode",e.RoleCode),this.utilities.isNull(e.RoleStatus)||t.eq("RoleStatus",e.RoleStatus),this.roleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformListSelect",(()=>{const e=this.storageInfo.getUser();this.roleGrid.value.setGloablValue("PlatformId",this.platId.value),this.roleGrid.value.setGloablValue("LastUpdateUserId",e.Id),this.roleGrid.value.setGloablValue("LastUpdateUserName",e.UserName),this.roleGrid.value.setGloablValue("LastUpdateDate",(()=>this.utilities.getCurrentDate())),this.loadRoleGridData()})),h(this,"loadRoleGridData",(async()=>{const e=await this.institutionRoleApi.getEntities(o.QueryWrapper.create()),t=this.utilities.parseApiResult(e),i=[];for(let o of t)i.some((e=>e==o.RoleId))||i.push(o.RoleId);const s=o.QueryWrapper.create().eq("PlatformId",this.platId.value).orderBy(["OrderNo"]);i.length>0&&s.notIn("Id",i),this.roleGrid.value.loadDataByQuery(s)})),h(this,"doChangeRoleWidth",(e=>{this.roleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"refRoleForm",t.ref()),h(this,"saveingRole",t.ref(!1)),h(this,"showEditRole",t.ref(!1)),h(this,"editRoleModalTitle",t.ref("新增 - 角色")),h(this,"roleFormModel",t.reactive({Id:0,PlatformId:0,RoleName:"",RoleCode:"",RoleDesc:"",RoleStatus:1,FrontEndVisible:0,DefaultUrl:"",WelcomeUrl:"",OrderNo:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"roleFormItems",t.reactive([{model:"RoleName",label:"角色名称",prop:"RoleName",type:"Input",span:24,rules:[{required:!0,message:"角色名称不能为空",trigger:"blur"}]},{model:"RoleCode",label:"角色编码",prop:"RoleCode",type:"Input",span:24,rules:[{required:!0,message:"角色编码不能为空",trigger:"blur"}]},{model:"RoleDesc",label:"角色描述",prop:"RoleDesc",type:"Input",span:24,inputProp:{type:"textarea",rows:4}},{model:"RoleStatus",label:"角色状态",prop:"RoleStatus",type:"Radio",span:12,radioProp:{datas:[{text:"启用",value:1},{text:"禁用",value:0}],type:"button"}},{model:"FrontEndVisible",label:"角色类型",prop:"FrontEndVisible",type:"Radio",span:12,radioProp:{datas:[{text:"前台可见",value:1},{text:"前台不可见",value:0}],type:"button"}},{model:"DefaultUrl",label:"默认页面",prop:"DefaultUrl",type:"Input",span:24},{model:"WelcomeUrl",label:"欢迎页面",prop:"WelcomeUrl",type:"Input",span:24},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveRole",(async()=>{if(!(await this.refRoleForm.value.validate()))return;this.saveingRole.value=!0;let e=await this.roleApi.save(this.roleFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingRole.value=!1);this.message.success("保存成功!"),this.roleGrid.value.refreshData(),this.saveingRole.value=!1,this.showEditRole.value=!1})),h(this,"selectRole"),h(this,"saveRoleModuleing",t.ref(!1)),h(this,"showRoleModule",t.ref(!1)),h(this,"roleModuleTitle",t.ref("")),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row)}})},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0,width:260},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"Operates",title:"功能点权限",format:(e,t)=>{const i=this.utilities.isNull(t.row.Operates)?[]:JSON.parse(t.row.Operates);if(0==i.length)return"";const o=[],r=e(s.Checkbox,{label:"all","model-value":t.row.IsAllChk,"onUpdate:model-value":e=>{t.row.IsAllChk=e,t.row.RoleOperates=t.row.IsAllChk?o:[],this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>"全选")),l=e(s.Divider,{type:"vertical"}),a=[];for(const d of i)o.push(d.code),a.push(e(s.Checkbox,{label:d.code},(()=>d.name)));const n=e(s.CheckboxGroup,{"model-value":t.row.RoleOperates,"onUpdate:model-value":e=>{t.row.RoleOperates=e,this.setRoleModuleIsChange(t.row),e&&(t.row.IsChk=e,this.setRoleModuleIsChange(t.row),this.changeParentRoleModuleStatus(t.row))}},(()=>a));return e(s.Space,(()=>[r,l,n]))}}],event:{event_search:e=>{this.loadModuleGridData(e)}}})),h(this,"loadModuleGridData",(e=>{this.moduleGrid.value.loadData((async t=>{const i=o.QueryWrapper.create().allEq({PlatformId:this.platId.value,WebOrApp:this.webOrApp.value}).ne("ModuleStatus",0).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||i.like("ModuleName",e.ModuleName);let s=await this.moduleApi.getEntities(i),r=this.utilities.parseApiResult(s);const l=o.QueryWrapper.create().eq("RoleId",this.selectRole.Id);s=await this.roleModuleApi.getEntities(l);let a=this.utilities.parseApiResult(s);for(const e of r){const t=a.filter((t=>t.ModuleId==e.Id));if(t.length>0){const i=t[0];e.IsChk=!0,e.RoleModuleId=i.Id,e.RoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.OrgIsChk=!0,e.OrgRoleOperates=this.utilities.isNull(i.Operates)?[]:JSON.parse(i.Operates),e.IsChange=!1,e.IsAllChk=!1}else e.IsChk=!1,e.RoleModuleId=0,e.RoleOperates=[],e.OrgIsChk=!1,e.OrgRoleOperates=[],e.IsChange=!1,e.IsAllChk=!1}t.success(r)}))})),h(this,"doSaveRoleModule",(async()=>{const e=this.moduleGrid.value.getDatas().filter((e=>1==e.IsChange));if(0==e.length)return void this.message.warning("没有需要保存的数据");this.saveRoleModuleing.value=!0;const t=[],i=[],o=[];for(const r of e)0==r.RoleModuleId?t.push({Id:0,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):0!=r.RoleModuleId&&1==r.IsChk?i.push({Id:r.RoleModuleId,RoleId:this.selectRole.Id,ModuleId:r.Id,Operates:JSON.stringify(r.RoleOperates)}):o.push(r.RoleModuleId);const s=[...t,...i];s.length>0&&await this.roleModuleApi.saves(s),o.length>0&&await this.roleModuleApi.deleteByIds(o.join(",")),this.message.success("操作完成"),this.saveRoleModuleing.value=!1,this.showRoleModule.value=!1})),h(this,"showImportRole",t.ref(!1)),h(this,"saveingImportRole",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformAbbreviation:""},selectedId:0})),h(this,"originRoleGrid",t.ref()),h(this,"originRoleGridOption",t.reactive({api:this.roleApi,setting:{border:!1,searchConfig:{btnSpan:24,labelWidth:80,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ed",field:"RoleName",title:"角色名称",minWidth:160},{colType:"ed",field:"RoleCode",title:"角色编码",width:120,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述",width:200}]})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.loadOriginRoleGridData()})),h(this,"doImportRole",(async()=>{const e=this.originRoleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台角色");this.saveingImportRole.value=!0;let t=[];for(const s of e)t.push(s.Id);const i=await this.roleApi.importRoles(this.platId.value,t),o=this.utilities.parseApiResult(i);this.saveingImportRole.value=!1,o?(this.showImportRole.value=!1,this.roleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.useBusinessRole()}useBusinessRole(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}doDeleteRole(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 删除角色配置的模块权限。 <br/> 2. 删除用户关联该角色的索引。 <br/> 3. 删除该角色。 <br/> 确定要执行该操作吗?",onOk:async()=>{await this.roleModuleApi.deleteRoleModuleByRoleId(e.Id);const t=await this.roleApi.delete(e.Id);this.utilities.parseApiResult(t)?(this.message.success("删除成功!"),this.roleGrid.value.refreshData()):this.message.warning("操作异常, 请稍后重试!")}})}doEditRole(e){const t=this.storageInfo.getUser();this.roleFormModel.Id=e.Id,this.roleFormModel.PlatformId=e.PlatformId,this.roleFormModel.RoleName=e.RoleName,this.roleFormModel.RoleCode=e.RoleCode,this.roleFormModel.RoleDesc=e.RoleDesc,this.roleFormModel.RoleStatus=e.RoleStatus,this.roleFormModel.FrontEndVisible=e.FrontEndVisible,this.roleFormModel.DefaultUrl=e.DefaultUrl,this.roleFormModel.WelcomeUrl=e.WelcomeUrl,this.roleFormModel.OrderNo=e.OrderNo,this.roleFormModel.LastUpdateUserId=t.Id,this.roleFormModel.LastUpdateUserName=t.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value=`编辑 - ${e.RoleName}`,this.showEditRole.value=!0}doAddRole(){const e=this.storageInfo.getUser();this.roleFormModel.Id=0,this.roleFormModel.PlatformId=this.platId.value,this.roleFormModel.RoleName="",this.roleFormModel.RoleCode="",this.roleFormModel.RoleDesc="",this.roleFormModel.RoleStatus=1,this.roleFormModel.FrontEndVisible=0,this.roleFormModel.DefaultUrl="",this.roleFormModel.WelcomeUrl="",this.roleFormModel.OrderNo=0,this.roleFormModel.LastUpdateUserId=e.Id,this.roleFormModel.LastUpdateUserName=e.UserName,this.roleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editRoleModalTitle.value="新增 - 角色",this.showEditRole.value=!0}doShowRoleModule(e){this.selectRole=e,this.roleModuleTitle.value=`模块权限 - ${this.selectRole.RoleName}`,this.showRoleModule.value=!0,t.nextTick((()=>{this.loadModuleGridData({})}))}setRoleModuleIsChange(e){let t=!1;if(e.OrgIsChk!=e.IsChk&&(t=!0),e.OrgRoleOperates.length!=e.RoleOperates.length)t=!0;else{for(const i of e.OrgRoleOperates)if(0==e.RoleOperates.filter((e=>e==i)).length){t=!0;break}for(const i of e.RoleOperates)if(0==e.OrgRoleOperates.filter((e=>e==i)).length){t=!0;break}}e.IsChange=t}changeParentRoleModuleStatus(e){const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e.PId&&t.IsChk==!e.IsChk));for(const o of i)o.IsChk=0!=e.IsChk||t.filter((e=>e.PId==o.Id&&1==e.IsChk)).length>0,this.setRoleModuleIsChange(o),this.changeParentRoleModuleStatus(o)}doShowImportRole(){this.showImportRole.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.platId.value).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformAbbreviation:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginRoleGridData()}))}loadOriginRoleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("RoleStatus",1).orderBy(["OrderNo"]);this.originRoleGrid.value.loadDataByQuery(e)}}const ze={style:{height:"650px","overflow-y":"auto",position:"relative"}},Ze={class:"import-role",style:{height:"610px",position:"relative"}},$e={style:{width:"100%",height:"100%"}},Je={style:{height:"530px","overflow-y":"auto"}};const Xe=f(He,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("Radio"),c=t.resolveComponent("RadioGroup"),f=t.resolveComponent("Button"),g=t.resolveComponent("Modal"),I=t.resolveComponent("NvComForm"),v=t.resolveComponent("Form"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"role"},{default:t.withCtx((()=>[t.createVNode(p,{width:"100%",title:"角色列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"roleGrid",option:e.roleGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformListSelect,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1}),t.createVNode(g,{modelValue:e.showRoleModule,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showRoleModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"模块权限",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[2]||(i[2]=t=>e.showRoleModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveRoleModuleing,onClick:e.doSaveRoleModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ze,[t.createVNode(h,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(c,{modelValue:e.webOrApp,"onUpdate:modelValue":i[1]||(i[1]=t=>e.webOrApp=t),type:"button",onOnChange:e.loadModuleGridData},{default:t.withCtx((()=>[t.createVNode(m,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(m,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showImportRole,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportRole=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveingImportRole,onClick:e.doImportRole},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ze,[t.createElementVNode("div",$e,[t.createVNode(h,{ref:"originRoleGrid",option:e.originRoleGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[4]||(i[4]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(a,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportRole]])])])])),_:1},8,["modelValue"]),t.createVNode(g,{modelValue:e.showEditRole,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showEditRole=t),draggable:"",mask:!0,"mask-closable":!1,width:620,title:e.editRoleModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[7]||(i[7]=t=>e.showEditRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(f,{type:"primary",loading:e.saveingRole,onClick:e.doSaveRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Je,[t.createVNode(v,{ref:"refRoleForm",model:e.roleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(I,{formModel:e.roleFormModel,formItems:e.roleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-414834fa"]]),et={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},tt=t.defineComponent({name:"Enterprise",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:et,setup:(e,t)=>new it(e,t)});class it extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"provinceApi",new a.ProvinceApi),h(this,"cityApi",new a.CityApi),h(this,"areaApi",new a.AreaApi),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doPlatformChange()}))})),h(this,"provinces",[]),h(this,"cities",[]),h(this,"areas",[]),h(this,"refSelectPlatform",t.ref()),h(this,"onlyView",t.ref(!1)),h(this,"enterpriseGrid",t.ref()),h(this,"enterpriseGridOption",t.reactive({api:this.enterpriseApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:15},searchOptions:[{field:"EnterpriseName",title:"企业名称",type:"Input",span:6}],toolbars:[{name:"add",onclick:()=>{this.doAddEnterprise()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:70,align:"center"},{colType:"ed",field:"EnterpriseName",title:"企业名称",minWidth:300},{colType:"ed",field:"EnterpriseCode",title:"企业代码",align:"center",minWidth:160},{colType:"ro",field:"Province",title:"省 市 区",align:"center",width:220,format:(e,t)=>{const i=t.row;let o=[],s=this.provinces.filter((e=>e.ProvinceCode==i.Province)),r=this.cities.filter((e=>e.CityCode==i.City)),l=this.areas.filter((e=>e.AreaCode==i.Area));return s.length>0&&o.push(s[0].ProvinceName),r.length>0&&o.push(r[0].CityName),l.length>0&&o.push(l[0].AreaName),e("span",o.join("-"))}},{colType:"ro",field:"Contact",title:"联系人",align:"center",width:120},{colType:"ro",field:"TelPhone",title:"联系电话",align:"center",width:140},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",align:"center",width:140},{colType:"ro",field:"LastUpdateTime",title:"最后修改时间",align:"center",width:160},{title:"操作",width:180,rowButtons:[{name:"view",text:"预览",onclick:(e,t)=>{this.doViewEnterprise(e)}},{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditEnterprise(e)}},{name:"delete",text:"删除"}]}],event:{event_search:e=>{this.enterpriseGrid.value.setPageIndex(1),this.loadEnterpriseGridData(e)}}})),h(this,"doPlatformChange",(()=>{this.loadEnterpriseGridData({})})),h(this,"saveingEnterprise",t.ref(!1)),h(this,"showEditEnterprise",t.ref(!1)),h(this,"editEnterpriseTitle",t.ref("新增 - 企业")),h(this,"enterpriseFormModel",t.reactive({Id:0,PlatformId:0,EnterpriseName:"",EnterpriseCode:"",LegalPerson:"",RegisteredCapital:0,Province:"",City:"",Area:"",Address:"",Contact:"",TelPhone:"",LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateTime:"",PostalCode:"",Fax:"",Email:""})),h(this,"enterpriseFormItems",t.reactive([{model:"",label:"基本信息",span:24,children:[{model:"EnterpriseName",label:"企业名称",type:"Input",prop:"EnterpriseName",span:12,inputProp:{placeholder:"请输入企业名称"}},{model:"EnterpriseCode",label:"企业代码",type:"Input",prop:"EnterpriseCode",span:12,inputProp:{placeholder:"请输入企业代码"}},{model:"LegalPerson",label:"企业法人",type:"Input",span:12,inputProp:{placeholder:"请输入企业法人"}},{model:"RegisteredCapital",label:"注册资金",type:"Input",span:12,inputProp:{placeholder:"请输入注册资金",append:"万元"}}]},{model:"",label:"联系信息",span:24,children:[{model:"Province",label:"省份",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setCityDatas(e),this.setAreaDatas("")},transfer:!0,filterable:!0}},{model:"City",label:"城市",type:"Select",span:8,selectProp:{datas:[],onChange:(e,t)=>{this.setAreaDatas(e)},transfer:!0,filterable:!0}},{model:"Area",label:"区县",type:"Select",span:8,selectProp:{datas:[],transfer:!0,filterable:!0}},{model:"Address",label:"地址",type:"Input",span:24,inputProp:{rows:4,type:"textarea",placeholder:"请输入联系地址"}},{model:"Contact",label:"联系人",type:"Input",span:12,inputProp:{placeholder:"请输入联系人"}},{model:"TelPhone",label:"联系电话",type:"Input",span:12,inputProp:{placeholder:"请输入联系电话"}},{model:"PostalCode",label:"邮政编码",type:"Input",span:12,inputProp:{placeholder:"请输入邮政编码"}},{model:"Email",label:"Email",type:"Input",span:12,inputProp:{placeholder:"请输入Email地址"}},{model:"Fax",label:"传真",type:"Input",span:12,inputProp:{placeholder:"请输入传真"}}]}])),h(this,"doSaveEnterprise",(async()=>{this.saveingEnterprise.value=!0;let e=await this.enterpriseApi.save(this.enterpriseFormModel);if(this.utilities.parseApiResult(e)<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingEnterprise.value=!1);this.message.success("保存成功!"),this.enterpriseGrid.value.refreshData(),this.saveingEnterprise.value=!1,this.showEditEnterprise.value=!1})),this.props=e,this.ctx=s,this.useArea(),this.getPlatData()}async useArea(){let e=await this.provinceApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.provinces=this.utilities.parseApiResult(e),e=await this.cityApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.cities=this.utilities.parseApiResult(e),e=await this.areaApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.areas=this.utilities.parseApiResult(e),this.setProvinceDatas(),this.refSelectPlatform.value.loadPlatforms()}loadEnterpriseGridData(e){const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value);for(const i of Object.keys(e)){const o=e[i];this.utilities.isNull(o)||t.like(i,o)}this.enterpriseGrid.value.loadDataByQuery(t)}setProvinceDatas(){this.enterpriseFormItems[1].children[0].selectProp.datas=this.provinces.map((e=>({text:e.ProvinceName,value:e.ProvinceCode})))}setCityDatas(e){this.enterpriseFormItems[1].children[1].selectProp.datas=this.cities.filter((t=>t.ProvinceCode==e)).map((e=>({text:e.CityName,value:e.CityCode})))}setAreaDatas(e){this.enterpriseFormItems[1].children[2].selectProp.datas=this.areas.filter((t=>t.CityCode==e)).map((e=>({text:e.AreaName,value:e.AreaCode})))}doAddEnterprise(){const e=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=0,this.enterpriseFormModel.PlatformId=this.platId.value,this.enterpriseFormModel.EnterpriseName="",this.enterpriseFormModel.EnterpriseCode="",this.enterpriseFormModel.LegalPerson="",this.enterpriseFormModel.RegisteredCapital=0,this.enterpriseFormModel.Province="",this.enterpriseFormModel.City="",this.enterpriseFormModel.Area="",this.enterpriseFormModel.Address="",this.enterpriseFormModel.Contact="",this.enterpriseFormModel.TelPhone="",this.enterpriseFormModel.PostalCode="",this.enterpriseFormModel.Fax="",this.enterpriseFormModel.Email="",this.enterpriseFormModel.LastUpdateUserId=e.Id,this.enterpriseFormModel.LastUpdateUserName=e.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(""),this.setAreaDatas(""),this.editEnterpriseTitle.value="新增 - 企业",this.showEditEnterprise.value=!0}doEditEnterprise(e){const t=this.storageInfo.getUser();this.onlyView.value=!1,this.enterpriseFormModel.Id=e.Id,this.enterpriseFormModel.PlatformId=e.InstitutionId,this.enterpriseFormModel.EnterpriseName=e.EnterpriseName,this.enterpriseFormModel.EnterpriseCode=e.EnterpriseCode,this.enterpriseFormModel.LegalPerson=e.LegalPerson,this.enterpriseFormModel.RegisteredCapital=e.RegisteredCapital,this.enterpriseFormModel.Province=e.Province,this.enterpriseFormModel.City=e.City,this.enterpriseFormModel.Area=e.Area,this.enterpriseFormModel.Address=e.Address,this.enterpriseFormModel.Contact=e.Contact,this.enterpriseFormModel.TelPhone=e.TelPhone,this.enterpriseFormModel.PostalCode=e.PostalCode,this.enterpriseFormModel.Fax=e.Fax,this.enterpriseFormModel.Email=e.Email,this.enterpriseFormModel.LastUpdateUserId=t.Id,this.enterpriseFormModel.LastUpdateUserName=t.UserName,this.enterpriseFormModel.LastUpdateTime=this.utilities.getCurrentDate(),this.setCityDatas(e.Province),this.setAreaDatas(e.City),this.editEnterpriseTitle.value="编辑 - "+e.EnterpriseName,this.showEditEnterprise.value=!0}doViewEnterprise(e){this.doEditEnterprise(e),this.onlyView.value=!0,this.editEnterpriseTitle.value="预览 - "+e.EnterpriseName}}const ot={style:{height:"650px","overflow-y":"auto"}};const st=f(tt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("NvComForm"),c=t.resolveComponent("Form"),f=t.resolveComponent("Button"),g=t.resolveComponent("Modal"),I=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(I,{gutter:8,class:""},{default:t.withCtx((()=>[t.createVNode(p,{width:"100%",title:"企业列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"enterpriseGrid",option:e.enterpriseGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformChange,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1}),t.createVNode(g,{modelValue:e.showEditEnterprise,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditEnterprise=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editEnterpriseTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(f,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditEnterprise=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),e.onlyView?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(f,{key:0,type:"primary",loading:e.saveingEnterprise,onClick:e.doSaveEnterprise},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"]))])),default:t.withCtx((()=>[t.createElementVNode("div",ot,[t.createVNode(c,{model:e.enterpriseFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(m,{ref:"enterpriseComForm",onlyView:e.onlyView,formModel:e.enterpriseFormModel,formItems:e.enterpriseFormItems},null,8,["onlyView","formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"])])),_:1})}],["__scopeId","data-v-57711b94"]]),rt={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},lt=t.defineComponent({name:"Institution",components:{SelectPlatform:r.SelectPlatform},emits:[""],props:rt,setup:(e,t)=>new at(e,t)});class at extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"institutionTypeApi",new i.InstitutionTypeApi),h(this,"institutioninforApi",new i.InstitutioninforApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"roleApi",new i.RoleApi),h(this,"enterpriseApi",new i.EnterpriseApi),h(this,"platId",t.ref(0)),h(this,"selectPlat",t.ref({})),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id,t.nextTick((()=>{this.doPlatformListSelect(this.platId.value)})))})),h(this,"institutionTypes",t.ref([])),h(this,"enterprises",[]),h(this,"institutionWidth",t.ref("calc(100% - 45px)")),h(this,"institutionGrid",t.ref()),h(this,"institutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:6,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input"},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input"},{field:"InstitutionCode",title:"机构编码",type:"Input"}],toolbars:[{name:"add",onclick:()=>{this.doAddInstitution()}},{name:"importInstitution",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportInstitution()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"Id",title:"ID",width:80,align:"center"},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:250},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",minWidth:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:140},{colType:"ro",field:"EnterpriseId",title:"所属企业",align:"center",width:220,format:(e,t)=>{const i=t.row.EnterpriseId;if(this.utilities.isNull(i))return"";const o=this.enterprises.filter((e=>e.Id==i));return 0==o.length?`${i}`:o[0].EnterpriseName}},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}},{colType:"num",field:"OrderNo",title:"排序号",width:90,align:"center"},{title:"操作",width:240,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditInstitution(e)}},{name:"roles",text:"绑定角色",onclick:(e,t)=>{this.doShowBindRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doRemoveInstitution(e)}},{name:"import",text:"->",onclick:(e,t)=>{this.doAddNode(e)}}]}],event:{event_search:e=>{this.loadInstitutionGridData(this.platId.value,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doPlatformListSelect",(async e=>{const t=this.platData.value.find((t=>t.Id==e));this.selectPlat.value=t,await this.loadEnterprises(),this.loadInstitutionGridData(this.platId.value,"","",""),this.loadInstitutionTree()})),h(this,"doWidthChange",(e=>{this.institutionWidth.value=e?"calc(100% - 350px)":"calc(100% - 45px)"})),h(this,"saveingInstitution",t.ref(!1)),h(this,"showEditInstitution",t.ref(!1)),h(this,"editInstitutionTitle",t.ref("新增 - 机构")),h(this,"institutionFormModel",t.reactive({Id:0,EnterpriseId:0,InstitutionPlatformId:0,InstitutionCode:"",InstitutionName:"",InstitutionAbbreviation:"",InstitutionTypeCode:"",OrderNo:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"institutionFormItems",t.reactive([{model:"InstitutionName",label:"机构名称",prop:"InstitutionName",type:"Input",span:24,inputProp:{placeholder:"请输入机构名称"}},{model:"InstitutionAbbreviation",label:"机构简称",prop:"InstitutionAbbreviation",type:"Input",span:24,inputProp:{placeholder:"请输入机构简称"}},{model:"InstitutionTypeCode",label:"机构类型",prop:"InstitutionTypeCode",type:"Select",span:24,selectProp:{datas:[],transfer:!0,onChange:(e,t)=>{this.utilities.isNull(e)||(this.institutionFormModel.InstitutionCode=e+"-")}}},{model:"EnterpriseId",label:"所属企业",prop:"EnterpriseId",type:"Select",span:24,selectProp:{datas:[],transfer:!0}},{model:"InstitutionCode",label:"机构编码",prop:"InstitutionCode",type:"Input",span:24,inputProp:{placeholder:"请输入机构编码"}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber",span:24}])),h(this,"doSaveInstitution",(async()=>{this.saveingInstitution.value=!0;let e=await this.institutioninforApi.save({Id:this.institutionFormModel.Id,EnterpriseId:this.institutionFormModel.EnterpriseId,InstitutionName:this.institutionFormModel.InstitutionName,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingInstitution.value=!1);await this.institutionPlatformApi.save({Id:this.institutionFormModel.InstitutionPlatformId,InstitutionId:this.institutionFormModel.Id<=0?t:this.institutionFormModel.Id,PlatformId:this.platId.value,InstitutionCode:this.institutionFormModel.InstitutionCode,InstitutionAbbreviation:this.institutionFormModel.InstitutionAbbreviation,InstitutionTypeCode:this.institutionFormModel.InstitutionTypeCode,OrderNo:this.institutionFormModel.OrderNo,LastUpdateUserId:this.institutionFormModel.LastUpdateUserId,LastUpdateUserName:this.institutionFormModel.LastUpdateUserName,LastUpdateDate:this.institutionFormModel.LastUpdateDate}),this.message.success("保存成功!"),this.institutionGrid.value.refreshData(),this.saveingInstitution.value=!1,this.showEditInstitution.value=!1})),h(this,"showImportInstitution",t.ref(!1)),h(this,"saveingImportInstitution",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originInstitutionGrid",t.ref()),h(this,"originInstitutionGridOption",t.reactive({api:this.institutioninforApi,setting:{searchConfig:{btnSpan:8,labelWidth:120,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"InstitutionName",title:"机构名称",type:"Input",span:12},{field:"InstitutionAbbreviation",title:"机构简称",type:"Input",span:12},{field:"InstitutionCode",title:"机构编码",type:"Input",span:12}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"Id",title:"ID",width:80},{colType:"ed",field:"InstitutionName",title:"机构名称",minWidth:200},{colType:"ed",field:"InstitutionAbbreviation",title:"机构简称",width:200},{colType:"ro",field:"InstitutionCode",title:"机构编码",align:"center",width:180},{colType:"ed",field:"InstitutionTypeCode",title:"机构类型",width:160,align:"center",format:(e,t)=>{const i=t.row.InstitutionTypeCode,o=this.institutionTypes.value.filter((e=>e.Code==i));return 0==o.length?i:o[0].Name}}],event:{event_search:e=>{this.loadOriginInstitutionGridData(this.platId.value,e.InstitutionCode,e.InstitutionName,e.InstitutionAbbreviation)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")})),h(this,"doImportInstitution",(async()=>{const e=this.originInstitutionGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台机构信息");this.saveingImportInstitution.value=!0;let t=[];const i=this.storageInfo.getUser();for(const r of e)t.push({InstitutionId:r.Id,PlatformId:this.platId.value,InstitutionCode:r.InstitutionCode,InstitutionAbbreviation:r.InstitutionAbbreviation,InstitutionTypeCode:r.InstitutionTypeCode,OrderNo:r.OrderNo,LastUpdateUserId:i.Id,LastUpdateUserName:i.UserName,LastUpdateDate:this.utilities.getCurrentDate()});const o=await this.institutionPlatformApi.saves(t),s=this.utilities.parseApiResult(o);this.saveingImportInstitution.value=!1,s?(this.showImportInstitution.value=!1,this.institutionGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),h(this,"selectedInstitutionTree"),h(this,"insertRecords",[]),h(this,"institutionTree",t.ref([])),h(this,"saveingInstitutionTree",t.ref(!1)),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"renderContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",width:"100%",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))]),e("span",{style:{display:"inline-block",float:"right",marginRight:"8px"}},[e(s.Icon,{type:"md-trash",style:{fontSize:"18px",color:"rgb(225, 76, 23)"},onClick:()=>{this.doDeleteNode(t,i,o)}})])]))),h(this,"doTreeSelectChange",(e=>{e.length>0?this.selectedInstitutionTree=e[0]:this.selectedInstitutionTree=void 0})),h(this,"loadInstitutionTree",(async()=>{this.insertRecords=[],this.selectedInstitutionTree=void 0,this.loadingInstitutionTree.value=!0;const e=await this.institutionTreeApi.getInstitutionTrees(this.platId.value),t=this.utilities.parseApiResult(e);this.loadingInstitutionTree.value=!1;const i=e=>{const o=t.filter((t=>t.PId==e));for(const t of o){t.title=t.InstitutionAbbreviation,t.expand=!0;const e=i(t.Id);e.length>0&&(t.children=e)}return o};this.institutionTree.value=i(0)})),h(this,"doSaveInstitutionTree",(async()=>{if(0==this.insertRecords.length)return void this.message.warning("没有需要保存的数据!");this.saveingInstitutionTree.value=!0;let e=await this.institutionTreeApi.saveInstitutionTrees(this.insertRecords),t=this.utilities.parseApiResult(e);this.saveingInstitutionTree.value=!1,t>0?(this.message.success("保存成功"),this.loadInstitutionTree()):this.message.error("操作异常, 请稍后重试!")})),h(this,"selectInstitution"),h(this,"showBindRole",t.ref(!1)),h(this,"saveingBindRole",t.ref(!1)),h(this,"roleGrid",t.ref()),h(this,"roleGridOption",t.reactive({api:this.roleApi,setting:{border:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称",width:200},{colType:"ed",field:"RoleCode",title:"角色编码",width:180,align:"center"},{colType:"ed",field:"RoleDesc",title:"角色描述"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveBindRole",(async()=>{const e=this.roleGrid.value.getDatas().filter((e=>1==e.IsChk)).map((e=>e.Id)).join(",");this.saveingBindRole.value=!0;const t=await this.institutionPlatformApi.save({Id:this.selectInstitution.InstitutionPlatformId,RoleIds:e}),i=this.utilities.parseApiResult(t);this.saveingBindRole.value=!1,i>0?(this.message.success("保存成功"),this.showBindRole.value=!1,this.institutionGrid.value.refreshData()):this.message.error("保存失败,稍后重试!")})),this.props=e,this.ctx=r,this.useBusinessInstitutionType(),this.useBusinessInstitution()}useBusinessInstitutionType(){t.onMounted((()=>{})),t.onUnmounted((()=>{})),this.getInstitutionTypes()}async getInstitutionTypes(){const e=await this.institutionTypeApi.getEntities(o.QueryWrapper.create().eq("1",1).orderBy(["OrderNo"]));this.institutionTypes.value=this.utilities.parseApiResult(e),this.setInstitutionTypeCodeDatas()}async loadEnterprises(){const e=await this.enterpriseApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.enterprises=this.utilities.parseApiResult(e),this.setEnterpriseDatas()}useBusinessInstitution(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}loadInstitutionGridData(e,t,i,o){this.institutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}async doRemoveInstitution(e){this.modal.confirm({title:"提示",content:"该操作将执行以下步骤 <br/> 1. 移除平台与机构的关联。 <br/> 2. 如果机构不存在于其他平台的关联,则会删除该机构。 <br/> 3. 移除该机构对应的机构树。 <br/> 确定要执行该操作吗?",onOk:async()=>{let t=await this.institutionPlatformApi.deleteByInsIdAndPlatformId(e.Id,this.platId.value),i=this.utilities.parseApiResult(t);i<=0?this.message.error("操作失败, 请稍后重试!"):(t=await this.institutionPlatformApi.getCount(o.QueryWrapper.create().eq("InstitutionId",e.Id)),i=this.utilities.parseApiResult(t),0==i&&(t=await this.institutioninforApi.delete(e.Id),i=this.utilities.parseApiResult(t)),t=await this.institutionTreeApi.deleteInstitutionTreeByInstitutionIdAndPlatformId(e.Id,this.platId.value),i=this.utilities.parseApiResult(t),this.message.success("操作成功"),this.institutionGrid.value.refreshData(),i>0&&this.loadInstitutionTree())}})}setInstitutionTypeCodeDatas(){const e=[];for(const t of this.institutionTypes.value)e.push({text:t.Name,value:t.Code});this.institutionFormItems[2].selectProp.datas=e}setEnterpriseDatas(){const e=[];let t=[];t=0!==this.selectPlat.PId?this.platData.value.filter((e=>e.Id==this.selectPlat.value.PId||this.selectPlat.value.Id==e.Id)):this.platData.value.filter((e=>e.Id==this.selectPlat.value.Id));const i=this.enterprises.filter((e=>t.some((t=>t.Id==e.PlatformId))));for(const o of i)e.push({text:o.EnterpriseName,value:o.Id});this.institutionFormItems[3].selectProp.datas=e}doEditInstitution(e){const t=this.storageInfo.getUser();this.institutionFormModel.Id=e.Id,this.institutionFormModel.EnterpriseId=e.EnterpriseId,this.institutionFormModel.InstitutionPlatformId=e.InstitutionPlatformId,this.institutionFormModel.InstitutionCode=e.InstitutionCode,this.institutionFormModel.InstitutionName=e.InstitutionName,this.institutionFormModel.InstitutionAbbreviation=e.InstitutionAbbreviation,this.institutionFormModel.InstitutionTypeCode=e.InstitutionTypeCode,this.institutionFormModel.OrderNo=e.OrderNo,this.institutionFormModel.LastUpdateUserId=t.Id,this.institutionFormModel.LastUpdateUserName=t.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="编辑 - "+e.InstitutionName,this.showEditInstitution.value=!0}doAddInstitution(){const e=this.storageInfo.getUser();this.institutionFormModel.Id=0,this.institutionFormModel.EnterpriseId=0,this.institutionFormModel.InstitutionPlatformId=0,this.institutionFormModel.InstitutionCode="",this.institutionFormModel.InstitutionName="",this.institutionFormModel.InstitutionAbbreviation="",this.institutionFormModel.InstitutionTypeCode="",this.institutionFormModel.OrderNo=1,this.institutionFormModel.LastUpdateUserId=e.Id,this.institutionFormModel.LastUpdateUserName=e.UserName,this.institutionFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editInstitutionTitle.value="新增 - 机构",this.showEditInstitution.value=!0}doShowImportInstitution(){this.showImportInstitution.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.platId.value).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginInstitutionGridData(this.originPlatform.selectedId,"","","")}))}loadOriginInstitutionGridData(e,t,i,o){this.originInstitutionGrid.value.loadData((async s=>{const r=await this.institutioninforApi.getInstitutioninfors(e,t,i,o),l=this.utilities.parseApiResult(r);s.success(l)}))}doAddNode(e){if(this.utilities.isNull(this.selectedInstitutionTree)){const t={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:0,PId:0,NodeLevel:1,ParentPath:"/",FakeId:this.utilities.getUniqueCode(),FakePId:null,PlatformId:this.platId.value,InstitutionId:e.Id,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};this.institutionTree.value.push(t),this.insertRecords.push(t)}else{this.utilities.isNull(this.selectedInstitutionTree.children)&&(this.selectedInstitutionTree.children=[]);const t=this.selectedInstitutionTree,i={Id:-1*(Date.now()-parseInt((Date.now()+"").substring(0,4)+"000000000")),RootId:t.RootId,PId:t.Id,NodeLevel:t.NodeLevel+1,ParentPath:t.ParentPath+t.Id+"/",FakeId:this.utilities.getUniqueCode(),FakePId:t.Id>0?null:t.FakeId,InstitutionId:e.Id,PlatformId:this.platId.value,OrderNo:e.OrderNo,InstitutionCode:e.InstitutionCode,InstitutionName:e.InstitutionName,InstitutionAbbreviation:e.InstitutionAbbreviation,InstitutionTypeCode:e.InstitutionTypeCode,title:e.InstitutionAbbreviation,expand:!0};t.children.push(i),this.insertRecords.push(i)}}doDeleteNode(e,t,i){this.modal.confirm({title:"提示",content:i.Id>0?"该操作将执行以下步骤 <br/> 1. 将该节点的子节点移动到该节点的父节点下 <br/> 2. 删除该节点 <br/> 确定要执行该操作吗?":"确定要移除该节点及其子节点吗?",onOk:async()=>{if(i.Id>0){const e=await this.institutionTreeApi.deleteInstitutionTree(i.Id);this.utilities.parseApiResult(e)>0?(this.message.success("操作成功"),this.loadInstitutionTree()):this.message.error("操作失败, 请稍后重试!")}else{const o=e.find((e=>e===t)).parent;if(this.utilities.isNull(o)){const e=this.institutionTree.value.indexOf(i);this.institutionTree.value.splice(e,1)}else{const t=e.find((e=>e.nodeKey===o)).node,s=t.children.indexOf(i);t.children.splice(s,1)}const s=e=>{for(const t of e){const e=this.insertRecords.findIndex((e=>e.FakeId==i.FakeId));this.insertRecords.splice(e,1),!this.utilities.isNull(t.children)&&t.children.length>0&&s(t.children)}};s([i])}}})}doShowBindRole(e){this.selectInstitution=e,this.showBindRole.value=!0,this.loadBindRole()}loadBindRole(){this.roleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.platId.value).eq("RoleStatus",1).orderBy(["OrderNo"]),i=await this.roleApi.getEntities(t),s=this.utilities.parseApiResult(i),r=this.selectInstitution.RoleIds,l=this.utilities.isNull(r)?[]:r.split(",");for(const o of s)o.IsChk=-1!=l.findIndex((e=>e==o.Id));e.success(s)}))}}const nt={style:{width:"100%",height:"100%",position:"relative"}},dt={style:{height:"500px","overflow-y":"auto"}},ut={class:"import-institution",style:{height:"600px","overflow-y":"auto",position:"relative"}},ht={style:{width:"100%",height:"100%"}},pt={style:{height:"calc(100%)"}},mt={style:{height:"610px","overflow-y":"auto",position:"relative"}};const ct=f(lt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("NvGrid"),p=t.resolveComponent("NvBox"),m=t.resolveComponent("Tree"),c=t.resolveComponent("Button"),f=t.resolveComponent("Space"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),y=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(y,{gutter:8,class:"institution"},{default:t.withCtx((()=>[t.createVNode(p,{width:e.institutionWidth,title:"机构列表"},{default:t.withCtx((()=>[t.createVNode(h,{ref:"institutionGrid",option:e.institutionGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformListSelect,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])])),_:1},8,["option"])])),_:1},8,["width"]),t.createVNode(p,{width:"350px",title:"组织机构树",showArrow:!0,expand:!1,onChange:e.doWidthChange},{footer:t.withCtx((()=>[t.createVNode(f,null,{default:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:e.loadInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"]),t.createVNode(c,{type:"primary",loading:e.saveingInstitutionTree,onClick:e.doSaveInstitutionTree},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",nt,[t.createVNode(m,{data:e.institutionTree,render:e.renderContent,class:"tree-render",onOnSelectChange:e.doTreeSelectChange},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("正在保存中")])),_:1},512),[[t.vShow,e.saveingInstitutionTree]]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(v,{modelValue:e.showEditInstitution,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:450,title:e.editInstitutionTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingInstitution,onClick:e.doSaveInstitution},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",dt,[t.createVNode(I,{model:e.institutionFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(g,{ref:"institutionComForm",formModel:e.institutionFormModel,formItems:e.institutionFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showImportInstitution,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImportInstitution=t),draggable:"",mask:!0,"mask-closable":!1,width:1200,title:"引入机构",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[4]||(i[4]=t=>e.showImportInstitution=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingImportInstitution,onClick:e.doImportInstitution},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",ut,[t.createElementVNode("div",ht,[t.createElementVNode("div",pt,[t.createVNode(h,{ref:"originInstitutionGrid",option:e.originInstitutionGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[3]||(i[3]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((i,o)=>(t.openBlock(),t.createBlock(a,{key:e.originPlatform.selectedId+""+o,value:i.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(i.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportInstitution]])])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showBindRole,"onUpdate:modelValue":i[7]||(i[7]=t=>e.showBindRole=t),draggable:"",mask:!0,"mask-closable":!1,width:900,title:"绑定角色",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(c,{type:"text",onClick:i[6]||(i[6]=t=>e.showBindRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(c,{type:"primary",loading:e.saveingBindRole,onClick:e.doSaveBindRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",mt,[t.createVNode(h,{ref:"roleGrid",option:e.roleGridOption},null,8,["option"]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingBindRole]])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-ed65a91d"]]),ft=t.defineComponent({name:"LoginLog",components:{},emits:[""],props:{},setup:(e,t)=>new gt(e,t)});class gt extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"loginLogApi",new i.LoginLogApi),h(this,"platformId",0),h(this,"userId",0),h(this,"loginLogGrid",t.ref()),h(this,"loginLogGridOption",t.reactive({api:this.loginLogApi,setting:{border:!0,searchConfig:{btnSpan:12,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:10},searchOptions:[{field:"LoginDate",title:"登录日期",type:"DatePicker",span:12},{field:"IPAddress",title:"登录IP",type:"Input",span:12}],toolbars:[{name:"refresh",type:"primary"}],columns:[{colType:"seq"},{colType:"ro",field:"LoginType",title:"登录方式",align:"center"},{colType:"ro",field:"LoginDate",title:"登录日期",align:"center",format:(e,t)=>{const i=t.row.LoginDate;return this.utilities.isNull(i)?"":i}},{colType:"ro",field:"IPAddress",title:"登录IP",align:"center"}],event:{event_search:e=>{this.loadLoginLog(this.platformId,this.userId,e)}}})),h(this,"loadLoginLog",((e,t,i={})=>{this.platformId=e,this.userId=t;const s=o.QueryWrapper.create();s.eq("PlatformId",this.platformId).eq("UserId",this.userId).orderBy(["Id"],!1),this.utilities.isNull(i.IPAddress)||s.like("IPAddress",i.IPAddress);const r=this.utilities.dateHelper.format(i.LoginDate,"YYYY-MM-DD");this.utilities.isNull(i.LoginDate)||s.between("LoginDate",`${r} 00:00:00`,`${r} 23:59:59`),this.loginLogGrid.value.loadDataByQuery(s)})),this.props=e,this.ctx=s}}const It={class:"loginLog"};const vt=f(ft,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("NvGrid");return t.openBlock(),t.createElementBlock("div",It,[t.createVNode(a,{ref:"loginLogGrid",option:e.loginLogGridOption},null,8,["option"])])}],["__scopeId","data-v-a0d5af5b"]]),yt={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},wt=t.defineComponent({name:"Userinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:vt,BaseLogin:r.BaseLogin},emits:[""],props:yt,setup:(e,t)=>new Ct(e,t)});class Ct extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:13},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}},{name:"import",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:180,rowButtons:[{name:"login",text:"登录",onclick:(e,t)=>{this.devOpsLogin(e)}},{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountType",label:"账号类型",type:"Radio",radioProp:{type:"button","button-style":"solid",datas:[{text:"用户账号",value:0},{text:"内部账号",value:1}]}},{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"姓名不能为空",trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,6,7,8,9]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=1,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.deleteUser(e.UserId,e.InstitutionUserId);this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}doShowImportUser(){this.showImportUser.value=!0,t.nextTick((()=>{this.loadImportUserGrid({})}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}}const Nt=e=>(t.pushScopeId("data-v-d910e362"),e=e(),t.popScopeId(),e),Mt={class:"instree-search"},xt={class:"instree-list"},Pt={style:{height:"600px","overflow-y":"auto"}},Ut=Nt((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),At={style:{height:"600px","overflow-y":"auto"}},Tt=Nt((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),bt={style:{height:"650px","overflow-y":"auto"}},Ft=Nt((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选需要引入的用户!",-1))),St={style:{height:"650px","overflow-y":"auto"}},Rt={style:{display:"none"}},Vt={style:{height:"400px","overflow-y":"auto"}},kt=["src"],Dt=["src"];const Et=f(wt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvGrid"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),y=t.resolveComponent("LoginLog"),w=t.resolveComponent("BaseLogin"),C=t.resolveComponent("FormItem"),N=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(N,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Mt,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",xt,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(c,{width:e.userBoxWidth,title:"用户列表1"},{default:t.withCtx((()=>[t.createVNode(f,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(v,{modelValue:e.showEditUser,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Pt,[t.createVNode(I,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),Ut])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showUserRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",At,[t.createVNode(f,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[Tt])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showImportUser,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportUser=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"引入用户",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingImportUser,onClick:e.doImportUser},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",bt,[t.createVNode(f,{ref:"otherUserGrid",option:e.otherUserGridOption},{default:t.withCtx((()=>[Ft])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[7]||(i[7]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",St,[t.createVNode(y,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",Rt,[t.createVNode(w,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(v,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[10]||(i[10]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[9]||(i[9]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Vt,[t.createVNode(I,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(C,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,kt)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(C,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Dt)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-d910e362"]]),Ot={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},Gt=t.defineComponent({name:"Module",components:{SelectPlatform:r.SelectPlatform},emits:["change"],props:Ot,setup:(e,t)=>new Lt(e,t)});class Lt extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"moduleApi",new i.ModuleApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id,t.nextTick((()=>{this.doPlatformChange(this.platData.value[0])})))})),h(this,"moduleWidth",t.ref("calc(100% - 300px)")),h(this,"webOrApp",t.ref(0)),h(this,"moduleGrid",t.ref()),h(this,"moduleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!1,isCurrent:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input"}],toolbars:[{name:"addModule",type:"primary",icon:"md-add",text:"新增",onclick:()=>{this.doAddModule()}},{name:"importModule",type:"default",icon:"md-arrow-round-up",text:"引入",onclick:()=>{this.doShowImportModule()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"ModuleName",title:"模块名称",minWidth:250,treeNode:!0},{colType:"ro",field:"ModuleAlias",title:"别名",width:250,align:"center"},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"OrderNo",title:"排序号",width:90,align:"center"},{colType:"ro",field:"ModuleStatus",title:"状态",width:70,align:"center",format:(e,t)=>{const i={0:{text:"禁用",color:"red"},1:{text:"正常",color:"green"},2:{text:"沙盒",color:"default"}}[this.utilities.getValueNotNull(t.row.ModuleStatus,0)];return e(s.Tag,{color:i.color},(()=>i.text))}},{colType:"ro",field:"LoadMode",title:"加载模式",width:120,align:"center",format:(e,t)=>({0:"路由",1:"链接",2:"低代码"}[t.row.LoadMode])},{colType:"ro",field:"ModuleUrl",title:"路径",width:260},{title:"操作",width:240,rowButtons:[{name:"editModule",text:"编辑",onclick:e=>{this.doEditModule(e)}},{name:"addModuleChild",text:"新增子项",onclick:e=>{this.doAddChildModule(e)}},{name:"deleteModule",text:"删除",type:"error",onclick:e=>{this.doDeleteModule(e)}}]}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.moduleGrid.value.loadDataByQuery(t)}}})),h(this,"doPlatformChange",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(t)||(this.selectedPlatform=t,this.loadModuleGridData())})),h(this,"loadModuleGridData",(()=>{this.moduleGrid.value.loadDataByQuery(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]))})),h(this,"doChangeModuleWidth",(e=>{this.moduleWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"parentModule"),h(this,"editModulePId",0),h(this,"editModuleChildData",[]),h(this,"saveingModule",t.ref(!1)),h(this,"moduleComForm",t.ref()),h(this,"showEditModule",t.ref(!1)),h(this,"editMoudelModalTitle",t.ref("新增 - 模块")),h(this,"moduleFormModel",t.reactive({Id:0,PlatformId:0,RootId:0,PId:0,ParentPath:"",HasChild:0,NodeLevel:0,ModuleName:"",ModuleAlias:"",ModuleUrl:"",ModuleType:"",WebOrApp:0,OrderNo:0,IconUrl:"",AttachParams:"",Operates:"",LoadMode:0,ModuleStatus:1,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"moduleFormItems",t.reactive([{model:"",label:"模块信息",span:24,children:[{model:"PId",label:"上级菜单",span:24,prop:"PId",type:"TreeSelect",isShow:!1,treeSelectProp:{data:[],onChange:(e,t)=>{this.setEditMoudelPId(e)}}},{model:"ModuleName",label:"模块名称",prop:"ModuleName",type:"Input"},{model:"ModuleAlias",label:"模块别名",prop:"ModuleAlias",type:"Input"},{model:"ModuleType",label:"模块类型",prop:"ModuleType",type:"Select",selectProp:{datas:[{text:"顶栏业务组",value:"Business"},{text:"左侧菜单组",value:"MenuGroup"},{text:"左侧菜单项",value:"MenuItem"}],transfer:!0}},{model:"IconUrl",label:"模块图标",prop:"IconUrl",type:"IconSelect",iconSelectProp:{placeholder:"模块图标"}},{model:"ModuleStatus",label:"模块状态",prop:"ModuleStatus",type:"Select",selectProp:{datas:[{text:"禁用",value:0},{text:"正常",value:1},{text:"沙盒",value:2}],transfer:!0}},{model:"OrderNo",label:"排序号",prop:"OrderNo",type:"InputNumber"}]},{model:"",label:"路由信息",span:24,children:[{model:"LoadMode",label:"加载模式",span:24,prop:"LoadMode",type:"Radio",radioProp:{datas:[{text:"路由",value:0},{text:"链接",value:1},{text:"低代码",value:3}]}},{model:"ModuleUrl",label:"路由地址",span:24,prop:"ModuleUrl",type:"Input"},{model:"AttachParams",label:"路由参数",span:24,prop:"AttachParams",type:"Input"},{model:"Operates",label:"功能点",span:24,prop:"Operates",type:"Input",inputProp:{type:"textarea",rows:4,placeholder:"例如: [{ code:'Edit', name: '编辑' }]"}}]}])),h(this,"doSaveModule",(async()=>{this.saveingModule.value=!0;let e=await this.moduleApi.save(this.moduleFormModel),t=this.utilities.parseApiResult(e);if(t<=0)return this.message.warning("保存失败,请稍后重试!"),void(this.saveingModule.value=!1);if(0==this.moduleFormModel.Id){const e=[{Id:t,RootId:this.utilities.isNull(this.parentModule)?t:this.parentModule.RootId}];this.utilities.isNull(this.parentModule)||0!=this.parentModule.HasChild||e.push({Id:this.parentModule.Id,HasChild:1}),await this.moduleApi.saves(e)}else if(this.editModulePId!=this.moduleFormModel.PId){let i=this.editModuleChildData;this.editModulePId>0&&(e=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",this.editModulePId)),t=this.utilities.parseApiResult(e),i.push({Id:this.editModulePId,HasChild:t>0?1:0})),await this.moduleApi.saves(i)}this.message.success("保存成功!"),this.moduleGrid.value.refreshData(),this.saveingModule.value=!1,this.showEditModule.value=!1})),h(this,"showImportModule",t.ref(!1)),h(this,"saveingImportModule",t.ref(!1)),h(this,"originPlatform",t.reactive({list:[],selectedItem:{Id:0,PlatformName:""},selectedId:0})),h(this,"originModuleGrid",t.ref()),h(this,"originModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},treeConfig:{expandAll:!0}},searchOptions:[{field:"ModuleName",title:"模块名称",type:"Input",span:24}],rightToolbars:[{name:"refresh"}],columns:[{colType:"checkbox"},{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.originModuleGrid.value.loadDataByQuery(t)}}})),h(this,"targetPlatform",t.reactive({Id:0,PlatformName:""})),h(this,"targetModuleGrid",t.ref()),h(this,"targetModuleGridOption",t.reactive({api:this.moduleApi,setting:{isTree:!0,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0,isCurrent:!0},treeConfig:{expandAll:!0}},toolbars:[],rightToolbars:[{name:"refresh"}],columns:[{colType:"ro",field:"ModuleName",title:"模块名称",treeNode:!0},{colType:"ro",field:"IconUrl",title:"图标",width:80,align:"center",format:(e,t)=>{const i=t.row.IconUrl;return this.utilities.isNull(i)?"":e(s.Icon,{type:i,style:{"font-size":"18px"}})}},{colType:"ro",field:"ModuleType",title:"模块类型",width:120,align:"center",format:(e,t)=>{const i={Business:{text:"顶栏业务组",color:"purple"},MenuGroup:{text:"左侧菜单组",color:"geekblue"},MenuItem:{text:"左侧菜单项",color:"green"}}[t.row.ModuleType];return this.utilities.isNull(i)?"":e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.utilities.isNull(e.ModuleName)||t.like("ModuleName",e.ModuleName),this.targetModuleGrid.value.loadDataByQuery(t)}}})),h(this,"doChangeOriginPlatform",(()=>{const e=this.originPlatform.list.filter((e=>e.Id==this.originPlatform.selectedId));e.length>0?this.originPlatform.selectedItem=e[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.loadOriginModuleGridData()})),h(this,"doImportOriginToTargetModule",(async()=>{const e=this.originModuleGrid.value.getCheckboxDatas();if(e.length<=0)return void this.message.warning("请选择源平台模块菜单");const t=this.targetModuleGrid.value.getCurrentRecord();if(this.utilities.isNull(t))return void this.message.warning("请选择目标平台模块菜单");this.saveingImportModule.value=!0;const i=await this.moduleApi.importModules(e,t),o=this.utilities.parseApiResult(i);this.saveingImportModule.value=!1,o>0?(this.originModuleGrid.value.refreshData(),this.targetModuleGrid.value.refreshData(),this.moduleGrid.value.refreshData(),this.message.success("导入成功")):this.message.warning("导入失败, 请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}setEditMoudelPId(e){this.editModuleChildData=[];const t=this.moduleGrid.value.getDatas(),i=t.filter((t=>t.Id==e))[0];this.moduleFormModel.RootId=i?i.RootId:this.moduleFormModel.Id,this.moduleFormModel.PId=i?i.Id:0,this.moduleFormModel.ParentPath=i?`${i.ParentPath}${i.Id}/`:"/",this.moduleFormModel.NodeLevel=i?i.NodeLevel+1:1;((e,t)=>{const i=e.filter((e=>e.PId==t.Id));for(const o of i)this.editModuleChildData.push({Id:o.Id,RootId:t.RootId,ParentPath:`${t.ParentPath}${t.Id}/`,NodeLevel:t.NodeLevel+1})})(t,this.moduleFormModel)}setParentModuleTreeItem(e){const t=this.moduleFormItems[0].children[0];if(t.isShow=e,0==e)return;const i=this.moduleGrid.value.getDatas(),o=this.moduleComForm.value.convertTreeData({datas:i,titleField:"ModuleName",rootTitle:"主目录",rootValue:0});t.treeSelectProp.data=o}doEditModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=e.Id,this.moduleFormModel.PlatformId=e.PlatformId,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.PId,this.moduleFormModel.ParentPath=e.ParentPath,this.moduleFormModel.HasChild=e.HasChild,this.moduleFormModel.NodeLevel=e.NodeLevel,this.moduleFormModel.ModuleName=e.ModuleName,this.moduleFormModel.ModuleAlias=e.ModuleAlias,this.moduleFormModel.ModuleUrl=e.ModuleUrl,this.moduleFormModel.ModuleType=e.ModuleType,this.moduleFormModel.WebOrApp=e.WebOrApp,this.moduleFormModel.OrderNo=e.OrderNo,this.moduleFormModel.IconUrl=e.IconUrl,this.moduleFormModel.AttachParams=e.AttachParams,this.moduleFormModel.Operates=e.Operates,this.moduleFormModel.LoadMode=e.LoadMode,this.moduleFormModel.ModuleStatus=e.ModuleStatus,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.editModulePId=e.PId,this.editModuleChildData=[],this.editMoudelModalTitle.value=`编辑 - 模块 - ${e.ModuleName}`,this.setParentModuleTreeItem(!0),this.showEditModule.value=!0}doAddModule(){const e=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=0,this.moduleFormModel.PId=0,this.moduleFormModel.ParentPath="/",this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates='[{"code":"Edit", "name": "编辑"},{"code":"Delete", "name": "删除"},{"code":"Add", "name": "新增"},{"code":"Save", "name": "保存"}]',this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=e.Id,this.moduleFormModel.LastUpdateUserName=e.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=void 0,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value="新增 - 模块",this.showEditModule.value=!0}doAddChildModule(e){const t=this.storageInfo.getUser();this.moduleFormModel.Id=0,this.moduleFormModel.PlatformId=this.selectedPlatform.Id,this.moduleFormModel.RootId=e.RootId,this.moduleFormModel.PId=e.Id,this.moduleFormModel.ParentPath=`${e.ParentPath}${e.Id}/`,this.moduleFormModel.HasChild=0,this.moduleFormModel.NodeLevel=e.NodeLevel+1,this.moduleFormModel.ModuleName="",this.moduleFormModel.ModuleAlias="",this.moduleFormModel.ModuleUrl="",this.moduleFormModel.ModuleType="Business"==e.ModuleType?"MenuGroup":"MenuItem",this.moduleFormModel.WebOrApp=this.webOrApp.value,this.moduleFormModel.OrderNo=1,this.moduleFormModel.IconUrl="",this.moduleFormModel.AttachParams="",this.moduleFormModel.Operates="",this.moduleFormModel.LoadMode=0,this.moduleFormModel.ModuleStatus=1,this.moduleFormModel.LastUpdateUserId=t.Id,this.moduleFormModel.LastUpdateUserName=t.UserName,this.moduleFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.parentModule=e,this.setParentModuleTreeItem(!1),this.editMoudelModalTitle.value=`新增子项 - 父模块 - ${e.ModuleName}`,this.showEditModule.value=!0}async doDeleteModule(e){1!=e.HasChild?this.modal.confirm({title:"提示",content:`数据删除后不可恢复, 确定要删除[ ${e.ModuleName} ]模块吗?`,onOk:async()=>{const t=e.PId;let i=await this.moduleApi.delete(e.Id),s=this.utilities.parseApiResult(i);s<=0?this.message.warning("删除失败,请稍后重试!"):(i=await this.moduleApi.getCount(o.QueryWrapper.create().eq("PId",t)),s=this.utilities.parseApiResult(i),s<=0&&await this.moduleApi.save({Id:t,HasChild:0}),this.message.success("删除成功!"),this.moduleGrid.value.refreshData())}}):this.message.warning("该模块存在子模板, 不能删除, 请先删除子模块!")}doShowImportModule(){this.targetPlatform.Id=this.selectedPlatform.Id,this.targetPlatform.PlatformName=this.selectedPlatform.PlatformName,this.showImportModule.value=!0,this.loadOriginPlatforms()}async loadOriginPlatforms(){var e;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).ne("Id",this.selectedPlatform.Id).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.originPlatform.list=this.utilities.parseApiResult(s),this.originPlatform.list.length>0?this.originPlatform.selectedItem=this.originPlatform.list[0]:this.originPlatform.selectedItem={Id:0,PlatformName:""},this.originPlatform.selectedId=this.originPlatform.selectedItem.Id,t.nextTick((()=>{this.loadOriginModuleGridData(),this.loadTargetModuleGridData()}))}loadOriginModuleGridData(){const e=o.QueryWrapper.create().eq("PlatformId",this.originPlatform.selectedId).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]);this.originModuleGrid.value.loadDataByQuery(e)}loadTargetModuleGridData(){this.targetModuleGrid.value.loadData((async e=>{const t=o.QueryWrapper.create().eq("PlatformId",this.targetPlatform.Id).eq("WebOrApp",this.webOrApp.value).orderBy(["OrderNo"]),i=await this.moduleApi.getEntities(t),s=this.utilities.parseApiResult(i),r={Id:0,PId:-1,ModuleName:"根节点",ModuleType:"",PlatformId:this.targetPlatform.Id,IconUrl:""};s.push(r),e.success(s)}))}}const Bt={style:{height:"650px","overflow-y":"auto"}},_t={class:"import-module",style:{height:"650px",position:"relative"}},Wt={style:{width:"100%",height:"100%"}},qt={style:{width:"560px",height:"100%",float:"left"}},Kt={style:{height:"calc(100% - 0px)"}},Qt={style:{width:"calc(100% - 570px)",height:"100%","margin-left":"10px",display:"inline-block"}},Yt={style:{height:"calc(100% - 0px)"}},Ht=(e=>(t.pushScopeId("data-v-23a8ab5f"),e=e(),t.popScopeId(),e))((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"点击选择要放置的位置!",-1)));const jt=f(Gt,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Radio"),p=t.resolveComponent("RadioGroup"),m=t.resolveComponent("NvGrid"),c=t.resolveComponent("NvComForm"),f=t.resolveComponent("Form"),g=t.resolveComponent("Button"),I=t.resolveComponent("Modal"),v=t.resolveComponent("Card"),y=t.resolveComponent("NvBox"),w=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(w,{gutter:8,class:"module"},{default:t.withCtx((()=>[t.createVNode(y,{width:"100%",title:"模块列表"},{default:t.withCtx((()=>[t.createVNode(m,{ref:"moduleGrid",option:e.moduleGridOption},{default:t.withCtx((()=>[t.createVNode(u,{width:"380px",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doPlatformChange,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"]),t.createVNode(p,{modelValue:e.webOrApp,"onUpdate:modelValue":i[1]||(i[1]=t=>e.webOrApp=t),type:"button",onOnChange:e.loadModuleGridData},{default:t.withCtx((()=>[t.createVNode(h,{label:0},{default:t.withCtx((()=>[t.createTextVNode("Web")])),_:1}),t.createVNode(h,{label:1},{default:t.withCtx((()=>[t.createTextVNode("App")])),_:1})])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"]),t.createVNode(I,{modelValue:e.showEditModule,"onUpdate:modelValue":i[3]||(i[3]=t=>e.showEditModule=t),draggable:"",mask:!0,"mask-closable":!1,width:700,title:e.editMoudelModalTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(g,{type:"text",onClick:i[2]||(i[2]=t=>e.showEditModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(g,{type:"primary",loading:e.saveingModule,onClick:e.doSaveModule},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Bt,[t.createVNode(f,{model:e.moduleFormModel,"label-width":90},{default:t.withCtx((()=>[t.createVNode(c,{ref:"moduleComForm",formModel:e.moduleFormModel,formItems:e.moduleFormItems},null,8,["formModel","formItems"])])),_:1},8,["model"])])])),_:1},8,["modelValue","title"]),t.createVNode(I,{modelValue:e.showImportModule,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showImportModule=t),draggable:"",mask:!0,"mask-closable":!1,width:1300,title:"引入模块",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(g,{type:"text",onClick:i[5]||(i[5]=t=>e.showImportModule=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(g,{type:"primary",loading:e.saveingImportModule,onClick:e.doImportOriginToTargetModule},{default:t.withCtx((()=>[t.createTextVNode("引入")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",_t,[t.createElementVNode("div",Wt,[t.createElementVNode("div",qt,[t.createVNode(v,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("源平台 - ["+t.toDisplayString(e.originPlatform.selectedItem.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",Kt,[t.createVNode(m,{ref:"originModuleGrid",option:e.originModuleGridOption},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.originPlatform.selectedId,"onUpdate:modelValue":i[4]||(i[4]=t=>e.originPlatform.selectedId=t),onOnChange:e.doChangeOriginPlatform,style:{width:"250px"}},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.originPlatform.list,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"])])),_:1},8,["option"])])])),_:1})]),t.createElementVNode("div",Qt,[t.createVNode(v,{"dis-hover":"",class:"import-module_card"},{title:t.withCtx((()=>[t.createTextVNode("目标平台 - ["+t.toDisplayString(e.targetPlatform.PlatformName)+"] - 模块菜单",1)])),default:t.withCtx((()=>[t.createElementVNode("div",Yt,[t.createVNode(m,{ref:"targetModuleGrid",option:e.targetModuleGridOption},{default:t.withCtx((()=>[Ht])),_:1},8,["option"])])])),_:1})]),t.withDirectives(t.createVNode(d,{fix:""},null,512),[[t.vShow,e.saveingImportModule]])])])])),_:1},8,["modelValue"])])),_:1})])),_:1})}],["__scopeId","data-v-23a8ab5f"]]),zt={type:"FeatureCollection",features:[{type:"Feature",properties:{name:"西安",center:[108.948024,34.263161],centroid:[108.797426,34.10671],childrenNum:13,level:"city",code:610100,filename:"610000/610100",fullname:"西安市",bbox:[[107.663753,34.743104],[109.822433,33.693877]],offset:[.5252,.6065]},geometry:{type:"MultiPolygon",coordinates:[[[[109.754502,34.212239],[109.745465,34.187491],[109.778102,34.183392],[109.801415,34.160887],[109.822194,34.155742],[109.789787,34.145049],[109.78098,34.160083],[109.755078,34.127197],[109.742184,34.12189],[109.739824,34.09792],[109.694753,34.109101],[109.669886,34.099931],[109.658835,34.105481],[109.634313,34.075633],[109.584235,34.072092],[109.567139,34.064688],[109.552806,34.044727],[109.56121,34.034181],[109.545496,34.025244],[109.533235,33.982077],[109.562994,33.960726],[109.603633,33.940982],[109.592984,33.896804],[109.576118,33.897691],[109.540142,33.875513],[109.537322,33.862042],[109.508541,33.848004],[109.470263,33.851796],[109.442518,33.843566],[109.399059,33.845422],[109.355945,33.867608],[109.316918,33.85462],[109.299823,33.856556],[109.289462,33.87027],[109.251874,33.880675],[109.207379,33.867043],[109.18493,33.874303],[109.164207,33.871319],[109.120576,33.876481],[109.107682,33.907609],[109.070555,33.906641],[109.051502,33.923169],[109.007985,33.883256],[108.944265,33.86664],[108.922161,33.869383],[108.913239,33.848649],[108.874788,33.824522],[108.854238,33.826539],[108.84002,33.815966],[108.805771,33.817177],[108.778487,33.798046],[108.756038,33.812657],[108.755923,33.839048],[108.741014,33.841468],[108.697843,33.828315],[108.650067,33.841549],[108.617717,33.825974],[108.602579,33.791426],[108.585425,33.780122],[108.584274,33.764536],[108.560444,33.765101],[108.544557,33.788438],[108.484405,33.804262],[108.466445,33.800629],[108.443709,33.781979],[108.404855,33.763324],[108.369454,33.793202],[108.345969,33.793848],[108.307,33.76292],[108.288292,33.767282],[108.259281,33.754763],[108.233148,33.726649],[108.191761,33.725276],[108.180191,33.711862],[108.149281,33.712347],[108.132243,33.721882],[108.113823,33.712589],[108.098396,33.723498],[108.073818,33.723417],[108.054247,33.709842],[108.008312,33.728993],[107.96612,33.734648],[107.951672,33.745797],[107.931583,33.731255],[107.90309,33.748947],[107.854278,33.694081],[107.830102,33.69788],[107.763503,33.719781],[107.737427,33.717923],[107.719353,33.725761],[107.695868,33.72366],[107.687924,33.744746],[107.665821,33.760013],[107.68591,33.796996],[107.679463,33.808298],[107.697422,33.817903],[107.708589,33.846794],[107.704387,33.857282],[107.717626,33.910431],[107.71377,33.92736],[107.76736,33.954521],[107.784455,33.980626],[107.8103,33.995045],[107.846564,33.975148],[107.87759,33.993918],[107.908213,33.999314],[107.915638,33.986104],[107.949887,33.985379],[107.941944,34.006079],[107.943038,34.042312],[107.972567,34.062113],[107.976481,34.075069],[108.00106,34.103953],[108.003074,34.155742],[108.011421,34.161047],[108.030013,34.208623],[108.027941,34.228144],[108.086769,34.231036],[108.143928,34.218585],[108.156534,34.225092],[108.20195,34.221718],[108.237638,34.199625],[108.264865,34.199464],[108.293185,34.209989],[108.328585,34.195928],[108.351495,34.196812],[108.37452,34.207659],[108.418266,34.20549],[108.425922,34.200348],[108.457351,34.209186],[108.468115,34.205731],[108.529706,34.23216],[108.56407,34.22959],[108.593369,34.239308],[108.619444,34.25826],[108.650125,34.265808],[108.669753,34.243966],[108.692087,34.238987],[108.700952,34.273675],[108.744756,34.276886],[108.750282,34.296151],[108.796792,34.296713],[108.794316,34.334185],[108.803239,34.359531],[108.828048,34.365947],[108.859879,34.388638],[108.89292,34.390802],[108.913469,34.406033],[108.929817,34.40443],[108.961015,34.424787],[108.955834,34.444979],[108.976441,34.44594],[108.971146,34.502962],[108.974081,34.541383],[108.955201,34.565866],[108.998315,34.576426],[109.011842,34.586184],[109.06123,34.593542],[109.092889,34.588983],[109.108891,34.577705],[109.138823,34.588823],[109.139053,34.639514],[109.156034,34.644709],[109.168237,34.666525],[109.173072,34.691931],[109.203407,34.697682],[109.243873,34.687297],[109.254176,34.6988],[109.280424,34.697442],[109.286641,34.687697],[109.340749,34.69872],[109.358651,34.716929],[109.365098,34.739285],[109.410859,34.743117],[109.429854,34.713814],[109.421163,34.706866],[109.430775,34.688016],[109.42335,34.679548],[109.437222,34.595621],[109.449771,34.553625],[109.429106,34.549385],[109.418054,34.536741],[109.391346,34.529138],[109.399692,34.49976],[109.391346,34.468529],[109.413277,34.46068],[109.424501,34.441934],[109.423753,34.423505],[109.442633,34.414128],[109.445799,34.397376],[109.461859,34.394169],[109.458981,34.350869],[109.450577,34.326724],[109.456045,34.298237],[109.477688,34.294465],[109.500252,34.268698],[109.523622,34.255851],[109.575831,34.262516],[109.627751,34.240031],[109.659122,34.245894],[109.668562,34.238586],[109.691069,34.243003],[109.731074,34.236337],[109.739996,34.217219],[109.754502,34.212239]]],[[[109.174166,33.808702],[109.154019,33.791103],[109.147284,33.799337],[109.162366,33.812657],[109.174166,33.808702]]]]}},{type:"Feature",properties:{name:"铜川",center:[108.979608,34.916582],centroid:[109.038368,35.195996],childrenNum:4,level:"city",code:610200,filename:"610000/610200",fullname:"铜川市",bbox:[[108.583512,35.580992],[109.496263,34.804856]],offset:[.4983,.496]},geometry:{type:"MultiPolygon",coordinates:[[[[108.868629,35.344653],[108.89787,35.350437],[108.923139,35.363114],[108.943689,35.393373],[108.987148,35.436444],[108.979204,35.448316],[108.992559,35.473004],[109.014893,35.497448],[109.014547,35.509311],[109.035845,35.518642],[109.032852,35.52979],[109.051559,35.548763],[109.091622,35.543625],[109.116086,35.565597],[109.179922,35.580769],[109.20358,35.580137],[109.243758,35.523702],[109.266494,35.519512],[109.342188,35.522595],[109.405909,35.520777],[109.406024,35.511762],[109.431293,35.500849],[109.448389,35.511604],[109.466694,35.509074],[109.468248,35.483763],[109.478379,35.473795],[109.45852,35.454568],[109.473601,35.453143],[109.4774,35.438977],[109.467097,35.421878],[109.493575,35.395986],[109.495647,35.357251],[109.476019,35.340215],[109.444475,35.343385],[109.411838,35.322699],[109.39785,35.329357],[109.382711,35.314059],[109.382481,35.298282],[109.368897,35.286071],[109.318703,35.274254],[109.283533,35.251012],[109.303564,35.246648],[109.30909,35.216414],[109.319278,35.200142],[109.344203,35.18998],[109.362162,35.164411],[109.381733,35.157184],[109.433538,35.167429],[109.44482,35.148684],[109.441021,35.104586],[109.444187,35.088848],[109.426746,35.06921],[109.415349,35.071993],[109.408384,35.09163],[109.359514,35.101009],[109.339425,35.092504],[109.296657,35.086145],[109.290728,35.09942],[109.27415,35.099579],[109.28313,35.084952],[109.261659,35.050761],[109.223726,35.04758],[109.20663,35.018625],[109.212559,35.003745],[109.176929,35.001597],[109.164438,34.983689],[109.144176,34.991728],[109.127886,34.975093],[109.105207,34.97167],[109.084542,34.955906],[109.097263,34.932892],[109.095479,34.919271],[109.062323,34.908357],[109.061748,34.888836],[109.034003,34.901107],[109.013914,34.891386],[108.983291,34.889951],[108.967347,34.88007],[108.977823,34.835348],[108.973736,34.821711],[108.957158,34.829766],[108.918189,34.83455],[108.898561,34.823545],[108.902302,34.810146],[108.855504,34.82219],[108.82327,34.804881],[108.81383,34.830643],[108.780559,34.852729],[108.766399,34.87202],[108.726509,34.866839],[108.689036,34.880707],[108.66699,34.916563],[108.665148,34.933608],[108.643217,34.975093],[108.631532,34.978993],[108.62048,35.011782],[108.599067,35.021966],[108.583526,35.043524],[108.60891,35.06762],[108.626812,35.099897],[108.591297,35.101645],[108.616278,35.11746],[108.644138,35.119288],[108.662673,35.128585],[108.655708,35.156866],[108.633432,35.164093],[108.65473,35.178467],[108.656629,35.194267],[108.676545,35.196729],[108.670674,35.210462],[108.696865,35.222764],[108.720292,35.254979],[108.739921,35.268464],[108.750627,35.293366],[108.79777,35.306448],[108.807843,35.300819],[108.824824,35.316279],[108.873349,35.326108],[108.868629,35.344653]]]]}},{type:"Feature",properties:{name:"宝鸡",center:[107.14487,34.369315],centroid:[107.205191,34.380063],childrenNum:12,level:"city",code:610300,filename:"610000/610300",fullname:"宝鸡市",bbox:[[106.313336,35.105585],[108.053089,33.57935]],offset:[.5126,.4754]},geometry:{type:"MultiPolygon",coordinates:[[[[108.027941,34.228144],[108.030013,34.208623],[108.011421,34.161047],[108.003074,34.155742],[108.00106,34.103953],[107.976481,34.075069],[107.972567,34.062113],[107.943038,34.042312],[107.941944,34.006079],[107.949887,33.985379],[107.915638,33.986104],[107.908213,33.999314],[107.87759,33.993918],[107.846564,33.975148],[107.8103,33.995045],[107.784455,33.980626],[107.76736,33.954521],[107.71377,33.92736],[107.717626,33.910431],[107.704387,33.857282],[107.708589,33.846794],[107.697422,33.817903],[107.679463,33.808298],[107.68591,33.796996],[107.665821,33.760013],[107.687924,33.744746],[107.695868,33.72366],[107.673764,33.699497],[107.650682,33.700628],[107.628694,33.714448],[107.586846,33.697719],[107.562555,33.70273],[107.517082,33.678318],[107.492503,33.679854],[107.467694,33.660612],[107.423601,33.649371],[107.400347,33.651312],[107.376516,33.682845],[107.336165,33.68907],[107.3056,33.710165],[107.314177,33.728831],[107.304334,33.733517],[107.305543,33.766878],[107.32212,33.774469],[107.328279,33.797642],[107.342037,33.81411],[107.322581,33.818872],[107.299499,33.792798],[107.276762,33.801194],[107.27279,33.790699],[107.231173,33.766797],[107.212581,33.74927],[107.187369,33.751774],[107.181612,33.769462],[107.163135,33.788035],[107.145233,33.794251],[107.128368,33.777618],[107.136945,33.81411],[107.112078,33.812818],[107.105746,33.822504],[107.080477,33.8221],[107.066432,33.838725],[107.063093,33.870431],[107.044904,33.873819],[107.038514,33.85462],[107.043234,33.805069],[107.028153,33.794574],[106.978247,33.800952],[106.930701,33.827266],[106.909691,33.847762],[106.890063,33.848327],[106.888681,33.860993],[106.855583,33.874384],[106.854375,33.848649],[106.839409,33.827023],[106.817823,33.834448],[106.80585,33.809832],[106.803835,33.72366],[106.797273,33.682441],[106.789215,33.67751],[106.71427,33.701356],[106.674955,33.701437],[106.705693,33.676944],[106.687043,33.665544],[106.64226,33.658994],[106.647325,33.634813],[106.629827,33.619605],[106.617911,33.591933],[106.596729,33.579389],[106.581475,33.590638],[106.575546,33.631658],[106.53485,33.695132],[106.482642,33.707336],[106.48811,33.758236],[106.479821,33.780768],[106.461804,33.789649],[106.468712,33.820083],[106.491391,33.834529],[106.493406,33.846148],[106.475331,33.875755],[106.428246,33.866479],[106.41092,33.909221],[106.443557,33.934615],[106.476022,33.973779],[106.479533,33.994401],[106.47159,34.024037],[106.505494,34.056479],[106.501867,34.104918],[106.56081,34.113203],[106.584871,34.149471],[106.572265,34.16997],[106.558565,34.227421],[106.551255,34.242601],[106.532087,34.254085],[106.512919,34.239389],[106.496053,34.238345],[106.496514,34.255129],[106.526446,34.291977],[106.5771,34.2809],[106.589246,34.253764],[106.602485,34.250873],[106.633626,34.259866],[106.663903,34.243163],[106.684107,34.259946],[106.705117,34.299522],[106.690324,34.334024],[106.710989,34.344372],[106.717378,34.369234],[106.697289,34.370598],[106.680078,34.383747],[106.662176,34.381663],[106.637252,34.392005],[106.613709,34.44626],[106.591606,34.456514],[106.599434,34.465966],[106.567948,34.474857],[106.552406,34.489191],[106.543657,34.47854],[106.536059,34.493034],[106.511825,34.502482],[106.487765,34.523375],[106.453861,34.531299],[106.407811,34.523135],[106.401365,34.511128],[106.379031,34.520654],[106.366137,34.512329],[106.33442,34.517852],[106.343803,34.536581],[106.340982,34.568026],[106.314044,34.578745],[106.323138,34.589863],[106.368151,34.610334],[106.419496,34.64343],[106.421741,34.654939],[106.44868,34.636396],[106.467215,34.640952],[106.470784,34.65374],[106.445687,34.669482],[106.44137,34.681705],[106.459617,34.705589],[106.486901,34.715172],[106.505839,34.746869],[106.539628,34.745671],[106.54855,34.761635],[106.575028,34.770095],[106.578367,34.789006],[106.554306,34.813735],[106.555918,34.861339],[106.528,34.876483],[106.517927,34.892422],[106.510214,34.925086],[106.493118,34.941095],[106.48316,34.980108],[106.502155,34.995548],[106.48857,35.02125],[106.503536,35.03374],[106.520978,35.027615],[106.545959,35.070562],[106.543542,35.085032],[106.575834,35.089325],[106.615379,35.071119],[106.661601,35.069687],[106.666206,35.076605],[106.706441,35.081852],[106.7145,35.105619],[106.777818,35.094253],[106.83843,35.079785],[106.856965,35.091232],[106.90169,35.094492],[106.912569,35.079546],[106.944401,35.080103],[106.950157,35.066905],[106.990796,35.068495],[107.012439,35.029365],[107.031031,35.029126],[107.051005,35.04074],[107.048242,35.028331],[107.082606,35.024035],[107.096076,35.010111],[107.089629,34.976685],[107.103041,34.960046],[107.135621,34.945873],[107.162387,34.944121],[107.179886,34.928272],[107.189556,34.893298],[107.201011,34.881664],[107.222999,34.878157],[107.230943,34.891864],[107.252528,34.881185],[107.262371,34.907481],[107.282978,34.911783],[107.28672,34.931856],[107.322351,34.938148],[107.35021,34.934086],[107.371969,34.917997],[107.392921,34.932414],[107.426019,34.92875],[107.455548,34.916802],[107.474774,34.91943],[107.524047,34.909871],[107.536653,34.915368],[107.537861,34.932493],[107.551158,34.940298],[107.562037,34.966495],[107.572168,34.971351],[107.605611,34.958693],[107.619714,34.964664],[107.633414,34.953915],[107.625815,34.918952],[107.63986,34.918793],[107.637731,34.93329],[107.654366,34.933529],[107.67434,34.951208],[107.741572,34.953517],[107.778584,34.964664],[107.804775,34.956782],[107.799997,34.966813],[107.820028,34.973739],[107.822791,34.953358],[107.84973,34.891466],[107.841269,34.890669],[107.857501,34.863172],[107.857961,34.844438],[107.90804,34.842684],[107.951787,34.863332],[107.94983,34.821552],[107.963127,34.79842],[107.992023,34.782782],[107.99916,34.750301],[108.015335,34.726032],[108.015623,34.695445],[108.032143,34.626644],[107.995822,34.612573],[107.980453,34.575866],[108.002441,34.552105],[108.004053,34.527938],[107.997606,34.487189],[108.017637,34.479101],[108.011881,34.457956],[108.019825,34.430797],[108.041698,34.390001],[108.027711,34.38503],[108.029438,34.370838],[108.053095,34.325761],[108.035884,34.315972],[108.009118,34.317015],[107.995764,34.332901],[107.987878,34.313485],[107.953744,34.32183],[107.950808,34.287803],[107.96825,34.286519],[107.973603,34.268858],[107.995131,34.265647],[107.990181,34.22212],[108.027941,34.228144]]]]}},{type:"Feature",properties:{name:"咸阳",center:[108.705117,34.333439],centroid:[108.394642,34.785702],childrenNum:14,level:"city",code:610400,filename:"610000/610400",fullname:"咸阳市",bbox:[[107.651841,35.544246],[109.177963,34.194981]],offset:[.4867,.5622]},geometry:{type:"MultiPolygon",coordinates:[[[[107.820028,34.973739],[107.858595,34.986873],[107.863372,34.999209],[107.843629,35.002313],[107.848349,35.023876],[107.827511,35.022205],[107.802069,35.032388],[107.759474,35.071198],[107.762006,35.084316],[107.722519,35.114917],[107.728563,35.127314],[107.715784,35.168144],[107.687291,35.216653],[107.670311,35.21443],[107.651948,35.239746],[107.662597,35.255375],[107.692357,35.251171],[107.720159,35.269257],[107.737312,35.267433],[107.736794,35.296141],[107.716648,35.302326],[107.745716,35.311601],[107.75176,35.305101],[107.79142,35.295903],[107.829814,35.273143],[107.841844,35.276395],[107.866193,35.256407],[107.904702,35.261166],[107.936073,35.253947],[107.937799,35.267353],[107.960594,35.261484],[107.949772,35.2453],[107.979301,35.245458],[108.048663,35.253789],[108.094885,35.280043],[108.123954,35.281788],[108.174666,35.305101],[108.193776,35.306607],[108.221463,35.296855],[108.239365,35.256248],[108.256921,35.267433],[108.298078,35.268385],[108.345336,35.300661],[108.352819,35.285753],[108.400134,35.282819],[108.402379,35.278061],[108.449062,35.273699],[108.489125,35.275285],[108.525043,35.289005],[108.543463,35.303911],[108.568272,35.290908],[108.602982,35.312315],[108.615357,35.331656],[108.610752,35.356459],[108.62215,35.3807],[108.631129,35.418632],[108.619444,35.442934],[108.616566,35.477276],[108.605975,35.502826],[108.622898,35.540779],[108.659162,35.537775],[108.690303,35.505436],[108.702563,35.511288],[108.727084,35.505831],[108.741993,35.491595],[108.767378,35.486769],[108.775494,35.459316],[108.791956,35.437631],[108.791611,35.421957],[108.808246,35.392898],[108.803584,35.379195],[108.835876,35.380304],[108.846467,35.349803],[108.868629,35.344653],[108.873349,35.326108],[108.824824,35.316279],[108.807843,35.300819],[108.79777,35.306448],[108.750627,35.293366],[108.739921,35.268464],[108.720292,35.254979],[108.696865,35.222764],[108.670674,35.210462],[108.676545,35.196729],[108.656629,35.194267],[108.65473,35.178467],[108.633432,35.164093],[108.655708,35.156866],[108.662673,35.128585],[108.644138,35.119288],[108.616278,35.11746],[108.591297,35.101645],[108.626812,35.099897],[108.60891,35.06762],[108.583526,35.043524],[108.599067,35.021966],[108.62048,35.011782],[108.631532,34.978993],[108.643217,34.975093],[108.665148,34.933608],[108.66699,34.916563],[108.689036,34.880707],[108.726509,34.866839],[108.766399,34.87202],[108.780559,34.852729],[108.81383,34.830643],[108.82327,34.804881],[108.855504,34.82219],[108.902302,34.810146],[108.898561,34.823545],[108.918189,34.83455],[108.957158,34.829766],[108.973736,34.821711],[108.997682,34.808551],[109.015986,34.781825],[109.034406,34.771451],[109.04517,34.752297],[109.030492,34.727948],[109.029053,34.70503],[109.046436,34.687058],[109.068655,34.713176],[109.090356,34.700876],[109.128174,34.699838],[109.173187,34.705589],[109.173072,34.691931],[109.168237,34.666525],[109.156034,34.644709],[109.139053,34.639514],[109.138823,34.588823],[109.108891,34.577705],[109.092889,34.588983],[109.06123,34.593542],[109.011842,34.586184],[108.998315,34.576426],[108.955201,34.565866],[108.974081,34.541383],[108.971146,34.502962],[108.976441,34.44594],[108.955834,34.444979],[108.961015,34.424787],[108.929817,34.40443],[108.913469,34.406033],[108.89292,34.390802],[108.859879,34.388638],[108.828048,34.365947],[108.803239,34.359531],[108.794316,34.334185],[108.796792,34.296713],[108.750282,34.296151],[108.744756,34.276886],[108.700952,34.273675],[108.692087,34.238987],[108.669753,34.243966],[108.650125,34.265808],[108.619444,34.25826],[108.593369,34.239308],[108.56407,34.22959],[108.529706,34.23216],[108.468115,34.205731],[108.457351,34.209186],[108.425922,34.200348],[108.418266,34.20549],[108.37452,34.207659],[108.351495,34.196812],[108.328585,34.195928],[108.293185,34.209989],[108.264865,34.199464],[108.237638,34.199625],[108.20195,34.221718],[108.156534,34.225092],[108.143928,34.218585],[108.086769,34.231036],[108.027941,34.228144],[107.990181,34.22212],[107.995131,34.265647],[107.973603,34.268858],[107.96825,34.286519],[107.950808,34.287803],[107.953744,34.32183],[107.987878,34.313485],[107.995764,34.332901],[108.009118,34.317015],[108.035884,34.315972],[108.053095,34.325761],[108.029438,34.370838],[108.027711,34.38503],[108.041698,34.390001],[108.019825,34.430797],[108.011881,34.457956],[108.017637,34.479101],[107.997606,34.487189],[108.004053,34.527938],[108.002441,34.552105],[107.980453,34.575866],[107.995822,34.612573],[108.032143,34.626644],[108.015623,34.695445],[108.015335,34.726032],[107.99916,34.750301],[107.992023,34.782782],[107.963127,34.79842],[107.94983,34.821552],[107.951787,34.863332],[107.90804,34.842684],[107.857961,34.844438],[107.857501,34.863172],[107.841269,34.890669],[107.84973,34.891466],[107.822791,34.953358],[107.820028,34.973739]]]]}},{type:"Feature",properties:{name:"渭南",center:[109.502882,34.499381],centroid:[109.856208,34.950969],childrenNum:11,level:"city",code:610500,filename:"610000/610500",fullname:"渭南市",bbox:[[108.967335,35.854156],[110.609331,34.20976]],offset:[.5413,.5493]},geometry:{type:"MultiPolygon",coordinates:[[[[110.430966,34.40948],[110.388716,34.408117],[110.377549,34.398338],[110.284357,34.391364],[110.251834,34.406754],[110.194215,34.414769],[110.162326,34.432159],[110.132164,34.42687],[110.103383,34.428874],[110.075178,34.413888],[110.059982,34.413247],[110.058485,34.396975],[110.03736,34.377814],[110.007197,34.368593],[110.024236,34.338998],[110.040526,34.324156],[110.030855,34.30217],[110.007255,34.303213],[110.024063,34.240352],[109.997642,34.221638],[109.964372,34.209748],[109.94929,34.219549],[109.95614,34.243645],[109.920395,34.230313],[109.883555,34.24742],[109.873655,34.270785],[109.853335,34.266048],[109.825591,34.288205],[109.792147,34.263078],[109.80199,34.224048],[109.775972,34.251997],[109.757322,34.252961],[109.743565,34.240352],[109.754502,34.212239],[109.739996,34.217219],[109.731074,34.236337],[109.691069,34.243003],[109.668562,34.238586],[109.659122,34.245894],[109.627751,34.240031],[109.575831,34.262516],[109.523622,34.255851],[109.500252,34.268698],[109.477688,34.294465],[109.456045,34.298237],[109.450577,34.326724],[109.458981,34.350869],[109.461859,34.394169],[109.445799,34.397376],[109.442633,34.414128],[109.423753,34.423505],[109.424501,34.441934],[109.413277,34.46068],[109.391346,34.468529],[109.399692,34.49976],[109.391346,34.529138],[109.418054,34.536741],[109.429106,34.549385],[109.449771,34.553625],[109.437222,34.595621],[109.42335,34.679548],[109.430775,34.688016],[109.421163,34.706866],[109.429854,34.713814],[109.410859,34.743117],[109.365098,34.739285],[109.358651,34.716929],[109.340749,34.69872],[109.286641,34.687697],[109.280424,34.697442],[109.254176,34.6988],[109.243873,34.687297],[109.203407,34.697682],[109.173072,34.691931],[109.173187,34.705589],[109.128174,34.699838],[109.090356,34.700876],[109.068655,34.713176],[109.046436,34.687058],[109.029053,34.70503],[109.030492,34.727948],[109.04517,34.752297],[109.034406,34.771451],[109.015986,34.781825],[108.997682,34.808551],[108.973736,34.821711],[108.977823,34.835348],[108.967347,34.88007],[108.983291,34.889951],[109.013914,34.891386],[109.034003,34.901107],[109.061748,34.888836],[109.062323,34.908357],[109.095479,34.919271],[109.097263,34.932892],[109.084542,34.955906],[109.105207,34.97167],[109.127886,34.975093],[109.144176,34.991728],[109.164438,34.983689],[109.176929,35.001597],[109.212559,35.003745],[109.20663,35.018625],[109.223726,35.04758],[109.261659,35.050761],[109.28313,35.084952],[109.27415,35.099579],[109.290728,35.09942],[109.296657,35.086145],[109.339425,35.092504],[109.359514,35.101009],[109.408384,35.09163],[109.415349,35.071993],[109.426746,35.06921],[109.444187,35.088848],[109.441021,35.104586],[109.44482,35.148684],[109.433538,35.167429],[109.381733,35.157184],[109.362162,35.164411],[109.344203,35.18998],[109.319278,35.200142],[109.30909,35.216414],[109.303564,35.246648],[109.283533,35.251012],[109.318703,35.274254],[109.368897,35.286071],[109.382481,35.298282],[109.382711,35.314059],[109.39785,35.329357],[109.411838,35.322699],[109.444475,35.343385],[109.476019,35.340215],[109.495647,35.357251],[109.513204,35.38577],[109.521147,35.425441],[109.546935,35.443805],[109.616181,35.442776],[109.698034,35.409052],[109.721059,35.41119],[109.752775,35.434544],[109.81379,35.443409],[109.821504,35.429636],[109.840384,35.432248],[109.85299,35.422195],[109.875727,35.435415],[109.882404,35.421166],[109.90186,35.411823],[109.953608,35.414832],[109.983712,35.410081],[109.996606,35.434702],[110.014105,35.408656],[110.05198,35.416732],[110.087381,35.406677],[110.102404,35.423303],[110.116507,35.425045],[110.138611,35.456071],[110.184487,35.469286],[110.2059,35.485583],[110.213153,35.502905],[110.230421,35.510497],[110.222478,35.546629],[110.273765,35.538803],[110.283033,35.56702],[110.251316,35.586457],[110.25713,35.597912],[110.234739,35.616553],[110.229558,35.634715],[110.211656,35.639295],[110.193927,35.656347],[110.172687,35.657689],[110.1332,35.675132],[110.162787,35.710006],[110.222017,35.721049],[110.232897,35.715133],[110.282227,35.711741],[110.29915,35.731222],[110.328967,35.752591],[110.370296,35.757401],[110.385838,35.784673],[110.411107,35.809967],[110.486628,35.828401],[110.510113,35.845963],[110.54937,35.854074],[110.550752,35.838088],[110.56733,35.819342],[110.563818,35.787668],[110.574007,35.769777],[110.577633,35.701486],[110.592311,35.682313],[110.592369,35.663293],[110.603996,35.658873],[110.60935,35.632189],[110.589088,35.602099],[110.580914,35.563147],[110.567502,35.539514],[110.531699,35.511446],[110.513049,35.483131],[110.48588,35.422828],[110.477591,35.413882],[110.450019,35.327772],[110.40397,35.286467],[110.374844,35.251964],[110.378355,35.210858],[110.364367,35.197999],[110.364713,35.140264],[110.373692,35.134226],[110.346466,35.084316],[110.333111,35.045115],[110.320563,35.038513],[110.320851,35.005178],[110.30151,34.988624],[110.274686,34.947306],[110.262195,34.94436],[110.254367,34.919191],[110.23094,34.880707],[110.238825,34.852012],[110.233702,34.837421],[110.246884,34.788846],[110.2432,34.725792],[110.229616,34.692649],[110.236638,34.67044],[110.269045,34.629442],[110.295524,34.611054],[110.350783,34.606656],[110.379161,34.600499],[110.367188,34.566746],[110.404488,34.557626],[110.372714,34.544343],[110.360626,34.517292],[110.367073,34.496157],[110.392688,34.466046],[110.409496,34.421581],[110.430966,34.40948]]]]}},{type:"Feature",properties:{name:"延安",center:[109.49081,36.596537],centroid:[109.319393,36.442397],childrenNum:13,level:"city",code:610600,filename:"610000/610600",fullname:"延安市",bbox:[[107.659612,37.498481],[110.551528,35.344618]],offset:[.5739,.4903]},geometry:{type:"MultiPolygon",coordinates:[[[[110.54937,35.854074],[110.510113,35.845963],[110.486628,35.828401],[110.411107,35.809967],[110.385838,35.784673],[110.370296,35.757401],[110.328967,35.752591],[110.29915,35.731222],[110.282227,35.711741],[110.232897,35.715133],[110.222017,35.721049],[110.162787,35.710006],[110.1332,35.675132],[110.172687,35.657689],[110.193927,35.656347],[110.211656,35.639295],[110.229558,35.634715],[110.234739,35.616553],[110.25713,35.597912],[110.251316,35.586457],[110.283033,35.56702],[110.273765,35.538803],[110.222478,35.546629],[110.230421,35.510497],[110.213153,35.502905],[110.2059,35.485583],[110.184487,35.469286],[110.138611,35.456071],[110.116507,35.425045],[110.102404,35.423303],[110.087381,35.406677],[110.05198,35.416732],[110.014105,35.408656],[109.996606,35.434702],[109.983712,35.410081],[109.953608,35.414832],[109.90186,35.411823],[109.882404,35.421166],[109.875727,35.435415],[109.85299,35.422195],[109.840384,35.432248],[109.821504,35.429636],[109.81379,35.443409],[109.752775,35.434544],[109.721059,35.41119],[109.698034,35.409052],[109.616181,35.442776],[109.546935,35.443805],[109.521147,35.425441],[109.513204,35.38577],[109.495647,35.357251],[109.493575,35.395986],[109.467097,35.421878],[109.4774,35.438977],[109.473601,35.453143],[109.45852,35.454568],[109.478379,35.473795],[109.468248,35.483763],[109.466694,35.509074],[109.448389,35.511604],[109.431293,35.500849],[109.406024,35.511762],[109.405909,35.520777],[109.342188,35.522595],[109.266494,35.519512],[109.243758,35.523702],[109.20358,35.580137],[109.179922,35.580769],[109.116086,35.565597],[109.091622,35.543625],[109.051559,35.548763],[109.032852,35.52979],[109.035845,35.518642],[109.014547,35.509311],[109.014893,35.497448],[108.992559,35.473004],[108.979204,35.448316],[108.987148,35.436444],[108.943689,35.393373],[108.923139,35.363114],[108.89787,35.350437],[108.868629,35.344653],[108.846467,35.349803],[108.835876,35.380304],[108.803584,35.379195],[108.808246,35.392898],[108.791611,35.421957],[108.791956,35.437631],[108.775494,35.459316],[108.767378,35.486769],[108.741993,35.491595],[108.727084,35.505831],[108.702563,35.511288],[108.690303,35.505436],[108.659162,35.537775],[108.622898,35.540779],[108.618466,35.556983],[108.567639,35.585509],[108.56384,35.597991],[108.539721,35.605575],[108.523259,35.661162],[108.530339,35.680498],[108.517042,35.716001],[108.533908,35.746205],[108.523259,35.759371],[108.527864,35.824226],[108.518942,35.849113],[108.499543,35.872261],[108.518654,35.905475],[108.563034,35.92129],[108.569308,35.939619],[108.588764,35.950394],[108.633777,35.944732],[108.656514,35.952989],[108.661752,35.993873],[108.688633,36.021064],[108.682532,36.055001],[108.690878,36.088766],[108.707456,36.109803],[108.69767,36.117338],[108.712349,36.138759],[108.702851,36.160803],[108.664918,36.214826],[108.646095,36.254163],[108.655075,36.273981],[108.642181,36.311175],[108.641605,36.359148],[108.651276,36.384727],[108.618926,36.433906],[108.593599,36.431483],[108.562631,36.438595],[108.533044,36.454616],[108.510653,36.474461],[108.514682,36.445551],[108.496838,36.422728],[108.485556,36.429451],[108.460574,36.423119],[108.418957,36.448599],[108.401401,36.447036],[108.40802,36.459616],[108.391615,36.50539],[108.365425,36.519679],[108.359611,36.547312],[108.340616,36.558862],[108.306424,36.561203],[108.287429,36.553322],[108.270218,36.567446],[108.262447,36.549341],[108.245466,36.571035],[108.216628,36.571347],[108.204713,36.606371],[108.222902,36.630933],[108.197863,36.629919],[108.182321,36.59007],[108.163614,36.5637],[108.141453,36.562608],[108.139092,36.57673],[108.115607,36.586638],[108.09287,36.58734],[108.094943,36.604499],[108.079977,36.613077],[108.06219,36.592566],[108.046188,36.596232],[108.002096,36.637403],[108.023163,36.648082],[108.023336,36.66967],[108.004744,36.68315],[107.985979,36.674891],[107.980798,36.653383],[107.974409,36.666086],[107.937454,36.658215],[107.940965,36.694835],[107.905507,36.740625],[107.906659,36.75238],[107.881907,36.747164],[107.86625,36.76709],[107.826706,36.785454],[107.819971,36.776817],[107.768223,36.792923],[107.74491,36.811203],[107.720792,36.802336],[107.672095,36.8329],[107.694947,36.849772],[107.723095,36.8591],[107.727124,36.892828],[107.723267,36.920094],[107.706287,36.963033],[107.693335,36.97421],[107.723958,36.985929],[107.748307,36.986317],[107.752739,37.001137],[107.725282,37.016265],[107.702142,37.018126],[107.69512,36.996637],[107.68591,37.022935],[107.674858,37.029916],[107.65995,37.058529],[107.670138,37.064653],[107.696962,37.050078],[107.720217,37.07349],[107.700473,37.091471],[107.692472,37.123856],[107.675779,37.121687],[107.704099,37.142676],[107.734377,37.136946],[107.744738,37.153905],[107.724131,37.16366],[107.749343,37.176511],[107.747616,37.207699],[107.771159,37.230521],[107.78388,37.230521],[107.797694,37.246144],[107.82141,37.243283],[107.820086,37.220697],[107.850594,37.221393],[107.858652,37.212341],[107.866941,37.16397],[107.887145,37.132299],[107.888584,37.083953],[107.930835,37.094028],[107.94252,37.081861],[107.959097,37.081783],[107.982525,37.110299],[108.032316,37.127187],[108.102195,37.130052],[108.11555,37.149646],[108.123954,37.20414],[108.136617,37.191139],[108.173745,37.195705],[108.174723,37.164666],[108.213347,37.171866],[108.230673,37.194235],[108.24915,37.201741],[108.260087,37.216983],[108.251971,37.234775],[108.275571,37.235239],[108.282248,37.26161],[108.261296,37.268491],[108.245524,37.283642],[108.249438,37.298018],[108.21657,37.325139],[108.236659,37.340279],[108.263253,37.341747],[108.319548,37.358814],[108.343436,37.373871],[108.362201,37.405363],[108.361395,37.388461],[108.407445,37.381127],[108.406581,37.406675],[108.418842,37.407215],[108.431736,37.388306],[108.428743,37.356961],[108.438701,37.3144],[108.486419,37.28542],[108.474274,37.26161],[108.452688,37.2538],[108.48665,37.233074],[108.515258,37.231294],[108.512725,37.204217],[108.540527,37.178833],[108.547838,37.163583],[108.536325,37.117117],[108.552097,37.088293],[108.536728,37.060544],[108.542254,37.039842],[108.510135,37.023246],[108.487743,37.026891],[108.501213,37.001292],[108.517503,37.003309],[108.536268,36.988955],[108.558486,36.986549],[108.598607,37.004783],[108.611328,37.029838],[108.621459,37.02627],[108.651218,37.03961],[108.672401,37.020298],[108.688173,36.996637],[108.73664,36.982592],[108.758456,36.98911],[108.768241,36.974831],[108.80485,37.002999],[108.803987,37.023789],[108.815845,37.029916],[108.809052,37.043409],[108.782631,37.05062],[108.770601,37.069072],[108.741245,37.081241],[108.757707,37.099607],[108.750915,37.114405],[108.773249,37.113088],[108.778314,37.121919],[108.79754,37.111694],[108.819528,37.139734],[108.834437,37.136868],[108.853202,37.154601],[108.883019,37.150962],[108.882904,37.177285],[108.862239,37.180149],[108.85349,37.205378],[108.859994,37.236554],[108.868801,37.242123],[108.862354,37.263543],[108.876227,37.252717],[108.889639,37.222321],[108.894646,37.23493],[108.920722,37.238333],[108.950884,37.233383],[108.963778,37.263233],[108.984673,37.267099],[109.002459,37.285807],[109.01449,37.283024],[109.013684,37.303891],[109.049027,37.295468],[109.056567,37.28542],[109.078498,37.312005],[109.111193,37.307214],[109.11787,37.322435],[109.142737,37.318572],[109.173935,37.30451],[109.178713,37.327148],[109.205249,37.32089],[109.231497,37.329311],[109.24347,37.31865],[109.24865,37.337035],[109.282612,37.346072],[109.300744,37.34445],[109.307651,37.354644],[109.342994,37.347385],[109.329812,37.373253],[109.349786,37.379815],[109.362968,37.408913],[109.385877,37.438154],[109.417421,37.446947],[109.434574,37.459672],[109.453397,37.460212],[109.468651,37.487351],[109.492539,37.498451],[109.509002,37.481647],[109.536516,37.477869],[109.564088,37.460135],[109.576291,37.438],[109.634659,37.419407],[109.669599,37.422339],[109.717778,37.435377],[109.738673,37.424808],[109.734758,37.400501],[109.772807,37.393246],[109.77344,37.363756],[109.784434,37.343369],[109.80366,37.347308],[109.812351,37.305051],[109.783801,37.310691],[109.762043,37.270733],[109.797788,37.265476],[109.811948,37.257821],[109.841017,37.279546],[109.879353,37.270887],[109.905601,37.277922],[109.898176,37.294927],[109.919128,37.314091],[109.926784,37.29284],[109.987857,37.26965],[110.011227,37.274212],[110.028323,37.265244],[110.030222,37.245294],[110.013126,37.204913],[109.988375,37.199652],[109.968919,37.213424],[109.954529,37.206306],[109.982101,37.179375],[109.978071,37.151659],[109.990677,37.130207],[110.013644,37.146316],[110.025099,37.132221],[110.011112,37.095345],[110.031546,37.053179],[110.032467,37.029605],[110.066141,37.01099],[110.087554,36.985308],[110.115816,36.973201],[110.170557,36.988567],[110.191107,37.013394],[110.242855,37.00362],[110.269621,36.988955],[110.278601,36.968544],[110.294718,36.965594],[110.324247,36.98492],[110.352222,36.975141],[110.362238,36.943857],[110.375649,36.962024],[110.388313,36.958608],[110.418706,36.973589],[110.425728,36.957211],[110.415655,36.934228],[110.408747,36.892361],[110.376052,36.88226],[110.382902,36.870448],[110.414043,36.865707],[110.424519,36.855524],[110.419511,36.835],[110.407251,36.824891],[110.422908,36.819214],[110.419569,36.798291],[110.4061,36.774483],[110.384111,36.775261],[110.388486,36.764911],[110.420145,36.760786],[110.432002,36.74802],[110.414504,36.728869],[110.421238,36.721549],[110.439946,36.737122],[110.451803,36.726533],[110.436722,36.71127],[110.433269,36.679799],[110.408575,36.696627],[110.393206,36.692498],[110.394472,36.676839],[110.422389,36.661799],[110.447429,36.621109],[110.47149,36.595764],[110.498256,36.578056],[110.489909,36.550746],[110.50217,36.530999],[110.503379,36.488209],[110.495781,36.472976],[110.473159,36.453209],[110.492154,36.423119],[110.487031,36.393877],[110.469245,36.369944],[110.459977,36.327847],[110.473562,36.310548],[110.468209,36.291366],[110.476037,36.279541],[110.473907,36.24813],[110.454164,36.223682],[110.459517,36.194601],[110.447083,36.164332],[110.45048,36.132247],[110.470453,36.094654],[110.467978,36.074634],[110.492212,36.034656],[110.499695,36.008098],[110.49296,35.995916],[110.514258,35.975714],[110.515064,35.958101],[110.503206,35.943237],[110.516675,35.921684],[110.511668,35.879739],[110.551212,35.87541],[110.54937,35.854074]]]]}},{type:"Feature",properties:{name:"汉中",center:[107.028621,33.077668],centroid:[107.106739,33.090936],childrenNum:11,level:"city",code:610700,filename:"610000/610700",fullname:"汉中市",bbox:[[105.491948,33.877432],[108.283384,32.146037]],offset:[.5785,.4543]},geometry:{type:"MultiPolygon",coordinates:[[[[108.054247,33.709842],[108.052117,33.680016],[108.065068,33.651635],[108.058391,33.618796],[108.070364,33.602129],[108.060406,33.578499],[108.066392,33.540692],[108.060463,33.520042],[108.077329,33.504004],[108.101677,33.500358],[108.151641,33.463977],[108.158606,33.432363],[108.143582,33.405604],[108.117507,33.416795],[108.092928,33.4009],[108.10398,33.391492],[108.095518,33.373483],[108.056434,33.349222],[108.042734,33.324061],[108.052923,33.297025],[108.039338,33.283139],[108.033237,33.260965],[108.021839,33.257878],[108.048606,33.237972],[108.046591,33.226677],[108.077502,33.212373],[108.070594,33.203757],[108.107318,33.21091],[108.097993,33.190587],[108.104498,33.134147],[108.090108,33.093461],[108.095115,33.072053],[108.132243,33.023112],[108.137941,33.008857],[108.126832,32.988243],[108.12545,32.943903],[108.078423,32.902314],[108.078192,32.877514],[108.102598,32.850341],[108.112787,32.819567],[108.130228,32.807809],[108.121191,32.79997],[108.128962,32.777021],[108.149914,32.782003],[108.150547,32.76779],[108.189286,32.766728],[108.230961,32.729796],[108.240574,32.716147],[108.228601,32.693994],[108.255137,32.685817],[108.253065,32.673634],[108.265958,32.615308],[108.258878,32.605652],[108.197345,32.620709],[108.187962,32.608188],[108.211678,32.600577],[108.249496,32.571273],[108.251625,32.545071],[108.277931,32.519926],[108.27914,32.497068],[108.247078,32.473303],[108.18612,32.438709],[108.176392,32.42846],[108.156073,32.439611],[108.121133,32.439857],[108.11555,32.433216],[108.135927,32.382692],[108.117046,32.38704],[108.109448,32.372026],[108.126717,32.349541],[108.13679,32.318103],[108.167125,32.291744],[108.180825,32.259053],[108.156649,32.239005],[108.141683,32.218871],[108.12309,32.218378],[108.088208,32.233418],[108.060751,32.220515],[108.034676,32.220761],[108.018616,32.211803],[108.024372,32.177273],[107.995706,32.147173],[107.979359,32.146022],[107.924733,32.197006],[107.890541,32.214433],[107.867517,32.202432],[107.8358,32.223063],[107.788715,32.279836],[107.754581,32.338215],[107.716763,32.328857],[107.694774,32.35701],[107.695292,32.374734],[107.679463,32.398279],[107.650452,32.412879],[107.636349,32.405989],[107.598243,32.411566],[107.571132,32.397705],[107.525255,32.382446],[107.502864,32.395654],[107.48974,32.425262],[107.457217,32.417717],[107.450195,32.430838],[107.461995,32.441333],[107.457793,32.458713],[107.43874,32.465844],[107.429243,32.501083],[107.436323,32.529755],[107.411283,32.538027],[107.377898,32.538928],[107.356888,32.506408],[107.313889,32.490185],[107.286087,32.454532],[107.283784,32.4342],[107.263926,32.403282],[107.230597,32.416077],[107.210048,32.431986],[107.189613,32.468057],[107.127102,32.482482],[107.104653,32.516649],[107.080131,32.542368],[107.091989,32.552604],[107.107761,32.600741],[107.097572,32.627009],[107.099069,32.649506],[107.087672,32.667909],[107.068389,32.669954],[107.059697,32.686144],[107.066835,32.708872],[107.030225,32.712387],[107.012554,32.721542],[106.988436,32.711815],[106.964778,32.717046],[106.917002,32.703313],[106.903417,32.721296],[106.872564,32.725628],[106.845913,32.721051],[106.823119,32.705357],[106.793244,32.712632],[106.784322,32.697264],[106.779429,32.737478],[106.732056,32.73854],[106.684453,32.709281],[106.663443,32.690723],[106.628733,32.681238],[106.588613,32.688597],[106.566797,32.675841],[106.518733,32.668645],[106.498068,32.649343],[106.461977,32.653105],[106.451673,32.660139],[106.450983,32.640181],[106.420533,32.616617],[106.389046,32.626682],[106.38329,32.646561],[106.351171,32.671834],[106.300862,32.679848],[106.278816,32.67069],[106.256424,32.693258],[106.174342,32.697591],[106.169334,32.710017],[106.153677,32.705766],[106.145388,32.720397],[106.120003,32.719662],[106.071652,32.75815],[106.076487,32.759049],[106.076717,32.763787],[106.072688,32.763869],[106.064226,32.782248],[106.094676,32.795969],[106.09364,32.823812],[106.069925,32.824057],[106.04667,32.852299],[106.021688,32.857522],[106.011557,32.82969],[105.99521,32.827975],[105.969307,32.849035],[105.940929,32.829771],[105.886879,32.835159],[105.857753,32.827404],[105.850788,32.818097],[105.831159,32.826098],[105.816941,32.790334],[105.822525,32.770159],[105.811415,32.772283],[105.779584,32.750225],[105.76882,32.767545],[105.750688,32.767954],[105.735952,32.753902],[105.719202,32.759703],[105.678045,32.726527],[105.649264,32.718681],[105.625376,32.702087],[105.596365,32.699226],[105.585198,32.729061],[105.563785,32.724893],[105.557856,32.752921],[105.568102,32.758722],[105.554691,32.773998],[105.556302,32.792049],[105.535868,32.789844],[105.524528,32.847729],[105.495517,32.87319],[105.493503,32.905495],[105.513995,32.919115],[105.534141,32.909491],[105.56557,32.9068],[105.590609,32.87678],[105.644544,32.882735],[105.656575,32.89538],[105.699401,32.903456],[105.735434,32.905331],[105.78557,32.92678],[105.826957,32.950751],[105.861724,32.938929],[105.917444,32.993784],[105.928093,33.041519],[105.9133,33.053164],[105.915084,33.066273],[105.933273,33.077019],[105.91871,33.105425],[105.936785,33.113562],[105.920092,33.132113],[105.92343,33.147732],[105.896376,33.142689],[105.924582,33.167576],[105.916926,33.177741],[105.927747,33.198473],[105.945534,33.188148],[105.9468,33.153507],[105.968328,33.154076],[105.966889,33.20018],[105.921301,33.236266],[105.906565,33.240166],[105.862588,33.234316],[105.828799,33.253897],[105.792823,33.262752],[105.791499,33.278591],[105.767438,33.28257],[105.747752,33.298893],[105.755235,33.32885],[105.734168,33.346544],[105.708956,33.380703],[105.732844,33.391005],[105.743262,33.385327],[105.802609,33.378756],[105.829662,33.382812],[105.837951,33.410795],[105.830986,33.456439],[105.841981,33.490069],[105.868344,33.509269],[105.902708,33.556157],[105.919459,33.554781],[105.953996,33.587159],[105.962112,33.606499],[105.979726,33.612405],[105.998951,33.604152],[106.018983,33.609735],[106.02848,33.595251],[106.045749,33.609735],[106.063881,33.604152],[106.086675,33.617097],[106.131343,33.597193],[106.110851,33.591933],[106.108491,33.569838],[106.1333,33.571861],[106.147518,33.581817],[106.143719,33.5649],[106.187178,33.546522],[106.237429,33.56409],[106.277492,33.59687],[106.303395,33.604395],[106.335169,33.587078],[106.351401,33.587239],[106.384902,33.612081],[106.431354,33.61912],[106.446896,33.613214],[106.45271,33.591852],[106.456048,33.537939],[106.477461,33.519394],[106.494269,33.530489],[106.541124,33.513076],[106.563055,33.543041],[106.559774,33.57089],[106.580554,33.575909],[106.581475,33.590638],[106.596729,33.579389],[106.617911,33.591933],[106.629827,33.619605],[106.647325,33.634813],[106.64226,33.658994],[106.687043,33.665544],[106.705693,33.676944],[106.674955,33.701437],[106.71427,33.701356],[106.789215,33.67751],[106.797273,33.682441],[106.803835,33.72366],[106.80585,33.809832],[106.817823,33.834448],[106.839409,33.827023],[106.854375,33.848649],[106.855583,33.874384],[106.888681,33.860993],[106.890063,33.848327],[106.909691,33.847762],[106.930701,33.827266],[106.978247,33.800952],[107.028153,33.794574],[107.043234,33.805069],[107.038514,33.85462],[107.044904,33.873819],[107.063093,33.870431],[107.066432,33.838725],[107.080477,33.8221],[107.105746,33.822504],[107.112078,33.812818],[107.136945,33.81411],[107.128368,33.777618],[107.145233,33.794251],[107.163135,33.788035],[107.181612,33.769462],[107.187369,33.751774],[107.212581,33.74927],[107.231173,33.766797],[107.27279,33.790699],[107.276762,33.801194],[107.299499,33.792798],[107.322581,33.818872],[107.342037,33.81411],[107.328279,33.797642],[107.32212,33.774469],[107.305543,33.766878],[107.304334,33.733517],[107.314177,33.728831],[107.3056,33.710165],[107.336165,33.68907],[107.376516,33.682845],[107.400347,33.651312],[107.423601,33.649371],[107.467694,33.660612],[107.492503,33.679854],[107.517082,33.678318],[107.562555,33.70273],[107.586846,33.697719],[107.628694,33.714448],[107.650682,33.700628],[107.673764,33.699497],[107.695868,33.72366],[107.719353,33.725761],[107.737427,33.717923],[107.763503,33.719781],[107.830102,33.69788],[107.854278,33.694081],[107.90309,33.748947],[107.931583,33.731255],[107.951672,33.745797],[107.96612,33.734648],[108.008312,33.728993],[108.054247,33.709842]]],[[[106.076717,32.763787],[106.076487,32.759049],[106.071652,32.75815],[106.072688,32.763869],[106.076717,32.763787]]]]}},{type:"Feature",properties:{name:"榆林",center:[109.741193,38.290162],centroid:[109.577105,38.048207],childrenNum:12,level:"city",code:610800,filename:"610000/610800",fullname:"榆林市",bbox:[[107.257494,39.58701],[111.248053,36.813965]],offset:[.5813,.5549]},geometry:{type:"MultiPolygon",coordinates:[[[[110.418706,36.973589],[110.388313,36.958608],[110.375649,36.962024],[110.362238,36.943857],[110.352222,36.975141],[110.324247,36.98492],[110.294718,36.965594],[110.278601,36.968544],[110.269621,36.988955],[110.242855,37.00362],[110.191107,37.013394],[110.170557,36.988567],[110.115816,36.973201],[110.087554,36.985308],[110.066141,37.01099],[110.032467,37.029605],[110.031546,37.053179],[110.011112,37.095345],[110.025099,37.132221],[110.013644,37.146316],[109.990677,37.130207],[109.978071,37.151659],[109.982101,37.179375],[109.954529,37.206306],[109.968919,37.213424],[109.988375,37.199652],[110.013126,37.204913],[110.030222,37.245294],[110.028323,37.265244],[110.011227,37.274212],[109.987857,37.26965],[109.926784,37.29284],[109.919128,37.314091],[109.898176,37.294927],[109.905601,37.277922],[109.879353,37.270887],[109.841017,37.279546],[109.811948,37.257821],[109.797788,37.265476],[109.762043,37.270733],[109.783801,37.310691],[109.812351,37.305051],[109.80366,37.347308],[109.784434,37.343369],[109.77344,37.363756],[109.772807,37.393246],[109.734758,37.400501],[109.738673,37.424808],[109.717778,37.435377],[109.669599,37.422339],[109.634659,37.419407],[109.576291,37.438],[109.564088,37.460135],[109.536516,37.477869],[109.509002,37.481647],[109.492539,37.498451],[109.468651,37.487351],[109.453397,37.460212],[109.434574,37.459672],[109.417421,37.446947],[109.385877,37.438154],[109.362968,37.408913],[109.349786,37.379815],[109.329812,37.373253],[109.342994,37.347385],[109.307651,37.354644],[109.300744,37.34445],[109.282612,37.346072],[109.24865,37.337035],[109.24347,37.31865],[109.231497,37.329311],[109.205249,37.32089],[109.178713,37.327148],[109.173935,37.30451],[109.142737,37.318572],[109.11787,37.322435],[109.111193,37.307214],[109.078498,37.312005],[109.056567,37.28542],[109.049027,37.295468],[109.013684,37.303891],[109.01449,37.283024],[109.002459,37.285807],[108.984673,37.267099],[108.963778,37.263233],[108.950884,37.233383],[108.920722,37.238333],[108.894646,37.23493],[108.889639,37.222321],[108.876227,37.252717],[108.862354,37.263543],[108.868801,37.242123],[108.859994,37.236554],[108.85349,37.205378],[108.862239,37.180149],[108.882904,37.177285],[108.883019,37.150962],[108.853202,37.154601],[108.834437,37.136868],[108.819528,37.139734],[108.79754,37.111694],[108.778314,37.121919],[108.773249,37.113088],[108.750915,37.114405],[108.757707,37.099607],[108.741245,37.081241],[108.770601,37.069072],[108.782631,37.05062],[108.809052,37.043409],[108.815845,37.029916],[108.803987,37.023789],[108.80485,37.002999],[108.768241,36.974831],[108.758456,36.98911],[108.73664,36.982592],[108.688173,36.996637],[108.672401,37.020298],[108.651218,37.03961],[108.621459,37.02627],[108.611328,37.029838],[108.598607,37.004783],[108.558486,36.986549],[108.536268,36.988955],[108.517503,37.003309],[108.501213,37.001292],[108.487743,37.026891],[108.510135,37.023246],[108.542254,37.039842],[108.536728,37.060544],[108.552097,37.088293],[108.536325,37.117117],[108.547838,37.163583],[108.540527,37.178833],[108.512725,37.204217],[108.515258,37.231294],[108.48665,37.233074],[108.452688,37.2538],[108.474274,37.26161],[108.486419,37.28542],[108.438701,37.3144],[108.428743,37.356961],[108.431736,37.388306],[108.418842,37.407215],[108.406581,37.406675],[108.407445,37.381127],[108.361395,37.388461],[108.362201,37.405363],[108.343436,37.373871],[108.319548,37.358814],[108.263253,37.341747],[108.236659,37.340279],[108.21657,37.325139],[108.249438,37.298018],[108.245524,37.283642],[108.261296,37.268491],[108.282248,37.26161],[108.275571,37.235239],[108.251971,37.234775],[108.260087,37.216983],[108.24915,37.201741],[108.230673,37.194235],[108.213347,37.171866],[108.174723,37.164666],[108.173745,37.195705],[108.136617,37.191139],[108.123954,37.20414],[108.11555,37.149646],[108.102195,37.130052],[108.032316,37.127187],[107.982525,37.110299],[107.959097,37.081783],[107.94252,37.081861],[107.930835,37.094028],[107.888584,37.083953],[107.887145,37.132299],[107.866941,37.16397],[107.858652,37.212341],[107.850594,37.221393],[107.820086,37.220697],[107.82141,37.243283],[107.797694,37.246144],[107.78388,37.230521],[107.771159,37.230521],[107.747616,37.207699],[107.749343,37.176511],[107.724131,37.16366],[107.744738,37.153905],[107.734377,37.136946],[107.704099,37.142676],[107.675779,37.121687],[107.692472,37.123856],[107.700473,37.091471],[107.720217,37.07349],[107.696962,37.050078],[107.670138,37.064653],[107.65995,37.058529],[107.674858,37.029916],[107.68591,37.022935],[107.69512,36.996637],[107.702142,37.018126],[107.725282,37.016265],[107.752739,37.001137],[107.748307,36.986317],[107.723958,36.985929],[107.693335,36.97421],[107.706287,36.963033],[107.723267,36.920094],[107.727124,36.892828],[107.723095,36.8591],[107.694947,36.849772],[107.672095,36.8329],[107.639515,36.818514],[107.603597,36.825824],[107.590818,36.836244],[107.540106,36.828624],[107.528479,36.853737],[107.533717,36.867184],[107.47794,36.908443],[107.447202,36.899432],[107.370645,36.904792],[107.332827,36.925608],[107.311702,36.913026],[107.294836,36.929414],[107.304276,36.951699],[107.287411,36.992369],[107.279525,37.041703],[107.285223,37.056435],[107.268703,37.099452],[107.277568,37.102396],[107.278258,37.128194],[107.307039,37.100459],[107.3311,37.13013],[107.337835,37.153982],[107.333978,37.173801],[107.317688,37.199961],[107.270315,37.229129],[107.291382,37.241272],[107.309342,37.238874],[107.293282,37.277458],[107.273135,37.29114],[107.257939,37.336958],[107.261047,37.37086],[107.271063,37.390313],[107.283612,37.440776],[107.284302,37.481955],[107.345663,37.518873],[107.359132,37.540214],[107.372199,37.580029],[107.368918,37.587574],[107.330467,37.584033],[107.312565,37.610127],[107.325056,37.606279],[107.36132,37.613282],[107.39672,37.652443],[107.419918,37.650212],[107.422047,37.665056],[107.389583,37.671208],[107.386877,37.691121],[107.407081,37.692966],[107.430566,37.684202],[107.465449,37.691198],[107.485077,37.706495],[107.490833,37.745376],[107.49918,37.765654],[107.523413,37.772949],[107.571305,37.776712],[107.599222,37.791146],[107.620692,37.775944],[107.646135,37.805194],[107.659259,37.8441],[107.650222,37.864581],[107.675952,37.875778],[107.683435,37.887739],[107.741169,37.845328],[107.815884,37.829062],[107.842708,37.828985],[107.8849,37.808341],[107.894628,37.813637],[107.937109,37.795062],[107.981949,37.787231],[107.979992,37.764732],[107.993692,37.735081],[108.014069,37.725861],[108.02443,37.698655],[108.013205,37.665517],[108.025408,37.649827],[108.060233,37.652058],[108.077041,37.642981],[108.108239,37.637827],[108.133912,37.621978],[108.154001,37.623901],[108.193661,37.638289],[108.205576,37.65575],[108.246502,37.665748],[108.292782,37.656981],[108.301128,37.64075],[108.33296,37.633057],[108.351265,37.641366],[108.422411,37.648827],[108.477037,37.674207],[108.532641,37.690583],[108.55958,37.681742],[108.61127,37.654212],[108.628366,37.652212],[108.699512,37.66967],[108.713442,37.680665],[108.741648,37.685509],[108.777681,37.68351],[108.792014,37.700269],[108.78338,37.737309],[108.784704,37.764655],[108.801397,37.792298],[108.793223,37.815863],[108.792072,37.872864],[108.798231,37.933652],[108.824882,37.98321],[108.826666,37.995155],[108.797655,38.047886],[108.830638,38.049798],[108.855504,38.038322],[108.882961,38.013833],[108.893841,37.978157],[108.917095,37.959776],[108.935803,37.921621],[108.974197,37.931889],[108.97955,37.959316],[109.017483,37.969962],[109.015468,37.982828],[109.028938,37.997452],[109.038032,38.021487],[109.069519,38.023017],[109.050754,38.055],[109.068828,38.091174],[109.06359,38.100196],[109.019785,38.119688],[108.964469,38.154761],[108.947258,38.170725],[108.938508,38.207453],[108.955144,38.218521],[108.976557,38.249503],[108.961878,38.265065],[108.976441,38.296942],[108.989738,38.310893],[109.007813,38.35913],[109.051272,38.385255],[109.059791,38.408705],[109.054265,38.433975],[109.092486,38.45353],[109.128634,38.480533],[109.147112,38.506157],[109.178655,38.520828],[109.196845,38.552668],[109.27674,38.622986],[109.310299,38.60249],[109.331366,38.597935],[109.366537,38.631107],[109.328891,38.660471],[109.325956,38.670029],[109.338734,38.7015],[109.403952,38.720603],[109.412528,38.747581],[109.442576,38.771141],[109.450864,38.788863],[109.489258,38.813317],[109.511189,38.833753],[109.549755,38.805672],[109.624413,38.854485],[109.649279,38.884514],[109.67098,38.926472],[109.683759,38.93554],[109.68537,38.968254],[109.665339,38.981697],[109.672016,38.997026],[109.691242,38.992647],[109.704826,39.016956],[109.725376,39.01839],[109.762388,39.057478],[109.793356,39.074072],[109.815345,39.096167],[109.860128,39.124435],[109.882116,39.116747],[109.890923,39.104007],[109.922121,39.107023],[109.893916,39.141239],[109.960457,39.186735],[109.897255,39.234082],[109.882174,39.233104],[109.868992,39.249732],[109.902723,39.271922],[109.941289,39.239952],[109.962702,39.211881],[110.010997,39.208568],[110.078401,39.230771],[110.110808,39.249732],[110.159851,39.263122],[110.193352,39.280721],[110.210851,39.281473],[110.202792,39.316356],[110.185293,39.3531],[110.158872,39.389599],[110.136769,39.391777],[110.126408,39.416849],[110.133373,39.448289],[110.152483,39.45399],[110.206188,39.437485],[110.217125,39.443262],[110.243488,39.423678],[110.276759,39.420301],[110.257648,39.407091],[110.281018,39.394179],[110.296617,39.376008],[110.34094,39.341531],[110.370008,39.329433],[110.385205,39.310494],[110.429124,39.342057],[110.416576,39.348668],[110.434995,39.380889],[110.469475,39.375182],[110.482599,39.360612],[110.499177,39.360687],[110.521741,39.383217],[110.559156,39.352124],[110.566927,39.318461],[110.596571,39.283052],[110.626273,39.266808],[110.669617,39.275908],[110.688382,39.267485],[110.70283,39.273878],[110.732877,39.308464],[110.738288,39.348518],[110.768565,39.382917],[110.782668,39.388098],[110.806613,39.411295],[110.862909,39.482639],[110.890826,39.508952],[110.959152,39.519445],[110.990177,39.537054],[110.996624,39.547767],[111.017231,39.552037],[111.040947,39.567691],[111.04371,39.554584],[111.100984,39.559452],[111.136787,39.58701],[111.154976,39.568664],[111.148875,39.532633],[111.107143,39.499208],[111.100005,39.483239],[111.108869,39.474165],[111.088032,39.468391],[111.086881,39.45669],[111.05833,39.447689],[111.053841,39.429907],[111.064374,39.400936],[111.086651,39.412721],[111.09776,39.404539],[111.086593,39.380139],[111.108121,39.356556],[111.125562,39.36647],[111.155034,39.368273],[111.161711,39.33552],[111.18842,39.350922],[111.194233,39.340479],[111.17944,39.326803],[111.187959,39.314327],[111.213804,39.301247],[111.247478,39.3023],[111.227159,39.284406],[111.213516,39.25718],[111.218985,39.24567],[111.163093,39.152465],[111.174144,39.135136],[111.162517,39.108455],[111.147321,39.100539],[111.138341,39.064267],[111.088953,39.02707],[111.038241,39.020126],[110.998409,38.998536],[110.979989,38.972257],[110.994552,38.960171],[111.009921,38.932593],[111.015735,38.896234],[111.012339,38.878312],[110.996049,38.868026],[111.010094,38.841623],[110.996509,38.825125],[110.979126,38.787727],[110.956274,38.776746],[110.965023,38.755688],[110.937681,38.718784],[110.915405,38.704305],[110.916211,38.673973],[110.896409,38.657816],[110.88081,38.626933],[110.89664,38.588216],[110.919895,38.582064],[110.909418,38.563152],[110.907692,38.521056],[110.870161,38.508894],[110.874248,38.453682],[110.84069,38.439986],[110.825033,38.449421],[110.796828,38.453454],[110.77766,38.4409],[110.758952,38.400407],[110.750318,38.36949],[110.701621,38.35334],[110.668581,38.313637],[110.638821,38.304718],[110.601291,38.308225],[110.577461,38.297247],[110.567963,38.245764],[110.567272,38.217529],[110.558235,38.210506],[110.523928,38.210506],[110.507869,38.18493],[110.510574,38.147274],[110.521165,38.124427],[110.501882,38.098132],[110.508789,38.061961],[110.501422,38.03901],[110.508099,38.012838],[110.52836,37.990638],[110.516618,37.970728],[110.522489,37.95495],[110.547644,37.940317],[110.587937,37.926602],[110.607277,37.89625],[110.650564,37.840034],[110.660752,37.808034],[110.680381,37.790072],[110.735755,37.770415],[110.755671,37.755055],[110.750721,37.736157],[110.716645,37.728704],[110.70352,37.718638],[110.706571,37.705342],[110.739094,37.68943],[110.775357,37.680896],[110.796137,37.663056],[110.793317,37.65075],[110.76373,37.639596],[110.772249,37.592655],[110.794928,37.56617],[110.771098,37.538365],[110.771271,37.520183],[110.759528,37.503461],[110.758377,37.471161],[110.744965,37.450726],[110.648146,37.438154],[110.631799,37.398803],[110.634044,37.36615],[110.651773,37.357038],[110.695059,37.349625],[110.693965,37.325912],[110.678711,37.317877],[110.690051,37.287043],[110.661903,37.282019],[110.650161,37.254341],[110.584541,37.18069],[110.540276,37.144612],[110.535556,37.115102],[110.495781,37.086743],[110.460495,37.044728],[110.425958,37.04085],[110.424059,37.023944],[110.450307,37.016497],[110.441212,37.00618],[110.412834,37.019212],[110.38319,37.021849],[110.377146,37.010291],[110.40846,36.989032],[110.418706,36.973589]]]]}},{type:"Feature",properties:{name:"安康",center:[109.029273,32.6903],centroid:[108.929995,32.759384],childrenNum:10,level:"city",code:610900,filename:"610000/610900",fullname:"安康市",bbox:[[108.021471,33.841692],[110.206428,31.705059]],offset:[.4158,.5065]},geometry:{type:"MultiPolygon",coordinates:[[[[109.438892,33.152124],[109.468536,33.140248],[109.514009,33.140248],[109.560347,33.125686],[109.576176,33.110226],[109.592236,33.119584],[109.601964,33.108192],[109.633277,33.118038],[109.688076,33.116573],[109.715245,33.099484],[109.768029,33.074496],[109.794507,33.066924],[109.784607,32.985961],[109.764345,32.909328],[109.789902,32.882491],[109.80838,32.878983],[109.847752,32.893259],[109.857077,32.910307],[109.883785,32.901743],[109.915962,32.901009],[109.931274,32.885346],[109.98872,32.886244],[110.004319,32.873271],[110.030452,32.872129],[110.05129,32.851891],[110.0841,32.842995],[110.113802,32.825445],[110.1195,32.812953],[110.14218,32.802828],[110.127501,32.777756],[110.139589,32.764931],[110.159621,32.767218],[110.162326,32.715902],[110.154498,32.690069],[110.187883,32.646316],[110.206418,32.632981],[110.165147,32.593866],[110.153807,32.593129],[110.13343,32.612198],[110.10252,32.619072],[110.085366,32.613099],[110.088187,32.585435],[110.051578,32.558664],[110.028207,32.548428],[109.995743,32.550721],[109.971164,32.577576],[109.944801,32.57684],[109.910552,32.59272],[109.881253,32.591983],[109.849479,32.579787],[109.817071,32.577413],[109.758186,32.589855],[109.7267,32.60827],[109.631838,32.600086],[109.61929,32.593047],[109.620038,32.567425],[109.636788,32.541058],[109.618138,32.524759],[109.587516,32.516075],[109.576003,32.491742],[109.552748,32.477155],[109.541639,32.444285],[109.526903,32.43338],[109.529609,32.405743],[109.506239,32.395326],[109.500425,32.378918],[109.513204,32.342319],[109.510671,32.324588],[109.495417,32.300367],[109.528688,32.270308],[109.550446,32.224871],[109.592754,32.219364],[109.604324,32.199226],[109.587113,32.161484],[109.592581,32.139194],[109.62165,32.106777],[109.617851,32.085132],[109.590969,32.047755],[109.587573,32.025272],[109.601388,31.997676],[109.631263,31.962242],[109.620614,31.928608],[109.594481,31.923331],[109.584983,31.900488],[109.607547,31.881681],[109.638227,31.81104],[109.604554,31.803774],[109.591833,31.788912],[109.592984,31.75191],[109.605993,31.743731],[109.585731,31.726711],[109.549755,31.730016],[109.501116,31.717125],[109.458981,31.715803],[109.457023,31.721587],[109.417882,31.71886],[109.415464,31.710018],[109.390252,31.705224],[109.323193,31.708861],[109.281576,31.716877],[109.28313,31.741749],[109.254694,31.766944],[109.28123,31.777928],[109.273575,31.80105],[109.213595,31.817479],[109.196212,31.817561],[109.198284,31.845789],[109.167028,31.875329],[109.124605,31.892157],[109.087823,31.927371],[109.035097,31.958038],[108.986745,31.979961],[108.955086,31.979137],[108.937127,31.988942],[108.902417,31.984905],[108.867765,32.004102],[108.837891,32.038862],[108.788675,32.048332],[108.751721,32.074184],[108.747749,32.099864],[108.734049,32.106448],[108.679769,32.102992],[108.583986,32.172257],[108.551061,32.176122],[108.510595,32.200212],[108.514509,32.218214],[108.507142,32.245661],[108.483656,32.251413],[108.471741,32.270636],[108.450789,32.2593],[108.431045,32.262586],[108.414985,32.252481],[108.387644,32.262257],[108.347984,32.25396],[108.329276,32.232596],[108.312065,32.232185],[108.287832,32.249359],[108.265152,32.256999],[108.247193,32.274825],[108.212196,32.256999],[108.213289,32.248208],[108.179328,32.221994],[108.156649,32.239005],[108.180825,32.259053],[108.167125,32.291744],[108.13679,32.318103],[108.126717,32.349541],[108.109448,32.372026],[108.117046,32.38704],[108.135927,32.382692],[108.11555,32.433216],[108.121133,32.439857],[108.156073,32.439611],[108.176392,32.42846],[108.18612,32.438709],[108.247078,32.473303],[108.27914,32.497068],[108.277931,32.519926],[108.251625,32.545071],[108.249496,32.571273],[108.211678,32.600577],[108.187962,32.608188],[108.197345,32.620709],[108.258878,32.605652],[108.265958,32.615308],[108.253065,32.673634],[108.255137,32.685817],[108.228601,32.693994],[108.240574,32.716147],[108.230961,32.729796],[108.189286,32.766728],[108.150547,32.76779],[108.149914,32.782003],[108.128962,32.777021],[108.121191,32.79997],[108.130228,32.807809],[108.112787,32.819567],[108.102598,32.850341],[108.078192,32.877514],[108.078423,32.902314],[108.12545,32.943903],[108.126832,32.988243],[108.137941,33.008857],[108.132243,33.023112],[108.095115,33.072053],[108.090108,33.093461],[108.104498,33.134147],[108.097993,33.190587],[108.107318,33.21091],[108.070594,33.203757],[108.077502,33.212373],[108.046591,33.226677],[108.048606,33.237972],[108.021839,33.257878],[108.033237,33.260965],[108.039338,33.283139],[108.052923,33.297025],[108.042734,33.324061],[108.056434,33.349222],[108.095518,33.373483],[108.10398,33.391492],[108.092928,33.4009],[108.117507,33.416795],[108.143582,33.405604],[108.158606,33.432363],[108.151641,33.463977],[108.101677,33.500358],[108.077329,33.504004],[108.060463,33.520042],[108.066392,33.540692],[108.060406,33.578499],[108.070364,33.602129],[108.058391,33.618796],[108.065068,33.651635],[108.052117,33.680016],[108.054247,33.709842],[108.073818,33.723417],[108.098396,33.723498],[108.113823,33.712589],[108.132243,33.721882],[108.149281,33.712347],[108.180191,33.711862],[108.191761,33.725276],[108.233148,33.726649],[108.259281,33.754763],[108.288292,33.767282],[108.307,33.76292],[108.345969,33.793848],[108.369454,33.793202],[108.404855,33.763324],[108.443709,33.781979],[108.466445,33.800629],[108.484405,33.804262],[108.544557,33.788438],[108.560444,33.765101],[108.584274,33.764536],[108.585425,33.780122],[108.602579,33.791426],[108.617717,33.825974],[108.650067,33.841549],[108.697843,33.828315],[108.741014,33.841468],[108.755923,33.839048],[108.756038,33.812657],[108.778487,33.798046],[108.805771,33.817177],[108.84002,33.815966],[108.835588,33.792233],[108.846985,33.777699],[108.903223,33.781091],[108.92337,33.774711],[108.942307,33.747816],[108.945473,33.726569],[108.922909,33.684543],[108.902245,33.678803],[108.879335,33.698527],[108.826493,33.649371],[108.798806,33.654628],[108.792244,33.642497],[108.815039,33.633034],[108.828508,33.617825],[108.805599,33.605366],[108.797367,33.58384],[108.750685,33.536401],[108.724897,33.530651],[108.693296,33.535267],[108.653809,33.54798],[108.625143,33.533161],[108.633086,33.501168],[108.588188,33.459681],[108.597456,33.407226],[108.574201,33.373889],[108.569884,33.318866],[108.583468,33.298487],[108.640166,33.321139],[108.66227,33.323574],[108.691051,33.291828],[108.687252,33.274773],[108.710507,33.270062],[108.740842,33.283788],[108.80698,33.24496],[108.816938,33.225783],[108.863851,33.192782],[108.900863,33.147732],[108.919283,33.151067],[108.931083,33.125035],[108.973218,33.13732],[108.97057,33.160338],[108.988817,33.176928],[109.005107,33.168796],[109.059618,33.214242],[109.124202,33.15985],[109.174569,33.161558],[109.218546,33.193351],[109.232015,33.192376],[109.258206,33.167739],[109.295448,33.173919],[109.313235,33.167576],[109.339195,33.135855],[109.373789,33.147244],[109.438892,33.152124]]]]}},{type:"Feature",properties:{name:"商洛",center:[109.939776,33.868319],centroid:[109.907166,33.647601],childrenNum:7,level:"city",code:611e3,filename:"610000/611000",fullname:"商洛市",bbox:[[108.569247,34.432503],[111.029972,33.095712]],offset:[.5437,.5872]},geometry:{type:"MultiPolygon",coordinates:[[[[109.185793,33.812334],[109.207379,33.867043],[109.251874,33.880675],[109.289462,33.87027],[109.299823,33.856556],[109.316918,33.85462],[109.355945,33.867608],[109.399059,33.845422],[109.442518,33.843566],[109.470263,33.851796],[109.508541,33.848004],[109.537322,33.862042],[109.540142,33.875513],[109.576118,33.897691],[109.592984,33.896804],[109.603633,33.940982],[109.562994,33.960726],[109.533235,33.982077],[109.545496,34.025244],[109.56121,34.034181],[109.552806,34.044727],[109.567139,34.064688],[109.584235,34.072092],[109.634313,34.075633],[109.658835,34.105481],[109.669886,34.099931],[109.694753,34.109101],[109.739824,34.09792],[109.742184,34.12189],[109.755078,34.127197],[109.78098,34.160083],[109.789787,34.145049],[109.822194,34.155742],[109.801415,34.160887],[109.778102,34.183392],[109.745465,34.187491],[109.754502,34.212239],[109.743565,34.240352],[109.757322,34.252961],[109.775972,34.251997],[109.80199,34.224048],[109.792147,34.263078],[109.825591,34.288205],[109.853335,34.266048],[109.873655,34.270785],[109.883555,34.24742],[109.920395,34.230313],[109.95614,34.243645],[109.94929,34.219549],[109.964372,34.209748],[109.997642,34.221638],[110.024063,34.240352],[110.007255,34.303213],[110.030855,34.30217],[110.040526,34.324156],[110.024236,34.338998],[110.007197,34.368593],[110.03736,34.377814],[110.058485,34.396975],[110.059982,34.413247],[110.075178,34.413888],[110.103383,34.428874],[110.132164,34.42687],[110.162326,34.432159],[110.194215,34.414769],[110.251834,34.406754],[110.284357,34.391364],[110.377549,34.398338],[110.388716,34.408117],[110.430966,34.40948],[110.458193,34.402426],[110.475922,34.409159],[110.473734,34.393207],[110.489449,34.35528],[110.502688,34.345174],[110.498141,34.320064],[110.474655,34.323514],[110.449328,34.291496],[110.432635,34.290853],[110.426476,34.276084],[110.442479,34.254004],[110.441385,34.242441],[110.489737,34.232321],[110.507869,34.217621],[110.551443,34.212801],[110.557141,34.193357],[110.589088,34.190223],[110.587706,34.17865],[110.621783,34.177445],[110.641987,34.160887],[110.614012,34.113686],[110.591793,34.101701],[110.595189,34.064769],[110.58834,34.06163],[110.586613,34.024037],[110.612113,34.024278],[110.624143,34.033859],[110.627769,34.019528],[110.649585,33.992307],[110.653442,33.969186],[110.670941,33.966447],[110.675603,33.946624],[110.626043,33.92462],[110.62587,33.90777],[110.591506,33.900191],[110.587304,33.886966],[110.612976,33.867447],[110.612746,33.85107],[110.644808,33.844938],[110.66789,33.852119],[110.684928,33.838805],[110.712615,33.83356],[110.72597,33.807733],[110.741338,33.798772],[110.782207,33.796027],[110.815938,33.753067],[110.816859,33.737395],[110.832228,33.712832],[110.823191,33.692869],[110.841841,33.663199],[110.857728,33.657781],[110.878853,33.634651],[110.94079,33.620091],[110.966577,33.609169],[111.003704,33.57866],[111.009748,33.562552],[111.003532,33.53308],[111.019476,33.520852],[111.026499,33.478563],[111.021664,33.476538],[111.020973,33.471189],[111.026787,33.467705],[111.020858,33.450846],[110.996739,33.43593],[111.011015,33.398873],[111.026153,33.375349],[111.026038,33.330392],[111.000366,33.32398],[111.007964,33.303683],[110.982867,33.270062],[110.997027,33.254709],[110.966174,33.256172],[110.942977,33.236347],[110.94597,33.228627],[110.921621,33.204001],[110.865326,33.21408],[110.830559,33.202537],[110.817377,33.177253],[110.824227,33.160257],[110.795101,33.149928],[110.765917,33.152449],[110.727811,33.133903],[110.717853,33.116899],[110.719926,33.099565],[110.702484,33.097124],[110.669559,33.130161],[110.651082,33.157492],[110.616372,33.145617],[110.594153,33.168552],[110.593923,33.20709],[110.577691,33.250566],[110.540966,33.255603],[110.527785,33.230415],[110.50902,33.221476],[110.470511,33.185059],[110.471029,33.171398],[110.451803,33.179367],[110.422332,33.17026],[110.361662,33.181725],[110.333975,33.159769],[110.297308,33.170585],[110.250338,33.160257],[110.218276,33.163185],[110.165031,33.209284],[110.13061,33.201725],[110.077595,33.20205],[110.040411,33.191238],[109.999139,33.212617],[109.973639,33.203919],[109.916595,33.229684],[109.845219,33.246991],[109.813157,33.236347],[109.762964,33.235778],[109.732456,33.231309],[109.70143,33.241222],[109.692969,33.254303],[109.649797,33.251703],[109.647783,33.268113],[109.616296,33.274124],[109.607374,33.264295],[109.606856,33.236022],[109.587688,33.229765],[109.549755,33.242279],[109.51424,33.237728],[109.498295,33.207333],[109.481948,33.200261],[109.464794,33.172943],[109.438892,33.152124],[109.373789,33.147244],[109.339195,33.135855],[109.313235,33.167576],[109.295448,33.173919],[109.258206,33.167739],[109.232015,33.192376],[109.218546,33.193351],[109.174569,33.161558],[109.124202,33.15985],[109.059618,33.214242],[109.005107,33.168796],[108.988817,33.176928],[108.97057,33.160338],[108.973218,33.13732],[108.931083,33.125035],[108.919283,33.151067],[108.900863,33.147732],[108.863851,33.192782],[108.816938,33.225783],[108.80698,33.24496],[108.740842,33.283788],[108.710507,33.270062],[108.687252,33.274773],[108.691051,33.291828],[108.66227,33.323574],[108.640166,33.321139],[108.583468,33.298487],[108.569884,33.318866],[108.574201,33.373889],[108.597456,33.407226],[108.588188,33.459681],[108.633086,33.501168],[108.625143,33.533161],[108.653809,33.54798],[108.693296,33.535267],[108.724897,33.530651],[108.750685,33.536401],[108.797367,33.58384],[108.805599,33.605366],[108.828508,33.617825],[108.815039,33.633034],[108.792244,33.642497],[108.798806,33.654628],[108.826493,33.649371],[108.879335,33.698527],[108.902245,33.678803],[108.922909,33.684543],[108.945473,33.726569],[108.942307,33.747816],[108.92337,33.774711],[108.903223,33.781091],[108.846985,33.777699],[108.835588,33.792233],[108.84002,33.815966],[108.854238,33.826539],[108.874788,33.824522],[108.913239,33.848649],[108.922161,33.869383],[108.944265,33.86664],[109.007985,33.883256],[109.051502,33.923169],[109.070555,33.906641],[109.107682,33.907609],[109.120576,33.876481],[109.164207,33.871319],[109.162366,33.812657],[109.147284,33.799337],[109.154019,33.791103],[109.174166,33.808702],[109.177562,33.809105],[109.185793,33.812334]]],[[[109.185793,33.812334],[109.177562,33.809105],[109.174166,33.808702],[109.162366,33.812657],[109.164207,33.871319],[109.18493,33.874303],[109.207379,33.867043],[109.185793,33.812334]]],[[[111.026499,33.478563],[111.026787,33.467705],[111.020973,33.471189],[111.021664,33.476538],[111.026499,33.478563]]]]}}],propertity:{name:"陕西",center:[108.948024,34.263161],centroid:[108.887114,35.263661],childrenNum:10,level:"province",code:61e4,filename:"610000",fullname:"陕西省",bbox:[[105.491948,39.58701],[111.248053,31.705059]],offset:[.5898,.5485]},version:"1.4.0",date:"2023-09-11 23:35:34",copyright:"Copyright (c) 2023 GeoJSON.CN",copyrightShort:"GeoJSON.CN",copyrightUrl:"https://geojson.cn",crs:{key:"3d266703d607223d8ebc45d972ca1b4e",type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}},Zt={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},$t=t.defineComponent({name:"Sublinepoins",components:{SelectPlatform:r.SelectPlatform,NvMap:d.NvMap},emits:[""],props:Zt,setup:(e,t)=>new Jt(e,t)});let Jt=class extends e.BaseInstance{constructor(e,s){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"institutionLinePointApi",new i.InstitutionLinePointApi),h(this,"institutionPointApi",new i.InstitutionPointApi),h(this,"selectedPlatform"),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"mapTheme",t.ref("light")),h(this,"MapType",t.ref(2)),h(this,"mapOption",t.ref({type:this.MapType.value,zoom:7,maxZoom:18,minZoom:4.5,center:[35.3308118573182,109.53369140625001]})),h(this,"NvMap1",t.ref()),h(this,"shanxiGeoObj",null),h(this,"polyline",null),h(this,"markers",[]),h(this,"isAddType",""),h(this,"pointMapData",[]),h(this,"pointData",t.ref([])),h(this,"lineMapData",[]),h(this,"lineData",[]),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"mapOnLoad",(()=>{this.shanxiGeoObj=this.NvMap1.value.addGeoJSON(zt,{color:"#9EFFFF",weight:1,fillOpacity:0}),this.polyline=this.NvMap1.value.addPolyline([],{color:"#D8A451",weight:5})})),h(this,"mapClick",(e=>{if("line"==this.isAddType&&this.polyline.addLatLng(e.latlng),"mark"==this.isAddType){const t=this.NvMap1.value.addMarker(e.latlng,{offset:[-35,-11]});this.markers.push(t)}})),h(this,"mapRightClick",(async e=>{if(this.markers.length>0){const e=this.markers.map((e=>({Id:0,Longitude:e.getLatLng().lng,Latitude:e.getLatLng().lat,PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0})));this.utilities.parseApiResult(await this.institutionPointApi.saves(e))>0?(this.message.success("保存成功"),this.doRefreshInsTree(),this.loadMapInfo()):this.message.error("保存失败")}if(this.polyline.getLatLngs().length>0){const e=this.polyline.getLatLngs().map((e=>({Id:0,Longitude:e.lng,Latitude:e.lat,PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0})));this.utilities.parseApiResult(await this.institutionLinePointApi.saves(e))>0?(this.message.success("保存成功"),this.doRefreshInsTree()):this.message.error("保存失败")}})),h(this,"addMapData",(async e=>{this.isAddType=e,0!=this.markers.length||this.message.warning("请先绘制,右键保存数据")})),h(this,"removeLine",(async()=>{this.modal.confirm({title:"提示",content:"确定要删除数据吗?",onOk:async()=>{if(this.lineData.length>0){this.utilities.parseApiResult(await this.institutionLinePointApi.DeleteByFilter(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.Id})))>0?(this.message.success("删除成功"),this.lineMapData.forEach((e=>{e.remove()}))):this.message.error("删除失败")}this.clearMapData(),this.doRefreshInsTree()}})})),h(this,"pointSelect",(e=>{this.NvMap1.value.setCenter([e.Latitude,e.Longitude])})),h(this,"removePoint",(async(e,t)=>{let i;if(e){const e=this.pointData.value.map((e=>e.Id)).join(",");i=this.utilities.parseApiResult(await this.institutionPointApi.deleteByIds(e))}else i=this.utilities.parseApiResult(await this.institutionPointApi.delete(t.Id));i>0?(this.message.success("删除成功"),this.doRefreshInsTree(),this.loadMapInfo()):this.message.error("删除失败")})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>{const s=[];return o.markCount>0&&s.push(e("span",{style:{color:"red",padding:"0 5px",fontWeight:"500"}},"点")),o.lineCount>0&&s.push(e("span",{style:{color:"red",padding:"0 5px",fontWeight:"500"}},"线")),e("div",{style:{display:"flex",justifyContent:"space-between",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))],[e("span",s)])})),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.isAddType="",this.selectedInsTree=e[0],this.loadMapInfo())})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"pointDataRef",t.ref()),h(this,"pointOption",t.reactive({keyField:"Id",titleField:"name"})),h(this,"showImport",t.ref(!1)),h(this,"refExcelImport",t.ref()),h(this,"isImporting",t.ref(!1)),h(this,"importLine",(()=>{this.showImport.value=!0})),h(this,"doImportDepart",(async e=>{this.isImporting.value=!0,this.refExcelImport.value.messageInfo("***数据导入开始***'"),e=e.map((e=>({Id:0,Longitude:e["经度"],Latitude:e["纬度"],PlatformId:this.selectedPlatform.Id,PlatformName:this.selectedPlatform.PlatformName,InsTreeId:this.selectedInsTree.Id,InsName:this.selectedInsTree.InstitutionAbbreviation,InstitutionId:this.selectedInsTree.InstitutionId,Altitude:0}))),this.utilities.parseApiResult(await this.institutionLinePointApi.saves(e)),this.isImporting.value=!1,this.refExcelImport.value.messageInfo("【导入完成】"),this.message.success("导入完成"),this.loadInsTree(),this.loadMapInfo()})),this.props=e,this.ctx=s,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}clearMapData(){!this.utilities.isNull(this.polyline)&&this.polyline.getLatLngs().length>0&&(this.polyline.remove(),this.polyline=null),this.markers.length>0&&(this.markers.forEach((e=>{e.remove()})),this.markers=[])}async loadPoint(){this.pointMapData.length>0&&this.pointMapData.forEach((e=>{e.remove()}));const e=this.utilities.parseApiResult(await this.institutionPointApi.getEntities(o.QueryWrapper.create().eq("platformId",this.selectedPlatform.Id).eq("insTreeId",this.selectedInsTree.Id)));this.pointData.value=e,e.length>0&&e.forEach((e=>{const t=this.NvMap1.value.addMarker({lat:e.Latitude,lng:e.Longitude},{offset:[-35,-11]});this.pointMapData.push(t)}))}async loadLine(){if(this.lineMapData.length>0&&this.lineMapData.forEach((e=>{e.remove()})),this.selectedInsTree.PId>0){let e=this.utilities.parseApiResult(await this.institutionLinePointApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.PId})));if(this.lineData=e,e.length>0){e=e.map((e=>[e.Latitude,e.Longitude]));let t=this.NvMap1.value.addPolyline(e,{color:"#80c342",weight:5});this.lineMapData.push(t)}}else{let e=this.utilities.parseApiResult(await this.institutionLinePointApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.selectedPlatform.Id,InsTreeId:this.selectedInsTree.Id})));if(this.lineData=e,e.length>0){e=e.map((e=>[e.Latitude,e.Longitude]));let t=this.NvMap1.value.addPolyline(e,{color:"#D8A451",weight:5});this.lineMapData.push(t)}}}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id);let i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1,i=await Promise.all(i.map((async e=>(e.markCount=this.utilities.parseApiResult(await this.institutionPointApi.getCount(o.QueryWrapper.create().eq("platformId",e.PlatformId).eq("insTreeId",e.Id))),e.lineCount=this.utilities.parseApiResult(await this.institutionLinePointApi.getCount(o.QueryWrapper.create().eq("platformId",e.PlatformId).eq("insTreeId",e.Id))),e))));const s=t=>{const o=i.filter((e=>e.PId==t));for(const i of o){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const o=s(i.Id);o.length>0&&(i.children=o)}return o};if(this.institutionTree.value=s(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}async loadMapInfo(){this.clearMapData(),await this.loadPoint(),await this.loadLine(),this.lineData.length>0?this.NvMap1.value.setCenter([this.lineData[0].Latitude,this.lineData[0].Longitude]):this.pointData.value.length>0?this.NvMap1.value.setCenter([this.pointData.value[0].Latitude,this.pointData.value[0].Longitude]):this.NvMap1.value.setCenter([35.3308118573182,109.53369140625001])}};const Xt={class:"instree-search"},ei={class:"instree-list"},ti={class:"nv-flex-1 nv-flex-col map-box"},ii={class:"nv-flex map-op",style:{"margin-bottom":"10px"}},oi={class:"nv-flex-1"},si=["onClick"],ri={style:{"font-size":"16px"}},li=["onClick"],ai={style:{height:"450px"}};const ni=f($t,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvMap"),g=t.resolveComponent("NvExcelImport"),I=t.resolveComponent("Modal"),v=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(v,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",Xt,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",ei,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createElementVNode("div",ti,[t.createElementVNode("div",ii,[t.createVNode(p,{type:"primary",icon:"md-create",onClick:i[1]||(i[1]=t=>e.addMapData("line"))},{default:t.withCtx((()=>[t.createTextVNode("绘制线")])),_:1}),t.createVNode(p,{type:"primary",icon:"md-create",onClick:i[2]||(i[2]=t=>e.addMapData("mark"))},{default:t.withCtx((()=>[t.createTextVNode("绘制点")])),_:1}),t.createVNode(p,{type:"primary",icon:"md-cloud-upload",onClick:e.importLine},{default:t.withCtx((()=>[t.createTextVNode("导入线")])),_:1},8,["onClick"]),t.createVNode(p,{type:"error",ghost:"",onClick:e.removeLine},{default:t.withCtx((()=>[t.createTextVNode("清除线")])),_:1},8,["onClick"])]),t.createElementVNode("div",oi,[t.createVNode(f,{option:e.mapOption,ref:"NvMap1",theme:e.mapTheme,onOnload:e.mapOnLoad,onClick:e.mapClick,onRightClick:e.mapRightClick},null,8,["option","theme","onOnload","onClick","onRightClick"])])]),e.pointData.length>0?(t.openBlock(),t.createBlock(c,{key:0,width:"200px",title:"点列表",showArrow:!0},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"error",ghost:"",onClick:i[3]||(i[3]=t.withModifiers((t=>e.removePoint(!0)),["stop"]))},{default:t.withCtx((()=>[t.createTextVNode("删除全部")])),_:1})])),_:1})])),default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.pointData,((i,o)=>(t.openBlock(),t.createElementBlock("div",{class:"nv-flex nv-c-p op-item",style:{"justify-content":"space-between"},key:i.Id,onClick:t.withModifiers((t=>e.pointSelect(i)),["stop"])},[t.createElementVNode("div",ri,t.toDisplayString(`点${o+1}`),1),t.createElementVNode("div",{style:{color:"red"},class:"nv-c-p",onClick:t.withModifiers((t=>e.removePoint(!1,i)),["stop"])},"删除",8,li)],8,si)))),128))])),_:1})):t.createCommentVNode("",!0),t.createVNode(I,{modelValue:e.showImport,"onUpdate:modelValue":i[5]||(i[5]=t=>e.showImport=t),transfer:"",draggable:"",mask:!0,"mask-closable":!1,width:900,title:"导入构件"},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[4]||(i[4]=t=>e.showImport=!1)},{default:t.withCtx((()=>[t.createTextVNode("关 闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",ai,[e.showImport?(t.openBlock(),t.createBlock(g,{key:0,ref:"refExcelImport",onImport:e.doImportDepart,isExportTemplete:!0,templeteUrl:"https://nvplanfromoss.oss-cn-beijing.aliyuncs.com/%E7%BB%BC%E5%90%88%E7%AE%A1%E7%90%86/%E7%BA%BF%E8%B7%AF%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF/%E7%BA%BF%E8%B7%AF%E6%A8%A1%E6%9D%BF.xlsx",templeteName:"线路导入模板.xlsx",isImporting:e.isImporting},null,8,["onImport","templeteUrl","templeteName","isImporting"])):t.createCommentVNode("",!0)])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-66a288c7"]]),di={Id:{default:0,type:Number}},ui=t.defineComponent({name:"ProjectSummary",components:{NvComFormUp:n.NvComFormUp},emits:["close","update"],props:di,setup:(e,t)=>new hi(e,t)});class hi extends e.BaseInstance{constructor(e,o){super(),h(this,"props"),h(this,"ctx"),h(this,"corePlatformConfigApi",new Fe),h(this,"projectSummaryApi",new i.ProjectSummaryApi),h(this,"provinceApi",new a.ProvinceApi),h(this,"cityApi",new a.CityApi),h(this,"areaApi",new a.AreaApi),h(this,"business",this.storageInfo.getCurrentInsTree()),h(this,"platformId",this.storageInfo.getCurrentPlatform().Id),h(this,"configType","GC"),h(this,"refbigform",t.ref()),h(this,"isShowSpin",t.ref(!1)),h(this,"isShowForm",t.ref(!0)),h(this,"nowData",t.reactive({Id:0,CreateUserId:0,CreateUserName:"",CreateDate:"",Province:"",City:"",Area:""})),h(this,"mainSaveFunLoading",t.ref(!1)),h(this,"mainFormRef",t.ref()),h(this,"mainFormModel",t.reactive({Id:0,Province:"",City:"",Area:""})),h(this,"mainFormItems",t.reactive([])),h(this,"mainRules",t.reactive({ProjectName:[{required:!0,message:"",trigger:"blur"}]})),h(this,"mainSaveFun",(async()=>{this.mainFormRef.value.validate((async e=>{var t,i,o,s,r,l;if(e){this.mainSaveFunLoading.value=!0;let e={Id:0==this.nowData.Id?0:this.nowData.Id,PlatformId:this.platformId,PlatformName:this.storageInfo.getCurrentPlatform().PlatformName,InsTreeId:null==(t=this.business)?void 0:t.Id,InstitutionId:null==(i=this.business)?void 0:i.InstitutionId,InsName:null==(o=this.business)?void 0:o.InstitutionName,DataType:"GC"==this.configType?1:"BD"==this.configType?2:0,ConfigData:JSON.stringify(this.utilities.deepCopy(this.mainFormModel)),CreateUserId:0==this.nowData.Id?this.storageInfo.getUser().Id:null==(s=this.nowData)?void 0:s.CreateUserId,CreateUserName:0==this.nowData.Id?this.storageInfo.getUser().UserName:null==(r=this.nowData)?void 0:r.CreateUserName,CreateDate:0==this.nowData.Id?this.utilities.getCurrentDate():null==(l=this.nowData)?void 0:l.CreateDate,UpdateDate:this.utilities.getCurrentDate(),Province:this.mainFormModel.Province,City:this.mainFormModel.City,Area:this.mainFormModel.Area};this.refbigform.value.saveTextData();const a=this.utilities.parseApiResult(await this.projectSummaryApi.save(e));a&&a>0?(this.message.success("保存成功!"),this.init()):this.message.error("保存失败,请稍后重试!"),this.mainSaveFunLoading.value=!1}}))})),h(this,"provinces",[]),h(this,"cities",[]),h(this,"areas",[]),h(this,"provinceList",[]),h(this,"cityList",[]),h(this,"areaList",[]),h(this,"provinceIndex",t.ref(null)),h(this,"cityIndex",t.ref(null)),h(this,"areaIndex",t.ref(null)),this.props=e,this.ctx=o,this.init()}async init(){await this.useArea(),await this.loadPlatformConfig()}async loadPlatformConfig(){let e=this.utilities.parseApiResult(await this.corePlatformConfigApi.getEntities(o.QueryWrapper.create().eq("PlatformId",this.platformId)));if(e&&e.length>0){let t="GC"==this.configType?JSON.parse(e[0].ProjectConfig):"BD"==this.configType?JSON.parse(e[0].ConstructConfig):[];if(!(t&&t.length>0))return void(this.isShowForm.value=!1);this.isShowForm.value=!0,this.isShowSpin.value=!0,t.forEach(((e,i)=>{if("region"==e.type){let o=[{label:"省份",type:"Select",model:"Province",prop:"Province",orderNum:e.orderNum,span:e.span,selectProp:{datas:[],onChange:(e,t)=>{this.setCityDatas(e),this.setAreaDatas("")},transfer:!0,filterable:!0},rules:1==e.requiredd?[{required:!0,message:"省份不能为空",trigger:"change"}]:[]},{label:"城市",type:"Select",model:"City",prop:"City",orderNum:e.orderNum,span:e.span,selectProp:{datas:[],onChange:(e,t)=>{this.setAreaDatas(e)},transfer:!0,filterable:!0},rules:1==e.requiredd?[{required:!0,message:"城市不能为空",trigger:"change"}]:[]},{label:"区县",type:"Select",model:"Area",prop:"Area",orderNum:e.orderNum,span:e.span,selectProp:{datas:[],transfer:!0,filterable:!0},rules:1==e.requiredd?[{required:!0,message:"区县不能为空",trigger:"change"}]:[]}];t.splice(i,1,...o)}if(e.requiredd>0)switch(e.type){case"Input":e.rules=[{required:!0,message:e.message,trigger:"blur"}];break;case"DatePicker":e.rules=[{required:!0,type:"date",message:e.message,trigger:"change"}];break;case"InputNumber":e.rules=[{required:!0,type:"number",message:e.message,trigger:"change"}]}})),t=this.utilities.deepCopy(t).sort(((e,t)=>e.orderNum-t.orderNum)),this.mainFormItems.splice(0,this.mainFormItems.length,...t),this.mainFormItems.forEach(((e,t)=>{"Province"==e.model&&(this.provinceIndex.value=t),"City"==e.model&&(this.cityIndex.value=t),"Area"==e.model&&(this.areaIndex.value=t)})),this.getForm(this.mainFormItems)}else this.isShowForm.value=!1}async getForm(e){let t={};e.forEach((e=>{switch(e.type){case"Input":case"DatePicker":case"TimePicker":t[e.model]="";break;case"InputNumber":t[e.model]=0;break;case"UploadFile":case"TextEditor":t[e.model]=this.utilities.getUniqueCode()}})),Object.assign(this.mainFormModel,t),await this.loadMainData()}async loadMainData(){var e,t;let i=this.utilities.parseApiResult(await this.projectSummaryApi.getEntities(o.QueryWrapper.create().allEq({PlatformId:this.platformId,InsTreeId:null==(e=this.business)?void 0:e.Id,InstitutionId:null==(t=this.business)?void 0:t.InstitutionId,DataType:"GC"==this.configType?1:"BD"==this.configType?2:0})));if(i)if(i.length>0){Object.assign(this.nowData,i[0]);let e=JSON.parse(i[0].ConfigData);Object.assign(e,{Province:i[0].Province?i[0].Province:"",City:i[0].City?i[0].City:"",Area:i[0].Area?i[0].Area:""}),Object.assign(this.mainFormModel,e),this.setProvinceDatas(),this.setCityDatas(i[0].Province?i[0].Province:""),this.setAreaDatas(i[0].City?i[0].City:""),setTimeout((()=>{this.isShowSpin.value=!1}),500)}else setTimeout((()=>{this.isShowSpin.value=!1}),500);else setTimeout((()=>{this.isShowSpin.value=!1}),500),this.message.error("请求数据出错,请联系管理员")}async useArea(){let e=await this.provinceApi.getEntities(o.QueryWrapper.create().eq("1","1"));this.provinces=this.utilities.parseApiResult(e),e=await this.cityApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.cities=this.utilities.parseApiResult(e),e=await this.areaApi.getEntities(o.QueryWrapper.create().eq("1","1")),this.areas=this.utilities.parseApiResult(e)}setProvinceDatas(){this.utilities.isNull(this.provinceIndex.value)||(this.mainFormItems[this.provinceIndex.value].selectProp.datas=this.provinces.map((e=>({text:e.ProvinceName,value:e.ProvinceCode}))))}setCityDatas(e){this.utilities.isNull(this.cityIndex.value)||(this.mainFormItems[this.cityIndex.value].selectProp.datas=this.cities.filter((t=>t.ProvinceCode==e)).map((e=>({text:e.CityName,value:e.CityCode}))))}setAreaDatas(e){this.utilities.isNull(this.areaIndex.value)||(this.mainFormItems[this.areaIndex.value].selectProp.datas=this.areas.filter((t=>t.CityCode==e)).map((e=>({text:e.AreaName,value:e.AreaCode}))))}}const pi={class:"form-box"};const mi=f(ui,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Spin"),n=t.resolveComponent("NvComFormUp"),d=t.resolveComponent("Form"),u=t.resolveComponent("NvButton"),h=t.resolveComponent("NvBox"),p=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(p,{gutter:8,class:"page"},{default:t.withCtx((()=>[e.isShowForm?(t.openBlock(),t.createBlock(h,{key:0,title:""},{footer:t.withCtx((()=>[t.createVNode(u,{loading:e.mainSaveFunLoading,onClick:e.mainSaveFun,type:"primary"},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[e.isShowSpin?(t.openBlock(),t.createBlock(a,{key:0,fix:""},{default:t.withCtx((()=>[t.createTextVNode("加载中...")])),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",pi,[t.createVNode(d,{ref:"mainFormRef",model:e.mainFormModel,"label-width":115},{default:t.withCtx((()=>[e.isShowForm&&!e.isShowSpin?(t.openBlock(),t.createBlock(n,{key:0,ref:"refbigform",formModel:e.mainFormModel,formItems:e.mainFormItems},null,8,["formModel","formItems"])):t.createCommentVNode("",!0)])),_:1},8,["model"])])])),_:1})):(t.openBlock(),t.createBlock(h,{key:1},{default:t.withCtx((()=>[t.createTextVNode(" 暂未配置项目概况,请联系管理员配置! ")])),_:1}))])),_:1})}],["__scopeId","data-v-73dcbb30"]]),ci={linkParam:{type:String,default:""},operates:{type:String,default:"-"}},fi=t.defineComponent({name:"ProjectUserinfor",components:{SelectPlatform:r.SelectPlatform,LoginLog:vt,BaseLogin:r.BaseLogin},emits:[""],props:ci,setup:(e,t)=>new gi(e,t)});class gi extends e.BaseInstance{constructor(e,r){super(),h(this,"props"),h(this,"ctx"),h(this,"platformApi",new i.PlatformApi),h(this,"institutionTreeApi",new i.InstitutionTreeApi),h(this,"userinforApi",new i.UserinforApi),h(this,"institutionUserApi",new i.InstitutionUserApi),h(this,"userRoleApi",new i.UserRoleApi),h(this,"institutionPlatformApi",new i.InstitutionPlatformApi),h(this,"roleApi",new i.RoleApi),h(this,"oauthApi",new i.OAuthApi),h(this,"userSignApi",new i.UserSignApi),h(this,"signTaskInfoApi",new l.SignTaskInfoApi),h(this,"selectedPlatform"),h(this,"platId",t.ref(0)),h(this,"platData",t.ref([])),h(this,"spinPlatShow",t.ref(!1)),h(this,"getPlatData",(async()=>{var e;this.spinPlatShow.value=!0;const i=null==(e=this.storageInfo.getCurrentPlatform())?void 0:e.Id,s=await this.platformApi.getEntities(o.QueryWrapper.create().eq("Id",i).or((e=>e.allEq({PId:i}))).orderBy(["OrderNo"]));this.platData.value=this.utilities.parseApiResult(s),this.spinPlatShow.value=!1,this.platData.value.length>0&&(this.platId.value=this.platData.value[0].Id),t.nextTick((()=>{this.doChangePlatform(this.platData.value[0])}))})),h(this,"selectedInsTree"),h(this,"institutionTree",t.ref([])),h(this,"loadingInstitutionTree",t.ref(!1)),h(this,"doChangePlatform",(e=>{const t=this.platData.value.find((e=>e.Id==this.platId.value));this.utilities.isNull(e)||(this.selectedPlatform=t,this.loadInsTree())})),h(this,"renderInsTreeContent",((e,{root:t,node:i,data:o})=>e("span",{style:{display:"inline-block",paddingLeft:"4px",boxSizing:"content-box",border:o.intoDrag?"1px dashed #2d8cf0":"0px"}},[e("span",[e("span",{style:{fontWeight:this.utilities.isNull(o.FakeId)?"normal":"bold"}},this.utilities.getValueNotNull(o.title,"[未知节点]"))])]))),h(this,"doChangeInsTree",(e=>{e.length>0&&(this.selectedInsTree=e[0],this.loadInstitutionTreeUsers({}))})),h(this,"doRefreshInsTree",(()=>{this.loadInsTree()})),h(this,"userBoxWidth",t.ref("calc(100% - 300px)")),h(this,"insTreeUserGrid",t.ref()),h(this,"insTreeUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:6,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0},isPagination:!0,pageSize:13},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input"},{field:"Account",title:"账号",type:"Input"},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}]}],toolbars:[{name:"add",text:"新增",onclick:()=>{this.doAddUser()}}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Account",title:"账号",width:140},{colType:"ro",field:"AccountStatus",title:"账号状态",width:140,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"},4:{text:"只读",color:"default"}}[t.row.AccountStatus],o=0==t.row.AccountType?"用户账号":"内部账号";return e(s.Tag,{color:i.color},(()=>o+" - "+i.text))}},{colType:"ro",field:"IsMutex",title:"单点登录",width:90,align:"center",format:(e,t)=>({0:"否",1:"是"}[t.row.IsMutex])},{colType:"ro",field:"ExpiredDate",title:"密码过期时间",width:130,align:"center",format:(e,t)=>{const i=t.row.ExpiredDate;return this.utilities.isNull(i)?"":i.split(" ")[0]}},{colType:"ro",field:"ErrorNum",title:"错误次数",width:90,align:"center",format:(e,t)=>t.row.ErrorNum+"/5"},{colType:"ro",field:"LastUpdateUserName",title:"最后修改人",width:120,align:"center"},{colType:"ro",field:"LastUpdateDate",title:"最后修改时间",width:140,align:"center"},{colType:"ro",field:"LastLoginTime",title:"最后登录时间",width:140,align:"center"},{title:"操作",width:180,rowButtons:[{name:"edit",text:"编辑",onclick:(e,t)=>{this.doEditUser(e)}},{name:"role",text:"定岗",onclick:(e,t)=>{this.doShowUserRole(e)}},{name:"delete",text:"移除",onclick:(e,t)=>{this.doDeleteUser(e)}}]},{title:"运维",width:150,rowButtons:[{name:"userSign",text:"签字",onclick:(e,t)=>{this.doShowEditUserSign(e)}},{name:"resize",text:"重置",onclick:(e,t)=>{this.doResetUserPwd(e.Id)}}]}],event:{event_search:e=>{this.insTreeUserGrid.value.setPageIndex(1),this.loadInstitutionTreeUsers(e)}}})),h(this,"doChangeUserBoxWidth",(e=>{this.userBoxWidth.value=e?"calc(100% - 300px)":"calc(100% - 45px)"})),h(this,"showEditUser",t.ref(!1)),h(this,"saveingUser",t.ref(!1)),h(this,"editUserTitle",t.ref("新增 - 用户")),h(this,"userForm",t.ref()),h(this,"userFormModel",t.reactive({Id:0,UserName:"",Sex:1,Phone:"",CIdNo:"",UserIconToken:"",UserSignImgToken:"",Account:"",AccountType:0,AccountStatus:1,ErrorNum:0,ExpiredDate:"",IsMutex:0,PwdAuthentication:0,LastUpdateUserId:0,LastUpdateUserName:"",LastUpdateDate:""})),h(this,"userFormItems",t.reactive([{model:"",label:"基础信息",span:24,children:[{model:"Account",label:"账号",type:"Input",prop:"Account"},{model:"UserName",label:"姓名",type:"Input",prop:"UserName"},{model:"Phone",label:"手机号",type:"Input",prop:"Phone"},{model:"Sex",label:"性别",type:"Select",selectProp:{datas:[{text:"男",value:1},{text:"女",value:2},{text:"其他",value:3}],transfer:!0}}]},{model:"",label:"账号信息",span:24,children:[{model:"AccountStatus",label:"账号状态",type:"Select",selectProp:{datas:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3},{text:"只读",value:4}],transfer:!0}},{model:"ExpiredDate",label:"密码过期时间",type:"DatePicker"},{model:"PwdAuthentication",label:"密码强认证",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"IsMutex",label:"单点登录",type:"Select",selectProp:{datas:[{text:"否",value:0},{text:"是",value:1}],transfer:!0}},{model:"ErrorNum",label:"错误次数",type:"Input"},{model:"WechatOpenId",label:"微信授权Id",type:"Input"}]}])),h(this,"userFormRule",t.reactive({UserName:[{required:!0,message:"姓名不能为空",trigger:"blur"}],Account:[{required:!0,message:"账号不能为空",trigger:"blur"}],Phone:[{required:!0,validator:this.validPhone,trigger:"blur"}]})),h(this,"doSaveUser",(async()=>{this.saveingUser.value=!0;let e=await this.userForm.value.validate();if(!e)return void(this.saveingUser.value=!1);if(0==this.userFormModel.AccountType&&this.utilities.isNull(this.userFormModel.Phone))return this.message.warning("在用户账号模式下,手机号必填!"),void(this.saveingUser.value=!1);if(!this.utilities.isNull(this.userFormModel.Phone)){if(!/^[1][3,4,5,7,8]\d{9}$/.test(this.userFormModel.Phone))return this.message.warning("手机号格式不正确, 请重新输入!"),void(this.saveingUser.value=!1);const t=o.QueryWrapper.create();t.eq("Phone",this.userFormModel.Phone).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);const i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`手机号 ${this.userFormModel.Phone} 已关联其他账号, 请重新输入!`),void(this.saveingUser.value=!1)}const t=o.QueryWrapper.create();t.eq("Account",this.userFormModel.Account).eq("IsDel",0),this.userFormModel.Id>0&&t.ne("Id",this.userFormModel.Id);let i=await this.userinforApi.isExist(t);if(e=this.utilities.parseApiResult(i),e)return this.message.warning(`账号 ${this.userFormModel.Account} 已存在, 请重新输入!`),void(this.saveingUser.value=!1);i=await this.userinforApi.save(this.userFormModel),e=this.utilities.parseApiResult(i),0==this.userFormModel.Id&&(await this.institutionUserApi.save({InstitutionId:this.selectedInsTree.InstitutionId,UserId:e,InsTreeId:this.selectedInsTree.Id}),await this.userinforApi.initialUserPwd(e,this.selectedPlatform.Id)),this.saveingUser.value=!1,e>0?(this.message.success("保存成功"),this.insTreeUserGrid.value.refreshData(),this.showEditUser.value=!1):this.message.error(i.msg)})),h(this,"currentUser"),h(this,"showUserRole",t.ref(!1)),h(this,"saveingUserRole",t.ref(!1)),h(this,"userRoleGrid",t.ref()),h(this,"userRoleGridOption",t.reactive({api:this.userinforApi,setting:{border:!1,toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"ro",width:50,align:"center",format:(e,t)=>e(s.Checkbox,{style:{"margin-right":"0px"},"model-value":t.row.IsChk,"onUpdate:model-value":e=>{t.row.IsChk=e}})},{colType:"ed",field:"RoleName",title:"角色名称"},{colType:"ed",field:"DefaultUrl",title:"默认页面",width:200,align:"center"},{colType:"ed",field:"欢迎页面",title:"WelcomeUrl",width:200,align:"center"},{colType:"num",field:"OrderNo",title:"排序号",width:100,align:"center"}]})),h(this,"doSaveUserRole",(async()=>{const e=this.userRoleGrid.value.getDatas().filter((e=>1==e.IsChk));this.saveingUserRole.value=!0;let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t),s=[];for(const o of e)-1==i.findIndex((e=>e.RoleId==o.Id))&&s.push({PlatformId:this.selectedPlatform.Id,UserId:this.currentUser.Id,RoleId:o.Id});let r=[];for(const o of i)-1==e.findIndex((e=>e.Id==o.RoleId))&&r.push(o.Id);if(0==s.length&&0==r.length)return this.message.warning("没有需要保存的数据"),void(this.saveingUserRole.value=!1);let l=!0;if(s.length>0){t=await this.userRoleApi.saves(s);let e=this.utilities.parseApiResult(t);1==l&&(l=e>0)}if(r.length>0){t=await this.userRoleApi.deleteByIds(r.join(","));let e=this.utilities.parseApiResult(t);0==l&&(l=e>0)}this.saveingUserRole.value=!1,l?(this.message.success("保存成功"),this.showUserRole.value=!1):this.message.error("保存失败, 请稍后重试!")})),h(this,"showImportUser",t.ref(!1)),h(this,"saveingImportUser",t.ref(!1)),h(this,"otherUserGrid",t.ref()),h(this,"otherUserGridOption",t.reactive({api:this.userinforApi,setting:{border:!0,searchConfig:{btnSpan:24,labelWidth:90,defaultShowSearch:!1},toolbarConfig:{isButtonGroup:!1},rowConfig:{isHover:!0}},searchOptions:[{field:"UserName",title:"用户姓名",type:"Input",span:8},{field:"Account",title:"账号",type:"Input",span:8},{field:"AccountStatus",title:"账号状态",type:"Radio",data:[{text:"正常",value:1},{text:"挂起",value:2},{text:"禁用",value:3}],span:8}],rightToolbars:[{name:"refresh"}],columns:[{colType:"seq"},{colType:"checkbox"},{colType:"ro",field:"UserName",title:"姓名",minWidth:160},{colType:"ro",field:"Sex",title:"性别",width:120,align:"center",format:(e,t)=>({1:"男",2:"女",3:"其他"}[t.row.Sex])},{colType:"ro",field:"Account",title:"账号",width:180},{colType:"ro",field:"AccountStatus",title:"账号状态",width:160,align:"center",format:(e,t)=>{const i={1:{text:"正常",color:"green"},2:{text:"挂起",color:"gold"},3:{text:"禁用",color:"red"}}[t.row.AccountStatus];return e(s.Tag,{color:i.color},(()=>i.text))}}],event:{event_search:e=>{this.loadImportUserGrid(e)}}})),h(this,"doImportUser",(async()=>{const e=this.otherUserGrid.value.getCheckboxDatas();if(0==e.length)return void this.message.warning("没有需要导入的用户");const t=[];for(const s of e)t.push({InstitutionId:this.selectedInsTree.InstitutionId,UserId:s.Id,InsTreeId:this.selectedInsTree.Id});this.saveingImportUser.value=!0;let i=await this.institutionUserApi.saves(t),o=this.utilities.parseApiResult(i);this.saveingImportUser.value=!1,o?(this.message.success("导入成功"),this.insTreeUserGrid.value.refreshData(),this.showImportUser.value=!1):this.message.error("导入失败, 请稍后重试!")})),h(this,"showLoginLog",t.ref(!1)),h(this,"loginLogRef",t.ref()),h(this,"doShowLoginLog",(e=>{this.showLoginLog.value=!0,this.loginLogRef.value.loadLoginLog(this.selectedPlatform.Id,e.Id)})),h(this,"loginRef",t.ref()),h(this,"logining",t.ref(!1)),h(this,"showEditUserSign",t.ref(!1)),h(this,"saveingUserSign",t.ref(!1)),h(this,"userSignForm",t.ref()),h(this,"userSignFormModel",t.reactive({Id:0,UserId:0,CAUserInfoKey:"",CAUserSealKey:"",CAUserYZKey:"",CAUserSealImg:"",CAUserYZImg:""})),h(this,"userSignFormItems",t.reactive([{model:"CAUserInfoKey",label:"用户KEY",type:"Input",prop:"CAUserInfoKey",span:24},{model:"CAUserSealKey",label:"印章KEY",type:"Input",prop:"CAUserSealKey",span:24},{model:"CAUserYZKey",label:"圆章KEY",type:"Input",prop:"CAUserYZKey",span:24}])),h(this,"doSaveUserSign",(async()=>{this.saveingUserSign.value=!0;const e=await this.userSignApi.save(this.userSignFormModel),t=this.utilities.parseApiResult(e);this.saveingUserSign.value=!1,t?(this.message.success("保存成功"),this.showEditUserSign.value=!1):this.message.error("保存失败,请稍后重试")})),h(this,"doLoadUserSealImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserSealKey))return void this.message.warning("请输入印章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserSealKey),t=this.utilities.parseApiResult(e);t?this.userSignFormModel.CAUserSealImg="data:image/png;base64,"+t.data.sealPic:this.message.error("读取失败,请稍后重试")})),h(this,"doLoadUserYZImg",(async()=>{if(this.utilities.isNull(this.selectedPlatform.CABusinessKey))return void this.message.warning("请先在平台模块设置CA业务KEY");if(this.utilities.isNull(this.userSignFormModel.CAUserYZKey))return void this.message.warning("请输入圆章KEY");const e=await this.signTaskInfoApi.GetUserSealCloudInfo(this.selectedPlatform.CABusinessKey,this.userSignFormModel.CAUserYZKey),t=this.utilities.parseApiResult(e);t?10==t.head.code?this.userSignFormModel.CAUserYZImg="data:image/png;base64,"+t.data.sealPic:this.message.error(t.head.msg):this.message.error("读取失败,请稍后重试")})),this.props=e,this.ctx=r,this.initData()}initData(){t.onMounted((()=>{this.getPlatData()})),t.onUnmounted((()=>{}))}async loadInsTree(){let e=!1;this.loadingInstitutionTree.value=!0;const t=await this.institutionTreeApi.getInstitutionTrees(this.selectedPlatform.Id),i=this.utilities.parseApiResult(t);this.loadingInstitutionTree.value=!1;const o=t=>{const s=i.filter((e=>e.PId==t));for(const i of s){i.title=i.InstitutionAbbreviation,i.expand=!0;const t=!this.utilities.isNull(this.selectedInsTree)&&this.selectedInsTree.Id==i.Id;i.selected=t,t&&(e=!0);const s=o(i.Id);s.length>0&&(i.children=s)}return s};if(this.institutionTree.value=o(0),!e&&this.institutionTree.value.length>0){const e=this.institutionTree.value[0];e.selected=!0,this.doChangeInsTree([e])}}loadInstitutionTreeUsers(e){this.insTreeUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getInstitutionTreeUsers(t.page,t.pageSize,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}doEditUser(e){const t=this.storageInfo.getUser();this.userFormModel.Id=e.Id,this.userFormModel.UserName=e.UserName,this.userFormModel.Sex=e.Sex,this.userFormModel.Phone=e.Phone,this.userFormModel.CIdNo=e.CIdNo,this.userFormModel.UserIconToken=e.UserIconToken,this.userFormModel.UserSignImgToken=e.UserSignImgToken,this.userFormModel.Account=e.Account,this.userFormModel.AccountStatus=e.AccountStatus,this.userFormModel.AccountType=e.AccountType,this.userFormModel.ErrorNum=e.ErrorNum,this.userFormModel.ExpiredDate=e.ExpiredDate,this.userFormModel.IsMutex=e.IsMutex,this.userFormModel.PwdAuthentication=e.PwdAuthentication,this.userFormModel.LastUpdateUserId=t.Id,this.userFormModel.LastUpdateUserName=t.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="编辑用户 - "+e.UserName,this.showEditUser.value=!0}doAddUser(){const e=this.storageInfo.getUser();this.userFormModel.Id=0,this.userFormModel.UserName="",this.userFormModel.Sex=1,this.userFormModel.Phone="",this.userFormModel.CIdNo="",this.userFormModel.UserIconToken="",this.userFormModel.UserSignImgToken="",this.userFormModel.Account="",this.userFormModel.AccountType=0,this.userFormModel.AccountStatus=1,this.userFormModel.ErrorNum=0;let t=this.utilities.getCurrentDate();t=this.utilities.dateHelper.format(this.utilities.dateHelper.add(this.utilities.stringHelper.toDate(t),1,"years"),"YYYY-MM-DD"),this.userFormModel.ExpiredDate=t,this.userFormModel.IsMutex=0,this.userFormModel.PwdAuthentication=0,this.userFormModel.LastUpdateUserId=e.Id,this.userFormModel.LastUpdateUserName=e.UserName,this.userFormModel.LastUpdateDate=this.utilities.getCurrentDate(),this.editUserTitle.value="新增 - 用户",this.showEditUser.value=!0}doDeleteUser(e){this.modal.confirm({title:"提示",content:`确定要移除用户${e.UserName}吗?`,onOk:async()=>{const t=await this.userinforApi.save({Id:e.Id,IsDel:1});this.utilities.parseApiResult(t)>0?(this.message.success("删除成功"),this.insTreeUserGrid.value.refreshData()):this.message.error("删除失败, 请稍后重试!")}})}doShowUserRole(e){this.currentUser=e,this.showUserRole.value=!0,t.nextTick((()=>{this.loadUserRole()}))}loadUserRole(){this.userRoleGrid.value.loadData((async e=>{let t=await this.userRoleApi.getEntities(o.QueryWrapper.create().eq("UserId",this.currentUser.Id).eq("PlatformId",this.selectedPlatform.Id)),i=this.utilities.parseApiResult(t);t=await this.institutionPlatformApi.getEntityByFilter(o.QueryWrapper.create().eq("PlatformId",this.selectedPlatform.Id).eq("InstitutionId",this.selectedInsTree.InstitutionId));let s=this.utilities.parseApiResult(t);if(this.utilities.isNull(s)||this.utilities.isNull(s.RoleIds))return void e.success([]);t=await this.roleApi.getEntities(o.QueryWrapper.create().in("Id",s.RoleIds.split(",")));let r=this.utilities.parseApiResult(t);for(const o of r){const e=!this.utilities.isNull(i)&&i.findIndex((e=>e.RoleId==o.Id))>=0;o.IsChk=e}e.success(r)}))}loadImportUserGrid(e){this.otherUserGrid.value.loadData((async t=>{const i=await this.userinforApi.getNotInInstitutionTreeUsers(this.selectedInsTree.InstitutionId,this.selectedInsTree.Id,this.utilities.getValueNotNull(e.UserName,""),this.utilities.getValueNotNull(e.Account,""),this.utilities.getValueNotNull(e.AccountStatus,0)),o=this.utilities.parseApiResult(i);t.success(o)}))}async devOpsLogin(e){this.logining.value=!0;const t=await this.oauthApi.devOpsLogin(e.Id),i=this.utilities.parseApiResult(t);this.logining.value=!1,i.IsSuccess?(this.message.success("登录成功!"),this.storageInfo.removeAll(),this.loginRef.value.setLoginResult(i)):this.message.warning(i.Msg)}doResetUserPwd(e){this.modal.confirm({title:"提示",content:"确定要重置为初始密码吗?",onOk:async()=>{const t=await this.userinforApi.resetUserPwd(e);this.utilities.parseApiResult(t)>0?this.message.success("重置成功"):this.message.error("操作失败,请稍后重试")}})}async doShowEditUserSign(e){this.showEditUserSign.value=!0;const t=await this.userSignApi.getEntityByFilter(o.QueryWrapper.create().eq("UserId",e.Id)),i=this.utilities.parseApiResult(t);this.utilities.isNull(i)?(this.userSignFormModel.Id=0,this.userSignFormModel.UserId=e.Id,this.userSignFormModel.CAUserInfoKey="",this.userSignFormModel.CAUserSealKey="",this.userSignFormModel.CAUserYZKey="",this.userSignFormModel.CAUserSealImg="",this.userSignFormModel.CAUserYZImg=""):(this.userSignFormModel.Id=i.Id,this.userSignFormModel.UserId=i.UserId,this.userSignFormModel.CAUserInfoKey=i.CAUserInfoKey,this.userSignFormModel.CAUserSealKey=i.CAUserSealKey,this.userSignFormModel.CAUserYZKey=i.CAUserYZKey,this.userSignFormModel.CAUserSealImg=i.CAUserSealImg,this.userSignFormModel.CAUserYZImg=i.CAUserYZImg)}validPhone(e,t,i){if(!t)return i(new Error("手机号不能为空"));/^1[3456789]\d{9}$/.test(t)?i():i("手机号格式不正确!")}}const Ii=e=>(t.pushScopeId("data-v-86385f96"),e=e(),t.popScopeId(),e),vi={class:"instree-search"},yi={class:"instree-list"},wi={style:{height:"600px","overflow-y":"auto"}},Ci=Ii((()=>t.createElementVNode("div",{style:{"margin-left":"16px",color:"#ff9900"}},[t.createElementVNode("div",{style:{"padding-bottom":"8px"}},"用户账号:手机号必填。在新设备登录时,需进行短信验证。"),t.createElementVNode("div",null,"内部账号:手机号可不填。")],-1))),Ni={style:{height:"600px","overflow-y":"auto"}},Mi=Ii((()=>t.createElementVNode("div",{class:"primary-color gird-tip"},"勾选绑定用户角色!",-1))),xi={style:{height:"650px","overflow-y":"auto"}},Pi={style:{display:"none"}},Ui={style:{height:"400px","overflow-y":"auto"}},Ai=["src"],Ti=["src"];return[{path:"/permission-service/platform/platform",component:y},{path:"/permission-service/platform/module",component:S},{path:"/permission-service/platform/role",component:L},{path:"/permission-service/institution/institutiontype",component:K},{path:"/permission-service/institution/institution",component:ee},{path:"/permission-service/institution/userinfor",component:Ne},{path:"/permission-service/institution/enterprise",component:Ae},{path:"/permission-service/thirdparty/information",component:De},{path:"/permission-service/platform/subplatform",component:Qe},{path:"/permission-service/platform/subrole",component:Xe},{path:"/permission-service/institution/subenterprise",component:st},{path:"/permission-service/institution/subinstitution",component:ct},{path:"/permission-service/institution/subuserinfor",component:Et},{path:"/permission-service/institution/projectUserinfor",component:f(fi,[["render",function(e,i,o,s,r,l){const a=t.resolveComponent("Option"),n=t.resolveComponent("Select"),d=t.resolveComponent("Spin"),u=t.resolveComponent("NvControlGroup"),h=t.resolveComponent("Tree"),p=t.resolveComponent("Button"),m=t.resolveComponent("Space"),c=t.resolveComponent("NvBox"),f=t.resolveComponent("NvGrid"),g=t.resolveComponent("NvComForm"),I=t.resolveComponent("Form"),v=t.resolveComponent("Modal"),y=t.resolveComponent("LoginLog"),w=t.resolveComponent("BaseLogin"),C=t.resolveComponent("FormItem"),N=t.resolveComponent("NvPage");return t.openBlock(),t.createBlock(N,{gutter:8,class:"userinfor"},{default:t.withCtx((()=>[t.createVNode(c,{width:"300px",title:"组织机构树",showArrow:!0,onChange:e.doChangeUserBoxWidth},{footer:t.withCtx((()=>[t.createVNode(m,null,{default:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:e.doRefreshInsTree},{default:t.withCtx((()=>[t.createTextVNode("刷新")])),_:1},8,["onClick"])])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",vi,[t.createVNode(u,{width:"100%",icon:"md-refresh",label:"系统平台",labelWidth:75,onClick:e.getPlatData},{default:t.withCtx((()=>[t.createVNode(n,{modelValue:e.platId,"onUpdate:modelValue":i[0]||(i[0]=t=>e.platId=t),onOnChange:e.doChangePlatform,transfer:""},{default:t.withCtx((()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.platData,((e,i)=>(t.openBlock(),t.createBlock(a,{key:i,value:e.Id},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.PlatformAbbreviation),1)])),_:2},1032,["value"])))),128))])),_:1},8,["modelValue","onOnChange"]),t.createVNode(d,{fix:"",show:e.spinPlatShow},null,8,["show"])])),_:1},8,["onClick"])]),t.createElementVNode("div",yi,[t.createVNode(h,{data:e.institutionTree,render:e.renderInsTreeContent,class:"tree-render",onOnSelectChange:e.doChangeInsTree},null,8,["data","render","onOnSelectChange"]),t.withDirectives(t.createVNode(d,{fix:""},{default:t.withCtx((()=>[t.createTextVNode("数据加载中")])),_:1},512),[[t.vShow,e.loadingInstitutionTree]])])])),_:1},8,["onChange"]),t.createVNode(c,{width:e.userBoxWidth,title:"用户列表"},{default:t.withCtx((()=>[t.createVNode(f,{ref:"insTreeUserGrid",option:e.insTreeUserGridOption},null,8,["option"])])),_:1},8,["width"]),t.createVNode(v,{modelValue:e.showEditUser,"onUpdate:modelValue":i[2]||(i[2]=t=>e.showEditUser=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:e.editUserTitle,styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[1]||(i[1]=t=>e.showEditUser=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUser,onClick:e.doSaveUser},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",wi,[t.createVNode(I,{ref:"userForm",model:e.userFormModel,"label-width":120,rules:e.userFormRule},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userComForm",formModel:e.userFormModel,formItems:e.userFormItems},null,8,["formModel","formItems"])])),_:1},8,["model","rules"]),Ci])])),_:1},8,["modelValue","title"]),t.createVNode(v,{modelValue:e.showUserRole,"onUpdate:modelValue":i[4]||(i[4]=t=>e.showUserRole=t),draggable:"",mask:!0,"mask-closable":!1,width:850,title:"定岗",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[3]||(i[3]=t=>e.showUserRole=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserRole,onClick:e.doSaveUserRole},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ni,[t.createVNode(f,{ref:"userRoleGrid",option:e.userRoleGridOption},{default:t.withCtx((()=>[Mi])),_:1},8,["option"])])])),_:1},8,["modelValue"]),t.createVNode(v,{modelValue:e.showLoginLog,"onUpdate:modelValue":i[6]||(i[6]=t=>e.showLoginLog=t),draggable:"",mask:!0,"mask-closable":!1,width:800,title:"登录日志",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[5]||(i[5]=t=>e.showLoginLog=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1})])),default:t.withCtx((()=>[t.createElementVNode("div",xi,[t.createVNode(y,{ref:"loginLogRef"},null,512)])])),_:1},8,["modelValue"]),t.createVNode(d,{size:"large",fix:"",show:e.logining},null,8,["show"]),t.createElementVNode("div",Pi,[t.createVNode(w,{ref:"loginRef",autoLogin:!1},null,512)]),t.createVNode(v,{modelValue:e.showEditUserSign,"onUpdate:modelValue":i[8]||(i[8]=t=>e.showEditUserSign=t),draggable:"",mask:!0,"mask-closable":!1,width:440,title:"编辑签字信息",styles:{top:"3%"}},{footer:t.withCtx((()=>[t.createVNode(p,{type:"text",onClick:i[7]||(i[7]=t=>e.showEditUserSign=!1)},{default:t.withCtx((()=>[t.createTextVNode("关闭")])),_:1}),t.createVNode(p,{type:"primary",loading:e.saveingUserSign,onClick:e.doSaveUserSign},{default:t.withCtx((()=>[t.createTextVNode("保存")])),_:1},8,["loading","onClick"])])),default:t.withCtx((()=>[t.createElementVNode("div",Ui,[t.createVNode(I,{ref:"userSignForm",model:e.userSignFormModel,"label-width":85},{default:t.withCtx((()=>[t.createVNode(g,{ref:"userSignComForm",formModel:e.userSignFormModel,formItems:e.userSignFormItems},null,8,["formModel","formItems"]),t.createVNode(C,{label:"印章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserSealImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserSealImg,alt:"",style:{width:"120px",height:"35px"}},null,8,Ai)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserSealImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1}),t.createVNode(C,{label:"圆章图片"},{default:t.withCtx((()=>[""!=e.userSignFormModel.CAUserYZImg?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.userSignFormModel.CAUserYZImg,alt:"",style:{width:"120px",height:"120px","margin-left":"16px"}},null,8,Ti)):t.createCommentVNode("",!0),t.createVNode(p,{type:"primary",style:{float:"right"},onClick:e.doLoadUserYZImg},{default:t.withCtx((()=>[t.createTextVNode("加载")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model"])])])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-86385f96"]])},{path:"/permission-service/subplatform/subModule",component:jt},{path:"/permission-service/institution/sublinepoins",component:ni},{path:"/permission-service/projectSummary/ProjectSummary",component:mi}]}));
|