lcny-vue3-antd-admin/dist/assets/index.d76b3a14.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.8eed47de.js";import{T as D}from"./useForm.c7d19684.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.0d66f056.js";import{T as Y}from"./index.d2beeadf.js";import"./index.f776c025.js";import"./Checkbox.869e2515.js";import"./index.dccc46ad.js";import"./index.57ee2224.js";import"./index.edf49c82.js";import"./index.4f5a886a.js";import"./useSize.50843ef6.js";import"./eagerComputed.b7441cce.js";import"./onMountedOrActivated.d6a1408a.js";import"./useWindowSizeFn.28c9d49d.js";import"./useContentViewHeight.1d96972c.js";import"./ArrowLeftOutlined.20b7981c.js";import"./transButton.c65d6553.js";import"./index.e4be21ad.js";import"./index.878aca67.js";import"./index.b043d20d.js";import"./dateUtil.d4ffde4e.js";import"./_baseMerge.c3a100be.js";import"./_isIterateeCall.221c0e95.js";import"./_baseEach.1d4ee42a.js";import"./get.9166fff3.js";import"./index.135535ea.js";import"./FullscreenOutlined.e1b912b1.js";import"./index.1ca0ffae.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.2dca1359.js";import"./fromPairs.84aabb58.js";import"./CaretUpOutlined.14ca0dd3.js";import"./scrollTo.7632f697.js";import"./index.b5cd5072.js";import"./index.8ad65a5b.js";import"./index.e750ac63.js";import"./_baseIteratee.b41854d9.js";import"./index.d5b4490d.js";import"./useRefs.3c226ba1.js";import"./download.80fe05e1.js";import"./index.dc06a63e.js";import"./uniqBy.6d05e157.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};