FastBee/docker/data/nginx/vue/static/js/chunk-2b3d50ef.ecefccfe.js
2025-07-07 09:21:15 +08:00

1 line
44 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2b3d50ef","chunk-78d15825","chunk-b2bd8bd6"],{"1e36":function(t,e,r){"use strict";r.d(e,"d",(function(){return a})),r.d(e,"e",(function(){return i})),r.d(e,"c",(function(){return n})),r.d(e,"a",(function(){return s})),r.d(e,"f",(function(){return l})),r.d(e,"b",(function(){return c}));var o=r("b775");function a(t){return Object(o["a"])({url:"/iot/category/list",method:"get",params:t})}function i(){return Object(o["a"])({url:"/iot/category/shortlist",method:"get"})}function n(t){return Object(o["a"])({url:"/iot/category/"+t,method:"get"})}function s(t){return Object(o["a"])({url:"/iot/category",method:"post",data:t})}function l(t){return Object(o["a"])({url:"/iot/category",method:"put",data:t})}function c(t){return Object(o["a"])({url:"/iot/category/"+t,method:"delete"})}},3021:function(t,e,r){"use strict";r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return i})),r.d(e,"d",(function(){return n})),r.d(e,"b",(function(){return s}));var o=r("b775");function a(t,e){return Object(o["a"])({url:"/sip/sipconfig/"+t+"/"+e,method:"get"})}function i(t){return Object(o["a"])({url:"/sip/sipconfig",method:"post",data:t})}function n(t){return Object(o["a"])({url:"/sip/sipconfig",method:"put",data:t})}function s(t){return Object(o["a"])({url:"/sip/sipconfig/product/"+t,method:"delete"})}},"38da":function(t,e,r){"use strict";r.d(e,"f",(function(){return a})),r.d(e,"d",(function(){return i})),r.d(e,"a",(function(){return n})),r.d(e,"g",(function(){return s})),r.d(e,"b",(function(){return l})),r.d(e,"c",(function(){return c})),r.d(e,"e",(function(){return u}));var o=r("b775");function a(t){return Object(o["a"])({url:"/iot/temp/list",method:"get",params:t})}function i(t){return Object(o["a"])({url:"/iot/temp/"+t,method:"get"})}function n(t){return Object(o["a"])({url:"/iot/temp",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/iot/temp",method:"put",data:t})}function l(t){return Object(o["a"])({url:"/iot/temp/"+t,method:"delete"})}function c(t){return Object(o["a"])({url:"/iot/temp/getTemp",method:"get",params:t})}function u(t){return Object(o["a"])({url:"/iot/temp/getTempByPid",method:"get",params:t})}},"3c10":function(t,e,r){},"4efc":function(t,e,r){t.exports=r.p+"static/img/gateway.5a51e30f.png"},"52bb":function(t,e,r){t.exports=r.p+"static/img/product.66c3c4d5.png"},"814a":function(t,e,r){"use strict";r.d(e,"e",(function(){return a})),r.d(e,"f",(function(){return i})),r.d(e,"d",(function(){return n})),r.d(e,"c",(function(){return s})),r.d(e,"a",(function(){return l})),r.d(e,"g",(function(){return c})),r.d(e,"b",(function(){return u}));var o=r("b775");function a(t){return Object(o["a"])({url:"/iot/firmware/list",method:"get",params:t})}function i(t){return Object(o["a"])({url:"/iot/firmware/upGradeVersionList",method:"get",params:t})}function n(t){return Object(o["a"])({url:"/iot/firmware/getLatest/"+t,method:"get"})}function s(t){return Object(o["a"])({url:"/iot/firmware/"+t,method:"get"})}function l(t){return Object(o["a"])({url:"/iot/firmware",method:"post",data:t})}function c(t){return Object(o["a"])({url:"/iot/firmware",method:"put",data:t})}function u(t){return Object(o["a"])({url:"/iot/firmware/"+t,method:"delete"})}},9355:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"padding-left":"20px"}},[r("el-row",{staticClass:"mb8",attrs:{gutter:10}},[r("el-col",{attrs:{span:1.5}},[0!=t.productInfo.isOwner?r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:add"],expression:"['iot:firmware:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("新增")]):t._e()],1),r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:list"],expression:"['iot:firmware:list']"}],attrs:{type:"warning",plain:"",icon:"el-icon-refresh",size:"mini"},on:{click:t.getList}},[t._v("刷新")])],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.firmwareList,size:"small"},on:{"selection-change":t.handleSelectionChange}},[r("el-table-column",{attrs:{label:"固件名称",align:"center",prop:"firmwareName"}}),r("el-table-column",{attrs:{label:"固件版本",align:"center",prop:"version",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v("Version ")]),t._v(" "+t._s(e.row.version)+" ")]}}])}),r("el-table-column",{attrs:{label:"状态",align:"center",prop:"isLatest",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.isLatest?r("el-tag",{attrs:{type:"success"}},[t._v("最新")]):r("el-tag",{attrs:{type:"info"}},[t._v("默认")])]}}])}),r("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(t.parseTime(e.row.createTime,"{y}-{m}-{d}")))])]}}])}),r("el-table-column",{attrs:{label:"下载地址",align:"center",prop:"filePath","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-link",{attrs:{href:t.getDownloadUrl(e.row.filePath),underline:!1,type:"success"}},[t._v(t._s(t.getDownloadUrl(e.row.filePath)))])]}}])}),r("el-table-column",{attrs:{label:"固件描述",align:"center",prop:"remark","min-width":"200"}}),r("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[0!=t.productInfo.isOwner?r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:query"],expression:"['iot:firmware:query']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"primary",icon:"el-icon-view"},on:{click:function(r){return t.handleUpdate(e.row)}}},[t._v("查看")]):t._e(),0!=t.productInfo.isOwner?r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:remove"],expression:"['iot:firmware:remove']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"danger",icon:"el-icon-delete"},on:{click:function(r){return t.handleDelete(e.row)}}},[t._v("删除")]):t._e()]}}])})],1),r("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[r("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"固件名称",prop:"firmwareName"}},[r("el-input",{attrs:{placeholder:"请输入固件名称"},model:{value:t.form.firmwareName,callback:function(e){t.$set(t.form,"firmwareName",e)},expression:"form.firmwareName"}})],1),r("el-form-item",{attrs:{label:"固件版本",prop:"version"}},[r("el-input",{attrs:{placeholder:"请输入固件版本",type:"number",step:"0.1"},model:{value:t.form.version,callback:function(e){t.$set(t.form,"version",e)},expression:"form.version"}})],1),r("el-form-item",{attrs:{label:"最新固件",prop:"isLatest"}},[r("el-switch",{attrs:{"active-text":"","inactive-text":"","active-value":1,"inactive-value":0},model:{value:t.form.isLatest,callback:function(e){t.$set(t.form,"isLatest",e)},expression:"form.isLatest"}}),r("el-link",{staticStyle:{"font-size":"12px","margin-left":"15px"},attrs:{type:"info",underline:!1}},[t._v("提示:产品中只能有一个最新固件")])],1),r("el-form-item",{attrs:{label:"固件上传",prop:"filePath"}},[r("fileUpload",{ref:"file-upload",attrs:{value:t.form.filePath,limit:1,fileSize:10,fileType:["bin","zip","pdf"]},on:{input:function(e){return t.getFilePath(e)}}})],1),r("el-form-item",{attrs:{label:"固件描述",prop:"remark"}},[r("el-input",{attrs:{type:"textarea",rows:"4",placeholder:"请输入固件信息"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:edit"],expression:"['iot:firmware:edit']"},{name:"show",rawName:"v-show",value:!t.form.firmwareId,expression:"!form.firmwareId"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("新 增")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:edit"],expression:"['iot:firmware:edit']"},{name:"show",rawName:"v-show",value:t.form.firmwareId,expression:"form.firmwareId"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("修 改")]),r("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)],1)],1)},a=[],i=r("5530"),n=(r("d81d"),r("2a75")),s=r("814a"),l=r("5f87"),c={name:"product-firmware",dicts:["iot_yes_no"],components:{fileUpload:n["a"]},props:{product:{type:Object,default:null}},watch:{product:function(t,e){this.productInfo=t,this.productInfo&&0!=this.productInfo.productId&&(this.queryParams.productId=this.productInfo.productId,this.form.productId=this.productInfo.productId,this.form.productName=this.productInfo.productName,this.getList())}},data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,firmwareList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:100,firmwareName:null,productName:null,productId:0,isSys:null},productInfo:{},form:{version:1},rules:{firmwareName:[{required:!0,message:"固件名称不能为空",trigger:"blur"}],version:[{required:!0,message:"固件版本不能为空",trigger:"blur"}],filePath:[{required:!0,message:"文件路径不能为空",trigger:"blur"}]},upload:{isUploading:!1,headers:{Authorization:"Bearer "+Object(l["a"])()},url:"/prod-api/iot/tool/upload",fileList:[]}}},created:function(){},methods:{getDownloadUrl:function(t){return window.location.origin+"/prod-api"+t},getList:function(){var t=this;this.loading=!0,Object(s["e"])(this.queryParams).then((function(e){t.firmwareList=e.rows,t.total=e.total,t.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={firmwareId:null,firmwareName:null,tenantId:null,tenantName:null,productId:this.form.productId,productName:this.form.productName,isSys:null,isLatest:0,version:1,filePath:null,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(t){this.ids=t.map((function(t){return t.firmwareId})),this.single=1!==t.length,this.multiple=!t.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加产品固件",this.upload.fileList=[]},handleUpdate:function(t){var e=this;this.reset();var r=t.firmwareId||this.ids;Object(s["c"])(r).then((function(t){e.form=t.data,e.open=!0,e.title="修改产品固件",e.upload.fileList=[{name:e.form.firmwareName,url:e.form.filePath}]}))},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(null!=t.form.firmwareId?Object(s["g"])(t.form).then((function(e){t.$modal.msgSuccess("修改成功"),t.open=!1,t.getList()})):Object(s["a"])(t.form).then((function(e){t.$modal.msgSuccess("新增成功"),t.open=!1,t.getList()})))}))},handleDelete:function(t){var e=this,r=t.firmwareId||this.ids;this.$modal.confirm('是否确认删除产品固件编号为"'+r+'"的数据项?').then((function(){return Object(s["b"])(r)})).then((function(){e.getList(),e.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/firmware/export",Object(i["a"])({},this.queryParams),"firmware_".concat((new Date).getTime(),".xlsx"))},getFilePath:function(t){this.form.filePath=t},submitUpload:function(){this.$refs.upload.submit()},handleFileUploadProgress:function(t,e,r){this.upload.isUploading=!0},handleFileSuccess:function(t,e,r){this.upload.isUploading=!1,this.form.filePath=t.url,this.$modal.msgSuccess(t.msg)},handleDownload:function(t){window.open("/prod-api"+t.filePath)}}},u=c,d=r("2877"),m=Object(d["a"])(u,o,a,!1,null,null,null);e["default"]=m.exports},"9b9c":function(t,e,r){"use strict";r.d(e,"f",(function(){return a})),r.d(e,"g",(function(){return i})),r.d(e,"e",(function(){return n})),r.d(e,"a",(function(){return s})),r.d(e,"i",(function(){return l})),r.d(e,"d",(function(){return c})),r.d(e,"b",(function(){return u})),r.d(e,"c",(function(){return d})),r.d(e,"h",(function(){return m}));var o=r("b775");function a(t){return Object(o["a"])({url:"/iot/product/list",method:"get",params:t})}function i(){return Object(o["a"])({url:"/iot/product/shortList",method:"get"})}function n(t){return Object(o["a"])({url:"/iot/product/"+t,method:"get"})}function s(t){return Object(o["a"])({url:"/iot/product",method:"post",data:t})}function l(t){return Object(o["a"])({url:"/iot/product",method:"put",data:t})}function c(t){return Object(o["a"])({url:"/iot/product/deviceCount/"+t,method:"get"})}function u(t){return Object(o["a"])({url:"/iot/product/status/",method:"put",data:t})}function d(t){return Object(o["a"])({url:"/iot/product/"+t,method:"delete"})}function m(t){return Object(o["a"])({url:"/iot/product/queryByTemplateId",method:"get",params:t})}},b19f:function(t,e,r){"use strict";r("b731")},b213:function(t,e,r){"use strict";r.d(e,"d",(function(){return a})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return n})),r.d(e,"e",(function(){return s})),r.d(e,"b",(function(){return l}));var o=r("b775");function a(t){return Object(o["a"])({url:"/iot/protocol/list",method:"get",params:t})}function i(t){return Object(o["a"])({url:"/iot/protocol/"+t,method:"get"})}function n(t){return Object(o["a"])({url:"/iot/protocol",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/iot/protocol",method:"put",data:t})}function l(t){return Object(o["a"])({url:"/iot/protocol/"+t,method:"delete"})}},b731:function(t,e,r){},bbfb:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"padding-left":"20px"}},[r("el-row",{attrs:{gutter:10}},[r("el-col",{attrs:{span:14}},[r("el-row",{staticClass:"mb8",attrs:{gutter:10}},[r("el-col",{attrs:{span:1.5}},[r("el-button",{attrs:{type:"warning",plain:"",icon:"el-icon-refresh",size:"mini"},on:{click:t.getList}},[t._v("刷新")])],1),r("el-tag",{staticStyle:{"margin-left":"15px"},attrs:{type:"danger"}},[t._v("该功能暂不可用,后面版本发布")])],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{"margin-bottom":"60px","margin-top":"20px"},attrs:{data:t.modelList,border:"",size:"small"}},[r("el-table-column",{attrs:{label:"名称",align:"center",prop:"modelName"}}),r("el-table-column",{attrs:{label:"标识符",align:"center",prop:"identifier"}}),r("el-table-column",{attrs:{label:"物模型类别",align:"center",prop:"type"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("dict-tag",{attrs:{options:t.dict.type.iot_things_type,value:e.row.type}})]}}])}),r("el-table-column",{attrs:{label:"数据类型",align:"center",prop:"datatype"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("dict-tag",{attrs:{options:t.dict.type.iot_data_type,value:e.row.datatype}})]}}])}),r("el-table-column",{attrs:{label:"部件",align:"center",prop:"part"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.part)+" 系统定义的部件 ")]}}])})],1),r("el-divider",[t._v("高级功能")]),r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"自定义页面",prop:"page"}},[r("el-input",{attrs:{placeholder:"请输入自定义页面"},model:{value:t.form.page,callback:function(e){t.$set(t.form,"page",e)},expression:"form.page"}})],1)],1)],1),r("el-col",{attrs:{span:8,offset:2}},[r("div",{staticClass:"phone"},[r("div",{staticClass:"phone-container"})]),r("div",{staticStyle:{"text-align":"center","margin-top":"15px",width:"370px"}},[t._v("界面展示")])])],1)],1)},a=[],i=r("01ca"),n={name:"device-log",dicts:["iot_things_type","iot_data_type","iot_yes_no"],props:{product:{type:Object,default:null}},data:function(){return{loading:!1,modelList:[],title:"",queryParams:{productId:0,type:4},form:{},productInfo:{}}},watch:{product:function(t,e){this.productInfo=t,this.productInfo&&0!=this.productInfo.productId&&(this.queryParams.productId=this.productInfo.productId,this.getList())}},created:function(){},methods:{getList:function(){var t=this;this.loading=!0,Object(i["f"])(this.queryParams).then((function(e){t.modelList=e.rows,t.total=e.total,t.loading=!1}))}}},s=n,l=(r("ca7c"),r("2877")),c=Object(l["a"])(s,o,a,!1,null,"acd2e2f8",null);e["default"]=c.exports},c59e:function(t,e,r){t.exports=r.p+"static/img/video.fb1e1b71.png"},c618:function(t,e,r){"use strict";r("f2db")},ca7c:function(t,e,r){"use strict";r("3c10")},f2db:function(t,e,r){},f9ef:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{padding:"6px"}},[r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"100px"}},[r("el-row",{attrs:{gutter:100}},[r("el-col",{attrs:{xs:24,sm:24,md:12,lg:12,xl:8}},[r("el-form-item",{attrs:{label:"默认配置",prop:"isdefault"}},[r("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.form.isdefault,callback:function(e){t.$set(t.form,"isdefault",e)},expression:"form.isdefault"}})],1),r("el-form-item",{attrs:{label:"服务器地址",prop:"ip"}},[r("el-input",{attrs:{disabled:""},model:{value:t.form.ip,callback:function(e){t.$set(t.form,"ip",e)},expression:"form.ip"}})],1),r("el-form-item",{attrs:{label:"服务器域",prop:"domain"}},[r("el-input",{model:{value:t.form.domain,callback:function(e){t.$set(t.form,"domain",e)},expression:"form.domain"}})],1),r("el-form-item",{attrs:{label:"认证密码",prop:"password"}},[r("el-input",{attrs:{placeholder:"请输入认证密码"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}})],1)],1),r("el-col",{attrs:{xs:24,sm:24,md:12,lg:12,xl:8}},[r("el-form-item",{attrs:{label:"接入方式"}},[r("el-input",{attrs:{disabled:""},model:{value:t.accessWay,callback:function(e){t.accessWay=e},expression:"accessWay"}})],1),r("el-form-item",{attrs:{label:"服务器端口",prop:"port"}},[r("el-input",{attrs:{type:"number",disabled:""},model:{value:t.form.port,callback:function(e){t.$set(t.form,"port",e)},expression:"form.port"}})],1),r("el-form-item",{attrs:{label:"服务器ID",prop:"serverSipid"}},[r("el-input",{model:{value:t.form.serverSipid,callback:function(e){t.$set(t.form,"serverSipid",e)},expression:"form.serverSipid"}})],1)],1),r("el-col",{attrs:{xs:23,sm:23,md:23,lg:23,xl:15}},[r("el-form-item",{staticStyle:{"text-align":"center","margin-top":"20px"}},[r("el-button",{directives:[{name:"show",rawName:"v-show",value:t.form.id&&2!=t.productInfo.status,expression:"form.id && productInfo.status != 2"},{name:"hasPermi",rawName:"v-hasPermi",value:["iot:video:edit"],expression:"['iot:video:edit']"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("修 改")]),r("el-button",{directives:[{name:"show",rawName:"v-show",value:!t.form.id&&2!=t.productInfo.status,expression:"!form.id && productInfo.status != 2"},{name:"hasPermi",rawName:"v-hasPermi",value:["iot:video:add"],expression:"['iot:video:add']"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("新 增")])],1)],1)],1)],1)],1)},a=[],i=r("3021"),n={name:"ConfigSip",props:{product:{type:Object,default:null}},data:function(){return{accessWay:"国标GB28181",loading:!0,ids:[],total:0,sipconfigList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,productId:null},form:{},rules:{domain:[{required:!0,message:"服务器域不能为空",trigger:"blur"}],serverSipid:[{required:!0,message:"服务器sipid不能为空",trigger:"blur"}],password:[{required:!0,message:"sip认证密码不能为空",trigger:"blur"}]}}},watch:{product:function(t,e){this.productInfo=t,this.productInfo&&0!=this.productInfo.productId&&(this.form.id||this.getSipconfig(!0))}},created:function(){this.productInfo=this.product,this.productInfo&&0!=this.productInfo.productId&&this.getSipconfig(!1)},methods:{getSipconfig:function(t){var e=this;Object(i["c"])(this.productInfo.productId,t).then((function(r){e.form=r.data,t&&e.submitForm()}))},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){e&&(t.form.productId=t.product.productId,null==t.form.isdefault&&(t.form.isdefault=0),null!=t.form.id?Object(i["d"])(t.form).then((function(e){t.$modal.msgSuccess("修改成功")})):Object(i["a"])(t.form).then((function(e){t.$modal.msgSuccess("新增成功"),t.getSipconfig(!1)})))}))}}},s=n,l=(r("b19f"),r("2877")),c=Object(l["a"])(s,o,a,!1,null,null,null);e["default"]=c.exports},ffab:function(t,e,r){"use strict";r.r(e);var o=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("el-card",{staticStyle:{margin:"6px","padding-bottom":"100px"}},[o("el-tabs",{staticStyle:{padding:"10px","min-height":"400px"},attrs:{"tab-position":"left"},on:{"tab-click":t.tabChange},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[o("el-tab-pane",{attrs:{name:"basic"}},[o("span",{attrs:{slot:"label"},slot:"label"},[o("span",{staticStyle:{color:"red"}},[t._v("* ")]),t._v("基本信息")]),o("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"100px"}},[o("el-row",{attrs:{gutter:100}},[o("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[o("el-form-item",{attrs:{label:"产品名称",prop:"productName"}},[o("el-input",{attrs:{placeholder:"请输入产品名称",readonly:2==t.form.status||0==t.form.isOwner},model:{value:t.form.productName,callback:function(e){t.$set(t.form,"productName",e)},expression:"form.productName"}})],1),o("el-form-item",{attrs:{label:"产品分类",prop:"categoryId"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择分类",disabled:2==t.form.status||0==t.form.isOwner},on:{change:t.selectCategory},model:{value:t.form.categoryId,callback:function(e){t.$set(t.form,"categoryId",e)},expression:"form.categoryId"}},t._l(t.categoryShortList,(function(t){return o("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),3!==t.form.deviceType?o("el-form-item",{attrs:{label:"通讯协议",prop:"protocolCode"}},[o("template",{slot:"label"},[o("span",[t._v("通讯协议")]),o("el-tooltip",{staticStyle:{cursor:"pointer"},attrs:{effect:"light",placement:"bottom"}},[o("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 产品建立后,不允许修改通讯协议,修改会导致该产品下设备脏数据问题"),o("br")]),o("i",{staticClass:"el-icon-question"})])],1),o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择协议",disabled:2==t.form.status||0!=t.form.productId||0==t.form.isOwner},on:{change:t.changeProductCode},model:{value:t.form.protocolCode,callback:function(e){t.$set(t.form,"protocolCode",e)},expression:"form.protocolCode"}},t._l(t.protocolList,(function(t){return o("el-option",{key:t.protocolCode,attrs:{label:t.protocolName,value:t.protocolCode}})})),1)],2):t._e(),3!==t.form.deviceType?o("el-form-item",[t.tempOpen?o("el-form-item",[[o("el-alert",{attrs:{type:"success",description:"当前通讯协议为modbus协议,请选择采集点模板,默认添加设备为网关设备"}})]],2):t._e()],1):t._e(),t.tempOpen?o("el-form-item",{attrs:{prop:"templateId"}},[o("span",{attrs:{slot:"label"},slot:"label"},[o("span",{staticStyle:{color:"#f56c6c"}},[t._v("* ")]),t._v("采集点模板")]),t.selectRowData?o("div",{staticStyle:{display:"inline-block","padding-right":"5px"}},[o("span",{staticStyle:{"font-size":"12px","padding-right":"5px",color:"#00bb00","font-weight":"bold"}},[t._v(t._s(t.selectRowData.templateName))]),o("el-button",{attrs:{plain:"",size:"mini",disabled:2==t.form.status||0!=t.form.productId||0==t.form.isOwner},on:{click:t.deleteData}},[t._v("删除")])],1):t._e(),o("el-button",{attrs:{type:"primary",size:"mini",plain:"",disabled:2==t.form.status||0!=t.form.productId||0==t.form.isOwner},on:{click:t.selectTemplate}},[t._v("选择模板")])],1):t._e(),o("el-form-item",{attrs:{label:"设备类型",prop:"deviceType"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择设备类型",disabled:2==t.form.status||0==t.form.isOwner},model:{value:t.form.deviceType,callback:function(e){t.$set(t.form,"deviceType",e)},expression:"form.deviceType"}},t._l(t.dict.type.iot_device_type,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),o("el-form-item",{attrs:{label:"传输协议",prop:"transport"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择传输协议",disabled:2==t.form.status||0==t.form.isOwner},model:{value:t.form.transport,callback:function(e){t.$set(t.form,"transport",e)},expression:"form.transport"}},t._l(t.dict.type.iot_transport_type,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),o("el-form-item",{attrs:{label:"联网方式",prop:"networkMethod"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择联网方式",disabled:2==t.form.status||0==t.form.isOwner},model:{value:t.form.networkMethod,callback:function(e){t.$set(t.form,"networkMethod",e)},expression:"form.networkMethod"}},t._l(t.dict.type.iot_network_method,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),o("el-form-item",{attrs:{label:"私有产品",prop:"isSys"}},[o("template",{slot:"label"},[o("span",[t._v("私有产品")]),o("el-tooltip",{staticStyle:{cursor:"pointer"},attrs:{effect:"light",placement:"bottom"}},[o("div",{attrs:{slot:"content"},slot:"content"},[t._v(" 设置为私有产品后,下级不能查看"),o("br")]),o("i",{staticClass:"el-icon-question"})])],1),o("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:2==t.form.status||0==t.form.isOwner},model:{value:t.form.isSys,callback:function(e){t.$set(t.form,"isSys",e)},expression:"form.isSys"}})],2)],1),o("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[o("el-form-item",{attrs:{label:"启用授权",prop:"networkMethod"}},[o("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:2==t.form.status||3==t.form.deviceType||0==t.form.isOwner},on:{change:function(e){return t.changeIsAuthorize(t.form.isAuthorize)}},model:{value:t.form.isAuthorize,callback:function(e){t.$set(t.form,"isAuthorize",e)},expression:"form.isAuthorize"}})],1),o("el-form-item",{attrs:{label:"认证方式",prop:"vertificateMethod"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择认证方式",disabled:2==t.form.status||3==t.form.deviceType||0==t.form.isOwner},model:{value:t.form.vertificateMethod,callback:function(e){t.$set(t.form,"vertificateMethod",e)},expression:"form.vertificateMethod"}},t._l(t.dict.type.iot_vertificate_method,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),o("el-form-item",{attrs:{label:"定位方式",prop:"locationWay"}},[o("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择设备状态",clearable:"",size:"small",disabled:2==t.form.status||3==t.form.deviceType||0==t.form.isOwner},model:{value:t.form.locationWay,callback:function(e){t.$set(t.form,"locationWay",e)},expression:"form.locationWay"}},t._l(t.dict.type.iot_location_way,(function(t){return o("el-option",{key:t.value,attrs:{label:t.label,value:Number(t.value)}})})),1)],1),o("el-form-item",{attrs:{label:"产品编号",prop:"productId"}},[o("el-input",{attrs:{placeholder:"自动生成",disabled:!t.form.mqttAccount||3==t.form.deviceType,readonly:""},model:{value:t.form.productId,callback:function(e){t.$set(t.form,"productId",e)},expression:"form.productId"}})],1),o("el-form-item",{attrs:{label:"Mqtt账号",prop:"mqttAccount"}},[o("el-input",{attrs:{placeholder:"不填自动生成",disabled:3==t.form.deviceType,readonly:"password"==t.accountInputType||0==t.form.isOwner,type:t.accountInputType},model:{value:t.form.mqttAccount,callback:function(e){t.$set(t.form,"mqttAccount",e)},expression:"form.mqttAccount"}},[o("el-button",{staticStyle:{"font-size":"18px"},attrs:{slot:"append",icon:"el-icon-view"},on:{click:function(e){return t.changeInputType("account")}},slot:"append"})],1)],1),o("el-form-item",{attrs:{label:"Mqtt密码",prop:"mqttPassword"}},[o("el-input",{attrs:{placeholder:"不填则自动生成",disabled:3==t.form.deviceType,readonly:"password"==t.passwordInputType||0==t.form.isOwner,type:t.passwordInputType},model:{value:t.form.mqttPassword,callback:function(e){t.$set(t.form,"mqttPassword",e)},expression:"form.mqttPassword"}},[o("el-button",{staticStyle:{"font-size":"18px"},attrs:{slot:"append",icon:"el-icon-view"},on:{click:function(e){return t.changeInputType("password")}},slot:"append"})],1)],1),o("el-form-item",{attrs:{label:"产品秘钥",prop:"mqttSecret"}},[o("el-input",{attrs:{placeholder:"自动生成",disabled:!t.form.mqttAccount||3==t.form.deviceType,readonly:"",type:t.keyInputType},model:{value:t.form.mqttSecret,callback:function(e){t.$set(t.form,"mqttSecret",e)},expression:"form.mqttSecret"}},[o("el-button",{staticStyle:{"font-size":"18px"},attrs:{slot:"append",icon:"el-icon-view"},on:{click:function(e){return t.changeInputType("key")}},slot:"append"})],1)],1),o("el-form-item",{attrs:{label:"备注信息",prop:"remark"}},[o("el-input",{attrs:{placeholder:"请输入内容",rows:"3",readonly:2==t.form.status||0==t.form.isOwner},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),o("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[o("el-form-item",{attrs:{label:"产品图片"}},[2==t.form.status&&null==t.form.imgUrl&&0!=t.form.isOwner?o("div",[2==t.form.deviceType?o("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("4efc")],src:r("4efc"),fit:"cover"}}):3==t.form.deviceType?o("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("c59e")],src:r("c59e"),fit:"cover"}}):o("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("52bb")],src:r("52bb"),fit:"cover"}})],1):o("div",[o("imageUpload",{ref:"image-upload",attrs:{disabled:!0,value:t.form.imgUrl,limit:2==t.form.status?0:1,fileSize:1},on:{input:function(e){return t.getImagePath(e)}}})],1),null==t.form.productId||0==t.form.productId?o("div",{staticClass:"el-upload__tip",staticStyle:{color:"#f56c6c"}},[t._v(" 提示:上传后需要提交保存")]):t._e()])],1)],1),o("el-col",{attrs:{span:20}},[o("el-form-item",{staticStyle:{"text-align":"center",margin:"40px 0px"}},[o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:product:edit"],expression:"['iot:product:edit']"},{name:"show",rawName:"v-show",value:0!=t.form.productId&&2!=t.form.status&&0!=t.form.isOwner,expression:"form.productId != 0 && form.status != 2 && form.isOwner != 0 "}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("修 改")]),o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:product:add"],expression:"['iot:product:add']"},{name:"show",rawName:"v-show",value:0==t.form.productId&&2!=t.form.status,expression:"form.productId == 0 && form.status != 2"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("新 增")])],1)],1)],1)],1),o("el-tab-pane",{attrs:{label:"",name:"things",disabled:0==t.form.productId}},[o("span",{attrs:{slot:"label"},slot:"label"},[o("span",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:model:list"],expression:"['iot:model:list']"}],staticStyle:{color:"red"}},[t._v("* ")]),t._v("产品模型")]),o("product-things-model",{ref:"productThingsModel",attrs:{product:t.form}})],1),3!==t.form.deviceType?o("el-tab-pane",{attrs:{label:"",name:"productFirmware",disabled:0==t.form.productId}},[o("span",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:list"],expression:"['iot:firmware:list']"}],attrs:{slot:"label"},slot:"label"},[t._v("固件管理")]),o("product-firmware",{ref:"productFirmware",attrs:{product:t.form}})],1):t._e(),3!==t.form.deviceType?o("el-tab-pane",{attrs:{label:"",name:"productAuthorize",disabled:0==t.form.productId}},[o("span",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:query"],expression:"['iot:authorize:query']"}],attrs:{slot:"label"},slot:"label"},[t._v("设备授权")]),o("product-authorize",{ref:"productAuthorize",attrs:{product:t.form}})],1):t._e(),3===t.form.deviceType?o("el-tab-pane",{attrs:{label:"",name:"sipConfig",disabled:0==t.form.productId}},[o("span",{attrs:{slot:"label"},slot:"label"},[t._v("SIP配置")]),o("config-sip",{ref:"configSip",attrs:{product:t.form}})],1):t._e(),o("div",{staticStyle:{"margin-top":"200px"}}),o("el-tab-pane",[o("span",{attrs:{slot:"label"},slot:"label"},[o("div",{staticStyle:{"margin-top":"200px"}})])]),1==t.form.status?o("el-tab-pane",{attrs:{name:"product04",disabled:""}},[o("span",{attrs:{slot:"label"},slot:"label"},[0!=t.form.isOwner?o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:product:add"],expression:"['iot:product:add']"}],attrs:{type:"success",size:"mini"},on:{click:function(e){return t.changeProductStatus(2)}}},[t._v("发布产品")]):t._e()],1)]):t._e(),2==t.form.status?o("el-tab-pane",{attrs:{name:"product05",disabled:""}},[o("span",{attrs:{slot:"label"},slot:"label"},[0!=t.form.isOwner?o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:product:edit"],expression:"['iot:product:edit']"}],attrs:{type:"danger",size:"mini"},on:{click:function(e){return t.changeProductStatus(1)}}},[t._v("取消发布")]):t._e()],1)]):t._e(),o("el-tab-pane",{attrs:{name:"product06",disabled:""}},[o("span",{attrs:{slot:"label"},slot:"label"},[o("el-button",{attrs:{type:"info",size:"mini"},on:{click:function(e){return t.goBack()}}},[t._v("返回列表")])],1)])],1),o("el-dialog",{attrs:{title:t.title,visible:t.open,width:"1000px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[o("el-row",{attrs:{gutter:30}},[o("el-col",{attrs:{span:11}},[o("el-form",{ref:"tempParams",attrs:{inline:!0,model:t.tempParams}},[o("el-form-item",{attrs:{size:"mini"}},[o("el-input",{attrs:{placeholder:"模板名称"},model:{value:t.tempParams.templateName,callback:function(e){t.$set(t.tempParams,"templateName",e)},expression:"tempParams.templateName"}})],1),o("el-form-item",{attrs:{size:"mini"}},[o("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.queryTemp}},[t._v("搜索")]),o("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:t.resetQuery}},[t._v("重置")])],1)],1),o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.tempList,"highlight-current-row":""}},[o("el-table-column",{attrs:{label:"选择采集点模板",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-radio",{attrs:{label:e.row},nativeOn:{change:function(r){return t.getCurrentRow(e.row)}},model:{value:t.currentRow,callback:function(e){t.currentRow=e},expression:"currentRow"}},[t._v(t._s(e.row.templateName))])]}}])})],1),o("pagination",{directives:[{name:"show",rawName:"v-show",value:t.tempTotal>0,expression:"tempTotal > 0"}],attrs:{total:t.tempTotal,small:"",layout:"total, prev, pager, next",page:t.tempParams.pageNum,limit:t.tempParams.pageSize},on:{"update:page":function(e){return t.$set(t.tempParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.tempParams,"pageSize",e)},pagination:t.getTempList}})],1),o("el-col",{attrs:{span:13}},[o("el-form",{attrs:{inline:!0,model:t.pointsParams}},[o("el-form-item",{attrs:{size:"mini"}},[o("span",{staticStyle:{"font-size":"16px","font-weight":"400"},attrs:{slot:"label"},slot:"label"},[t._v("物模型列表")])]),o("el-form-item",{attrs:{size:"mini"}},[o("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("从机数量:")]),t._v(" "+t._s(t.selectRowData.slaveTotal)+" ")]),o("el-form-item",{attrs:{size:"mini"}},[o("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("变量数量:")]),t._v(" "+t._s(t.selectRowData.pointTotal)+" ")]),o("el-form-item",{attrs:{size:"mini"}},[o("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("采集方式:")]),o("dict-tag",{staticStyle:{display:"inline-block"},attrs:{options:t.dict.type.data_collect_type,value:t.selectRowData.pollingMethod,size:"small"}})],1)],1),o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.pointList,border:!1,size:"mini"}},[o("el-table-column",{attrs:{prop:"templateName",label:"物模型名称"}}),o("el-table-column",{attrs:{prop:"regAddr",label:"寄存器"}}),o("el-table-column",{attrs:{prop:"datatype",label:"数值类型"}})],1),o("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,small:"",layout:"total, prev, pager, next",page:t.pointsParams.pageNum,limit:t.pointsParams.pageSize},on:{"update:page":function(e){return t.$set(t.pointsParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.pointsParams,"pageSize",e)},pagination:t.getList}})],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:t.cancel}},[t._v("取 消")]),o("el-button",{attrs:{type:"primary"},on:{click:t.submitSelect}},[t._v("确 定")])],1)],1)],1)},a=[],i=r("c7eb"),n=r("1da1"),s=(r("b0c0"),r("a9e3"),r("d3b7"),r("2ca0"),r("416d")),l=r("9355"),c=r("bbfb"),u=r("ddac"),d=r("0835"),m=r("f9ef"),p=r("b213"),f=r("1e36"),h=r("9b9c"),b=r("38da"),g=r("cec4"),v={name:"ProductEdit",dicts:["iot_device_type","iot_network_method","iot_vertificate_method","iot_transport_type","data_collect_type","iot_location_way"],components:{productThingsModel:s["default"],productApp:c["default"],productAuthorize:u["default"],productFirmware:l["default"],imageUpload:d["a"],configSip:m["default"]},data:function(){return{keyInputType:"password",accountInputType:"password",passwordInputType:"password",activeName:"basic",categoryShortList:[],protocolList:[],form:{networkMethod:1,deviceType:1,vertificateMethod:3,transport:"MQTT",imgUrl:"",locationWay:1,isSys:0},tempOpen:!1,rules:{productName:[{required:!0,message:"产品名称不能为空",trigger:"blur"}],categoryId:[{required:!0,message:"产品分类ID不能为空",trigger:"blur"}],deviceType:[{required:!0,message:"请选择设备类型",trigger:"blur"}],protocolCode:[{required:!0,message:"设备协议不能为空",trigger:"blur"}],transport:[{required:!0,message:"传输协议不能为空",trigger:"blur"}],isSys:[{required:!0,message:"传输协议不能为空",trigger:"blur"}]},queryParams:{tenantName:null},pointList:[],open:!1,title:"",loading:!0,tempList:[],total:0,tempTotal:0,pointsParams:{pageNum:1,pageSize:8,templateId:0},tempParams:{pageNum:1,pageSize:10},currentRow:{},selectRowData:{},isModbus:!1}},created:function(){var t=this.$route.query&&this.$route.query.productId;this.form.productId=t,0!=this.form.productId&&null!=this.form.productId&&this.getProduct();var e=this.$route.query&&this.$route.query.tabPanelName;null!=e&&""!=e&&(this.activeName=e),this.getShortCategory(),this.form.productId&&0!=this.form.productId||(this.accountInputType="text",this.passwordInputType="text"),this.getProtocol()},activated:function(){var t=this.$route.query.t;null!=t&&t!=this.uniqueId&&(this.uniqueId=t);var e=this.$route.query.productId;null!=e&&0!=e&&(this.form.productId=Number(e),this.getProduct(),this.getShortCategory());var r=this.$route.query&&this.$route.query.tabPanelName;null!=r&&""!=r&&(this.activeName=r)},methods:{getShortCategory:function(){var t=this;Object(f["e"])().then((function(e){t.categoryShortList=e.data}))},goBack:function(){var t={path:"/iot/product",query:{t:Date.now(),pageNum:this.$route.query.pageNum}};this.$tab.closeOpenPage(t),this.reset()},getProduct:function(){var t=this;Object(h["e"])(this.form.productId).then((function(e){t.form=e.data,t.changeProductCode(t.form.protocolCode)}))},reset:function(){this.form={productId:0,productName:null,categoryId:null,categoryName:null,status:0,tslJson:null,isAuthorize:0,deviceType:1,networkMethod:1,vertificateMethod:3,mqttAccount:null,mqttPassword:null,mqttSecret:null,remark:null,imgUrl:"",locationWay:1,isSys:0},this.resetForm("form")},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e)if(null!=t.form.productId&&0!=t.form.productId)Object(h["i"])(t.form).then((function(e){t.changeProductCode(t.form.protocolCode),t.$modal.alertSuccess("修改成功")}));else{if(t.tempOpen&&!t.form.templateId)return void t.$modal.alert("请选择采集点模板");Object(h["a"])(t.form).then((function(e){t.form.isModbus?t.$modal.alertSuccess("物模型已经从采集点模板同步至产品"):t.$modal.alertSuccess("添加成功,可以开始定义物模型或配置"),t.form=e.data,t.changeProductCode(t.form.protocolCode)}))}}))},getDeviceCountByProductId:function(t){return new Promise((function(e,r){Object(h["d"])(t).then((function(t){e(t)})).catch((function(t){r(t)}))}))},changeProductStatus:function(t){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var o,a;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(o="确定取消发布?",2!=t){r.next=5;break}o="产品发布后,可以创建对应的设备",r.next=10;break;case 5:if(1!=t){r.next=10;break}return r.next=8,e.getDeviceCountByProductId(e.form.productId);case 8:a=r.sent,a.data>0&&(o="重要提示:产品下已有 "+a.data+" 个设备,取消发布可以修改产品信息和模型,重新发布后对应设备状态将会被重置!");case 10:e.$confirm(o,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var r={};r.productId=e.form.productId,r.status=t,r.deviceType=e.form.deviceType,Object(h["b"])(r).then((function(t){e.$modal.alertSuccess(t.msg),e.activeName="basic",e.getProduct()})).catch((function(){2==t?e.activeName="basic":e.goBack()}))})).catch((function(){e.activeName="basic"}));case 11:case"end":return r.stop()}}),r)})))()},selectCategory:function(t){for(var e=0;e<this.categoryShortList.length;e++)if(this.categoryShortList[e].id==t)return void(this.form.categoryName=this.categoryShortList[e].name)},getImagePath:function(t){this.form.imgUrl=t},changeInputType:function(t){"key"==t?this.keyInputType="password"==this.keyInputType?"text":"password":"account"==t?this.accountInputType="password"==this.accountInputType?"text":"password":"password"==t&&(this.passwordInputType="password"==this.passwordInputType?"text":"password")},changeIsAuthorize:function(){var t=this,e="1"==this.form.isAuthorize?"启用":"停用";this.$modal.confirm("确认要"+e+"授权码吗?").then((function(){null!=t.form.productId&&0!=t.form.productId&&Object(h["i"])(t.form).then((function(r){t.$modal.alertSuccess("授权码已"+e)}))})).catch((function(){t.form.isAuthorize=0}))},getProtocol:function(){var t=this,e={protocolStatus:1,pageSize:99};Object(p["d"])(e).then((function(e){t.protocolList=e.rows}))},selectTemplate:function(){this.open=!0,this.title="选择模板",this.getTempList()},getTempDetail:function(){var t=this,e={productId:this.form.productId};Object(b["e"])(e).then((function(e){t.selectRowData=e.data}))},cancel:function(){this.open=!1},getTempList:function(){var t=this;this.loading=!0,Object(b["f"])(this.tempParams).then((function(e){t.tempList=e.rows,t.tempTotal=e.total,t.currentRow=t.tempList[0],t.getCurrentRow(t.tempList[0]),t.loading=!1,t.getList()}))},getList:function(){var t=this;Object(g["c"])(this.pointsParams).then((function(e){t.pointList=e.rows,t.total=e.total}))},submitSelect:function(){this.open=!1,this.form.templateId=this.selectRowData.templateId},getCurrentRow:function(t){null!=t&&(this.selectRowData=t),this.pointsParams.templateId=t.templateId,this.getList()},deleteData:function(){this.selectRowData={},this.form.templateId=null},changeProductCode:function(t){t&&t.startsWith("MODBUS")?(this.tempOpen=!0,this.form.deviceType=2,this.form.isModbus=!0,0!=this.form.productId&&null!=this.form.productId&&this.getTempDetail()):(this.form.isModbus=!1,this.tempOpen=!1)},tabChange:function(t){"alert"==t.paneName&&this.$refs.productAlert.getCacheThingsModel(this.form.productId)},queryTemp:function(){this.getTempList()},handleQuery:function(){this.tempParams.pageNum=1,this.getTempList()},resetQuery:function(){this.resetForm("tempParams"),this.handleQuery()}}},y=v,w=(r("c618"),r("2877")),x=Object(w["a"])(y,o,a,!1,null,null,null);e["default"]=x.exports}}]);