lcny-vue3-antd-admin/dist/assets/index.e1bc75b6.js

2 lines
4.7 KiB
JavaScript

var F=Object.defineProperty;var p=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var d=(o,t,e)=>t in o?F(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,B=(o,t)=>{for(var e in t||(t={}))A.call(t,e)&&d(o,e,t[e]);if(p)for(var e of p(t))E.call(t,e)&&d(o,e,t[e]);return o};var c=(o,t,e)=>new Promise((u,r)=>{var l=a=>{try{s(e.next(a))}catch(i){r(i)}},n=a=>{try{s(e.throw(a))}catch(i){r(i)}},s=a=>a.done?u(a.value):Promise.resolve(a.value).then(l,n);s((e=e.apply(o,t)).next())});import{B as T,u as w}from"./useTable.72173fde.js";import{T as D}from"./useForm.f871c33b.js";import{bT as y,cG as k,J as I,aA as b,o as f,h,p as v,x as S,l as R,cs as x,fc as M,fd as P}from"./index.5507fe17.js";import{T as Y}from"./index.83700ad8.js";import"./index.faa8e0f5.js";import"./Checkbox.efaa4304.js";import"./index.6e5b2552.js";import"./index.57bd1540.js";import"./index.4900f75b.js";import"./index.2a3aa684.js";import"./useSize.c0f5b644.js";import"./eagerComputed.e9ce5a28.js";import"./onMountedOrActivated.5d966e54.js";import"./useWindowSizeFn.99499627.js";import"./useContentViewHeight.13c12838.js";import"./ArrowLeftOutlined.f6e88cef.js";import"./transButton.fe1069bf.js";import"./index.f194462c.js";import"./index.51f3a02d.js";import"./index.3c5919ff.js";import"./dateUtil.958ac7c5.js";import"./_baseMerge.12352c5e.js";import"./_isIterateeCall.96e8eb41.js";import"./_baseEach.d7914b08.js";import"./get.657d8bbb.js";import"./index.5f9bb11d.js";import"./FullscreenOutlined.0d82c9ff.js";import"./index.7807c21b.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.26063e9c.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.3b6baded.js";import"./scrollTo.f9b4fba8.js";import"./index.e95afe4e.js";import"./index.0f01657b.js";import"./index.91809bd5.js";import"./_baseIteratee.73049377.js";import"./index.dcbe2e7a.js";import"./useRefs.ed098601.js";import"./download.953c82f1.js";import"./index.027fcf4f.js";import"./uniqBy.78e71798.js";const m={xs:24,sm:12,md:8,lg:6,xl:6,xxl:4},_=[{label:"\u76D1\u63A7\u8BBE\u5907",value:1},{label:"\u571F\u58E4\u8BBE\u5907",value:2},{label:"\u6C34\u8D28\u8BBE\u5907",value:3},{label:"\u6C14\u8C61\u8BBE\u5907",value:4}],g=[{label:"\u2160\u7EA7\u9884\u8B66",value:1},{label:"\u2161\u7EA7\u9884\u8B66",value:2},{label:"\u2162\u7EA7\u9884\u8B66",value:3},{label:"\u2163\u7EA7\u9884\u8B66",value:4}],C=[{value:0,color:"red",label:"\u672A\u5904\u7406"},{value:1,color:"green",label:"\u5DF2\u5904\u7406"},{value:2,color:"pink",label:"\u5DF2\u5FFD\u7565"}],W=[{title:"\u57FA\u5730",dataIndex:"base_name"},{title:"\u76D1\u63A7\u70B9",dataIndex:"point_name"},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"device_type",customRender:({text:o})=>{var e;const t=_.find(({value:u})=>u==o);return(e=t==null?void 0:t.label)!=null?e:o}},{title:"\u5185\u5BB9",dataIndex:"content"},{title:"\u7B49\u7EA7",dataIndex:"lv",width:100,customRender:({text:o})=>{var e;const t=g.find(({value:u})=>u==o);return(e=t==null?void 0:t.label)!=null?e:o}},{title:"\u72B6\u6001",dataIndex:"status",width:100,customRender:({record:o})=>{var n,s;const t=o.status,u=C.find(a=>a.value===t),r=(n=u==null?void 0:u.color)!=null?n:"red",l=(s=u==null?void 0:u.label)!=null?s:t;return y(Y,{color:r},()=>l)}},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"created_at",width:180,customRender:({text:o})=>o?k.unix(o).format("YYYY-MM-DD HH:mm:ss"):""},{width:90,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],j=[{field:"lv",label:"\u7B49\u7EA7",component:"Select",componentProps:{options:g},colProps:m},{field:"device",label:"\u8BBE\u5907\u7C7B\u578B",component:"Select",componentProps:{options:_},colProps:m},{field:"status",label:"\u72B6\u6001",component:"Select",componentProps:{options:C},colProps:m}],H={components:{BasicTable:T,TableAction:D},setup(){const[o,{reload:t}]=w({title:"\u8D26\u53F7\u5217\u8868",api:r=>c(this,null,function*(){const{data:l,meta:n}=yield P(B({},r));return{items:l,total:n==null?void 0:n.total}}),rowKey:"id",columns:W,formConfig:{labelWidth:80,schemas:j},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!0});return{handleMark:r=>c(this,null,function*(){yield M(r.id),x.success("\u6807\u8BB0\u6210\u529F"),t()}),registerTable:o,handleSuccess:()=>{x.success("\u64CD\u4F5C\u6210\u529F"),t()}}}},L={key:0,class:"flex items-center justify-center"};function N(o,t,e,u,r,l){const n=b("TableAction"),s=b("BasicTable");return f(),h("div",null,[v(s,{onRegister:u.registerTable},{bodyCell:S(({column:a,record:i})=>[a.key==="action"?(f(),h("div",L,[v(n,{actions:[{label:"\u6807\u8BB0",popConfirm:{title:"\u662F\u5426\u786E\u8BA4\u6807\u8BB0",placement:"topRight",confirm:u.handleMark.bind(null,i)},ifShow:i.status==0}]},null,8,["actions"])])):R("",!0)]),_:1},8,["onRegister"])])}var It=I(H,[["render",N]]);export{It as default};