You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
15 KiB

3 weeks ago
import{_ as Se,u as q,s as W,g as Oe,i as E,j as Ne,r as m,k as G,l as C,o,c as S,h as p,w as g,F as x,m as v,n as _,d as O,e as A,t as L,a as Te,E as D,p as u,q as V}from"./index-CI8aco7-.js";import{s as xe,_ as ve,a as ke,i as we,b as De,g as K,c as Q,d as Be,p as Ie,e as He,f as Fe,h as Re,j as Pe,k as Ee,l as Ae,m as Le,n as Ve,o as Ue,q as Ye}from"./index-Dt44Wo52.js";import{d as Me}from"./download-DA4MPZiT.js";const je={class:"app-container"},ze=Object.assign({name:"ediTtablePage"},{__name:"index",props:{apiName:{type:String,default:null},detailColumName:{type:String,default:null},apiType:{type:String,default:null},hideSearch:{type:Boolean,default:!1},multipleTable:{type:Boolean,default:!1},showTableIndex:{type:Boolean,default:!0},leftOperation:{type:Object,default:null},rightOperation:{type:[Object,String],default:null},showApiRightOperation:{type:Object,default:null},apiRightHideConfig:{type:Object,default:{apiUpdate:{prop:"readState",ruleValue:!0},apiDelete:{prop:"readState",ruleValue:!0}}},tableColumns:{type:Object,default:null},searchOptions:{type:Object,default:[]},searchButtons:{type:Object,default:["search","export"]},searchFilter:{type:Object,default:{}},columnWidth:{type:Number,default:120},columnHeaderAlign:{type:String,default:"center"},columnAlign:{type:String,default:"center"},apiEditFormRules:{type:Object,default:null},tableFormRules:{type:Object,default:null},hideHeaderInfo:{type:Boolean,default:!1},editDisabledConfig:{type:Object,default:[{prop:"readState",ruleValue:!0}]},hideSetColums:{type:Boolean,default:!1}},emits:["leftOperationHadel","rightOperationHadel","tableSelectionHandle"],setup(X,{emit:Z}){const ee=q(),N=W.userStore().state,U=W.permissionStore(),e=Oe({loading:!1,detailLoading:!1,pageLoading:!1,searchBtnOptions:{search:{icon:"Search",auth:":page",label:"查询",type:null},create:{icon:"Plus",auth:":create",label:"新增",type:"primary"},import:{icon:"BottomRight",auth:":import",label:"导入",type:"warning"},export:{icon:"TopRight",auth:":export",label:"导出",type:"success"},custominvoke:{icon:"Position",auth:":custominvoke",label:"手动开关",type:"primary"},outputMany:{icon:"Position",auth:":outputMany",label:"手动传出",type:"primary"}},searchRightBtn:[{name:"pageSave",icon:"Check",auth:":pageSave",label:"保存页面",type:"warning"}],tableData:[],sortFilter:{sortBy:void 0,isAscending:void 0},pager:{page:1,pageSize:10,total:1},tableSelectList:[],leaveSaveTip:"此操作将重新渲染页面,检测有数据【未保存】,操作后将【清空未保存数据】,是否确定继续?",headerInfoData:[],currentDetailId:null,stage_tableData:[],stage_indexs:[],initTableColums:[],localTableColumnsName:null,tableFormRulesData:null}),l=X;function k(){e.localTableColumnsName=K(q().name),l.apiType=="detailApi"&&(e.localTableColumnsName=K(l.apiName+"Detail"));let a=JSON.parse(localStorage.getItem(e.localTableColumnsName));return e.initTableColums=l.tableColumns||Q[l.apiName],a&&a!=null&&a!=null?a:JSON.parse(JSON.stringify(e.initTableColums))}const B=Z;function te(a){e.tableSelectList=a,B("tableSelectionHandle",a)}function ae(a,t){B("leftOperationHadel",a,t)}function le(){if(typeof l.rightOperation=="object"&&!l.showApiRightOperation)return l.rightOperation;if(typeof l.rightOperation=="object"&&l.showApiRightOperation||typeof l.rightOperation=="string"){let a=l.showApiRightOperation||l.rightOperation.split(","),t={apiUpdate:{label:"编辑",type:"warning"},apiDelete:{label:"删除",type:"danger"}},n=[];return a&&a.length>0&&a.forEach(r=>{n.push({label:t[r].label,name:r,link:!0,type:t[r].type,auth:l.apiName+":"+r,hide:(s,b)=>s[l.apiRightHideConfig[r].prop]==l.apiRightHideConfig[r].ruleValue})}),typeof l.rightOperation=="object"&&(n=[...n,...l.rightOperation]),n}}const h=E();function ne(a,t){if(a.name=="apiUpdate"){let r=k().filter(s=>!s.noEdit);h.value.open(r,t.row)}a.name=="apiDelete"&&D.confirm("是否确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{e.loading=!0,Be(l.apiName,t.row.uId).then(n=>{u.success("操作成功!"),c