1 line
60 KiB
JavaScript
1 line
60 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-115ac4f8","chunk-998b165e","chunk-55daa2dc","chunk-b2bd8bd6"],{1464:function(t,e,r){"use strict";r("7a34")},"1e36":function(t,e,r){"use strict";r.d(e,"d",(function(){return i})),r.d(e,"e",(function(){return o})),r.d(e,"c",(function(){return n})),r.d(e,"a",(function(){return l})),r.d(e,"f",(function(){return s})),r.d(e,"b",(function(){return c}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/category/list",method:"get",params:t})}function o(){return Object(a["a"])({url:"/iot/category/shortlist",method:"get"})}function n(t){return Object(a["a"])({url:"/iot/category/"+t,method:"get"})}function l(t){return Object(a["a"])({url:"/iot/category",method:"post",data:t})}function s(t){return Object(a["a"])({url:"/iot/category",method:"put",data:t})}function c(t){return Object(a["a"])({url:"/iot/category/"+t,method:"delete"})}},3021:function(t,e,r){"use strict";r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return o})),r.d(e,"d",(function(){return n})),r.d(e,"b",(function(){return l}));var a=r("b775");function i(t,e){return Object(a["a"])({url:"/sip/sipconfig/"+t+"/"+e,method:"get"})}function o(t){return Object(a["a"])({url:"/sip/sipconfig",method:"post",data:t})}function n(t){return Object(a["a"])({url:"/sip/sipconfig",method:"put",data:t})}function l(t){return Object(a["a"])({url:"/sip/sipconfig/product/"+t,method:"delete"})}},"38da":function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"d",(function(){return o})),r.d(e,"a",(function(){return n})),r.d(e,"g",(function(){return l})),r.d(e,"b",(function(){return s})),r.d(e,"c",(function(){return c})),r.d(e,"e",(function(){return u}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/temp/list",method:"get",params:t})}function o(t){return Object(a["a"])({url:"/iot/temp/"+t,method:"get"})}function n(t){return Object(a["a"])({url:"/iot/temp",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/iot/temp",method:"put",data:t})}function s(t){return Object(a["a"])({url:"/iot/temp/"+t,method:"delete"})}function c(t){return Object(a["a"])({url:"/iot/temp/getTemp",method:"get",params:t})}function u(t){return Object(a["a"])({url:"/iot/temp/getTempByPid",method:"get",params:t})}},4443:function(t,e,r){"use strict";r("dfef")},"47e5":function(t,e,r){"use strict";r("de70")},"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"},"584f":function(t,e,r){"use strict";r.d(e,"k",(function(){return i})),r.d(e,"n",(function(){return o})),r.d(e,"l",(function(){return n})),r.d(e,"m",(function(){return l})),r.d(e,"j",(function(){return s})),r.d(e,"e",(function(){return c})),r.d(e,"c",(function(){return u})),r.d(e,"f",(function(){return d})),r.d(e,"h",(function(){return p})),r.d(e,"g",(function(){return m})),r.d(e,"a",(function(){return f})),r.d(e,"o",(function(){return h})),r.d(e,"b",(function(){return v})),r.d(e,"d",(function(){return b})),r.d(e,"i",(function(){return g}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/device/list",method:"get",params:t})}function o(t){return Object(a["a"])({url:"/iot/device/unAuthlist",method:"get",params:t})}function n(t){return Object(a["a"])({url:"/iot/device/listByGroup",method:"get",params:t})}function l(t){return Object(a["a"])({url:"/iot/device/shortList",method:"get",params:t})}function s(){return Object(a["a"])({url:"/iot/device/all",method:"get"})}function c(t){return Object(a["a"])({url:"/iot/device/"+t,method:"get"})}function u(t){return Object(a["a"])({url:"/iot/device/synchronization/"+t,method:"get"})}function d(t){return Object(a["a"])({url:"/iot/device/getDeviceBySerialNumber/"+t,method:"get"})}function p(){return Object(a["a"])({url:"/iot/device/statistic",method:"get"})}function m(t){return Object(a["a"])({url:"/iot/device/runningStatus",method:"get",params:t})}function f(t){return Object(a["a"])({url:"/iot/device",method:"post",data:t})}function h(t){return Object(a["a"])({url:"/iot/device",method:"put",data:t})}function v(t){return Object(a["a"])({url:"/iot/device/"+t,method:"delete"})}function b(t){return Object(a["a"])({url:"/iot/device/generator",method:"get",params:t})}function g(t){return Object(a["a"])({url:"/iot/device/getMqttConnectData",method:"get",params:t})}},"7a34":function(t,e,r){},"814a":function(t,e,r){"use strict";r.d(e,"e",(function(){return i})),r.d(e,"f",(function(){return o})),r.d(e,"d",(function(){return n})),r.d(e,"c",(function(){return l})),r.d(e,"a",(function(){return s})),r.d(e,"g",(function(){return c})),r.d(e,"b",(function(){return u}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/firmware/list",method:"get",params:t})}function o(t){return Object(a["a"])({url:"/iot/firmware/upGradeVersionList",method:"get",params:t})}function n(t){return Object(a["a"])({url:"/iot/firmware/getLatest/"+t,method:"get"})}function l(t){return Object(a["a"])({url:"/iot/firmware/"+t,method:"get"})}function s(t){return Object(a["a"])({url:"/iot/firmware",method:"post",data:t})}function c(t){return Object(a["a"])({url:"/iot/firmware",method:"put",data:t})}function u(t){return Object(a["a"])({url:"/iot/firmware/"+t,method:"delete"})}},9355:function(t,e,r){"use strict";r.r(e);var a=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}},[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("新增")])],1),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)],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[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:firmware:edit"],expression:"['iot:firmware:edit']"}],staticStyle:{padding:"5px"},attrs:{size:"small",type:"primary",icon:"el-icon-edit"},on:{click:function(r){return t.handleUpdate(e.row)}}},[t._v("修改")]),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("删除")])]}}])})],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",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),r("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)],1)],1)},i=[],o=r("5530"),n=(r("d81d"),r("2a75")),l=r("814a"),s=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(s["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(l["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(l["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(l["g"])(t.form).then((function(e){t.$modal.msgSuccess("修改成功"),t.open=!1,t.getList()})):Object(l["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(l["b"])(r)})).then((function(){e.getList(),e.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/firmware/export",Object(o["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"),p=Object(d["a"])(u,a,i,!1,null,null,null);e["default"]=p.exports},"9b9c":function(t,e,r){"use strict";r.d(e,"f",(function(){return i})),r.d(e,"g",(function(){return o})),r.d(e,"e",(function(){return n})),r.d(e,"a",(function(){return l})),r.d(e,"i",(function(){return s})),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 p}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/product/list",method:"get",params:t})}function o(){return Object(a["a"])({url:"/iot/product/shortList",method:"get"})}function n(t){return Object(a["a"])({url:"/iot/product/"+t,method:"get"})}function l(t){return Object(a["a"])({url:"/iot/product",method:"post",data:t})}function s(t){return Object(a["a"])({url:"/iot/product",method:"put",data:t})}function c(t){return Object(a["a"])({url:"/iot/product/deviceCount/"+t,method:"get"})}function u(t){return Object(a["a"])({url:"/iot/product/status/",method:"put",data:t})}function d(t){return Object(a["a"])({url:"/iot/product/"+t,method:"delete"})}function p(t){return Object(a["a"])({url:"/iot/product/queryByTemplateId",method:"get",params:t})}},a67d:function(t,e,r){"use strict";r("eab6")},b213:function(t,e,r){"use strict";r.d(e,"d",(function(){return i})),r.d(e,"c",(function(){return o})),r.d(e,"a",(function(){return n})),r.d(e,"e",(function(){return l})),r.d(e,"b",(function(){return s}));var a=r("b775");function i(t){return Object(a["a"])({url:"/iot/protocol/list",method:"get",params:t})}function o(t){return Object(a["a"])({url:"/iot/protocol/"+t,method:"get"})}function n(t){return Object(a["a"])({url:"/iot/protocol",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/iot/protocol",method:"put",data:t})}function s(t){return Object(a["a"])({url:"/iot/protocol/"+t,method:"delete"})}},bbfb:function(t,e,r){"use strict";r.r(e);var a=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)},i=[],o=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(o["f"])(this.queryParams).then((function(e){t.modelList=e.rows,t.total=e.total,t.loading=!1}))}}},l=n,s=(r("1464"),r("2877")),c=Object(s["a"])(l,a,i,!1,null,"acd2e2f8",null);e["default"]=c.exports},c59e:function(t,e,r){t.exports=r.p+"static/img/video.fb1e1b71.png"},ddac:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticStyle:{"padding-left":"20px"}},[r("el-form",{directives:[{name:"show",rawName:"v-show",value:t.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:t.queryParams,inline:!0,"label-width":"68px"}},[r("el-form-item",{attrs:{label:"设备编号",prop:"serialNumber"}},[r("el-input",{attrs:{placeholder:"请输入设备编号",clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.serialNumber,callback:function(e){t.$set(t.queryParams,"serialNumber",e)},expression:"queryParams.serialNumber"}})],1),r("el-form-item",{attrs:{label:"授权码",prop:"authorizeCode"}},[r("el-input",{attrs:{placeholder:"请输入授权码",clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.queryParams.authorizeCode,callback:function(e){t.$set(t.queryParams,"authorizeCode",e)},expression:"queryParams.authorizeCode"}})],1),r("el-form-item",{attrs:{label:"状态",prop:"status"}},[r("el-select",{attrs:{placeholder:"请选择状态",clearable:"",size:"small"},model:{value:t.queryParams.status,callback:function(e){t.$set(t.queryParams,"status",e)},expression:"queryParams.status"}},t._l(t.dict.type.iot_auth_status,(function(t){return r("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.handleQuery}},[t._v("搜索")]),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:t.resetQuery}},[t._v("重置")])],1)],1),r("el-row",{staticClass:"mb8",attrs:{gutter:10}},[r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:add"],expression:"['iot:authorize:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("生成授权码")])],1),r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:remove"],expression:"['iot:authorize:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:t.multiple},on:{click:t.handleDelete}},[t._v("批量删除")])],1),r("el-col",{attrs:{span:1.5}},[r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:export"],expression:"['iot:authorize:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:t.handleExport}},[t._v("导出")])],1),r("el-col",{attrs:{span:1.5}},[r("el-link",{staticStyle:{"padding-top":"5px"},attrs:{type:"info",underline:!1}},[t._v("Tips:双击可以复制授权码。")])],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.authorizeList,size:"small"},on:{"selection-change":t.handleSelectionChange,"cell-dblclick":t.celldblclick}},[r("el-table-column",{attrs:{type:"selection",selectable:t.selectable,width:"55",align:"center"}}),r("el-table-column",{attrs:{label:"授权码",width:"320",align:"center",prop:"authorizeCode"}}),r("el-table-column",{attrs:{label:"状态",align:"center",prop:"active",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("dict-tag",{attrs:{options:t.dict.type.iot_auth_status,value:e.row.status}})]}}])}),r("el-table-column",{attrs:{label:"设备编号",width:"150",align:"center",prop:"serialNumber"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-link",{attrs:{type:"primary",underline:!1},on:{click:function(r){return t.getDeviceBySerialNumber(e.row.serialNumber)}}},[t._v(t._s(e.row.serialNumber))])]}}])}),r("el-table-column",{attrs:{label:"授权时间",align:"center",prop:"updateTime",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(t.parseTime(e.row.updateTime,"{y}-{m}-{d} {h}:{m}:{s}")))])]}}])}),r("el-table-column",{attrs:{label:"备注",align:"center",prop:"remark"}}),r("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[1!=e.row.status||e.row.deviceId?t._e():r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:edit"],expression:"['iot:authorize:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-s-check"},on:{click:function(r){return t.handleUpdate(e.row,"auth")}}},[t._v("设备授权")]),r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:edit"],expression:"['iot:authorize:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-notebook-1"},on:{click:function(r){return t.handleUpdate(e.row,"remark")}}},[t._v("备注")]),e.row.deviceId?t._e():r("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:authorize:remove"],expression:"['iot:authorize:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(r){return t.handleDelete(e.row)}}},[t._v("删除")])]}}])})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.queryParams.pageNum,limit:t.queryParams.pageSize},on:{"update:page":function(e){return t.$set(t.queryParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.queryParams,"pageSize",e)},pagination:t.getList}}),r("el-dialog",{attrs:{title:t.title,visible:t.open,width:t.editWidth,"append-to-body":""},on:{"update:visible":function(e){t.open=e}}},["auth"==t.editType?r("div",[r("div",{staticClass:"el-divider el-divider--horizontal",staticStyle:{"margin-top":"-25px"}}),r("el-form",{ref:"queryDeviceForm",attrs:{model:t.deviceParams,inline:!0,"label-width":"68px"}},[r("el-form-item",{attrs:{label:"设备名称",prop:"deviceName"}},[r("el-input",{staticStyle:{width:"150px"},attrs:{placeholder:"请输入设备名称",clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.deviceParams.deviceName,callback:function(e){t.$set(t.deviceParams,"deviceName",e)},expression:"deviceParams.deviceName"}})],1),r("el-form-item",{staticStyle:{margin:"0 30px"},attrs:{label:"设备编号",prop:"serialNumber"}},[r("el-input",{staticStyle:{width:"150px"},attrs:{placeholder:"请输入设备编号",clearable:"",size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleQuery(e)}},model:{value:t.deviceParams.serialNumber,callback:function(e){t.$set(t.deviceParams,"serialNumber",e)},expression:"deviceParams.serialNumber"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.handleDeviceQuery}},[t._v("搜索")]),r("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:t.resetDeviceQuery}},[t._v("重置")])],1)],1),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.deviceLoading,expression:"deviceLoading"}],ref:"singleTable",attrs:{data:t.deviceList,size:"mini","highlight-current-row":""},on:{"row-click":t.rowClick}},[r("el-table-column",{attrs:{label:"选择",width:"50",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return[r("input",{attrs:{type:"radio",name:"device"},domProps:{checked:t.row.isSelect}})]}}],null,!1,1388052008)}),r("el-table-column",{attrs:{label:"设备名称",align:"center",prop:"deviceName"}}),r("el-table-column",{attrs:{label:"设备ID",align:"center",prop:"deviceId"}}),r("el-table-column",{attrs:{label:"设备编号",align:"center",prop:"serialNumber"}}),r("el-table-column",{attrs:{label:"用户名称",align:"center",prop:"userName"}}),r("el-table-column",{attrs:{label:"设备状态",align:"center",prop:"status"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("dict-tag",{attrs:{options:t.dict.type.iot_device_status,value:e.row.status}})]}}],null,!1,2431977129)})],1),r("pagination",{directives:[{name:"show",rawName:"v-show",value:t.deviceTotal>0,expression:"deviceTotal>0"}],attrs:{total:t.deviceTotal,page:t.deviceParams.pageNum,limit:t.deviceParams.pageSize},on:{"update:page":function(e){return t.$set(t.deviceParams,"pageNum",e)},"update:limit":function(e){return t.$set(t.deviceParams,"pageSize",e)},pagination:t.getDeviceList}})],1):t._e(),"remark"==t.editType?r("div",[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):t._e(),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),r("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)]),r("el-dialog",{attrs:{title:"设备详情",visible:t.openDevice,width:"600px","append-to-body":""},on:{"update:visible":function(e){t.openDevice=e}}},[null==t.device?r("div",{staticStyle:{"text-align":"center"}},[r("i",{staticClass:"el-icon-warning",staticStyle:{color:"#E6A23C"}}),t._v(" 提示:查找不到设备,可能已经被删除")]):t._e(),null!=t.device?r("el-descriptions",{attrs:{border:"",column:2,size:"medium"}},[r("el-descriptions-item",{attrs:{label:"设备ID"}},[t._v(t._s(t.device.deviceId))]),r("el-descriptions-item",{attrs:{label:"设备名称"}},[t._v(t._s(t.device.deviceName))]),r("el-descriptions-item",{attrs:{label:"设备编号"}},[t._v(t._s(t.device.serialNumber))]),r("el-descriptions-item",{attrs:{label:"设备状态"}},[1==t.device.status?r("el-tag",{attrs:{type:"warning"}},[t._v("未激活")]):2==t.device.status?r("el-tag",{attrs:{type:"danger"}},[t._v("禁用")]):3==t.device.status?r("el-tag",{attrs:{type:"success"}},[t._v("在线")]):4==t.device.status?r("el-tag",{attrs:{type:"info"}},[t._v("离线")]):t._e()],1),r("el-descriptions-item",{attrs:{label:"设备影子"}},[1==t.device.isShadow?r("el-tag",{attrs:{type:"success"}},[t._v("启用")]):r("el-tag",{attrs:{type:"info"}},[t._v("未启用")])],1),r("el-descriptions-item",{attrs:{label:"定位方式"}},[1==t.device.locationWay?r("el-tag",{attrs:{type:"success"}},[t._v("自动定位")]):2==t.device.locationWay?r("el-tag",{attrs:{type:"warning"}},[t._v("设备定位")]):3==t.device.locationWay?r("el-tag",{attrs:{type:"primary"}},[t._v("自定义位置")]):t._e()],1),r("el-descriptions-item",{attrs:{label:"产品名称"}},[t._v(t._s(t.device.productName))]),r("el-descriptions-item",{attrs:{label:"租户名称"}},[t._v(t._s(t.device.userName))]),r("el-descriptions-item",{attrs:{label:"固件版本"}},[t._v("Version "+t._s(t.device.firmwareVersion))]),r("el-descriptions-item",{attrs:{label:"所在地址"}},[t._v(t._s(t.device.networkAddress))]),r("el-descriptions-item",{attrs:{label:"设备经度"}},[t._v(t._s(t.device.longitude))]),r("el-descriptions-item",{attrs:{label:"设备纬度"}},[t._v(t._s(t.device.latitude))]),r("el-descriptions-item",{attrs:{label:"入网IP"}},[t._v(t._s(t.device.networkIp))]),r("el-descriptions-item",{attrs:{label:"设备信号"}},[t._v(t._s(t.device.rssi))]),r("el-descriptions-item",{attrs:{label:"创建时间"}},[t._v(t._s(t.device.createTime))]),r("el-descriptions-item",{attrs:{label:"激活时间"}},[t._v(t._s(t.device.activeTime))]),r("el-descriptions-item",{attrs:{label:"备注信息"}},[t._v(t._s(t.device.remark))])],1):t._e(),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.goToEditDevice(t.device.deviceId)}}},[t._v("查看设备")]),r("el-button",{on:{click:t.closeDevice}},[t._v("关 闭")])],1)],1)],1)},i=[],o=r("5530"),n=r("ade3"),l=(r("14d9"),r("d81d"),r("584f")),s=r("b775");function c(t){return Object(s["a"])({url:"/iot/authorize/list",method:"get",params:t})}function u(t){return Object(s["a"])({url:"/iot/authorize/"+t,method:"get"})}function d(t){return Object(s["a"])({url:"/iot/authorize/addProductAuthorizeByNum",method:"post",data:t})}function p(t){return Object(s["a"])({url:"/iot/authorize",method:"put",data:t})}function m(t){return Object(s["a"])({url:"/iot/authorize/"+t,method:"delete"})}var f={name:"product-authorize",dicts:["iot_auth_status","iot_device_status"],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.deviceParams.productId=this.productInfo.productId,this.getList(),this.getDeviceList())}},data:function(){var t;return{device:{},openDevice:!1,deviceLoading:!0,deviceTotal:0,deviceList:[],deviceParams:(t={pageNum:1,pageSize:10,userId:null,deviceName:null,productId:0,productName:null},Object(n["a"])(t,"userId",null),Object(n["a"])(t,"userName",null),Object(n["a"])(t,"tenantId",null),Object(n["a"])(t,"tenantName",null),Object(n["a"])(t,"serialNumber",null),Object(n["a"])(t,"status",null),Object(n["a"])(t,"networkAddress",null),Object(n["a"])(t,"activeTime",null),t),editType:"",editWidth:"500px",loading:!0,ids:[],multiple:!0,showSearch:!0,total:0,authorizeList:[],title:"",open:!1,createNum:10,queryParams:{pageNum:1,pageSize:10,authorizeCode:null,productId:null,deviceId:null,serialNumber:null,userId:null,userName:null,status:null},form:{},productInfo:{}}},created:function(){},methods:{getDeviceBySerialNumber:function(t){var e=this;this.openDevice=!0,Object(l["f"])(t).then((function(t){e.device=t.data}))},goToEditDevice:function(t){this.openDevice=!1,this.$router.push({path:"/iot/device-edit",query:{deviceId:t}})},getDeviceList:function(){var t=this;this.deviceLoading=!0,this.deviceParams.params={},Object(l["n"])(this.deviceParams).then((function(e){for(var r=0;r<e.rows.length;r++)e.rows[r].isSelect=!1;t.deviceList=e.rows,t.deviceTotal=e.total,t.deviceLoading=!1}))},handleDeviceQuery:function(){this.deviceParams.pageNum=1,this.getDeviceList()},resetDeviceQuery:function(){this.resetForm("queryDeviceForm"),this.handleDeviceQuery()},rowClick:function(t){null!=t&&(this.setRadioSelected(t.deviceId),this.form.userId=t.userId,this.form.userName=t.userName,this.form.deviceId=t.deviceId,this.form.serialNumber=t.serialNumber)},setRadioSelected:function(t){for(var e=0;e<this.deviceList.length;e++){var r=this.deviceList[e];this.deviceList[e].deviceId==t?(r.isSelect=!0,this.$set(this.deviceList,e,r)):(r.isSelect=!1,this.$set(this.deviceList,e,r))}},getList:function(){var t=this;this.loading=!0,c(this.queryParams).then((function(e){t.authorizeList=e.rows,t.total=e.total,t.loading=!1}))},cancel:function(){this.open=!1,this.reset()},closeDevice:function(){this.openDevice=!1},reset:function(){this.form={authorizeId:null,authorizeCode:null,productId:"",userId:"",deviceId:null,serialNumber:null,userName:null,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null},this.device={},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.authorizeId})),this.multiple=!t.length},handleAdd:function(){var t=this;this.$prompt("","输入授权码数量",{customClass:"createNum",confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/[0-9\-]/,inputErrorMessage:"数量内容不正确",inputType:"number",inputValue:this.createNum}).then((function(e){var r=e.value;if(t.createNum=r,null!=t.queryParams.productId){var a={productId:t.queryParams.productId,createNum:t.createNum};d(a).then((function(e){t.$modal.msgSuccess("新增授权码成功"),t.getList(),t.createNum=10}))}})).catch((function(){t.$message({type:"info",message:"取消新增"})}))},handleUpdate:function(t,e){var r=this;this.reset(),this.editType=e;var a=t.authorizeId||this.ids;u(a).then((function(t){r.form=t.data,r.open=!0,"auth"==r.editType?(r.title="选择设备",r.editWidth="800px"):(r.title="备注信息",r.editWidth="500px");for(var e=0;e<r.deviceList.length;e++){var a=r.deviceList[e];a.isSelect=!1,r.$set(r.deviceList,e,a)}}))},submitForm:function(){var t=this;"auth"==this.editType?null!=this.form.deviceId&&0!=this.form.deviceId?p(this.form).then((function(e){t.$modal.msgSuccess("设备授权成功"),t.open=!1,t.getList()})):this.$modal.msg("请选择要授权的设备"):null!=this.form.authorizeId&&p(this.form).then((function(e){t.$modal.msgSuccess("备注成功"),t.open=!1,t.getList()}))},handleDelete:function(t){var e=this,r=t.authorizeId||this.ids;this.$modal.confirm('是否确认删除产品授权码编号为"'+r+'"的数据项?').then((function(){return m(r)})).then((function(){e.getList(),e.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/authorize/export",Object(o["a"])({},this.queryParams),"authorize_".concat((new Date).getTime(),".xlsx"))},selectable:function(t){return null==t.deviceId},celldblclick:function(t,e,r,a){var i=this;this.$copyText(t[e.property]).then((function(t){i.onCopy()}),(function(t){this.onError()}))},onCopy:function(){this.$notify({title:"成功",message:"复制成功!",type:"success",offset:50,duration:2e3})},onError:function(){this.$notify({title:"失败",message:"复制失败!",type:"error",offset:50,duration:2e3})}}},h=f,v=(r("a67d"),r("2877")),b=Object(v["a"])(h,a,i,!1,null,null,null);e["default"]=b.exports},de70:function(t,e,r){},dfef:function(t,e,r){},eab6:function(t,e,r){},f9ef:function(t,e,r){"use strict";r.r(e);var a=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:"接入方式"}},[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:"domain"}},[r("el-input",{attrs:{disabled:""},model:{value:t.form.domain,callback:function(e){t.$set(t.form,"domain",e)},expression:"form.domain"}})],1),r("el-form-item",{attrs:{label:"服务器ID",prop:"serverSipid"}},[r("el-input",{attrs:{disabled:""},model:{value:t.form.serverSipid,callback:function(e){t.$set(t.form,"serverSipid",e)},expression:"form.serverSipid"}})],1)],1),r("el-col",{attrs:{xs:24,sm:24,md:12,lg:12,xl:8}},[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:"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:"认证密码",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: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:product:edit"],expression:"['iot:product: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:product:add"],expression:"['iot:product:add']"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("新 增")])],1)],1)],1)],1)],1)},i=[],o=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(o["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.tenantId=t.product.tenantId,t.form.productId=t.product.productId,t.form.isdefault=1,null!=t.form.id?Object(o["d"])(t.form).then((function(e){t.$modal.msgSuccess("修改成功")})):Object(o["a"])(t.form).then((function(e){t.$modal.msgSuccess("新增成功"),t.form=e.data})))}))}}},l=n,s=(r("4443"),r("2877")),c=Object(s["a"])(l,a,i,!1,null,null,null);e["default"]=c.exports},ffab:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-card",{staticStyle:{margin:"6px","padding-bottom":"100px"}},[a("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"}},[a("el-tab-pane",{attrs:{name:"basic"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("span",{staticStyle:{color:"red"}},[t._v("* ")]),t._v("基本信息")]),a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"100px"}},[a("el-row",{attrs:{gutter:100}},[a("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[a("el-form-item",{attrs:{label:"产品名称",prop:"productName"}},[a("el-input",{attrs:{placeholder:"请输入产品名称",readonly:2==t.form.status},model:{value:t.form.productName,callback:function(e){t.$set(t.form,"productName",e)},expression:"form.productName"}})],1),a("el-form-item",{attrs:{label:"产品分类",prop:"categoryId"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择分类",disabled:2==t.form.status},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 a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),3!==t.form.deviceType?a("el-form-item",{attrs:{label:"通讯协议",prop:"protocolCode"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择协议",disabled:2==t.form.status},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 a("el-option",{key:t.protocolCode,attrs:{label:t.protocolName,value:t.protocolCode}})})),1)],1):t._e(),3!==t.form.deviceType?a("el-form-item",[t.tempOpen?a("el-form-item",[[a("el-alert",{attrs:{type:"success",description:"当前通讯协议为modbus协议,请选择采集点模板,默认添加设备为网关设备"}})]],2):t._e()],1):t._e(),t.tempOpen?a("el-form-item",{attrs:{prop:"templateId"}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("span",{staticStyle:{color:"#f56c6c"}},[t._v("* ")]),t._v("采集点模板")]),t.selectRowData?a("div",{staticStyle:{display:"inline-block","padding-right":"5px"}},[a("span",{staticStyle:{"font-size":"12px","padding-right":"5px",color:"#00bb00","font-weight":"bold"}},[t._v(t._s(t.selectRowData.templateName))]),a("el-button",{attrs:{plain:"",size:"mini",disabled:2==t.form.status||0!=t.form.productId},on:{click:t.deleteData}},[t._v("删除")])],1):t._e(),a("el-button",{attrs:{type:"primary",size:"mini",plain:"",disabled:2==t.form.status||0!=t.form.productId},on:{click:t.selectTemplate}},[t._v("选择模板")])],1):t._e(),a("el-form-item",{attrs:{label:"设备类型",prop:"deviceType"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择设备类型",disabled:2==t.form.status},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 a("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),a("el-form-item",{attrs:{label:"传输协议",prop:"transport"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择传输协议",disabled:2==t.form.status},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 a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:"联网方式",prop:"networkMethod"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择联网方式",disabled:2==t.form.status},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 a("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),a("el-form-item",{attrs:{label:"备注信息",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入内容",rows:"3",readonly:2==t.form.status},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),a("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[a("el-form-item",{attrs:{label:"启用授权",prop:"networkMethod"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:2==t.form.status||3==t.form.deviceType},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),a("el-form-item",{attrs:{label:"认证方式",prop:"vertificateMethod"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择认证方式",disabled:2==t.form.status||3==t.form.deviceType},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 a("el-option",{key:t.value,attrs:{label:t.label,value:parseInt(t.value)}})})),1)],1),a("el-form-item",{attrs:{label:"产品编号",prop:"productId"}},[a("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),a("el-form-item",{attrs:{label:"Mqtt账号",prop:"mqttAccount"}},[a("el-input",{attrs:{placeholder:"不填自动生成",disabled:3==t.form.deviceType,readonly:"password"==t.accountInputType,type:t.accountInputType},model:{value:t.form.mqttAccount,callback:function(e){t.$set(t.form,"mqttAccount",e)},expression:"form.mqttAccount"}},[a("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),a("el-form-item",{attrs:{label:"Mqtt密码",prop:"mqttPassword"}},[a("el-input",{attrs:{placeholder:"不填则自动生成",disabled:3==t.form.deviceType,readonly:"password"==t.passwordInputType,type:t.passwordInputType},model:{value:t.form.mqttPassword,callback:function(e){t.$set(t.form,"mqttPassword",e)},expression:"form.mqttPassword"}},[a("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),a("el-form-item",{attrs:{label:"产品秘钥",prop:"mqttSecret"}},[a("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"}},[a("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)],1),a("el-col",{attrs:{xs:24,sm:24,md:24,lg:12,xl:8}},[a("el-form-item",{attrs:{label:"产品图片"}},[2==t.form.status&&null==t.form.imgUrl?a("div",[2==t.form.deviceType?a("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("4efc")],src:r("4efc"),fit:"cover"}}):3==t.form.deviceType?a("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("c59e")],src:r("c59e"),fit:"cover"}}):a("el-image",{staticStyle:{height:"145px","border-radius":"10px"},attrs:{"preview-src-list":[r("52bb")],src:r("52bb"),fit:"cover"}})],1):a("div",[a("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?a("div",{staticClass:"el-upload__tip",staticStyle:{color:"#f56c6c"}},[t._v("提示:上传后需要提交保存")]):t._e()])],1)],1),a("el-col",{attrs:{span:20}},[a("el-form-item",{staticStyle:{"text-align":"center",margin:"40px 0px"}},[a("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,expression:"form.productId!=0 && form.status!=2"}],attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("修 改")]),a("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),a("el-tab-pane",{attrs:{label:"",name:"things",disabled:0==t.form.productId}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("span",{staticStyle:{color:"red"}},[t._v("* ")]),t._v("产品模型")]),a("product-things-model",{ref:"productThingsModel",attrs:{product:t.form}})],1),3!==t.form.deviceType?a("el-tab-pane",{attrs:{label:"",name:"productFirmware",disabled:0==t.form.productId}},[a("span",{attrs:{slot:"label"},slot:"label"},[t._v("固件管理")]),a("product-firmware",{ref:"productFirmware",attrs:{product:t.form}})],1):t._e(),3!==t.form.deviceType?a("el-tab-pane",{attrs:{label:"",name:"productAuthorize",disabled:0==t.form.productId}},[a("span",{attrs:{slot:"label"},slot:"label"},[t._v("设备授权")]),a("product-authorize",{ref:"productAuthorize",attrs:{product:t.form}})],1):t._e(),3!==t.form.deviceType?a("el-tab-pane",{attrs:{label:"",name:"alert",disabled:0==t.form.productId}},[a("span",{attrs:{slot:"label"},slot:"label"},[t._v(" 告警配置")]),a("product-alert",{ref:"productAlert",attrs:{product:t.form}})],1):t._e(),3===t.form.deviceType?a("el-tab-pane",{attrs:{label:"",name:"sipConfig",disabled:0==t.form.productId}},[a("span",{attrs:{slot:"label"},slot:"label"},[t._v("SIP配置")]),a("config-sip",{ref:"configSip",attrs:{product:t.form}})],1):t._e(),a("div",{staticStyle:{"margin-top":"200px"}}),a("el-tab-pane",[a("span",{attrs:{slot:"label"},slot:"label"},[a("div",{staticStyle:{"margin-top":"200px"}})])]),1==t.form.status?a("el-tab-pane",{attrs:{name:"product04",disabled:""}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("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("发布产品")])],1)]):t._e(),2==t.form.status?a("el-tab-pane",{attrs:{name:"product05",disabled:""}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("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("取消发布")])],1)]):t._e(),a("el-tab-pane",{attrs:{name:"product06",disabled:""}},[a("span",{attrs:{slot:"label"},slot:"label"},[a("el-button",{attrs:{type:"info",size:"mini"},on:{click:function(e){return t.goBack()}}},[t._v("返回列表")])],1)])],1),a("el-dialog",{attrs:{title:t.title,visible:t.open,width:"1000px","append-to-body":""},on:{"update:visible":function(e){t.open=e}}},[a("el-row",{attrs:{gutter:30}},[a("el-col",{attrs:{span:11}},[a("el-form",{ref:"tempParams",attrs:{inline:!0,model:t.tempParams}},[a("el-form-item",{attrs:{size:"mini"}},[a("el-input",{attrs:{placeholder:"模板名称"},model:{value:t.tempParams.templateName,callback:function(e){t.$set(t.tempParams,"templateName",e)},expression:"tempParams.templateName"}})],1),a("el-form-item",{attrs:{size:"mini"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.queryTemp}},[t._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:t.resetQuery}},[t._v("重置")])],1)],1),a("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":""}},[a("el-table-column",{attrs:{label:"选择采集点模板",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("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),a("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),a("el-col",{attrs:{span:13}},[a("el-form",{attrs:{inline:!0,model:t.pointsParams}},[a("el-form-item",{attrs:{size:"mini"}},[a("span",{staticStyle:{"font-size":"16px","font-weight":"400"},attrs:{slot:"label"},slot:"label"},[t._v("物模型列表")])]),a("el-form-item",{attrs:{size:"mini"}},[a("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("从机数量:")]),t._v(" "+t._s(t.selectRowData.slaveTotal)+" ")]),a("el-form-item",{attrs:{size:"mini"}},[a("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("变量数量:")]),t._v(" "+t._s(t.selectRowData.pointTotal)+" ")]),a("el-form-item",{attrs:{size:"mini"}},[a("span",{staticStyle:{"font-weight":"400","font-size":"12px"},attrs:{slot:"label"},slot:"label"},[t._v("采集方式:")]),a("dict-tag",{staticStyle:{display:"inline-block"},attrs:{options:t.dict.type.data_collect_type,value:t.selectRowData.pollingMethod,size:"small"}})],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.pointList,border:!1,size:"mini"}},[a("el-table-column",{attrs:{prop:"templateName",label:"物模型名称"}}),a("el-table-column",{attrs:{prop:"regAddr",label:"寄存器"}}),a("el-table-column",{attrs:{prop:"datatype",label:"数值类型"}})],1),a("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),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.cancel}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitSelect}},[t._v("确 定")])],1)],1)],1)},i=[],o=r("c7eb"),n=r("1da1"),l=(r("a9e3"),r("d3b7"),r("b0c0"),r("2ca0"),r("416d")),s=r("9355"),c=r("bbfb"),u=r("1850"),d=r("ddac"),p=r("0835"),m=r("f9ef"),f=r("b213"),h=r("1e36"),v=r("9b9c"),b=r("38da"),g=r("cec4"),y={name:"ProductEdit",dicts:["iot_device_type","iot_network_method","iot_vertificate_method","iot_transport_type","data_collect_type"],components:{productThingsModel:l["default"],productApp:c["default"],productAlert:u["default"],productAuthorize:d["default"],productFirmware:s["default"],imageUpload:p["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:""},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"}]},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;if(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(h["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(v["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:""},this.resetForm("form")},submitForm:function(){var t=this;this.$refs["form"].validate((function(e){if(e){if(t.tempOpen&&!t.form.templateId)return void t.$modal.alert("请选择采集点模板");null!=t.form.productId&&0!=t.form.productId?Object(v["i"])(t.form).then((function(e){t.changeProductCode(t.form.protocolCode),t.$modal.alertSuccess("修改成功")})):Object(v["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(v["d"])(t).then((function(t){e(t)})).catch((function(t){r(t)}))}))},changeProductStatus:function(t){var e=this;return Object(n["a"])(Object(o["a"])().mark((function r(){var a,i;return Object(o["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a="确定取消发布?",2!=t){r.next=5;break}a="产品发布后,可以创建对应的设备",r.next=10;break;case 5:if(1!=t){r.next=10;break}return r.next=8,e.getDeviceCountByProductId(e.form.productId);case 8:i=r.sent,i.data>0&&(a="重要提示:产品下已有 "+i.data+" 个设备,取消发布可以修改产品信息和模型,重新发布后对应设备状态将会被重置!");case 10:e.$confirm(a,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var r={};r.productId=e.form.productId,r.status=t,r.deviceType=e.form.deviceType,Object(v["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(v["i"])(t.form).then((function(r){t.$modal.alertSuccess("授权码已"+e)}))})).catch((function(){t.form.isAuthorize=0}))},getProtocol:function(){var t=this,e={protocolStatus:1};Object(f["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()}}},w=y,_=(r("47e5"),r("2877")),I=Object(_["a"])(w,a,i,!1,null,null,null);e["default"]=I.exports}}]); |