马宇豪
2024-01-05 6a33c71f381aec0dbc778f80527b62d343fd0146
1
import{_ as N,a as P,E as T}from"./index.1683511265143.js";import{e as y}from"./index.168351126514326.js";import{J as S,aF as x,a1 as O,w as R,f as $,k as J,a as c,F as q,a8 as L,b as t,Y as i,R as p,u as M,aC as Q,aD as W,a5 as r,o as u,Q as X,X as Y,W as f}from"./vue.1683511265143.js";const B=n=>(Q("data-v-5e22d732"),n=n(),W(),n),j=B(()=>t("tr",{class:"m-color b-font",style:{"text-align":"center"}},"\u5B9E\u9A8C\u6240\u7528\u7684\u4EEA\u5668/\u8BBE\u5907",-1)),z=B(()=>t("tr",null,[t("td",{class:"w-16 m-color required"},"\u8BBE\u5907\u540D\u79F0"),t("td",{class:"w-16 m-color"},"\u7F16\u53F7"),t("td",{class:"w-16 m-color"},"\u989D\u5B9A\u529F\u7387"),t("td",{class:"w-16 m-color"},"\u662F\u5426\u7279\u79CD"),t("td",{class:"w-16 m-color required"},"\u8BBE\u5907\u6570\u91CF"),t("td",{class:"w-16 m-color"},"\u64CD\u4F5C")],-1)),G={class:"w-16"},H={class:"w-16"},K={class:"w-16"},Z={class:"w-16"},ee={class:"w-16"},te={class:"w-16"},se=f("\u5220\u9664"),ae={style:{"text-align":"center"}},le=f(" \u6DFB\u52A0\u73B0\u6709\u5B9E\u9A8C\u4EEA\u5668/\u8BBE\u5907 "),de=f(" \u65B0\u589E\u5B9E\u9A8C\u4EEA\u5668/\u8BBE\u5907\u914D\u7F6E "),oe=S({name:"selectEquipment",props:{disabled:Boolean,data:Array},setup(n,{expose:g}){const b=n,h=x(()=>P(()=>import("./equipmentDialog.1683511265143.js"),["assets/equipmentDialog.1683511265143.js","assets/index.168351126514326.js","assets/index.1683511265143.js","assets/index.168351126514326.css","assets/vue.1683511265143.js"])),e=O({disabled:!1,equipmentList:[],allEquipmentList:[],equipmentTypeList:[],specialDeviceList:[{id:1,name:"\u662F"},{id:2,name:"\u5426"}]});R(()=>{e.equipmentList=b.data,e.disabled=b.disabled});const C=$(),V=async()=>{const s=await y().getAllType();s.data.code===100&&(e.equipmentTypeList=s.data.data)},D=()=>{w()},A=()=>{e.equipmentList.push({deviceId:null,deviceUseCount:null,deviceCode:"",deviceName:"",devicePower:"",specialDevice:"",deviceUnit:null,safeProtect:null})},F=(s,o)=>{C.value.showEquipmentDialog(s,o,e.specialDeviceList)},U=s=>{e.equipmentList.splice(s,1)},w=async()=>{let s=await y().getAllEquipment();s.data.code===100?e.allEquipmentList=JSON.parse(JSON.stringify(s.data.data)):T({type:"warning",message:s.data.msg})},k=(s,o)=>{const d=e.allEquipmentList.find(m=>m.id===s);e.equipmentList[o]={deviceId:d.id,deviceUseCount:null,deviceCode:d.deviceCode,deviceName:d.deviceName,devicePower:d.devicePower,specialDevice:d.specialDevice,deviceUnit:d.deviceUnit,safeProtect:d.safeProtect}},I=s=>{e.equipmentList=s};return g({dataList:e.equipmentList,formatList:I}),J(()=>{V(),w()}),(s,o)=>{const d=r("el-option"),m=r("el-select"),_=r("el-input"),v=r("el-button");return u(),c(q,null,[j,z,(u(!0),c(q,null,L(e.equipmentList,(l,E)=>(u(),c("tr",{key:E},[t("td",G,[i(m,{disabled:e.disabled,filterable:"",modelValue:l.deviceId,"onUpdate:modelValue":a=>l.deviceId=a,onChange:a=>k(a,E),onFocus:a=>D()},{default:p(()=>[(u(!0),c(q,null,L(e.allEquipmentList,a=>(u(),X(d,{key:a.id,value:a.id,label:a.deviceName},null,8,["value","label"]))),128))]),_:2},1032,["disabled","modelValue","onUpdate:modelValue","onChange","onFocus"])]),t("td",H,[i(_,{disabled:"",modelValue:l.deviceCode,"onUpdate:modelValue":a=>l.deviceCode=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",K,[i(_,{disabled:"",modelValue:l.devicePower,"onUpdate:modelValue":a=>l.devicePower=a},null,8,["modelValue","onUpdate:modelValue"])]),t("td",Z,[t("div",null,Y(l.specialDevice==1?"\u662F":l.specialDevice==2?"\u5426":""),1)]),t("td",ee,[i(_,{disabled:e.disabled,type:"number",modelValue:l.deviceUseCount,"onUpdate:modelValue":a=>l.deviceUseCount=a},null,8,["disabled","modelValue","onUpdate:modelValue"])]),t("td",te,[i(v,{disabled:e.disabled,type:"danger",onClick:a=>U(E)},{default:p(()=>[se]),_:2},1032,["disabled","onClick"])])]))),128)),t("tr",ae,[i(v,{disabled:e.disabled,type:"primary",shape:"round",onClick:o[0]||(o[0]=l=>A())},{default:p(()=>[le]),_:1},8,["disabled"]),i(v,{disabled:e.disabled,shape:"round",onClick:o[1]||(o[1]=l=>F("\u65B0\u589E",{}))},{default:p(()=>[de]),_:1},8,["disabled"])]),i(M(h),{ref_key:"equipmentDialogRef",ref:C,equipmentTypeList:e.equipmentTypeList},null,8,["equipmentTypeList"])],64)}}});var ce=N(oe,[["__scopeId","data-v-5e22d732"]]);export{ce as default};