2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
import{E as B,a as ue,b as pe,u as Se,d as Te,L as Ve,l as we,K as Ne}from"./element-plus-53a783a7.js";import"./vue-20eed888.js";import{u as fe,b as de}from"./index-03a63030.js";import{u as me}from"./vue-i18n-d6e8419a.js";import{s as ge,d as ve,g as le,a as ie,b as De}from"./authInterface-473123dc.js";import{d as ce,G as ye,r as o,k as t,ah as _,ai as R,o as oe,c as be,e as d,P as v,u as c,L as U,T as X,U as $,b as xe,S as Pe,i as Ce,F as ke,a as q}from"./@vue-e95c845e.js";import{_ as _e}from"./y9plugin-components-412bad23.js";import"./lodash-es-2e98bc53.js";import"./@vueuse-409d7ed5.js";import"./@element-plus-57b52633.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-e13f206c.js";import"./axios-db0ed51e.js";import"./async-validator-20f92749.js";import"./memoize-one-297ddbcb.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-606f2ab9.js";import"./lodash-11751b8b.js";import"./pinia-22d008e7.js";import"./nprogress-e9cc33fd.js";import"./vue-router-e03c3082.js";/* empty css *//* empty css *//* empty css */import"./y9plugin-sso-6f4b3ca3.js";import"./y9plugin-watermark-e18d3181.js";import"./@intlify-d4a3a758.js";import"./v-viewer-decd5d79.js";import"./viewerjs-c43574b2.js";import"./vxe-table-3ccf2bcd.js";import"./xe-utils-90392958.js";import"./dom-zindex-d72a3c32.js";import"./request-6d47a533.js";const Fe=ce({__name:"dictVal",props:{isView:{type:Boolean,default:()=>!1}},setup(re,{expose:P}){const S=ye("sizeObjInfo"),r=fe(),{t:i}=me();o();const u=o({}),J=o(),F=o(),A=o(),T=o(),N=o(),V=o(),O=o(),M=re;let n=o({rowKey:"id",load:(l,C,g)=>{u.value.parameterId=N.value,u.value.isPrimary=T.value,u.value.pid=l.id,le(u.value).then(k=>{g(k.data)})},lazy:!0,headerBackground:!0,pageConfig:{background:!1,currentPage:1,pageSize:5,total:0},columns:[{type:"index",title:t(()=>i("序号")),width:80,fixed:"left"},{title:t(()=>i("显示值")),key:"showVal"},{title:t(()=>i("字段值")),key:"fieldVal"},{title:t(()=>i("参数名称")),key:"parameterName"},{title:t(()=>i("参数key")),key:"fieldName"},{title:t(()=>i("排序")),key:"sort"},{title:t(()=>i("操作")),width:150,fixed:"right",render:l=>M.isView?_("div",[_("span",{onClick:()=>{Q(l.id)}},i("详情"))]):_("div",[_("span",{onClick:()=>{Q(l.id)}},i("详情")),_("span",{class:"leftMargin",onClick:()=>{x(l.id)}},i("编辑")),_("span",{class:"leftMargin",onClick:()=>{H(l.id)}},i("删除"))])}],tableData:[]});const Y=o({filtersValueCallBack:l=>{u.value=l},itemList:[{type:"input",value:"",key:"fieldVal",label:t(()=>i("字段值")),labelWidth:"42px",span:r.device==="mobile"?24:6},{type:"input",value:"",key:"showVal",label:t(()=>i("显示值")),labelWidth:"42px",span:r.device==="mobile"?24:6},{type:"slot",slotName:"slotSearch",span:6},{type:"slot",slotName:"slotBtns",span:r.device==="mobile"?24:6,justify:"flex-end"}],showBorder:!0,borderRadio:"4px"});async function w(){n.value.loading=!0,u.value.parameterId=N.value,u.value.isPrimary=T.value,V.value=="是"&&u.value.pid==null?(delete n.value.pageConfig,n.value.pageConfig=!1,u.value.page=1,u.value.limit=9999999,u.value.pid="0"):V.value=="否"&&(u.value.page=n.value.pageConfig.currentPage,u.value.limit=n.value.pageConfig.pageSize,delete u.value.pid);let l=await le(u.value);n.value.tableData=l.data||[],V.value=="否"&&(n.value.pageConfig.total=l.count||0),n.value.loading=!1}function m(l){n.value.tableData=[],n.value.pageConfig.pageSize=l,w()}function ee(l){n.value.tableData=[],n.value.pageConfig.currentPage=l,w()}function D(){n.value.pageConfig?(n.value.pageConfig.currentPage=1,n.value.pageConfig.pageSize=5):(u.value.page=1,u.value.limit=9999999),(u.value.fieldVal==null||u.value.fieldVal=="")&&(u.value.showVal==null||u.value.showVal=="")||(u.value.pid="-1"),n.value.tableData=[],w()}function G(){J.value.elTableFilterRef.onReset(),n.value.pageConfig&&(n.value.pageConfig.currentPage=1,n.value.pageConfig.pageSize=5),n.value.tableData=[],u.value.fieldVal="",u.value.showVal="",u.value.pid="0",w()}function ae(l,C,g,k,e,a){e=="否"&&(delete n.value.pageConfig,n.value.pageConfig={background:!1,currentPage:1,pageSize:5,total:0},n.value.pageConfig.currentPage=1,n.value.pageConfig.pageSize=5,n.value.tableData=[]),N.value=l,T.value=C,A.value=g,F.value=k,V.value=e,O.value=a,w()}const W=o(),te=(l,C,g)=>{let k=de("number",C,!0);k.valid?g():g(new Error(k.msg))};let y=o({show:!1,title:t(()=>i("新增权限值")),showFooter:!0,onOkLoading:!0,onOk:l=>new Promise(async(C,g)=>{var e;await((e=W.value)==null?void 0:e.elFormRef).validate(async a=>{if(a){let s=W.value.model,p=new FormData;for(let z in s)s[z]!=null&&z!="createTime"&&z!="updateTime"&&p.append(z,s[z]);(await ge(p)).code==0&&(B({message:"数据保存成功",type:"success"}),C(),G()),g()}else g()})})}),f=o({model:{parameterName:A.value,fieldName:F.value,parameterId:N.value,isPrimary:T.value,isTree:V.value,parameterType:O.value},rules:{parameterName:[{required:!0,message:t(()=>i("名称不能为空")),trigger:"blur"}],fieldName:[{required:!0,message:t(()=>i("参数key不能为空")),trigger:"blur"}],isTree:[{required:!0,message:t(()=>i("是否树形不能为空")),trigger:"blur"}],sort:[{required:!0,message:t(()=>i("排序不能为空")),trigger:"blur"},{validator:te,trigger:"blur"}],fieldVal:[{required:!0,message:t(()=>i("字段值不能为空")),trigger:"blur"}],showVal:[{required:!0,message:t(()=>i("显示值不能为空")),trigger:"blur"}],pid:[{required:!0,message:t(()=>i("父级不能为空")),trigger:"blur"}]},itemList:[{type:"input",label:t(()=>i("显示值")),prop:"showVal"},{type:"input",label:t(()=>i("字段值")),prop:"fieldVal"},{type:"input",label:t(()=>i("排序")),prop:"sort",props:{type:"number",max:999,min:0}},{type:"input",label:t(()=>i("参数名称")),prop:"parameterName",props:{disabled:!0}},{type:"input",label:t(()=>i("参数key")),prop:"fieldName",props:{disabled:!0}}],descriptionsFormConfig:{labelWidth:"200px",labelAlign:"center"}});function j(l,C){if(V.value=="是"){let g={type:"select",label:t(()=>i("选择父级")),prop:"pid",props:{options:[{label:t(()=>i("本级")),value:"0"}]}},k={parameterId:N.value,limit:1e5,page:1};le(k).then(e=>{for(let a of e.data)if(a.id!=f.value.model.id){let s={label:t(()=>i(a.showVal)),value:a.id};g.props.options.push(s)}if(f.value.itemList[0].prop=="pid"?f.value.itemList[0].props.options=g.props.options:f.value.itemList.unshift(g),l=="")for(let a of f.value.itemList)a.prop!="parameterName"&&a.prop!="fieldName"&&(a.props==null?a.props={disabled:!1}:a.props.disabled=!1);else ie({id:l}).then(s=>{if(f.value.model=s.data,C)for(let p of f.value.itemList)p.props==null?p.props={disabled:!0}:p.props.disabled=!0;else for(let p of f.value.itemList)p.prop!="parameterName"&&p.prop!="fieldName"&&(p.props==null?p.props={disabled:!1}:p.props.disabled=!1)})})}else f.value.itemList[0].prop=="pid"&&f.value.itemList.splice(0,1)}function b(){y.value.show=!0,f.value.model={},f.value.model.parameterName=A.value,f.value.model.fieldName=F.value,f.value.model.parameterId=N.value,f.value.model.isPrimary=T.value,f.value.model.isTree=V.value,f.value.model.parameterType=O.value;for(let l of f.value.itemList)l.prop!="parameterName"&&l.prop!="fieldName"&&(l.props==null?l.props={disabled:!1}:l.props.disabled=!1);y.value.okText="保存",y.value.title=t(()=>i("新增权限信息")),j("",!1)}async function x(l){f.value.model.id=l,j(l,!1),y.value.okText="保存",y.value.title=t(()=>i("编辑权限信息")),y.value.show=!0}async function Q(l){f.value.model.id=l,j(l,!0),y.value.okText=!1,y.value.title=t(()=>i("查看权限信息")),y.value.show=!0}async function H(l){ue.confirm("是否确认删除这条数据","删除数据确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"info",draggable:!0}).then(()=>{ve({id:l}).then(g=>{g.status=="success"?(B({type:"info",message:"删除成功"}),w()):B({type:"warning",message:"删除失败"+g.msg})})}).catch(()=>{B({type:"info",message:"删除失败"})})}return P({initTableData:ae,resetTable:()=>{u.value.pid=void 0,n.value.tableData=[]}}),(l,C)=>{const g=pe,k=R("y9Table"),e=R("y9Form"),a=R("y9Dialog");return oe(),be(ke,null,[d(k,{config:c(n),filterConfig:Y.value,onOnCurrPageChange:ee,ref_key:"filterRef",ref:J,onOnPageSizeChange:m},{slotSearch:v(()=>[d(g,{size:c(S).buttonSize,style:U({fontSize:c(S).baseFontSize}),class:"global-btn-main",type:"primary",onClick:D},{default:v(()=>[X($(l.$t("查询")),1)]),_:1},8,["size","style"]),d(g,{size:c(S).buttonSize,style:U({fontSize:c(S).baseFontSize}),class:"el-button el-button--default global-btn-third",onClick:G},{default:v(()=>[X($(l.$t("重置")),1)]),_:1},8,["size","style"])]),slotBtns:v(()=>[M.isView?Pe("",!0):(oe(),xe(g,{key:0,size:c(S).buttonSize,style:U({fontSize:c(S).baseFontSize}),class:"global-btn-main",type:"primary",onClick:b},{default:v(()=>[X($(l.$t("新增")),1)]),_:1},8,["size","style"]))]),_:1},8,["config","filterConfig"]),d(a,{config:c(y),"onUpdate:config":C[0]||(C[0]=s=>Ce(y)?y.value=s:y=s)},{default:v(()=>[d(e,{ref_key:"ruleFormRef",ref:W,config:c(f)},null,8,["config"])]),_:1},8,["config"])],64)}}});const Ie=_e(Fe,[["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/auth/dictVal.vue"]]),Le=ce({__name:"index",setup(re){const P=ye("sizeObjInfo"),S=fe(),{t:r}=me();o();const i=o({}),u=o(),J=JSON.parse(sessionStorage.getItem("ssoUserInfo")),F=o(!1),A=o("配置权限值"),T=o(),N=o(),V=o(),O=o(),M=o(),Z=o(),n=o(!0),Y=o(),w=o();let m=o({headerBackground:!0,pageConfig:{background:!1,currentPage:1,pageSize:5,total:0,pageSizeOpts:[5,10,15,20,30,40,1e3]},columns:[{type:"index",title:t(()=>r("序号")),width:80,fixed:"left"},{title:t(()=>r("参数名称")),key:"parameterName"},{title:t(()=>r("参数key")),key:"fieldName"},{title:t(()=>r("参数类型")),key:"parameterType"},{title:t(()=>r("排序")),key:"sort"},{title:t(()=>r("操作")),width:300,fixed:"right",render:e=>e.parameterType=="公有"&&J.managerLevel!==1?_("div",[_("span",{onClick:()=>{C(e.id)}},r("详情")),_("span",{class:"leftMargin",onClick:()=>{H(e.parameterId,"N",e.parameterName,e.fieldName,e.isTree,!0)}},r("查看权限值"))]):_("div",[_("span",{onClick:()=>{C(e.id)}},r("详情")),_("span",{class:"leftMargin",onClick:()=>{l(e.id)}},r("编辑")),_("span",{class:"leftMargin",onClick:()=>{g(e.id)}},r("删除")),_("span",{class:"leftMargin",onClick:()=>{H(e.parameterId,"N",e.parameterName,e.fieldName,e.isTree,!1)}},r("配置权限值"))])}],tableData:[]});const ee=o({filtersValueCallBack:e=>{i.value=e},itemList:[{type:"input",value:"",key:"parameterName",label:t(()=>r("参数名称")),labelWidth:"82px",span:S.device==="mobile"?24:6},{type:"select",value:"",key:"parameterType",label:t(()=>r("参数类型")),labelWidth:"82px",span:S.device==="mobile"?24:6,props:{options:[{label:"公有",value:"公有"},{label:"私有",value:"私有"}]}},{type:"slot",slotName:"slotSearch",span:6},{type:"slot",slotName:"slotBtns",span:S.device==="mobile"?24:6,justify:"flex-end"}],showBorder:!0,borderRadio:"4px"});async function D(){m.value.loading=!0,i.value.page=m.value.pageConfig.currentPage,i.value.limit=m.value.pageConfig.pageSize;let e=await De(i.value);m.value.tableData=e.data||[],m.value.pageConfig.total=e.count||0,m.value.loading=!1}function G(e){m.value.tableData=[],m.value.pageConfig.pageSize=e,D()}function ae(e){m.value.tableData=[],m.value.pageConfig.currentPage=e,D()}function W(){m.value.pageConfig.currentPage=1,m.value.pageConfig.pageSize=15,m.value.tableData=[],D()}function te(){u.value.elTableFilterRef.onReset(),m.value.pageConfig.currentPage=1,m.value.pageConfig.pageSize=15,m.value.tableData=[],i.value={},D()}function y(){m.value.pageConfig.currentPage=1,m.value.pageConfig.pageSize=15,m.value.tableData=[],D()}y();const f=o(),j=(e,a,s)=>{let p=de("number",a,!0);p.valid?s():s(new Error(p.msg))};let b=o({show:!1,title:t(()=>r("新增权限配置")),showFooter:!0,onOkLoading:!0,onOk:e=>new Promise(async(a,s)=>{var I;await((I=f.value)==null?void 0:I.elFormRef).validate(async z=>{if(z){let E=f.value.model,K=new FormData;for(let L in E)E[L]!=null&&L!="createTime"&&L!="updateTime"&&K.append(L,E[L]);(await ge(K)).code==0&&(B({message:"数据保存成功",type:"success"}),a(),D()),s()}else s()})})}),x=o({model:{isPrimary:"Y",parameterType:"公有"},rules:{parameterName:[{required:!0,message:t(()=>r("名称不能为空")),trigger:"blur"}],fieldName:[{required:!0,message:t(()=>r("参数key不能为空")),trigger:"blur"}],isTree:[{required:!0,message:t(()=>r("是否树形不能为空")),trigger:"blur"}],sort:[{required:!0,message:t(()=>r("排序不能为空")),trigger:"blur"},{validator:j,trigger:"blur"}]},itemList:[{type:"input",label:t(()=>r("参数名称")),prop:"parameterName"},{type:"input",label:t(()=>r("参数key")),prop:"fieldName"},{type:"select",label:t(()=>r("是否树形")),prop:"isTree",props:{options:[{label:t(()=>r("是")),value:"是"},{label:t(()=>r("否")),value:"否"}]}},{type:"input",label:t(()=>r("排序")),prop:"sort",props:{type:"number",max:999,min:0}}],descriptionsFormConfig:{labelWidth:"200px",labelAlign:"center"}});function Q(){x.value.model={isPrimary:"Y",parameterType:"公有"};for(let e of x.value.itemList)e.props==null?e.props={disabled:!1}:e.props.disabled=!1;b.value.okText="保存",b.value.title=t(()=>r("新增权限信息")),b.value.show=!0}function H(e,a,s,p,I,z){N.value=e,V.value=a,O.value=s,M.value=p,Z.value=I,Y.value="公有",F.value=!0,n.value=z}function ne(){w.value.initTableData(N.value,V.value,O.value,M.value,Z.value,Y.value)}async function l(e){let s=await ie({id:e});x.value.model=s.data;for(let p of x.value.itemList)p.props==null?p.props={disabled:!1}:p.props.disabled=!1;b.value.title=t(()=>r("编辑权限信息")),b.value.okText="保存",b.value.show=!0}async function C(e){let s=await ie({id:e});x.value.model=s.data;for(let p of x.value.itemList)p.props==null?p.props={disabled:!0}:p.props.disabled=!0;b.value.okText=!1,b.value.title=t(()=>r("查看权限信息")),b.value.show=!0}async function g(e){ue.confirm("是否确认删除这条数据","删除数据确认",{confirmButtonText:"确定",cancelButtonText:"取消",type:"info",draggable:!0}).then(()=>{ve({id:e}).then(s=>{s.status=="success"?(B({type:"info",message:"删除成功"}),D()):B({type:"warning",message:"删除失败"+s.msg})})}).catch(()=>{})}function k(){F.value=!1,w.value.resetTable()}return(e,a)=>{const s=pe,p=R("y9Table"),I=Se,z=R("Warning"),E=Te,K=Ve,se=R("y9Form"),L=R("y9Dialog"),he=we,ze=Ne;return oe(),be(ke,null,[d(p,{config:c(m),filterConfig:ee.value,onOnCurrPageChange:ae,ref_key:"filterRef",ref:u,onOnPageSizeChange:G},{slotSearch:v(()=>[d(s,{size:c(P).buttonSize,style:U({fontSize:c(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:W},{default:v(()=>[a[8]||(a[8]=q("i",{class:"ri-search-line"},null,-1)),q("span",null,$(e.$t("查询")),1)]),_:1},8,["size","style"]),d(s,{size:c(P).buttonSize,style:U({fontSize:c(P).baseFontSize}),class:"el-button el-button--default global-btn-third",onClick:te},{default:v(()=>[a[9]||(a[9]=q("i",{class:"ri-refresh-line"},null,-1)),q("span",null,$(e.$t("重置")),1)]),_:1},8,["size","style"])]),slotBtns:v(()=>[d(s,{size:c(P).buttonSize,style:U({fontSize:c(P).baseFontSize}),class:"global-btn-main",type:"primary",onClick:Q},{default:v(()=>[a[10]||(a[10]=q("i",{class:"ri-add-line"},null,-1)),q("span",null,$(e.$t("新增")),1)]),_:1},8,["size","style"])]),_:1},8,["config","filterConfig"]),d(L,{config:c(b),"onUpdate:config":a[4]||(a[4]=h=>Ce(b)?b.value=h:b=h)},{default:v(()=>[d(se,{ref_key:"ruleFormRef",ref:f,config:c(x)},{isLimit:v(()=>[d(I,{modelValue:T.value,"onUpdate:modelValue":a[0]||(a[0]=h=>T.value=h),"active-text":"是","inactive-text":"否"},null,8,["modelValue"]),d(K,{effect:"light",content:"点击配置限流信息",placement:"top-start"},{default:v(()=>[d(E,{class:"operate",onClick:a[1]||(a[1]=h=>e.openView("1"))},{default:v(()=>[d(z)]),_:1})]),_:1})]),isAuth:v(()=>[d(I,{modelValue:T.value,"onUpdate:modelValue":a[2]||(a[2]=h=>T.value=h),"active-text":"是","inactive-text":"否"},null,8,["modelValue"]),d(K,{effect:"light",content:"点击配置鉴权信息",placement:"top-start"},{default:v(()=>[d(E,{class:"operate",onClick:a[3]||(a[3]=h=>e.openView("2"))},{default:v(()=>[d(z)]),_:1})]),_:1})]),_:1},8,["config"])]),_:1},8,["config"]),d(ze,{onClosed:k,onOpened:ne,modelValue:F.value,"onUpdate:modelValue":a[7]||(a[7]=h=>F.value=h),title:A.value},{footer:v(()=>[d(s,{class:"el-button el-button--default global-btn-third",onClick:a[6]||(a[6]=h=>k())},{default:v(()=>a[11]||(a[11]=[X("关闭")])),_:1})]),default:v(()=>[d(he),d(Ie,{isView:n.value,"onUpdate:isView":a[5]||(a[5]=h=>n.value=h),ref_key:"dictValRef",ref:w},null,8,["isView"])]),_:1},8,["modelValue","title"])],64)}}});const va=_e(Le,[["__file","E:/workSpaceJDK11/y9-interface-platform/y9vue-interfacePlatform/src/views/auth/index.vue"]]);export{va as default};
|