mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 13:34:13 +08:00
2 lines
4.2 KiB
JavaScript
2 lines
4.2 KiB
JavaScript
var Y=Object.defineProperty;var y=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var C=(o,s,t)=>s in o?Y(o,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[s]=t,d=(o,s)=>{for(var t in s||(s={}))R.call(s,t)&&C(o,t,s[t]);if(y)for(var t of y(s))D.call(s,t)&&C(o,t,s[t]);return o};var I=(o,s)=>{var t={};for(var i in o)R.call(o,i)&&s.indexOf(i)<0&&(t[i]=o[i]);if(o!=null&&y)for(var i of y(o))s.indexOf(i)<0&&D.call(o,i)&&(t[i]=o[i]);return t};var h=(o,s,t)=>new Promise((i,f)=>{var v=r=>{try{m(t.next(r))}catch(c){f(c)}},l=r=>{try{m(t.throw(r))}catch(c){f(c)}},m=r=>r.done?i(r.value):Promise.resolve(r.value).then(v,l);m((t=t.apply(o,s)).next())});import{u as Z,B as q,T as H}from"./useForm-df5105ea.js";import{f as Q,b as ee,u as te}from"./schema-f1b33936.js";import{a as ae,B as oe}from"./index-e60b7cd2.js";import{u as se,B as ne}from"./useTable-3e054214.js";import ie from"./modal-fe4687ff.js";import{u as re}from"./index-ccf6944d.js";import{N as le,R as de}from"./antd-eedb3ef5.js";import{d as ce,f as _,c as ue,u as n,a6 as me,Z as B,a4 as F,a5 as g,k as x,l as O,G as T,$ as S,a8 as pe,a9 as fe}from"./vue-72a104e4.js";import{_ as we}from"./index.js";import"./copyTextToClipboard-96e9be8c.js";import"./deviceApi-af691457.js";import"./useWindowSizeFn-46f0db92.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";const ge=ce({__name:"drawer",emits:["success","register","ocrClick"],setup(o,{expose:s,emit:t}){const[i,{openModal:f}]=re(),v=[{title:"预埋件编号",dataIndex:"code",key:"code"},{title:"类型",dataIndex:"type",key:"type"},{title:"X(mm)",dataIndex:"x",key:"x",width:"80px"},{title:"Y(mm)",dataIndex:"y",key:"y",width:"80px"},{title:"w(mm)",dataIndex:"w",key:"w",width:"80px"},{title:"h(mm)",dataIndex:"h",key:"h",width:"80px"}],l=_([]),m=t,r=_(!0),c=_(),[N,{resetFields:V,setFieldsValue:E,validate:J,getFieldsValue:P}]=Z({labelWidth:120,schemas:Q,showActionButtonGroup:!1}),[U,{setDrawerProps:b,closeDrawer:L}]=ae(e=>h(this,null,function*(){yield V(),b({confirmLoading:!1}),r.value=!!(e!=null&&e.isUpdate),c.value=e==null?void 0:e.record,l.value=[],(c.value&&c.value.paramJson?JSON.parse(c.value.paramJson):[]).forEach((u,p)=>{l.value.push(d({index:p},u))}),yield E(d({},e.record))})),M=e=>{l.value=[],e.forEach((a,u)=>{l.value.push(d({index:u},a))})},[j]=se({title:"预埋件列表",columns:v,dataSource:l,useSearchForm:!1,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,pagination:!1,rowKey:e=>e.code,actionColumn:{width:180,title:"操作",dataIndex:"action",fixed:void 0}}),A=ue(()=>n(r)?"编辑":"新增");function G(){return h(this,null,function*(){const e=yield J();b({confirmLoading:!0});const a=I(e,[]),u=n(r)?te:ee,p=n(r)?Object.assign({},d(d({},n(c)),a)):d({},a);let w=[];l.value.forEach(k=>{delete k.index,w.push(k)}),p.paramJson=JSON.stringify(w),yield u(p),L(),m("success"),b({confirmLoading:!1})})}const $=()=>{f(!0,{isUpdate:!1})},z=(e,a)=>{f(!0,{record:e,isUpdate:!0})},K=e=>{l.value=l.value.filter(a=>a.code!==e.code)},W=()=>{const e=P(),a=n(r)?Object.assign({},d(d({},n(c)),e)):d({},e);m("ocrClick",a)},X=e=>h(this,null,function*(){l.value[e.index]=d({},e)});return s({setParamData:M}),(e,a)=>{const u=me("a-button");return B(),F(n(oe),fe(e.$attrs,{onRegister:n(U),showFooter:"",title:A.value,width:"900px",onOk:G}),{default:g(()=>[x(n(q),{onRegister:n(N)},null,8,["onRegister"]),x(n(ne),{onRegister:n(j)},{toolbar:g(()=>[x(u,{type:"primary",onClick:$,icon:O(n(le))},{default:g(()=>a[0]||(a[0]=[T("新 增")])),_:1},8,["icon"]),a[2]||(a[2]=S("div",{style:{width:"5px"}},null,-1)),x(u,{type:"primary",icon:O(n(de)),onClick:W},{default:g(()=>a[1]||(a[1]=[T("OCR识别")])),_:1},8,["icon"]),a[3]||(a[3]=S("div",{style:{width:"5px"}},null,-1))]),bodyCell:g(({column:p,record:w})=>[p.dataIndex==="action"?(B(),F(n(H),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:z.bind(null,w),divider:!0},{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:K.bind(null,w),placement:"topRight"},divider:!0}]},null,8,["actions"])):pe("",!0)]),_:1},8,["onRegister"]),x(ie,{onRegister:n(i),onSuccess:X},null,8,["onRegister"])]),_:1},16,["onRegister","title"])}}});const Se=we(ge,[["__scopeId","data-v-d2e691bb"]]);export{Se as default};
|