import{aI as C,a0 as O,ax as E}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897336.js";import{_ as V}from"./index.vue_vue_type_script_setup_true_name_PermissionButton_lang.1703796278973.js";import{q as Y,j as H,r as J}from"./firmware.1703796278973.js";import{a as L}from"./dayjs.min.1703796278973.js";import R from"./index.1703796278973111.js";import{h as z}from"./system.1703796278973.js";import{o as f}from"./comm.1703796278973.js";import{d as w,k as i,p as U,r as m,o as d,c as _,a as t,z as y,b as s,u as l,t as $,A as I,x as G,F as K,h as Q,B as W}from"./vue.1703796278973.js";import"./index.17037962789733.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./permission.1703796278973.js";import"./index.170379627897337.js";import"./index.170379627897319.js";import"./index.170379627897318.js";import"./index.170379627897325.js";import"./index.170379627897327.js";import"./FileUpload.1703796278973.js";import"./index.170379627897329.js";import"./index.170379627897330.js";import"./_plugin-vue_export-helper.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";const X=w({name:"FirmwarePage"}),Re=w({...X,setup(Z){const T=z(),u=i({}),h=i({}),k=i([]),p=i(!1),c=i({}),v=[{title:"固件名称",key:"name",dataIndex:"name",fixed:"left",width:200,ellipsis:!0,search:{type:"string"}},{title:"固件版本",dataIndex:"version",key:"version",ellipsis:!0,search:{type:"string"}},{title:"所属产品",dataIndex:"productId",key:"productId",ellipsis:!0,width:200,scopedSlots:!0,search:{type:"select",options:k}},{title:"签名方式",dataIndex:"signMethod",key:"signMethod",scopedSlots:!0,search:{type:"select",options:[{label:"MD5",value:"md5"},{label:"SHA256",value:"sha256"}]},width:150},{title:"创建时间",key:"createTime",dataIndex:"createTime",search:{type:"date"},width:200,scopedSlots:!0},{title:"说明",dataIndex:"description",key:"description",ellipsis:!0,search:{type:"string"}},{title:"操作",key:"action",fixed:"right",width:200,scopedSlots:!0}],b=e=>e?[{key:"view",text:"升级任务",tooltip:{title:"升级任务"},icon:"FileTextOutlined",onClick:async()=>{P(e)}},{key:"update",text:"编辑",tooltip:{title:"编辑"},icon:"EditOutlined",onClick:async()=>{F(e)}},{key:"delete",text:"删除",tooltip:{title:"删除"},popConfirm:{title:"确认删除?",okText:" 确定",cancelText:"取消",onConfirm:async()=>{A(e.id)}},icon:"DeleteOutlined"}]:[],P=e=>{T.jumpPage("device/Firmware/Task",{},{id:e.id,productId:e.productId})},S=()=>{c.value={},p.value=!0},F=e=>{c.value=C.cloneDeep(e),p.value=!0},M=e=>{p.value=!1,c.value={},e&&(f("操作成功","success"),u.value.reload())},A=async e=>{const a=await J(e);a.status===200?(f("操作成功","success"),u.value.reload()):f(a==null?void 0:a.message,"error")};U(()=>{Y({paging:!1,sorts:[{name:"name",order:"desc"}],terms:[{column:"state",value:1}]}).then(e=>{const a=e.result.filter(o=>C.map((o==null?void 0:o.features)||[],"id").includes("supportFirmware"));k.value=a.map(o=>({label:o.name,value:o.id}))})});const B=e=>{h.value=e};return(e,a)=>{const o=m("pro-search"),g=m("AIcon"),x=V,D=O,j=E,q=m("FullPage"),N=m("page-container");return d(),_(N,null,{default:t(()=>[y("div",null,[s(o,{columns:v,target:"search",onSearch:B}),s(q,null,{default:t(()=>[s(j,{ref_key:"tableRef",ref:u,model:"TABLE",columns:v,request:l(H),defaultParams:{sorts:[{name:"createTime",order:"desc"}]},params:l(h)},{headerTitle:t(()=>[s(x,{type:"primary",onClick:S,hasPermission:"device/Firmware:add"},{icon:t(()=>[s(g,{type:"PlusOutlined"})]),default:t(()=>[$(" 新增 ")]),_:1})]),productId:t(n=>[y("span",null,I(n.productName),1)]),createTime:t(n=>[y("span",null,I(l(L)(n.createTime).format("YYYY-MM-DD HH:mm:ss")),1)]),action:t(n=>[s(D,null,{default:t(()=>[(d(!0),G(K,null,Q(b(n),r=>(d(),_(x,{key:r.key,disabled:r.disabled,popConfirm:r.popConfirm,tooltip:{...r.tooltip},style:{padding:"0px"},onClick:r.onClick,type:"link",danger:r.key==="delete",hasPermission:"device/Firmware:"+r.key},{icon:t(()=>[s(g,{type:r.icon},null,8,["type"])]),_:2},1032,["disabled","popConfirm","tooltip","onClick","danger","hasPermission"]))),128))]),_:2},1024)]),_:1},8,["request","params"])]),_:1})]),l(p)?(d(),_(R,{key:0,data:l(c),onChange:M},null,8,["data"])):W("",!0)]),_:1})}}});export{Re as default};
