detect/detect.gui/Embedded/dist/assets/index-062f5c4c.js

2 lines
2.9 KiB
JavaScript
Raw Normal View History

2024-11-13 17:09:15 +08:00
var D=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var Y=(n,d)=>{var i={};for(var t in n)j.call(n,t)&&d.indexOf(t)<0&&(i[t]=n[t]);if(n!=null&&D)for(var t of D(n))d.indexOf(t)<0&&H.call(n,t)&&(i[t]=n[t]);return i};import{j as I,k as N,m as O}from"./index.js";import{u as V,B as E}from"./useTable-f8594a7b.js";import{T as F}from"./useForm-322569b9.js";import{j as b}from"./antd-fb8ca017.js";import{r as K,s as z,c as G,a as y}from"./schema-fc621ae3.js";import{u as U}from"./index-922f0b14.js";import{_ as W}from"./drawer.vue_vue_type_script_setup_true_lang-6fccf3c1.js";import{d as Z,a6 as q,Z as S,_ as J,k as g,a5 as _,G as L,a4 as Q,u,a8 as X}from"./vue-08ef39cb.js";import"./index-9a268806.js";import"./useWindowSizeFn-40274562.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-bf4926ca.js";const fe=Z({name:"ConstantPage",__name:"index",setup(n){I();const d=N(),[i,{openDrawer:t}]=U(),[k,{reload:C,setSelectedRowKeys:v}]=V({api:e=>z(x(e)),columns:G,formConfig:{labelWidth:120,schemas:y,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),x=(e,l=!0)=>{const w=e,{pageNum:p,pageSize:f,field:c="id",order:A="descend"}=w,M=Y(w,["pageNum","pageSize","field","order"]),a={pageNum:p,pageSize:f,orderByClause:`${c} ${A==="descend"?"desc":"asc"}`};return Object.keys(M).forEach(h=>{const r=y.find(m=>m.field===h),o=e[h],s=h;if(r){if(o!==void 0&&o!=="")if(r.component==="Input"){const m=l?"":"%";a[s]=`${m}${o.trim()}${m}`}else["Select","ApiSelect","ApiTreeSelect"].includes(r.component)?a[s]=O(o)?o.value:o:r.component==="RangePicker"?(a[`${s}From`]=b(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),a[`${s}To`]=b(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):r.component==="DatePicker"?a[s]=b(o).format(r.componentProps.format||"YYYY-MM-DD"):a[s]=o}else a[s]=o}),a},T=()=>{t(!0,{isUpdate:!1})},R=e=>{t(!0,{record:e,isUpdate:!0})},$=e=>{K(e.id).then(l=>{C(),v([])})},B=()=>{C()},P=e=>{d("/system/constant/detail/"+e.id)};return(e,l)=>{const p=q("a-button");return S(),J("div",null,[g(u(E),{onRegister:u(k)},{toolbar:_(()=>[g(p,{type:"primary",onClick:T},{default:_(()=>l[0]||(l[0]=[L(" 新增")])),_:1})]),bodyCell:_(({column:f,record:c})=>[f.dataIndex==="action"?(S(),Q(u(F),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:R.bind(null,c),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:P.bind(null,c),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:$.bind(null,c),placement:"topRight"}}]},null,8,["actions","dropDownActions"])):X("",!0)]),_:1},8,["onRegister"]),g(W,{onRegister:u(i),onSuccess:B},null,8,["onRegister"])])}}});export{fe as default};