Files
aiot-platform-ui/apps/web-antd/dist/js/cancel-form-Cw5e76L2.js
lzh 91cd7adc39
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 9s
chore: build and deploy web-antd
2026-03-27 16:58:19 +08:00

2 lines
2.5 KiB
JavaScript

var b=(_,u,l)=>new Promise((o,r)=>{var d=s=>{try{t(l.next(s))}catch(e){r(e)}},m=s=>{try{t(l.throw(s))}catch(e){r(e)}},t=s=>s.done?o(s.value):Promise.resolve(s.value).then(d,m);t((l=l.apply(_,u)).next())});import{a9 as f,cp as x,an as p,bt as I,ac as h}from"./bootstrap-BRzwfS6_.js";import{e as S}from"./index-B6UeBCJS.js";import{m as T}from"./index-Dyc7GJY5.js";import{m as k,b9 as v,ab as B,b2 as g,bJ as C,j as i,ae as n,u as c,ad as O,ac as V,bp as w}from"../jse/index-index-D2yVKoFr.js";import{u as A}from"./use-modal-BtqDoQjW.js";import"./x-B96ous_M.js";const D={class:"cf-order-info"},N={class:"cf-info-row"},E={class:"cf-info-value"},F={key:0,class:"cf-info-row"},L={class:"cf-info-value cf-info-desc"},M={class:"cf-section"},U=k({name:"CancelOrderForm",__name:"cancel-form",emits:["success"],setup(_,{emit:u}){const l=u,o=v({orderId:0,orderCode:"",orderType:void 0,title:""}),r=v(""),d=v(!1),[m,t]=A({onOpenChange:e=>{if(e){const a=t.getData();a&&(o.value=a),r.value=""}},onConfirm:s});function s(){return b(this,null,function*(){const e=r.value.trim();if(e.length<2){f.warning("取消原因至少2个字符");return}if(e.length>200){f.warning("取消原因不能超过200字符");return}if(!o.value.orderType){f.error("工单类型未知,无法取消");return}d.value=!0,t.setState({confirmLoading:!0});try{yield o.value.orderType==="SECURITY"?T({orderId:o.value.orderId,reason:e}):S({orderId:o.value.orderId,reason:e}),f.success("工单已取消"),t.close(),l("success")}finally{d.value=!1,t.setState({confirmLoading:!1})}})}return(e,a)=>(g(),B(c(m),{title:"取消工单",class:"w-[480px]"},{default:C(()=>[i(c(x),{type:"error","show-icon":"",class:"cf-alert",message:"取消后工单将无法恢复,请确认操作"},{icon:C(()=>[i(c(p),{icon:"lucide:alert-circle",class:"text-red-500"})]),_:1}),n("div",D,[n("div",N,[i(c(p),{icon:"solar:document-text-bold-duotone",class:"cf-info-icon"}),a[1]||(a[1]=n("span",{class:"cf-info-label"},"工单编号",-1)),n("span",E,w(o.value.orderCode),1)]),o.value.title?(g(),O("div",F,[i(c(p),{icon:"solar:notes-bold-duotone",class:"cf-info-icon"}),a[2]||(a[2]=n("span",{class:"cf-info-label"},"工单标题",-1)),n("span",L,w(o.value.title),1)])):V("",!0)]),n("div",M,[a[3]||(a[3]=n("div",{class:"cf-section-title"},"取消原因",-1)),i(c(I).TextArea,{value:r.value,"onUpdate:value":a[0]||(a[0]=y=>r.value=y),placeholder:"请输入取消工单的原因",rows:4,maxlength:200,"show-count":""},null,8,["value"])])]),_:1}))}}),H=h(U,[["__scopeId","data-v-2bb30899"]]);export{H as default};