"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[6381],{76002:function(e,a,t){t.r(a),t.d(a,{default:function(){return I}});var l=t(66252),i=t(3577);const s=e=>((0,l.dD)("data-v-e37ba112"),e=e(),(0,l.Cn)(),e),d={class:"boxHeader"},n={class:"item"},o=s((()=>(0,l._)("div",{class:"name"},"电阶描述",-1))),c={class:"com"},m={class:"dateBox"},r={class:"item"},p=s((()=>(0,l._)("div",{class:"name"},"开始时间",-1))),u={class:"com"},w={class:"item"},_=s((()=>(0,l._)("div",{class:"name"},"结束时间",-1))),v={class:"com"},g={class:"item"},h=s((()=>(0,l._)("div",{class:"name"},"电价",-1))),y={class:"com"},b={class:"item btn"},f=s((()=>(0,l._)("div",{class:"name"},null,-1))),W={class:"com"},k=(0,l.Uk)("保存"),V={class:"boxContent"},C={class:"priceColor"},x=(0,l.Uk)("删除");function L(e,a,t,s,L,z){const U=(0,l.up)("el-radio"),D=(0,l.up)("el-radio-group"),I=(0,l.up)("el-time-select"),j=(0,l.up)("el-input"),A=(0,l.up)("el-button"),P=(0,l.up)("el-table-column"),S=(0,l.up)("el-empty"),$=(0,l.up)("el-table"),H=(0,l.up)("el-scrollbar"),B=(0,l.up)("el-main"),K=(0,l.Q2)("loading");return(0,l.wg)(),(0,l.j4)(B,{class:"boxMain"},{default:(0,l.w5)((()=>[(0,l._)("div",d,[(0,l._)("div",n,[o,(0,l._)("div",c,[(0,l.Wm)(D,{modelValue:L.params.type,"onUpdate:modelValue":a[0]||(a[0]=e=>L.params.type=e)},{default:(0,l.w5)((()=>[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(L.levelList,((e,a)=>((0,l.wg)(),(0,l.j4)(U,{key:a,label:e.id,value:e.id,size:L.size},{default:(0,l.w5)((()=>[(0,l.Uk)((0,i.toDisplayString)(e.name),1)])),_:2},1032,["label","value","size"])))),128))])),_:1},8,["modelValue"])])]),(0,l._)("div",m,[(0,l._)("div",r,[p,(0,l._)("div",u,[(0,l.Wm)(I,{modelValue:L.params.start,"onUpdate:modelValue":a[1]||(a[1]=e=>L.params.start=e),start:"01:00",step:"00:30",end:"23:30",placeholder:"开始时间"},null,8,["modelValue"])])]),(0,l._)("div",w,[_,(0,l._)("div",v,[(0,l.Wm)(I,{modelValue:L.params.end,"onUpdate:modelValue":a[2]||(a[2]=e=>L.params.end=e),start:"01:00",step:"00:30",end:"23:30",placeholder:"结束时间"},null,8,["modelValue"])])])]),(0,l._)("div",g,[h,(0,l._)("div",y,[(0,l.Wm)(j,{modelValue:L.params.price,"onUpdate:modelValue":a[3]||(a[3]=e=>L.params.price=e),placeholder:"电价",style:{width:"220px"}},null,8,["modelValue"])])]),(0,l._)("div",b,[f,(0,l._)("div",W,[(0,l.Wm)(A,{type:"primary",onClick:z.save},{default:(0,l.w5)((()=>[k])),_:1},8,["onClick"])])])]),(0,l._)("div",V,[(0,l.wy)(((0,l.wg)(),(0,l.j4)(H,{height:"100%","element-loading-text":"加载中..."},{default:(0,l.w5)((()=>[(0,l.Wm)($,{stripe:"",data:L.tableList},{empty:(0,l.w5)((()=>[(0,l.Wm)(S,{description:"暂无数据","image-size":100})])),default:(0,l.w5)((()=>[(0,l.Wm)(P,{type:"index",align:"center",width:"50",label:"序号"}),(0,l.Wm)(P,{label:"电阶描述",align:"center",width:"100",prop:"type"},{default:(0,l.w5)((e=>[(0,l.Uk)((0,i.toDisplayString)(1==e.row.type?"平段":2==e.row.type?"低谷":"高峰"),1)])),_:1}),(0,l.Wm)(P,{label:"开始时间",align:"center",width:"100",prop:"start"}),(0,l.Wm)(P,{label:"结束时间",align:"center",width:"100",prop:"end"}),(0,l.Wm)(P,{label:"电单价",align:"center",prop:"price"},{default:(0,l.w5)((e=>[(0,l._)("span",C,(0,i.toDisplayString)(e.row.price)+"元/度",1)])),_:1}),(0,l.Wm)(P,{label:"操作",width:"100",align:"center",fixed:"right"},{default:(0,l.w5)((e=>[(0,l.Wm)(A,{class:"table_btn_text",text:"",icon:"sc-icon-Delete",size:L.size,type:"danger",onClick:a=>z.handlerCommand(e.row,"delete")},{default:(0,l.w5)((()=>[x])),_:2},1032,["size","onClick"])])),_:1})])),_:1},8,["data"])])),_:1})),[[K,L.loading]])])])),_:1})}var z={name:"electricLevel",data(){return{size:"small",levelList:[{name:"平段",id:1},{name:"低谷",id:2},{name:"高峰",id:3}],params:{type:1,start:"",end:"",price:""},loading:!1,tableList:[]}},mounted(){this.getList()},methods:{async getList(){this.loading=!0;const e=await this.$API.system.electricity.list.post();200==e.code&&(this.tableList=e.data),this.loading=!1},async save(){const e=await this.$API.system.electricity.config.post(this.params);200==e.code&&await this.getList()},handlerCommand(e,a){if("delete"==a){let a={id:e.id};this.delete(a)}},async delete(e={id:""}){const a=await this.$API.system.electricity.delete.post(e);200==a.code&&await this.getList()}}},U=t(83744);const D=(0,U.Z)(z,[["render",L],["__scopeId","data-v-e37ba112"]]);var I=D}}]);