lcny-vue3-antd-admin/dist/assets/index.706dfe40.js

2 lines
4.8 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 s=a=>{try{l(e.next(a))}catch(i){r(i)}},n=a=>{try{l(e.throw(a))}catch(i){r(i)}},l=a=>a.done?u(a.value):Promise.resolve(a.value).then(s,n);l((e=e.apply(o,t)).next())});import{B as T,u as D}from"./useTable.ca422b4e.js";import{T as w}from"./BasicForm.58096e25.js";import{bT as I,e5 as y,J as k,aA as b,o as f,h,p as v,x as S,l as R,cs as x,f5 as M,f6 as P}from"./index.0af5f3c7.js";import{T as Y}from"./index.e99ecc5a.js";import"./index.a477d07f.js";import"./Checkbox.8cbb0949.js";import"./index.9984b352.js";import"./useForm.7be02120.js";import"./index.d959cab4.js";import"./index.701a3266.js";import"./index.bf3a57cd.js";import"./useSize.b42ca083.js";import"./eagerComputed.a26e4a97.js";import"./onMountedOrActivated.d52cd355.js";import"./useWindowSizeFn.bea1b5d7.js";import"./useContentViewHeight.7a4fda07.js";import"./ArrowLeftOutlined.87e755e9.js";import"./transButton.5f87d2ce.js";import"./index.e574d844.js";import"./index.255f79bb.js";import"./index.0192f903.js";import"./index.2594aba0.js";import"./index.9a71820b.js";import"./_baseIteratee.f2a8dc4d.js";import"./get.177a5851.js";import"./index.1ad38bf5.js";import"./index.40e15f2b.js";import"./index.09865871.js";import"./dateUtil.b96e4341.js";import"./uniqBy.ebd435aa.js";import"./index.b218e437.js";import"./FullscreenOutlined.51e1a299.js";import"./_baseMerge.9ba1e1d0.js";import"./_isIterateeCall.c81e5263.js";import"./_baseEach.bcbdbca2.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.ab77ea04.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.06451468.js";import"./scrollTo.7901c474.js";import"./index.9015992b.js";import"./useRefs.50da323c.js";import"./download.f26bcfe4.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:"ID",dataIndex:"id"},{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,l;const t=o.status,u=C.find(a=>a.value===t),r=(n=u==null?void 0:u.color)!=null?n:"red",s=(l=u==null?void 0:u.label)!=null?l:t;return I(Y,{color:r},()=>s)}},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"created_at",width:180,customRender:({text:o})=>o?y.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:w},setup(){const[o,{reload:t}]=D({title:"\u8D26\u53F7\u5217\u8868",api:r=>c(this,null,function*(){const{data:s,meta:n}=yield P(B({},r));return{items:s,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,s){const n=b("TableAction"),l=b("BasicTable");return f(),h("div",null,[v(l,{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 St=k(H,[["render",N]]);export{St as default};