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
16 KiB
2 lines
16 KiB
2 weeks ago
|
import{_ as De,m as K,s as Q,l as Te,f as Y,g as Be,r as p,p as X,q as N,o as s,c as w,i as f,w as u,F as x,h as D,k as C,d as y,e as v,t as H,a as Re,E as F,v as d,x as M}from"./index-C8ULRFhF.js";import{s as Ie,_ as He,a as Fe,i as Pe,b as Ee,g as Z,c as T,d as Ve,p as Ae,e as Le,f as Ue,h as Ye,j as Me,k as je,l as $e,m as ze,n as Je,o as qe,q as We,r as Ge}from"./index-YZp8Ts8_.js";const Ke={class:"app-container"},Qe=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(ee,{emit:te}){const ae=K(),k=Q.userStore().state,j=Q.permissionStore(),t=Te({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=ee;function $(l){{t.localTableColumnsName=Z(K().name),a.apiType=="detailApi"&&(t.localTableColumnsName=Z(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 P=te;function le(l){t.tableSelectList=l,P("tableSelectionHandle",l)}function ne(l,e){P("leftOperationHadel",l,e)}function ie(){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:(r,_)=>r[a.apiRightHideConfig[i].prop]==a.apiRightHideConfig[i].ruleValue})}),typeof a.rightOperation=="object"&&(n=[...n,...a.rightOperation]),n}}const b=Y();function oe(l,e){if(l.name=="apiUpdate"){let i=(a.tableColumns||T[a.apiName]).filter(r=>!r.noEdit);b.value.open(i,e.row)}l.name=="apiDelete"&&F.confirm("是否确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{t.loading=!0,Ve(a.apiName,e.row.uId).then(n=>{d.success("操作成功!"
|