Files
aiot-platform-ui/apps/web-antd/dist/js/form-enhanced-B6vJrfa3.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
5.3 KiB
JavaScript

var A=Object.defineProperty,V=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var b=(r,o,t)=>o in r?A(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,w=(r,o)=>{for(var t in o||(o={}))B.call(o,t)&&b(r,t,o[t]);if(g)for(var t of g(o))j.call(o,t)&&b(r,t,o[t]);return r},_=(r,o)=>V(r,M(o));var f=(r,o,t)=>new Promise((a,c)=>{var v=l=>{try{m(t.next(l))}catch(p){c(p)}},h=l=>{try{m(t.throw(l))}catch(p){c(p)}},m=l=>l.done?a(l.value):Promise.resolve(l.value).then(v,h);m((t=t.apply(r,o)).next())});import{ar as z,a9 as D,$ as H,ac as N}from"./bootstrap-CRjSNGHY.js";import{e as F,c as L,f as S}from"./index-BvAci9nf.js";import{d as E}from"./data-Dg2RhqW8.js";import{m as T,b9 as $,aa as x,ab as J,b2 as i,bJ as y,ae as s,ad as d,ac as O,j as P,u as C,ai as W,bp as q}from"../jse/index-index-CMeVxoEG.js";import{u as G}from"./use-modal-BABce5hC.js";import"./x-CpZ5_sBZ.js";const K={class:"flex items-center gap-3"},Q={class:"flex h-10 w-10 items-center justify-center rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 shadow-md"},R={xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},U={key:0,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"},X={key:1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"},Y={key:2,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"},Z={class:"text-lg font-semibold text-gray-900 dark:text-white"},ee={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},te={key:1,class:"text-xs text-gray-500 dark:text-gray-400"},ae={key:2,class:"text-xs text-gray-500 dark:text-gray-400"},se={class:"area-form-content"},oe={key:0,class:"mb-4 rounded-lg border-l-4 border-blue-500 bg-blue-50 p-4 dark:bg-blue-950/30"},re={class:"rounded-lg border border-gray-200 bg-gray-50/50 p-6 dark:border-gray-700 dark:bg-gray-800/50"},le=T({__name:"form-enhanced",emits:["success"],setup(r,{emit:o}){const t=o,a=$(),c=x(()=>{const n=a.value;return!!n&&!("id"in n)&&"parentId"in n&&n.parentId!==null&&n.parentId!==0}),v=x(()=>a.value&&"id"in a.value&&a.value.id?"编辑区域":c.value?"新增下级区域":"新增区域"),h=x(()=>a.value&&"id"in a.value&&a.value.id?"lucide:edit":c.value?"lucide:folder-plus":"lucide:plus-circle"),[m,l]=z({commonConfig:{componentProps:{class:"w-full"},formItemClass:"col-span-2",labelWidth:120},layout:"horizontal",schema:E(),showDefaultActions:!1}),[p,u]=G({onConfirm(){return f(this,null,function*(){if(!(yield l.validate()))return;u.lock();const e=yield l.getValues();try{yield a.value&&"id"in a.value&&a.value.id?L(e):S(_(w({},e),{parentId:e.parentId===0?void 0:e.parentId})),yield u.close(),t("success"),D.success(H("ui.actionMessage.operationSuccess"))}finally{u.unlock()}})},onOpenChange(n){return f(this,null,function*(){var k;if(!n){a.value=void 0;return}const e=u.getData();if(a.value=e!=null?e:null,!!e)if("id"in e&&e.id){u.lock();try{const I=yield F(e.id);yield l.setValues(I)}finally{u.unlock()}}else yield l.setValues({parentId:(k=e.parentId)!=null?k:0,isActive:!0,sort:0})})}});return(n,e)=>(i(),J(C(p),{title:v.value,class:"area-form-modal",width:"720px"},{title:y(()=>[s("div",K,[s("div",Q,[(i(),d("svg",R,[h.value==="lucide:edit"?(i(),d("path",U)):h.value==="lucide:folder-plus"?(i(),d("path",X)):(i(),d("path",Y))]))]),s("div",null,[s("h3",Z,q(v.value),1),c.value?(i(),d("p",ee," 为当前区域添加下级子区域 ")):a.value&&"id"in a.value&&a.value.id?(i(),d("p",te," 修改区域信息 ")):(i(),d("p",ae," 创建新的业务区域 "))])])]),default:y(()=>[s("div",se,[c.value?(i(),d("div",oe,[...e[0]||(e[0]=[s("div",{class:"flex items-start"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"mt-0.5 h-5 w-5 flex-shrink-0 text-blue-600 dark:text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),s("div",{class:"ml-3"},[s("p",{class:"text-sm font-medium text-blue-800 dark:text-blue-300"}," 新增下级区域 "),s("p",{class:"mt-1 text-xs text-blue-700 dark:text-blue-400"}," 新区域将作为当前区域的子级,继承上级区域的部分属性 ")])],-1)])])):O("",!0),s("div",re,[P(C(m),{class:"area-form"})]),e[1]||(e[1]=s("div",{class:"mt-4 flex items-start gap-2 rounded-lg bg-amber-50 p-3 dark:bg-amber-950/30"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-600 dark:text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})]),s("p",{class:"text-xs text-amber-800 dark:text-amber-300"},[s("strong",null,"注意:"),W(" 区域编码建议使用层级结构(如:A-B-C),停用区域将影响相关工单策略 ")])],-1))])]),_:1},8,["title"]))}}),ve=N(le,[["__scopeId","data-v-d4632940"]]);export{ve as default};