/*!
 *  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-45a5820c"],{"50df":function(e,t,o){},b0c4:function(e,t,o){"use strict";o("50df")},c847:function(e,t,o){"use strict";o.r(t);var r=o("f2bf");const c={class:"dialog-footer"};function i(e,t,o,i,l,s){const a=Object(r["resolveComponent"])("el-option"),n=Object(r["resolveComponent"])("el-select"),d=Object(r["resolveComponent"])("el-form-item"),u=Object(r["resolveComponent"])("el-form"),m=Object(r["resolveComponent"])("el-button"),j=Object(r["resolveComponent"])("el-dialog");return Object(r["openBlock"])(),Object(r["createBlock"])(j,{modelValue:l.dialogFormVisible,"onUpdate:modelValue":t[1]||(t[1]=e=>l.dialogFormVisible=e),title:l.title,rules:l.rules,width:"500px",onClose:s.close},{default:Object(r["withCtx"])(()=>[Object(r["createVNode"])(u,{ref:"form",model:l.form,rules:l.rules,"label-width":"60px"},{default:Object(r["withCtx"])(()=>[Object(r["createVNode"])(d,{label:e.$t("dataEnquiry.xm"),prop:"projectId"},{default:Object(r["withCtx"])(()=>[Object(r["createVNode"])(n,{modelValue:l.form.projectId,"onUpdate:modelValue":t[0]||(t[0]=e=>l.form.projectId=e),size:"small",multiple:"",placeholder:"请选择"},{default:Object(r["withCtx"])(()=>[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(l.projectData,e=>(Object(r["openBlock"])(),Object(r["createBlock"])(a,{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(r["createElementVNode"])("div",c,[Object(r["createVNode"])(m,{type:"primary",size:"small",onClick:s.save},{default:Object(r["withCtx"])(()=>t[2]||(t[2]=[Object(r["createTextVNode"])("确 定")])),_:1},8,["onClick"]),Object(r["createVNode"])(m,{size:"small",onClick:s.close},{default:Object(r["withCtx"])(()=>t[3]||(t[3]=[Object(r["createTextVNode"])("取 消")])),_:1},8,["onClick"])])]),_:1},8,["modelValue","title","rules","onClose"])}o("14d9");var l=o("fbb2"),s={data(){return{form:{imei:"",num:"",projectIds:"",projectId:[]},rules:{projectId:[{required:!0,trigger:"change",message:"请选择项目"}]},projectData:[],clearable:!0,title:"",dialogFormVisible:!1}},created(){},methods:{async getProjectData(){const{data:e}=await Object(l["getProjects"])();this.projectData=e},bindProduct(e){this.title="绑定项目";const t=[];if(e.projects)for(var o=0;o<e.projects.length;o++)t.push(e.projects[o].id);this.form.projectId=t,this.form.imei=e.imei,this.form.num=e.vehicleNumber,this.form.projectIds=t.join(","),console.log(this.form),this.dialogFormVisible=!0,this.getProjectData()},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;{this.form.projectIds=this.form.projectId.join(",");const{msg:e}=await Object(l["bindProject"])(this.form);this.$notify({title:e,type:"success"}),this.$refs["form"].resetFields(),this.dialogFormVisible=!1,this.$parent.fetchData()}})}}},a=(o("b0c4"),o("d959")),n=o.n(a);const d=n()(s,[["render",i]]);t["default"]=d},fbb2:function(e,t,o){"use strict";o.r(t),o.d(t,"getList",(function(){return c})),o.d(t,"getDeviceList",(function(){return i})),o.d(t,"getProjects",(function(){return l})),o.d(t,"bindProject",(function(){return s}));var r=o("b775");function c(e){const t="?page="+e.page+"&size="+e.size+"&projectId="+e.projectId;return Object(r["default"])({url:"/vehicle/list"+t,method:"get",data:e})}function i(e){return Object(r["default"])({url:"/tq/api/getDeviceList",method:"get",data:e})}function l(e){return Object(r["default"])({url:"/tq/api/projects",method:"get",data:e})}function s(e){return Object(r["default"])({url:"/tq/api/bindProject?imei="+e.imei+"&num="+e.num+"&projectIds="+e.projectIds,method:"post",data:e})}}}]);