mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 13:34:13 +08:00
2 lines
2.9 KiB
JavaScript
2 lines
2.9 KiB
JavaScript
var D=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var v=(a,d)=>{var r={};for(var t in a)M.call(a,t)&&d.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&D)for(var t of D(a))d.indexOf(t)<0&&P.call(a,t)&&(r[t]=a[t]);return r};import{j as $,k as j,l as E,_ as H}from"./index.js";import{u as V,B as N}from"./useTable-0de69f2a.js";import{T as O}from"./useForm-e0ed66d8.js";import{j as _}from"./antd-c0547b89.js";import{r as F,s as K,c as U,a as w}from"./schema-dd4d6593.js";import{u as z}from"./index-ac231c36.js";import{_ as G}from"./drawer.vue_vue_type_script_setup_true_lang-d3ba9eb4.js";import{d as W,a6 as Z,Z as x,_ as q,k as h,a5 as b,G as J,a4 as L,u as m,a8 as Q}from"./vue-08ef39cb.js";import"./index-dabaf6d0.js";import"./useWindowSizeFn-40274562.js";import"./onMountedOrActivated-4630d53b.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-fb88ba3c.js";const X=W({name:"AUTHDATADEVICE",__name:"index",setup(a){$();const d=j(),[r,{openDrawer:t}]=z(),[y,{reload:g,setSelectedRowKeys:ee}]=V({title:"设备表",api:e=>K(Y(e)),columns:U,formConfig:{labelWidth:120,schemas:w,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!1,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),Y=e=>{const C=e,{pageNum:l,pageSize:p,field:f="id",order:c="descend"}=C,B=v(C,["pageNum","pageSize","field","order"]),n={pageNum:l,pageSize:p,orderByClause:`${f} ${c==="descend"?"desc":"asc"}`};return Object.keys(B).forEach(u=>{const i=w.find(I=>I.field===u),o=e[u],s=u;i?o!==void 0&&o!==""&&(i.component==="Input"?n[s]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(i.component)?n[s]=E(o)?o.value:o:i.component==="RangePicker"?(n[`${s}From`]=_(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),n[`${s}To`]=_(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):i.component==="DatePicker"?n[s]=_(o).format(i.componentProps.format||"YYYY-MM-DD"):n[s]=o):n[s]=o}),n},T=()=>{t(!0,{isUpdate:!1})},k=e=>{t(!0,{record:e,isUpdate:!0})},S=e=>{F(e.id).then(l=>{g()})},A=()=>{g()},R=e=>{d("/data/device/detail/"+e.id)};return(e,l)=>{const p=Z("a-button");return x(),q("div",null,[h(m(N),{onRegister:m(y)},{toolbar:b(()=>[h(p,{type:"primary",onClick:T},{default:b(()=>l[0]||(l[0]=[J(" 新增")])),_:1})]),bodyCell:b(({column:f,record:c})=>[f.dataIndex==="action"?(x(),L(m(O),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:k.bind(null,c),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:R.bind(null,c),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:S.bind(null,c),placement:"topRight"}}]},null,8,["actions","dropDownActions"])):Q("",!0)]),_:1},8,["onRegister"]),h(G,{onRegister:m(r),onSuccess:A},null,8,["onRegister"])])}}});const _e=H(X,[["__scopeId","data-v-5ffc32a9"]]);export{_e as default};
|