/*!
 *  build: vue-admin-beautiful 
 *  vue-admin-beautiful author: chuzhixin 1204505056@qq.com 
 *  vue-admin-beautiful QQ Group(QQ群): 972435319、1139183756 
 *  time: 2024-10-10 11:14:28
 */
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0df4e93c"],{8106:function(e,t,r){"use strict";r("b84b")},a5f3:function(e,t,r){"use strict";r.r(t);var o=r("f2bf");const a={class:"dialog-footer"};function l(e,t,r,l,s,c){const i=Object(o["resolveComponent"])("el-option"),n=Object(o["resolveComponent"])("el-select"),d=Object(o["resolveComponent"])("el-form-item"),u=Object(o["resolveComponent"])("el-form"),m=Object(o["resolveComponent"])("el-button"),f=Object(o["resolveComponent"])("el-dialog");return Object(o["openBlock"])(),Object(o["createBlock"])(f,{modelValue:s.dialogFormVisible,"onUpdate:modelValue":t[1]||(t[1]=e=>s.dialogFormVisible=e),title:s.title,width:"500px",onClose:c.close},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(u,{ref:"form",model:s.form,rules:s.rules,"label-width":"60px"},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(d,{label:e.$t("dataEnquiry.xm"),prop:"projectIds"},{default:Object(o["withCtx"])(()=>[Object(o["createVNode"])(n,{modelValue:s.form.projectIds,"onUpdate:modelValue":t[0]||(t[0]=e=>s.form.projectIds=e),size:"small",filterable:"",multiple:"",placeholder:"请选择"},{default:Object(o["withCtx"])(()=>[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(s.projectData,e=>(Object(o["openBlock"])(),Object(o["createBlock"])(i,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"]),Object(o["createElementVNode"])("div",a,[Object(o["createVNode"])(m,{type:"primary",size:"small",onClick:c.save},{default:Object(o["withCtx"])(()=>t[2]||(t[2]=[Object(o["createTextVNode"])("确 定")])),_:1},8,["onClick"]),Object(o["createVNode"])(m,{size:"small",onClick:c.close},{default:Object(o["withCtx"])(()=>t[3]||(t[3]=[Object(o["createTextVNode"])("取 消")])),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","onClose"])}var s=r("f547"),c={data(){return{form:{userId:"",projectIds:[]},rules:{projectIds:[{required:!0,trigger:"change",message:"请选择项目"}]},projectData:[],clearable:!0,title:"",dialogFormVisible:!1}},created(){},methods:{async getProjectData(){const{data:e}=await Object(s["allProject"])();this.projectData=e},bindDevice(e){this.title="绑定项目",this.form.userId=e.userId,this.dialogFormVisible=!0,this.getProjectData(),this.getAlarmProjects()},async getAlarmProjects(){const{data:e}=await Object(s["alarmProjects"])({userId:this.form.userId});this.form.projectIds=e},close(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1,this.$emit("fetch-data")},save(){console.log(this.form),this.$refs["form"].validate(async e=>{if(!e)return!1;{const{msg:e}=await Object(s["assignToProjects"])(this.form);this.$notify({title:e,type:"success"}),this.$refs["form"].resetFields(),this.dialogFormVisible=!1,this.$parent.fetchData()}})}}},i=(r("8106"),r("d959")),n=r.n(i);const d=n()(c,[["render",l]]);t["default"]=d},b84b:function(e,t,r){},f547:function(e,t,r){"use strict";r.r(t),r.d(t,"getList",(function(){return a})),r.d(t,"doEdit",(function(){return l})),r.d(t,"doDelete",(function(){return s})),r.d(t,"doAdd",(function(){return c})),r.d(t,"alarmProjects",(function(){return i})),r.d(t,"allProject",(function(){return n})),r.d(t,"assignToProjects",(function(){return d}));var o=r("b775");function a(e){return Object(o["default"])({url:"/alarmUser/list?page="+e.page+"&size="+e.size,method:"get",data:e})}function l(e){return Object(o["default"])({url:"/alarmUser/update",method:"post",data:e})}function s(e){return Object(o["default"])({url:"/alarmUser/remove?userId="+e.userId,method:"post",data:e})}function c(e){return Object(o["default"])({url:"/alarmUser/insert",method:"post",data:e})}function i(e){return Object(o["default"])({url:"/alarmUser/alarmProjectIds?userId="+e.userId,method:"get",data:e})}function n(e){return Object(o["default"])({url:"/alarmUser/allProjects",method:"get",data:e})}function d(e){return Object(o["default"])({url:"/alarmUser/addProjects",method:"post",data:e})}}}]);