(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-105a803a","chunk-4261f672"],{"09a1":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"template-parameter-dialog",attrs:{title:e.$t("template.paramter.038405-0"),visible:e.openEdit,width:"900px","append-to-body":""},on:{"update:visible":function(t){e.openEdit=t}}},[a("el-row",[a("el-col",{staticClass:"model-card",attrs:{span:11}},[a("el-form",{staticClass:"search-form",attrs:{model:e.queryParams,inline:!0,"label-width":"48px",size:"small"}},[a("el-form-item",{attrs:{label:"",prop:"templateName"}},[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:e.$t("template.paramter.038405-1"),clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.templateName,callback:function(t){e.$set(e.queryParams,"templateName",t)},expression:"queryParams.templateName"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.handleQuery},slot:"append"})],1)],1)],1),a("div",{staticClass:"tip-wrap"},[a("i",{staticClass:"el-icon-warning"}),e._v(" "+e._s(e.$t("template.paramter.038405-3"))+" ")]),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.templateList,size:"small","highlight-current-row":"",border:!1,"show-header":!1,"row-style":{backgroundColor:"#eee"}},on:{"row-click":e.rowClick}},[a("el-table-column",{attrs:{label:e.$t("template.paramter.038405-4"),width:"30",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("input",{attrs:{type:"radio",disabled:"array"==e.row.datatype||"object"==e.row.datatype,name:"template"},domProps:{checked:e.row.isSelect}})]}}])}),a("el-table-column",{attrs:{label:e.$t("template.paramter.038405-5"),align:"left",prop:"templateName"}}),a("el-table-column",{attrs:{label:e.$t("template.paramter.038405-6"),align:"left",prop:"identifier"}}),a("el-table-column",{attrs:{label:e.$t("template.paramter.038405-7"),align:"center",prop:"datatype",width:"60"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.iot_data_type,value:t.row.datatype}})]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],staticStyle:{margin:"0 0 10px","background-color":"#eee"},attrs:{small:"",layout:"prev, pager, next",total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}})],1),a("el-col",{attrs:{span:11,offset:1}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-8"),prop:"name"}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-9")},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-10"),prop:"id"}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-11")},model:{value:e.form.id,callback:function(t){e.$set(e.form,"id",t)},expression:"form.id"}})],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-12"),prop:"order"}},[a("el-input-number",{staticStyle:{width:"290px"},attrs:{"controls-position":"right",placeholder:e.$t("template.paramter.038405-13"),type:"number"},model:{value:e.form.order,callback:function(t){e.$set(e.form,"order",t)},expression:"form.order"}})],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-14"),prop:"property"}},[a("el-checkbox",{attrs:{name:"isChart",label:e.$t("template.paramter.038405-15"),"true-label":1,"false-label":0},on:{change:e.isChartChange},model:{value:e.form.isChart,callback:function(t){e.$set(e.form,"isChart",t)},expression:"form.isChart"}}),a("el-checkbox",{attrs:{name:"isMonitor",label:e.$t("template.paramter.038405-16"),"true-label":1,"false-label":0},on:{change:e.isMonitorChange},model:{value:e.form.isMonitor,callback:function(t){e.$set(e.form,"isMonitor",t)},expression:"form.isMonitor"}}),a("el-checkbox",{attrs:{name:"isReadonly",label:e.$t("template.paramter.038405-17"),"true-label":1,"false-label":0},on:{change:e.isReadonlyChange},model:{value:e.form.isReadonly,callback:function(t){e.$set(e.form,"isReadonly",t)},expression:"form.isReadonly"}}),a("el-checkbox",{attrs:{name:"isHistory",label:e.$t("template.paramter.038405-18"),"true-label":1,"false-label":0},model:{value:e.form.isHistory,callback:function(t){e.$set(e.form,"isHistory",t)},expression:"form.isHistory"}}),a("el-checkbox",{attrs:{name:"isSharePerm",label:e.$t("template.paramter.038405-19"),"true-label":1,"false-label":0},model:{value:e.form.isSharePerm,callback:function(t){e.$set(e.form,"isSharePerm",t)},expression:"form.isSharePerm"}})],1),a("div",{staticStyle:{"margin-bottom":"20px","background-color":"#ddd",height:"1px"}}),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-20"),prop:"datatype"}},[a("el-select",{staticStyle:{width:"132.9px"},attrs:{placeholder:e.$t("template.paramter.038405-21")},model:{value:e.form.datatype,callback:function(t){e.$set(e.form,"datatype",t)},expression:"form.datatype"}},[a("el-option",{key:"integer",attrs:{label:e.$t("template.paramter.038405-22"),value:"integer"}}),a("el-option",{key:"decimal",attrs:{label:e.$t("template.paramter.038405-23"),value:"decimal"}}),a("el-option",{key:"bool",attrs:{label:e.$t("template.paramter.038405-24"),value:"bool",disabled:1==e.form.isChart}}),a("el-option",{key:"enum",attrs:{label:e.$t("template.paramter.038405-25"),value:"enum",disabled:1==e.form.isChart}}),a("el-option",{key:"string",attrs:{label:e.$t("template.paramter.038405-26"),value:"string",disabled:1==e.form.isChart}})],1)],1),"integer"==e.form.datatype||"decimal"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-27")}},[a("el-row",{staticStyle:{width:"290px"}},[a("el-col",{attrs:{span:11}},[a("el-input",{attrs:{placeholder:e.$t("template.paramter.038405-28"),type:"number"},model:{value:e.form.specs.min,callback:function(t){e.$set(e.form.specs,"min",t)},expression:"form.specs.min"}})],1),a("el-col",{attrs:{span:2,align:"center"}},[e._v(e._s(e.$t("template.paramter.038405-29")))]),a("el-col",{attrs:{span:11}},[a("el-input",{attrs:{placeholder:e.$t("template.paramter.038405-30"),type:"number"},model:{value:e.form.specs.max,callback:function(t){e.$set(e.form.specs,"max",t)},expression:"form.specs.max"}})],1)],1)],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-31")}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-32")},model:{value:e.form.specs.unit,callback:function(t){e.$set(e.form.specs,"unit",t)},expression:"form.specs.unit"}})],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-33")}},[a("el-input-number",{staticStyle:{width:"290px"},attrs:{"controls-position":"right",placeholder:e.$t("template.paramter.038405-34"),type:"number"},model:{value:e.form.specs.step,callback:function(t){e.$set(e.form.specs,"step",t)},expression:"form.specs.step"}})],1)],1):e._e(),"bool"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-35"),prop:""}},[a("el-row",{staticStyle:{"margin-bottom":"10px"}},[a("el-col",{attrs:{span:10}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-36")},model:{value:e.form.specs.falseText,callback:function(t){e.$set(e.form.specs,"falseText",t)},expression:"form.specs.falseText"}})],1),a("el-col",{attrs:{span:10,offset:1}},[e._v(e._s(e.$t("template.paramter.038405-37")))])],1),a("el-row",[a("el-col",{attrs:{span:10}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-38")},model:{value:e.form.specs.trueText,callback:function(t){e.$set(e.form.specs,"trueText",t)},expression:"form.specs.trueText"}})],1),a("el-col",{attrs:{span:10,offset:1}},[e._v(e._s(e.$t("template.paramter.038405-39")))])],1)],1)],1):e._e(),"enum"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-40")}},[a("el-select",{staticStyle:{width:"132.9px"},attrs:{placeholder:e.$t("template.paramter.038405-41")},model:{value:e.form.specs.showWay,callback:function(t){e.$set(e.form.specs,"showWay",t)},expression:"form.specs.showWay"}},[a("el-option",{key:"select",attrs:{label:e.$t("template.paramter.038405-42"),value:"select"}}),a("el-option",{key:"button",attrs:{label:e.$t("template.paramter.038405-43"),value:"button"}})],1)],1),a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-44"),prop:""}},[e._l(e.form.specs.enumList,(function(t,r){return a("el-row",{key:"enum"+r,staticStyle:{width:"290px","margin-bottom":"10px"}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{placeholder:e.$t("template.paramter.038405-45")},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}})],1),a("el-col",{attrs:{span:11,offset:1}},[a("el-input",{attrs:{placeholder:e.$t("template.paramter.038405-46")},model:{value:t.text,callback:function(a){e.$set(t,"text",a)},expression:"item.text"}})],1),0!=r?a("el-col",{attrs:{span:3,offset:1}},[a("a",{staticStyle:{color:"#f56c6c"},on:{click:function(t){return e.removeEnumItem(r)}}},[e._v(e._s(e.$t("template.paramter.038405-47")))])]):e._e()],1)})),a("div",[e._v(" + "),a("a",{staticStyle:{color:"#486ff2"},on:{click:function(t){return e.addEnumItem()}}},[e._v(e._s(e.$t("template.paramter.038405-48")))])])],2)],1):e._e(),"string"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.paramter.038405-49"),prop:""}},[a("el-row",[a("el-col",{attrs:{span:10}},[a("el-input",{staticStyle:{width:"290px"},attrs:{placeholder:e.$t("template.paramter.038405-50"),type:"number"},model:{value:e.form.specs.maxLength,callback:function(t){e.$set(e.form.specs,"maxLength",t)},expression:"form.specs.maxLength"}})],1)],1)],1)],1):e._e()],1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("template.paramter.038405-51")))]),a("el-button",{on:{click:e.cancel}},[e._v(e._s(e.$t("template.paramter.038405-52")))])],1)],1)},s=[],i=(a("14d9"),a("a434"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("cec4")),l={name:"things_parameter",dicts:["iot_things_type","iot_data_type","iot_yes_no"],props:{data:{type:Object,default:null}},watch:{data:function(e,t){this.index=e.index,e&&e.parameter.name&&""!=e.parameter.name&&(this.form.name=e.parameter.name,this.form.id=e.parameter.id,this.form.order=e.parameter.order,this.form.isChart=e.parameter.isChart?e.parameter.isChart:0,this.form.isHistory=e.parameter.isHistory?e.parameter.isHistory:1,this.form.isSharePerm=e.parameter.isSharePerm?e.parameter.isSharePerm:0,this.form.isMonitor=e.parameter.isMonitor?e.parameter.isMonitor:0,this.form.isReadonly=e.parameter.isReadonly?e.parameter.isReadonly:0,this.form.specs=e.parameter.datatype,this.form.datatype=this.form.specs.type,this.form.specs.enumList||(this.form.specs.enumList=[{value:"",text:""}]),this.form.specs.arrayType||(this.form.specs.arrayType="integer")),this.openEdit=!0,this.getList()}},data:function(){return{loading:!0,total:0,templateList:[],openEdit:!1,queryParams:{pageNum:1,pageSize:10,name:null,type:null},index:-1,form:{},rules:{name:[{required:!0,message:this.$t("template.paramter.038405-53"),trigger:"blur"}],id:[{required:!0,message:this.$t("template.paramter.038405-54"),trigger:"blur"}],order:[{required:!0,message:this.$t("template.paramter.038405-55"),trigger:"blur"}],datatype:[{required:!0,message:this.$t("template.paramter.038405-56"),trigger:"change"}]}}},created:function(){this.getList(),this.reset()},methods:{getList:function(){var e=this;this.loading=!0,Object(i["e"])(this.queryParams).then((function(t){for(var a=0;a0,expression:"total > 0"}],staticStyle:{"margin-bottom":"20px"},attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}})],1),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"600px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:e.$t("template.index.891112-22"),prop:"templateName"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:e.$t("template.index.891112-23")},model:{value:e.form.templateName,callback:function(t){e.$set(e.form,"templateName",t)},expression:"form.templateName"}})],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-24"),prop:"identifier"}},[a("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:e.$t("template.index.891112-25")},model:{value:e.form.identifier,callback:function(t){e.$set(e.form,"identifier",t)},expression:"form.identifier"}})],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-26"),prop:"modelOrder"}},[a("el-input-number",{staticStyle:{width:"400px"},attrs:{"controls-position":"right",placeholder:e.$t("template.index.891112-27"),type:"number"},model:{value:e.form.modelOrder,callback:function(t){e.$set(e.form,"modelOrder",t)},expression:"form.modelOrder"}})],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-28"),prop:"type"}},[a("el-radio-group",{on:{change:function(t){return e.typeChange(e.form.type)}},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[a("el-radio-button",{attrs:{label:"1"}},[e._v(e._s(e.$t("template.index.891112-29")))]),a("el-radio-button",{attrs:{label:"2"}},[e._v(e._s(e.$t("template.index.891112-30")))]),a("el-radio-button",{attrs:{label:"3"}},[e._v(e._s(e.$t("template.index.891112-31")))])],1)],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-32"),prop:"property"}},[a("el-row",[a("el-col",{attrs:{span:6}},[a("el-tooltip",{attrs:{effect:"dark",content:e.$t("template.index.891112-33"),placement:"top"}},[a("el-checkbox",{directives:[{name:"show",rawName:"v-show",value:1==e.form.type,expression:"form.type == 1"}],attrs:{name:"isChart",label:e.$t("template.index.891112-8"),"true-label":1,"false-label":0},on:{change:e.isChartChange},model:{value:e.form.isChart,callback:function(t){e.$set(e.form,"isChart",t)},expression:"form.isChart"}})],1)],1),a("el-col",{attrs:{span:6}},[a("el-tooltip",{attrs:{effect:"dark",content:e.$t("template.index.891112-34"),placement:"top"}},[a("el-checkbox",{directives:[{name:"show",rawName:"v-show",value:1==e.form.type,expression:"form.type == 1"}],attrs:{name:"isMonitor",label:e.$t("template.index.891112-9"),"true-label":1,"false-label":0},on:{change:e.isMonitorChange},model:{value:e.form.isMonitor,callback:function(t){e.$set(e.form,"isMonitor",t)},expression:"form.isMonitor"}})],1)],1),a("el-col",{attrs:{span:6}},[a("el-tooltip",{attrs:{effect:"dark",content:e.$t("template.index.891112-35"),placement:"top"}},[a("el-checkbox",{attrs:{name:"isReadonly",label:e.$t("template.index.891112-36"),disabled:3==e.form.type,"true-label":1,"false-label":0},on:{change:e.isReadonlyChange},model:{value:e.form.isReadonly,callback:function(t){e.$set(e.form,"isReadonly",t)},expression:"form.isReadonly"}})],1)],1),a("el-col",{attrs:{span:6}},[a("el-tooltip",{attrs:{effect:"dark",content:e.$t("template.index.891112-37"),placement:"top"}},[a("el-checkbox",{attrs:{name:"isHistory",label:e.$t("template.index.891112-11"),"true-label":1,"false-label":0},model:{value:e.form.isHistory,callback:function(t){e.$set(e.form,"isHistory",t)},expression:"form.isHistory"}})],1)],1),a("el-col",{attrs:{span:6}},[a("el-tooltip",{attrs:{effect:"dark",content:e.$t("template.index.891112-38"),placement:"top"}},[a("el-checkbox",{attrs:{name:"isSharePerm",label:e.$t("template.index.891112-39"),"true-label":1,"false-label":0},model:{value:e.form.isSharePerm,callback:function(t){e.$set(e.form,"isSharePerm",t)},expression:"form.isSharePerm"}})],1)],1)],1)],1),a("el-divider"),a("el-form-item",{attrs:{label:e.$t("template.index.891112-14"),prop:"datatype"}},[a("el-select",{staticStyle:{width:"183px"},attrs:{placeholder:e.$t("template.index.891112-40")},on:{change:e.dataTypeChange},model:{value:e.form.datatype,callback:function(t){e.$set(e.form,"datatype",t)},expression:"form.datatype"}},[a("el-option",{key:"integer",attrs:{label:e.$t("template.index.891112-41"),value:"integer"}}),a("el-option",{key:"decimal",attrs:{label:e.$t("template.index.891112-42"),value:"decimal"}}),a("el-option",{key:"bool",attrs:{label:e.$t("template.index.891112-43"),value:"bool",disabled:1==e.form.isChart}}),a("el-option",{key:"enum",attrs:{label:e.$t("template.index.891112-44"),value:"enum",disabled:1==e.form.isChart}}),a("el-option",{key:"string",attrs:{label:e.$t("template.index.891112-45"),value:"string",disabled:1==e.form.isChart}}),a("el-option",{key:"array",attrs:{label:e.$t("template.index.891112-46"),value:"array",disabled:1==e.form.isChart}}),a("el-option",{key:"object",attrs:{label:e.$t("template.index.891112-47"),value:"object",disabled:1==e.form.isChart}})],1)],1),"integer"==e.form.datatype||"decimal"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-48")}},[a("el-row",{staticStyle:{width:"400px"}},[a("el-col",{attrs:{span:11}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-49"),type:"number"},model:{value:e.form.specs.min,callback:function(t){e.$set(e.form.specs,"min",t)},expression:"form.specs.min"}})],1),a("el-col",{attrs:{span:2,align:"center"}},[e._v(e._s(e.$t("template.index.891112-50")))]),a("el-col",{attrs:{span:11}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-51"),type:"number"},model:{value:e.form.specs.max,callback:function(t){e.$set(e.form.specs,"max",t)},expression:"form.specs.max"}})],1)],1)],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-52")}},[a("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:e.$t("template.index.891112-53")},model:{value:e.form.specs.unit,callback:function(t){e.$set(e.form.specs,"unit",t)},expression:"form.specs.unit"}})],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-54")}},[a("el-input-number",{staticStyle:{width:"400px"},attrs:{"controls-position":"right",placeholder:e.$t("template.index.891112-55"),type:"number"},model:{value:e.form.specs.step,callback:function(t){e.$set(e.form.specs,"step",t)},expression:"form.specs.step"}})],1)],1):e._e(),"bool"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-56"),prop:""}},[a("el-row",{staticStyle:{"margin-bottom":"10px"}},[a("el-col",{attrs:{span:9}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-57")},model:{value:e.form.specs.falseText,callback:function(t){e.$set(e.form.specs,"falseText",t)},expression:"form.specs.falseText"}})],1),a("el-col",{attrs:{span:10,offset:1}},[e._v(e._s(e.$t("template.index.891112-58")))])],1),a("el-row",[a("el-col",{attrs:{span:9}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-59")},model:{value:e.form.specs.trueText,callback:function(t){e.$set(e.form.specs,"trueText",t)},expression:"form.specs.trueText"}})],1),a("el-col",{attrs:{span:10,offset:1}},[e._v(e._s(e.$t("template.index.891112-60")))])],1)],1)],1):e._e(),"enum"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-61")}},[a("el-select",{staticStyle:{width:"175px"},attrs:{placeholder:e.$t("template.index.891112-62")},model:{value:e.form.specs.showWay,callback:function(t){e.$set(e.form.specs,"showWay",t)},expression:"form.specs.showWay"}},[a("el-option",{key:"select",attrs:{label:e.$t("template.index.891112-63"),value:"select"}}),a("el-option",{key:"button",attrs:{label:e.$t("template.index.891112-64"),value:"button"}})],1)],1),a("el-form-item",{attrs:{label:e.$t("template.index.891112-65"),prop:""}},[e._l(e.form.specs.enumList,(function(t,r){return a("el-row",{key:"enum"+r,staticStyle:{"margin-bottom":"10px"}},[a("el-col",{attrs:{span:9}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-66")},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}})],1),a("el-col",{attrs:{span:11,offset:1}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-67")},model:{value:t.text,callback:function(a){e.$set(t,"text",a)},expression:"item.text"}})],1),0!=r?a("el-col",{attrs:{span:2,offset:1}},[a("a",{staticStyle:{color:"#f56c6c"},on:{click:function(t){return e.removeEnumItem(r)}}},[e._v(e._s(e.$t("del")))])]):e._e()],1)})),a("div",[e._v(" + "),a("a",{staticStyle:{color:"#409eff"},on:{click:function(t){return e.addEnumItem()}}},[e._v(e._s(e.$t("template.index.891112-68")))])])],2)],1):e._e(),"string"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-69"),prop:""}},[a("el-row",[a("el-col",{attrs:{span:9}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-70"),type:"number"},model:{value:e.form.specs.maxLength,callback:function(t){e.$set(e.form.specs,"maxLength",t)},expression:"form.specs.maxLength"}})],1),a("el-col",{attrs:{span:14,offset:1}},[e._v(e._s(e.$t("template.index.891112-71")))])],1)],1)],1):e._e(),"array"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-72"),prop:""}},[a("el-row",[a("el-col",{attrs:{span:9}},[a("el-input",{attrs:{placeholder:e.$t("template.index.891112-73"),type:"number"},nativeOn:{input:function(t){return e.handleChangeCount(t)}},model:{value:e.form.specs.arrayCount,callback:function(t){e.$set(e.form.specs,"arrayCount",t)},expression:"form.specs.arrayCount"}})],1)],1)],1),e.form.specs.arrayCount>0&&(e.form.specs.arrayIndex||null==e.form.templateId)?a("el-form-item",{attrs:{label:e.$t("template.index.891112-115"),prop:""}},[a("template",{slot:"label"},[a("span",[e._v(e._s(e.$t("template.index.891112-115")))]),a("el-tooltip",{staticStyle:{cursor:"pointer"},attrs:{effect:"light",placement:"top"}},[a("div",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.$t("template.index.891112-116")))]),a("i",{staticClass:"el-icon-question"})])],1),e._l(e.arrayModelList,(function(t,r){return a("div",{key:r,staticStyle:{display:"inline-block"}},[a("el-input",{staticClass:"custom-input",staticStyle:{width:"80px","margin-right":"10px",display:"inline-block"},attrs:{size:"small",type:"number",oninput:"if(value>10000)value=10000;if(value<0)value=0"},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.editTag(r)},blur:function(t){return e.editTag(r)}},model:{value:e.arrayModelList[r],callback:function(t){e.$set(e.arrayModelList,r,t)},expression:"arrayModelList[index]"}})],1)}))],2):e._e(),a("el-form-item",{attrs:{label:e.$t("template.index.891112-74"),prop:""}},[a("el-radio-group",{model:{value:e.form.specs.arrayType,callback:function(t){e.$set(e.form.specs,"arrayType",t)},expression:"form.specs.arrayType"}},[a("el-radio",{attrs:{label:"integer"}},[e._v(e._s(e.$t("template.index.891112-41")))]),a("el-radio",{attrs:{label:"decimal"}},[e._v(e._s(e.$t("template.index.891112-42")))]),a("el-radio",{attrs:{label:"string"}},[e._v(e._s(e.$t("template.index.891112-45")))]),a("el-radio",{attrs:{label:"object"}},[e._v(e._s(e.$t("template.index.891112-47")))])],1)],1),"object"==e.form.specs.arrayType?a("el-form-item",{attrs:{label:e.$t("product.product-things-model.142341-82")}},[a("div",{staticStyle:{"background-color":"#f8f8f8","border-radius":"5px"}},e._l(e.form.specs.params,(function(t,r){return a("el-row",{key:r,staticStyle:{padding:"0 10px 5px"}},[0==r?a("div",{staticStyle:{"margin-top":"5px"}}):e._e(),a("el-col",{attrs:{span:18}},[a("el-input",{staticStyle:{"margin-top":"3px"},attrs:{readonly:"",size:"mini",placeholder:e.$t("product.product-things-model.142341-83")},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"item.name"}},[a("template",{slot:"prepend"},[a("el-tag",{staticStyle:{"margin-left":"-21px",height:"26px","line-height":"26px"},attrs:{size:"mini",effect:"dark"}},[e._v(e._s(t.order))]),e._v(" "+e._s(e.form.identifier+"_"+t.id)+" ")],1),a("el-button",{attrs:{slot:"append",size:"small"},on:{click:function(a){return e.editParameter(t,r)}},slot:"append"},[e._v(e._s(e.$t("edit")))])],2)],1),a("el-col",{attrs:{span:2,offset:2}},[a("el-button",{staticStyle:{padding:"5px"},attrs:{size:"small",plain:"",type:"danger",icon:"el-icon-delete"},on:{click:function(t){return e.removeParameter(r)}}},[e._v(e._s(e.$t("del")))])],1)],1)})),1),a("div",[e._v(" + "),a("a",{staticStyle:{color:"#486ff2"},on:{click:function(t){return e.addParameter()}}},[e._v(e._s(e.$t("product.product-things-model.142341-85")))])])]):e._e()],1):e._e(),"object"==e.form.datatype?a("div",[a("el-form-item",{attrs:{label:e.$t("template.index.891112-75"),prop:""}},[a("div",{staticStyle:{"background-color":"#f8f8f8","border-radius":"5px"}},e._l(e.form.specs.params,(function(t,r){return a("el-row",{key:r,staticStyle:{padding:"0 10px 5px"}},[0==r?a("div",{staticStyle:{"margin-top":"5px"}}):e._e(),a("el-col",{attrs:{span:18}},[a("el-input",{staticStyle:{"margin-top":"3px"},attrs:{readonly:"",size:"mini",placeholder:e.$t("template.index.891112-76")},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"item.name"}},[a("template",{slot:"prepend"},[a("el-tag",{staticStyle:{"margin-left":"-21px",height:"26px","line-height":"26px"},attrs:{size:"mini",effect:"dark"}},[e._v(e._s(t.order))]),e._v(" "+e._s(e.form.identifier+"_"+t.id)+" ")],1),a("el-button",{attrs:{slot:"append"},on:{click:function(a){return e.editParameter(t,r)}},slot:"append"},[e._v(e._s(e.$t("edit")))])],2)],1),a("el-col",{attrs:{span:2,offset:2}},[a("el-button",{staticStyle:{padding:"5px"},attrs:{size:"small",plain:"",type:"danger",icon:"el-icon-delete"},on:{click:function(t){return e.removeParameter(r)}}},[e._v(e._s(e.$t("del")))])],1)],1)})),1),a("div",[e._v(" + "),a("a",{staticStyle:{color:"#486ff2"},on:{click:function(t){return e.addParameter()}}},[e._v(e._s(e.$t("template.index.891112-78")))])])])],1):e._e()],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:template:edit"],expression:"['iot:template:edit']"},{name:"show",rawName:"v-show",value:e.form.templateId,expression:"form.templateId"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("update")))]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:template:add"],expression:"['iot:template:add']"},{name:"show",rawName:"v-show",value:!e.form.templateId,expression:"!form.templateId"}],attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("add")))]),a("el-button",{on:{click:e.cancel}},[e._v(e._s(e.$t("cancel")))])],1)],1),a("things-parameter",{attrs:{data:e.paramData},on:{dataEvent:function(t){return e.getParamData(t)}}})],1)},s=[],i=a("5530"),l=(a("d9e2"),a("99af"),a("a630"),a("d81d"),a("14d9"),a("4e82"),a("a434"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("ac1f"),a("00b4"),a("3ca3"),a("498a"),a("cec4")),o=a("09a1"),n=a("5f87"),m={name:"Template",dicts:["iot_things_type","iot_data_type","iot_yes_no"],components:{thingsParameter:o["default"]},data:function(){return{isTenant:!1,loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,templateList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,templateName:null,type:null},isSys:0,owner:!1,sysUserId:0,form:{},arrayModelList:[],modelCount:5,tags:[],isEditing:[],newTag:[],paramData:{index:-1,parameter:{}},rules:{templateName:[{required:!0,message:this.$t("template.index.891112-84"),trigger:"blur"}],identifier:[{required:!0,message:this.$t("template.index.891112-85"),trigger:"blur"},{validator:this.validateInput,trigger:"blur"}],modelOrder:[{required:!0,message:this.$t("template.index.891112-86"),trigger:"blur"}],type:[{required:!0,message:this.$t("template.index.891112-87"),trigger:"change"}],datatype:[{required:!0,message:this.$t("template.index.891112-88"),trigger:"change"}]}}},created:function(){this.getList(),this.init(),this.modelCount&&(this.arrayModelList=Array.from({length:this.modelCount},(function(e,t){return t})))},methods:{init:function(){-1!==this.$store.state.user.roles.indexOf("tenant")&&(this.isTenant=!0),this.sysUserId=Object(n["b"])()},getList:function(){var e=this;this.loading=!0,Object(l["e"])(this.queryParams).then((function(t){e.templateList=t.rows,e.total=t.total,e.loading=!1}))},validateInput:function(e,t,a){t&&t.trim()&&!/\s/.test(t)?a():a(new Error(this.$t("template.index.891112-114")))},cancel:function(){this.open=!1,this.reset()},handleChangeCount:function(){this.modelCount=this.form.specs.arrayCount,this.form.specs.arrayCount&&(this.arrayModelList=Array.from({length:this.form.specs.arrayCount},(function(e,t){return t})))},editTag:function(e){this.isEditing[e]=!0,this.newTag[e]=this.arrayModelList[e]},saveTag:function(e){this.tags[e]=this.arrayModelList[e],this.isEditing[e]=!1},reset:function(){this.form={templateId:null,templateName:null,userId:null,userName:null,tenantId:null,tenantName:null,identifier:null,modelOrder:0,type:1,datatype:"integer",isSys:null,isChart:1,isHistory:1,isMonitor:1,isReadonly:1,isSharePerm:1,delFlag:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null,owner:null,modelCount:5,specs:{enumList:[{value:"",text:""}],arrayType:"integer",arrayCount:5,showWay:"select",params:[]}},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.templateId})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.modelCount=5,this.arrayModelList=Array.from({length:this.modelCount},(function(e,t){return t})),this.open=!0,this.title=this.$t("template.index.891112-89")},handleUpdate:function(e){var t=this;this.reset();var a=e.templateId||this.ids;this.isSys=e.isSys,this.owner=e.owner,Object(l["d"])(a).then((function(e){var a=e.data;if(t.open=!0,t.title=t.$t("template.index.891112-90"),a.specs=JSON.parse(a.specs),a.specs.enumList||(a.specs.showWay="select",a.specs.enumList=[{value:"",text:""}]),a.specs.arrayType||(a.specs.arrayType="integer"),a.specs.arrayCount||(a.specs.arrayCount=5),a.specs.params||(a.specs.params=[]),"array"==a.specs.type&&"object"==a.specs.arrayType||"object"==a.specs.type)for(var r=0;r0)for(var a=e.form.specs.params.map((function(e){return e.id})).sort(),r=0;r".concat(this.$t("template.index.891112-105"),'').concat(t.max,",")+"
".concat(this.$t("template.index.891112-106"),'').concat(t.min,"
")+"
"+"
".concat(this.$t("template.index.891112-107"),'').concat(t.step,"
,")+"
".concat(this.$t("template.index.891112-108"),'').concat(t.unit||"无","
");if("string"===t.type)return'最大长度:'+t.maxLength+"";if("array"===t.type)return"
数组类型:".concat(t.arrayType,"
,")+"
元素个数:".concat(t.arrayCount,"
");if("enum"===t.type){for(var a="",r=0;r"+t.enumList[r].value+":"+t.enumList[r].text+"",r!==t.enumList.length-1&&(a+=","),r>0&&r%2!=0&&(a+="
");return a}if("bool"===t.type)return"
0:".concat(t.falseText,"
,")+"
1:".concat(t.trueText,"
");if("object"===t.type){for(var s="",i=0;i"+t.params[i].name+":"+t.params[i].datatype.type+"",i!==t.params.length-1&&(s+=","),i>0&&i%2!==0&&(s+="
");return s}}},addParameter:function(){this.paramData={index:-1,parameter:{}}},editParameter:function(e,t){this.paramData=null,this.paramData={index:t,parameter:e}},removeParameter:function(e){this.form.specs.params.splice(e,1)},getParamData:function(e){-1==e.index?this.form.specs.params.push(e.parameter):(this.form.specs.params[e.index]=e.parameter,this.$set(this.form.specs.params,e.index,this.form.specs.params[e.index]))}}},p=m,c=(a("c6d29"),a("2877")),d=Object(c["a"])(p,r,s,!1,null,"7e280635",null);t["default"]=d.exports},cec4:function(e,t,a){"use strict";a.d(t,"e",(function(){return s})),a.d(t,"d",(function(){return i})),a.d(t,"a",(function(){return l})),a.d(t,"f",(function(){return o})),a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return m}));var r=a("b775");function s(e){return Object(r["a"])({url:"/iot/template/list",method:"get",params:e})}function i(e){return Object(r["a"])({url:"/iot/template/"+e,method:"get"})}function l(e){return Object(r["a"])({url:"/iot/template",method:"post",data:e})}function o(e){return Object(r["a"])({url:"/iot/template",method:"put",data:e})}function n(e){return Object(r["a"])({url:"/iot/template/"+e,method:"delete"})}function m(e){return Object(r["a"])({url:"/iot/template/getPoints",method:"get",params:e})}}}]);