Files
aiot-platform-ui/apps/web-antd/dist/js/index-B5LuTYkO.js
lzh 24c3dbc8f1
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-23 17:20:54 +08:00

2 lines
6.9 KiB
JavaScript

var D=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var G=(d,t,s)=>t in d?D(d,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):d[t]=s,F=(d,t)=>{for(var s in t||(t={}))ae.call(t,s)&&G(d,s,t[s]);if(V)for(var s of V(t))ie.call(t,s)&&G(d,s,t[s]);return d},z=(d,t)=>ee(d,te(t));var _=(d,t,s)=>new Promise((r,x)=>{var f=p=>{try{m(s.next(p))}catch(g){x(g)}},k=p=>{try{m(s.throw(p))}catch(g){x(g)}},m=p=>p.done?r(p.value):Promise.resolve(p.value).then(f,k);m((s=s.apply(d,t)).next())});import{au as j,cF as ne,ay as T,an as N,$ as S,br as le,ax as oe,a9 as v}from"./bootstrap-DmcuvVZS.js";import{u as se}from"./useSortable-jtnNPDb0-XvV4hVH9.js";import"./vxe-table-CF-Re93B.js";import{_ as ce,g as ue,d as de,u as re,a as me,b as fe}from"./form.vue_vue_type_script_setup_true_lang-D1bN9I1F.js";import{d as P}from"./data-DPhY-QG7.js";import{_ as pe}from"./table-action.vue_vue_type_script_setup_true_lang-DLEMWDWC.js";import{_ as ve}from"./page.vue_vue_type_script_setup_true_lang-D_L6nEGY.js";import{m as ye,b9 as y,w as he,v as be,ab as $,b2 as h,bJ as c,j as u,ae as b,u as n,ad as w,I as L,bb as ge,aR as _e,bp as R,ac as H,ai as O,bZ as J,n as xe}from"../jse/index-index-B6J4axeY.js";import{u as ke}from"./use-modal-BrjqCt0f.js";import{u as Ce}from"./use-vxe-grid-DQWlXi-M.js";import{A as U}from"./icons-CieLeI1V.js";import{v as Te}from"./AlertBuilder-CxKfA7Bf.js";import"./index-CmA6iyrg.js";import"./dict-tag.vue_vue_type_script_setup_true_lang-D0nJjy4y.js";import"./index-C3H1eIkn.js";import"./index-Dlk9vVoe.js";import"./x-CGHUyQuD.js";import"./circle-check-big-CXTM1Gxe.js";const Se={class:"flex h-full gap-4"},we=["onClick"],Oe={class:"mb-4 flex flex-shrink-0 items-center justify-between"},Ae={class:"text-base font-medium"},Ee={class:"flex items-center gap-2"},Ne={class:"inspection-template-table min-h-0 flex-1 overflow-auto"},Qe=ye({name:"OpsInspectionTemplate",__name:"index",setup(d){const t=y("MALE_TOILET"),s=y({}),r=y([]),x=y(!1),f=y(!1),k=y([]),m=y(null),[p,g]=ke({connectedComponent:ce,destroyOnClose:!0}),[Y,A]=Ce({gridOptions:{columns:fe(),data:[],keepSource:!0,pagerConfig:{enabled:!1},rowConfig:{keyField:"id",isHover:!0},toolbarConfig:{enabled:!1}}});function E(){return _(this,null,function*(){var i,e;x.value=!0;try{const a=yield ue({functionType:t.value,pageNo:1,pageSize:100}),l=(i=a==null?void 0:a.list)!=null?i:[];r.value=l,A.setGridOptions({data:l}),s.value[t.value]=(e=a==null?void 0:a.total)!=null?e:l.length}catch(a){r.value=[],A.setGridOptions({data:[]})}finally{x.value=!1}})}function Z(i){f.value||(t.value=i)}function q(){g.setData({functionType:t.value}).open()}function I(i){g.setData(i).open()}function K(i){return _(this,null,function*(){var a;const e=v.loading({content:S("ui.actionMessage.deleting",[i.itemTitle]),duration:0});try{yield de(i.id),v.success(S("ui.actionMessage.deleteSuccess",[i.itemTitle])),yield C()}catch(l){const o=(l==null?void 0:l.message)||((a=l==null?void 0:l.data)==null?void 0:a.msg)||"删除失败";v.error(o)}finally{e()}})}function Q(i){return _(this,null,function*(){var l;const e=!i.isActive;try{yield Te(e?`确认启用检查项【${i.itemTitle}】吗?`:`确认停用检查项【${i.itemTitle}】吗?`)}catch(o){return}const a=v.loading({content:e?"启用中...":"停用中...",duration:0});try{yield re(z(F({},i),{isActive:e})),v.success(e?"已启用":"已停用"),yield C()}catch(o){const M=(o==null?void 0:o.message)||((l=o==null?void 0:o.data)==null?void 0:l.msg)||"操作失败";v.error(M)}finally{a()}})}function C(){return _(this,null,function*(){yield E()})}function W(){k.value=J(r.value),f.value=!0,xe(()=>{m.value?m.value.option("disabled",!1):m.value=se(".inspection-template-table .vxe-table .vxe-table--body-wrapper:not(.fixed-right--wrapper) .vxe-table--body tbody",r.value,{draggable:".vxe-body--row",animation:150,handle:".drag-handle",disabled:!1,onEnd:({newDraggableIndex:i,oldDraggableIndex:e})=>{e!==i&&r.value.splice(i!=null?i:0,0,r.value.splice(e!=null?e:0,1)[0])}})})}function X(){return _(this,null,function*(){const i=v.loading({content:"正在保存排序...",duration:0});try{const e=r.value.map(a=>a.id);yield me(e),f.value=!1,m.value&&m.value.option("disabled",!0),v.success("排序保存成功"),yield C()}catch(e){console.error("排序保存失败",e),v.error("排序保存失败")}finally{i()}})}function B(){r.value=J(k.value),A.setGridOptions({data:r.value}),m.value&&m.value.option("disabled",!0),f.value=!1}return he(t,()=>{f.value&&B(),m.value=null,E()}),be(()=>{E()}),(i,e)=>(h(),$(n(ve),{"auto-content-height":""},{default:c(()=>[u(n(p),{onSuccess:C}),b("div",Se,[u(n(j),{class:"w-[220px] flex-shrink-0 overflow-hidden","body-style":{padding:"8px"}},{default:c(()=>[e[0]||(e[0]=b("div",{class:"mb-2 px-2 text-sm font-medium text-gray-500"},"功能类型",-1)),(h(!0),w(L,null,ge(n(P),a=>{var l;return h(),w("div",{key:a.value,class:_e(["flex cursor-pointer items-center justify-between rounded-md px-3 py-2.5 text-sm transition-colors",t.value===a.value?"bg-blue-50 font-medium text-blue-600":"text-gray-700 hover:bg-gray-50"]),onClick:o=>Z(a.value)},[b("span",null,R(a.label),1),u(n(ne),{count:(l=s.value[a.value])!=null?l:0,"number-style":{backgroundColor:t.value===a.value?"#1677ff":"#f0f0f0",color:t.value===a.value?"#fff":"#999",fontSize:"12px",boxShadow:"none"}},null,8,["count","number-style"])],10,we)}),128))]),_:1}),u(n(j),{class:"min-w-0 flex-1 overflow-hidden","body-style":{padding:"16px",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"}},{default:c(()=>{var a,l;return[b("div",Oe,[b("div",Ae,R((l=(a=n(P).find(o=>o.value===t.value))==null?void 0:a.label)!=null?l:t.value)+" - 检查项列表 ",1),b("div",Ee,[f.value?(h(),w(L,{key:1},[u(n(T),{onClick:B},{default:c(()=>[...e[3]||(e[3]=[O("取消",-1)])]),_:1}),u(n(T),{type:"primary",onClick:X},{default:c(()=>[...e[4]||(e[4]=[O("保存排序",-1)])]),_:1})],64)):(h(),w(L,{key:0},[r.value.length>1?(h(),$(n(T),{key:0,onClick:W},{icon:c(()=>[u(n(N),{icon:"lucide:align-start-vertical"})]),default:c(()=>[e[1]||(e[1]=O(" 排序 ",-1))]),_:1})):H("",!0),u(n(T),{type:"primary",onClick:q},{icon:c(()=>[u(n(N),{icon:"lucide:plus"})]),default:c(()=>[e[2]||(e[2]=O(" 新增 ",-1))]),_:1})],64))])]),b("div",Ne,[u(n(Y),null,{drag:c(()=>[f.value?(h(),$(n(oe),{key:0,title:"拖动排序"},{default:c(()=>[u(n(N),{icon:"ic:round-drag-indicator",class:"drag-handle cursor-move text-xl text-gray-400"})]),_:1})):H("",!0)]),isActive:c(({row:o})=>[u(n(le),{checked:o.isActive,"checked-children":"启用","un-checked-children":"停用",size:"small",onClick:M=>Q(o)},null,8,["checked","onClick"])]),actions:c(({row:o})=>[u(n(pe),{actions:[{label:n(S)("common.edit"),type:"link",icon:n(U).EDIT,onClick:()=>I(o)},{label:n(S)("common.delete"),type:"link",danger:!0,icon:n(U).DELETE,popConfirm:{title:`确认删除检查项【${o.itemTitle}】吗?`,confirm:()=>K(o)}}]},null,8,["actions"])]),_:1})])]}),_:1})])]),_:1}))}});export{Qe as default};