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 Ne,m as q,s as W,l as ve,f as V,g as xe,r as g,p as G,q as N,o,c as O,i as p,w as b,F as w,h as D,k as _,d as v,e as L,t as U,a as we,E as R,v as u,x as Y}from"./index-Dk5CK9SF.js";import{s as De,_ as Te,a as ke,i as Be,b as Re,g as K,c as T,d as Ie,p as He,e as Fe,f as Pe,h as Ee,j as Ae,k as Ve,l as Le,m as Ue,n as Ye,o as Me,q as je,r as ze}from"./index-Ce2KtBHV.js";const $e={class:"app-container"},Je=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(Q,{emit:X}){const Z=q(),x=W.userStore().state,M=W.permissionStore(),t=ve({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}),a=Q;function j(l){{t.localTableColumnsName=K(q().name),a.apiType=="detailApi"&&(t.localTableColumnsName=K(a.apiName+"Detail"));let e=JSON.parse(localStorage.getItem(t.localTableColumnsName));return t.initTableColums=a.tableColumns||T[a.apiName],e&&e!=null&&e!=null?e:JSON.parse(JSON.stringify(t.initTableColums))}}const I=X;function ee(l){t.tableSelectList=l,I("tableSelectionHandle",l)}function te(l,e){I("leftOperationHadel",l,e)}function ae(){if(typeof a.rightOperation=="object"&&!a.showApiRightOperation)return a.rightOperation;if(typeof a.rightOperation=="object"&&a.showApiRightOperation||typeof a.rightOperation=="string"){let l=a.showApiRightOperation||a.rightOperation.split(","),e={apiUpdate:{label:"编辑",type:"warning"},apiDelete:{label:"删除",type:"danger"}},n=[];return l&&l.length>0&&l.forEach(i=>{n.push({label:e[i].label,name:i,link:!0,type:e[i].type,auth:a.apiName+":"+i,hide:(s,h)=>s[a.apiRightHideConfig[i].prop]==a.apiRightHideConfig[i].ruleValue})}),typeof a.rightOperation=="object"&&(n=[...n,...a.rightOperation]),n}}const y=V();function le(l,e){if(l.name=="apiUpdate"){let i=(a.tableColumns||T[a.apiName]).filter(s=>!s.noEdit);y.value.open(i,e.row)}l.name=="apiDelete"&&R.confirm("是否确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.loading=!0,Ie(a.apiName,e.row.uId).then(n=>{u.success("操作成功!"),d(1)}).c