Files
aiot-platform-ui/apps/web-antd/dist/js/card-view-CbWgNGGN.js
lzh c6e51a215f
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 10s
chore: build and deploy web-antd
2026-03-25 16:05:53 +08:00

2 lines
7.8 KiB
JavaScript

var Q=Object.defineProperty;var B=Object.getOwnPropertySymbols;var X=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable;var z=(l,i,s)=>i in l?Q(l,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[i]=s,D=(l,i)=>{for(var s in i||(i={}))X.call(i,s)&&z(l,s,i[s]);if(B)for(var s of B(i))J.call(i,s)&&z(l,s,i[s]);return l};var W=(l,i,s)=>new Promise((k,C)=>{var A=u=>{try{y(s.next(u))}catch(p){C(p)}},m=u=>{try{y(s.throw(u))}catch(p){C(p)}},y=u=>u.done?k(u.value):Promise.resolve(u.value).then(A,m);y((s=s.apply(l,i)).next())});import{dg as Z,bZ as ee,b_ as te,an as _,ax as P,az as oe,ak as ae,ay as w,bE as se,bu as re,S as ne,bS as ie,ac as ce}from"./bootstrap-Cs_ukuUC.js";import{m as le,b9 as N,aa as de,ad as b,b2 as c,j as n,ac as g,bJ as d,ab as T,u as t,I as ue,bb as pe,ae as a,aR as fe,aT as x,bp as f,ai as O,cf as _e}from"../jse/index-index-BQSou8bA.js";import{f as ye}from"./index-Cznb2uHz.js";import{u as ge,S as Y,b as Ce,c as be,O as $,a as Te}from"./data-2467LO9F.js";import{D as me}from"./dict-enum-CaHgMaDZ.js";const he={class:"work-order-card-view"},ve=["onClick"],Ee={class:"card-header"},Ne={class:"status-text"},ke={class:"card-body"},Ie={class:"card-title"},De={class:"info-rows"},Pe={class:"info-row"},we={class:"info-text order-code-styled"},xe={class:"info-row"},Oe={class:"info-text location-text"},Ae={class:"info-row"},Se={key:0,class:"info-text assignee-text"},Re={key:0,class:"assignee-phone"},Me={key:1,class:"info-text info-text--muted"},Ve={key:0,class:"info-row"},Le={class:"card-footer"},Ue={class:"card-meta"},Be={class:"create-time"},ze={key:0,class:"pagination-wrapper"},We=!1,Ye=le({name:"WorkOrderCardView",__name:"card-view",props:{searchParams:{}},emits:["assign","cancel","detail","notify","upgrade"],setup(l,{expose:i,emit:s}){const k=l,C=s,A=[{id:10001,orderCode:"WO20260123143025001",title:"A区洗手间紧急保洁",orderType:"CLEAN",status:"ARRIVED",priority:0,location:"A区 / 1楼洗手间",assigneeId:2001,assigneeName:"张三",createTime:"2026-01-23 14:30:25"},{id:10002,orderCode:"WO20260123150012002",title:"B区大厅日常保洁",orderType:"CLEAN",status:"DISPATCHED",priority:1,location:"B区 / 大厅",assigneeId:2002,assigneeName:"李四",createTime:"2026-01-23 15:00:12"},{id:10003,orderCode:"WO20260123151530003",title:"C区会议室深度保洁",orderType:"CLEAN",status:"PENDING",priority:2,location:"C区 / 3楼会议室",createTime:"2026-01-23 15:15:30"},{id:10004,orderCode:"WO20260123091045004",title:"D区电梯厅保洁",orderType:"CLEAN",status:"COMPLETED",priority:2,location:"D区 / 电梯厅",assigneeId:2003,assigneeName:"王五",createTime:"2026-01-23 09:10:45"},{id:10005,orderCode:"WO20260123160000005",title:"E区停车场应急清洁",orderType:"CLEAN",status:"QUEUED",priority:0,location:"E区 / 地下停车场",assigneeId:2001,assigneeName:"张三",createTime:"2026-01-23 16:00:00"},{id:10006,orderCode:"WO20260123102030006",title:"A区休息区保洁",orderType:"CLEAN",status:"CONFIRMED",priority:1,location:"A区 / 2楼休息区",assigneeId:2004,assigneeName:"赵六",createTime:"2026-01-23 10:20:30"},{id:10007,orderCode:"WO20260123110500007",title:"F区门厅玻璃清洁",orderType:"CLEAN",status:"PAUSED",priority:2,location:"F区 / 门厅",assigneeId:2005,assigneeName:"钱七",createTime:"2026-01-23 11:05:00"},{id:10008,orderCode:"WO20260123140000008",title:"B区卫生间设备维修",orderType:"REPAIR",status:"PENDING",priority:1,location:"B区 / 2楼卫生间",createTime:"2026-01-23 14:00:00"}],m=N(!1),y=N([]),u=N(0),p=N({pageNo:1,pageSize:8}),F=Z(),G=de(()=>F.getDictOptions(me.OPS_TRIGGER_SOURCE)),{getPriorityInfo:v}=ge();function S(r){const o=G.value.find(E=>E.value===r);if(!o)return{label:r,color:"default"};if(o.cssClass)return{label:o.label,color:o.cssClass};let e="default";switch(o.colorType){case"danger":{e="error";break}case"info":{e="default";break}case"primary":{e="processing";break}case"success":{e="success";break}case"warning":{e="warning";break}default:e=o.colorType||"default"}return{label:o.label,color:e}}function I(){return W(this,null,function*(){m.value=!0;try{if(!We){const r=yield ye(D(D({},p.value),k.searchParams));y.value=r.list||[],u.value=r.total||0}}finally{m.value=!1}})}function H(r,o){p.value.pageNo=r,p.value.pageSize=o,I()}function j(r){return r===0}function R(r){return["CANCELLED","COMPLETED"].includes(r)}function q(r){return["ARRIVED","CONFIRMED","DISPATCHED","QUEUED"].includes(r)}function K(r){if(!r)return"-";try{const o=_e(r);return o.isValid()?o.format("YYYY-MM-DD HH:mm:ss"):"-"}catch(o){return"-"}}return i({reload:I,query:()=>{p.value.pageNo=1,I()}}),(r,o)=>(c(),b("div",he,[n(t(ne),{spinning:m.value,class:"card-grid"},{default:d(()=>[y.value.length>0?(c(),T(t(ee),{key:0,gutter:[12,12]},{default:d(()=>[(c(!0),b(ue,null,pe(y.value,e=>(c(),T(t(te),{key:e.id,xs:24,sm:12,md:8,lg:6,xl:6},{default:d(()=>{var E,M,V,L,U;return[a("div",{class:fe(["order-card",{"order-card--urgent":j(e.priority),"order-card--terminal":R(e.status)}]),onClick:h=>C("detail",e.id)},[a("div",Ee,[a("div",{class:"status-info",style:x({"--status-color":(E=t(Y)[e.status])==null?void 0:E.text,"--status-bg":(M=t(Y)[e.status])==null?void 0:M.bg})},[n(t(_),{icon:t(Ce)[e.status]||"solar:circle-bold",class:"status-icon"},null,8,["icon"]),a("span",Ne,f(t(be)[e.status]),1)],4),a("div",{class:"priority-tag",style:x(t(v)(e.priority).style)},[t(v)(e.priority).icon?(c(),T(t(_),{key:0,icon:t(v)(e.priority).icon},null,8,["icon"])):g("",!0),O(" "+f(t(v)(e.priority).label),1)],4)]),a("div",ke,[n(t(P),{title:e.title,placement:"topLeft"},{default:d(()=>[a("h4",Ie,f(e.title),1)]),_:2},1032,["title"]),a("div",De,[a("div",Pe,[n(t(_),{icon:"solar:bill-list-bold-duotone",class:"info-icon"}),a("span",we,f(e.orderCode),1)]),a("div",xe,[n(t(_),{icon:"solar:map-point-bold-duotone",class:"info-icon"}),a("span",Oe,f(e.location||"未指定位置"),1)]),a("div",Ae,[n(t(_),{icon:"solar:user-bold-duotone",class:"info-icon"}),e.assigneeName?(c(),b("span",Se,[O(f(e.assigneeName)+" ",1),(V=e.extInfo)!=null&&V.assignedUserPhone?(c(),b("span",Re," ("+f(e.extInfo.assignedUserPhone)+") ",1)):g("",!0)])):(c(),b("span",Me,"待分配"))]),e.sourceType?(c(),b("div",Ve,[n(t(_),{icon:"solar:radar-bold-duotone",class:"info-icon"}),n(t(oe),{color:S(e.sourceType).color,class:"source-tag",bordered:!1},{default:d(()=>[O(f(S(e.sourceType).label),1)]),_:2},1032,["color"])])):g("",!0)])]),a("div",Le,[a("div",Ue,[a("span",{class:"type-tag",style:x({backgroundColor:(L=t($)[e.orderType])==null?void 0:L.bg,color:(U=t($)[e.orderType])==null?void 0:U.text})},f(t(Te)[e.orderType]),5),a("span",Be,f(K(e.createTime)),1)]),a("div",{class:"card-actions",onClick:o[0]||(o[0]=ae(()=>{},["stop"]))},[e.status==="PENDING"?(c(),T(t(P),{key:0,title:"分配执行人"},{default:d(()=>[n(t(w),{type:"primary",size:"small",class:"action-btn",onClick:h=>C("assign",e)},{default:d(()=>[n(t(_),{icon:"solar:user-plus-bold"})]),_:1},8,["onClick"])]),_:2},1024)):g("",!0),g("",!0),e.priority!==0&&q(e.status)?(c(),T(t(P),{key:2,title:"升级为紧急"},{default:d(()=>[n(t(w),{size:"small",class:"action-btn action-btn--upgrade",onClick:h=>C("upgrade",e)},{default:d(()=>[n(t(_),{icon:"solar:bolt-bold"})]),_:1},8,["onClick"])]),_:2},1024)):g("",!0),R(e.status)?g("",!0):(c(),T(t(se),{key:3,title:"确定取消此工单?",placement:"topRight",onConfirm:h=>C("cancel",e)},{default:d(()=>[n(t(w),{size:"small",class:"action-btn action-btn--danger"},{default:d(()=>[n(t(_),{icon:"solar:close-circle-bold"})]),_:1})]),_:1},8,["onConfirm"]))])])],10,ve)]}),_:2},1024))),128))]),_:1})):(c(),T(t(re),{key:1,description:"暂无工单数据",class:"my-16"}))]),_:1},8,["spinning"]),y.value.length>0?(c(),b("div",ze,[n(t(ie),{current:p.value.pageNo,"onUpdate:current":o[1]||(o[1]=e=>p.value.pageNo=e),"page-size":8,total:u.value,"show-total":e=>`${e}`,size:"small","show-quick-jumper":"",onChange:H},null,8,["current","total","show-total"])])):g("",!0)]))}}),Xe=ce(Ye,[["__scopeId","data-v-408d2496"]]);export{Xe as default};