2 lines
7.9 KiB
JavaScript
2 lines
7.9 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((I,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?I(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 k,aa as de,v as ue,ad as b,b2 as c,j as n,ac as g,bJ as d,ab as T,u as t,I as pe,bb as fe,ae as a,aR as _e,aT as x,bp as f,ai as O,cf as ye}from"../jse/index-index-BQSou8bA.js";import{f as ge}from"./index-Cznb2uHz.js";import{u as Ce}from"./data-2467LO9F.js";import{S as Y,a as be,b as Te,O as $,c as me}from"./data-iVUhChM8.js";import{D as he}from"./dict-enum-CaHgMaDZ.js";const ve={class:"work-order-card-view"},Ee=["onClick"],Ne={class:"card-header"},ke={class:"status-text"},Ie={class:"card-body"},De={class:"card-title"},Pe={class:"info-rows"},we={class:"info-row"},xe={class:"info-text order-code-styled"},Oe={class:"info-row"},Ae={class:"info-text location-text"},Se={class:"info-row"},Re={key:0,class:"info-text assignee-text"},Me={key:0,class:"assignee-phone"},Ve={key:1,class:"info-text info-text--muted"},Le={key:0,class:"info-row"},Ue={class:"card-footer"},Be={class:"card-meta"},ze={class:"create-time"},We={key:0,class:"pagination-wrapper"},Ye=!1,$e=le({name:"WorkOrderCardView",__name:"card-view",props:{searchParams:{}},emits:["assign","cancel","detail","notify","upgrade"],setup(l,{expose:i,emit:s}){const I=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=k(!1),y=k([]),u=k(0),p=k({pageNo:1,pageSize:8}),F=Z(),G=de(()=>F.getDictOptions(he.OPS_TRIGGER_SOURCE)),{getPriorityInfo:v}=Ce();function S(r){const o=G.value.find(N=>N.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 E(){return W(this,null,function*(){m.value=!0;try{if(!Ye){const r=yield ge(D(D({},p.value),I.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,E()}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=ye(r);return o.isValid()?o.format("YYYY-MM-DD HH:mm:ss"):"-"}catch(o){return"-"}}return i({reload:E,query:()=>{p.value.pageNo=1,E()}}),ue(()=>{E()}),(r,o)=>(c(),b("div",ve,[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(pe,null,fe(y.value,e=>(c(),T(t(te),{key:e.id,xs:24,sm:12,md:8,lg:6,xl:6},{default:d(()=>{var N,M,V,L,U;return[a("div",{class:_e(["order-card",{"order-card--urgent":j(e.priority),"order-card--terminal":R(e.status)}]),onClick:h=>C("detail",e.id)},[a("div",Ne,[a("div",{class:"status-info",style:x({"--status-color":(N=t(Y)[e.status])==null?void 0:N.text,"--status-bg":(M=t(Y)[e.status])==null?void 0:M.bg})},[n(t(_),{icon:t(be)[e.status]||"solar:circle-bold",class:"status-icon"},null,8,["icon"]),a("span",ke,f(t(Te)[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",Ie,[n(t(P),{title:e.title,placement:"topLeft"},{default:d(()=>[a("h4",De,f(e.title),1)]),_:2},1032,["title"]),a("div",Pe,[a("div",we,[n(t(_),{icon:"solar:bill-list-bold-duotone",class:"info-icon"}),a("span",xe,f(e.orderCode),1)]),a("div",Oe,[n(t(_),{icon:"solar:map-point-bold-duotone",class:"info-icon"}),a("span",Ae,f(e.location||"未指定位置"),1)]),a("div",Se,[n(t(_),{icon:"solar:user-bold-duotone",class:"info-icon"}),e.assigneeName?(c(),b("span",Re,[O(f(e.assigneeName)+" ",1),(V=e.extInfo)!=null&&V.assignedUserPhone?(c(),b("span",Me," ("+f(e.extInfo.assignedUserPhone)+") ",1)):g("",!0)])):(c(),b("span",Ve,"待分配"))]),e.sourceType?(c(),b("div",Le,[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",Ue,[a("div",Be,[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(me)[e.orderType]),5),a("span",ze,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,Ee)]}),_:2},1024))),128))]),_:1})):(c(),T(t(re),{key:1,description:"暂无工单数据",class:"my-16"}))]),_:1},8,["spinning"]),y.value.length>0?(c(),b("div",We,[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)]))}}),Ze=ce($e,[["__scopeId","data-v-4605c3cb"]]);export{Ze as default};
|