FastBee/docker/data/nginx/vue/static/js/chunk-0966317c.d0a32e72.js
2025-07-07 09:21:15 +08:00

1 line
27 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0966317c"],{"377d":function(e,t,a){"use strict";a("a4a0")},"466d":function(e,t,a){"use strict";var i=a("c65b"),n=a("d784"),o=a("825a"),r=a("7234"),l=a("50c4"),s=a("577e"),c=a("1d80"),d=a("dc4a"),u=a("8aa5"),m=a("14c3");n("match",(function(e,t,a){return[function(t){var a=c(this),n=r(t)?void 0:d(t,e);return n?i(n,t,a):new RegExp(t)[e](s(a))},function(e){var i=o(this),n=s(e),r=a(t,i,n);if(r.done)return r.value;if(!i.global)return m(i,n);var c=i.unicode;i.lastIndex=0;var d,p=[],f=0;while(null!==(d=m(i,n))){var h=s(d[0]);p[f]=h,""===h&&(i.lastIndex=u(n,l(i.lastIndex),c)),f++}return 0===f?null:p}]}))},"7a72":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"device-timer-wrap"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,inline:!0,"label-width":"70px"}},[a("el-form-item",{attrs:{label:"定时名称",prop:"jobName"}},[a("el-input",{attrs:{placeholder:"请输入定时名称",clearable:"",size:"small"},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.jobName,callback:function(t){e.$set(e.queryParams,"jobName",t)},expression:"queryParams.jobName"}})],1),a("el-form-item",{attrs:{label:"定时状态",prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择定时状态",clearable:"",size:"small"},model:{value:e.queryParams.status,callback:function(t){e.$set(e.queryParams,"status",t)},expression:"queryParams.status"}},e._l(e.dict.type.sys_job_status,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1),a("el-form-item",{staticStyle:{float:"right"}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:add"],expression:"['iot:device:timer:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.jobList,size:"mini"},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:"名称",align:"center",prop:"jobName","show-overflow-tooltip":!0}}),a("el-table-column",{attrs:{label:"描述",align:"center",prop:"cronText"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{domProps:{innerHTML:e._s(e.formatCronDisplay(t.row))}})]}}])}),a("el-table-column",{attrs:{label:"CRON表达式",align:"center",prop:"cronExpression","show-overflow-tooltip":!0}}),a("el-table-column",{attrs:{label:"动作",align:"left",prop:"actions","show-overflow-tooltip":!0,width:"260"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticStyle:{overflow:"hidden","white-space":"nowrap"},domProps:{innerHTML:e._s(e.formatActionsDisplay(t.row.actions))}})]}}])}),a("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"0","inactive-value":"1","active-text":"启用"},on:{change:function(a){return e.handleStatusChange(t.row)}},model:{value:t.row.status,callback:function(a){e.$set(t.row,"status",a)},expression:"scope.row.status"}})]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:query"],expression:"['iot:device:timer:query']"}],attrs:{size:"mini",type:"text",icon:"el-icon-view"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("查看")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:query"],expression:"['iot:device:timer:query']"}],attrs:{size:"mini",type:"text",icon:"el-icon-caret-right"},on:{click:function(a){return e.handleView(t.row)}}},[e._v("定时详细")]),a("br"),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:remove"],expression:"['iot:device:timer:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:execute"],expression:"['iot:device:timer:execute']"}],attrs:{size:"mini",type:"text",icon:"el-icon-caret-right"},on:{click:function(a){return e.handleRun(t.row)}}},[e._v("执行一次")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],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}}),a("el-dialog",{staticClass:"device-timer-config-dialog",attrs:{title:e.title,visible:e.open,width:"800px","append-to-body":"","close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){e.open=t}}},[a("div",{staticClass:"el-divider el-divider--horizontal",staticStyle:{"margin-top":"-25px"}}),a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"定时名称",prop:"jobName"}},[a("el-input",{staticStyle:{width:"280px"},attrs:{placeholder:"请输入定时名称"},model:{value:e.form.jobName,callback:function(t){e.$set(e.form,"jobName",t)},expression:"form.jobName"}})],1),a("el-form-item",{attrs:{label:"执行时间",prop:"timerTimeValue"}},[a("el-time-picker",{staticStyle:{width:"280px"},attrs:{"value-format":"HH:mm",format:"HH:mm",placeholder:"选择时间",disabled:1==e.form.isAdvance},on:{change:e.timeChange},model:{value:e.timerTimeValue,callback:function(t){e.timerTimeValue=t},expression:"timerTimeValue"}})],1),a("el-form-item",{attrs:{label:"选择星期",prop:"timerWeek"}},[a("el-row",[a("el-col",{attrs:{span:18}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择",multiple:"",disabled:1==e.form.isAdvance},on:{change:e.weekChange},model:{value:e.timerWeekValue,callback:function(t){e.timerWeekValue=t},expression:"timerWeekValue"}},e._l(e.timerWeeks,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),a("el-form-item",{attrs:{label:"cron表达式",prop:"cron"}},[a("el-row",[a("el-col",{attrs:{span:18}},[a("el-input",{attrs:{placeholder:"cron执行表达式",disabled:0==e.form.isAdvance},model:{value:e.form.cronExpression,callback:function(t){e.$set(e.form,"cronExpression",t)},expression:"form.cronExpression"}},[a("template",{slot:"append"},[a("el-button",{attrs:{type:"primary",disabled:0==e.form.isAdvance},on:{click:e.handleShowCron}},[e._v(" 生成表达式 "),a("i",{staticClass:"el-icon-time el-icon--right"})])],1)],2)],1),a("el-col",{attrs:{span:4,offset:1}},[a("el-checkbox",{attrs:{"true-label":1,"false-label":0},on:{change:e.customerCronChange},model:{value:e.form.isAdvance,callback:function(t){e.$set(e.form,"isAdvance",t)},expression:"form.isAdvance"}},[e._v("自定义表达式")])],1)],1)],1),a("el-form-item",{attrs:{label:"定时状态",prop:"status"}},[a("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},e._l(e.dict.type.sys_job_status,(function(t){return a("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1),a("div",{staticStyle:{height:"1px","background-color":"#ddd",margin:"0 0 20px 0"}}),a("el-form-item",{staticClass:"action-wrap",attrs:{label:"执行动作",prop:"actions"}},[e._l(e.actionList,(function(t,i){return a("div",{key:i+"action",staticClass:"item-wrap"},[a("el-row",{attrs:{gutter:16}},[a("el-col",{attrs:{span:5}},[a("el-select",{attrs:{placeholder:"请选择类型",size:"small"},on:{change:function(t){return e.handleActionTypeChange(t,i)}},model:{value:t.type,callback:function(a){e.$set(t,"type",a)},expression:"actionItem.type"}},e._l(e.modelTypes,(function(e,t){return a("el-option",{key:t+"type",attrs:{label:e.label,value:e.value}})})),1)],1),a("el-col",{attrs:{span:10}},[1==t.type?a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择父级物模型",size:"small"},on:{change:function(t){return e.handleActionParentModelChange(t,i)}},model:{value:t.parentId,callback:function(a){e.$set(t,"parentId",a)},expression:"actionItem.parentId"}},e._l(e.thingsModel.properties,(function(e,t){return a("el-option",{key:t+"property",attrs:{label:e.name,value:e.id}})})),1):2==t.type?a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择父级物模型",size:"small"},on:{change:function(t){return e.handleActionParentModelChange(t,i)}},model:{value:t.parentId,callback:function(a){e.$set(t,"parentId",a)},expression:"actionItem.parentId"}},e._l(e.thingsModel.functions,(function(e,t){return a("el-option",{key:t+"func",attrs:{label:e.name,value:e.id}})})),1):e._e()],1),a("div",{staticClass:"delete-wrap"},[0!==i?a("el-button",{staticStyle:{padding:"5px"},attrs:{size:"small",plain:"",type:"danger",icon:"el-icon-delete"},on:{click:function(t){return e.handleRemoveActionItem(i)}}},[e._v("删除")]):e._e()],1)],1),a("el-row",{attrs:{gutter:16}},[t.parentModel&&"array"===t.parentModel.datatype.type?a("el-col",{attrs:{span:5}},[a("el-select",{attrs:{placeholder:"请选择",size:"small"},on:{change:function(t){return e.handleActionIndexChange(t,i)}},model:{value:t.arrayIndex,callback:function(a){e.$set(t,"arrayIndex",a)},expression:"actionItem.arrayIndex"}},e._l(t.parentModel.datatype.arrayModel,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1):e._e(),t.parentModel&&"array"===t.parentModel.datatype.type&&"object"===t.parentModel.datatype.arrayType?a("el-col",{attrs:{span:5}},[a("el-select",{attrs:{placeholder:"请选择",size:"small"},on:{change:function(t){return e.handleActionModelChange(t,i)}},model:{value:t.id,callback:function(a){e.$set(t,"id",a)},expression:"actionItem.id"}},e._l(t.parentModel.datatype.params,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1):e._e(),t.parentModel&&"object"===t.parentModel.datatype.type?a("el-col",{attrs:{span:5}},[a("el-select",{attrs:{placeholder:"请选择",size:"small"},on:{change:function(t){return e.handleActionModelChange(t,i)}},model:{value:t.id,callback:function(a){e.$set(t,"id",a)},expression:"actionItem.id"}},e._l(t.parentModel.datatype.params,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1):e._e(),t.model?a("el-col",{attrs:{span:10}},["integer"==t.model.datatype.type||"decimal"==t.model.datatype.type?a("div",[a("el-input",{staticStyle:{"vertical-align":"baseline"},attrs:{placeholder:"值",max:t.model.datatype.max,min:t.model.datatype.min,type:"number",size:"small"},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"actionItem.value"}},[a("template",{slot:"append"},[e._v(e._s(t.model.datatype.unit))])],2)],1):"bool"==t.model.datatype.type?a("div",[a("el-switch",{staticStyle:{"vertical-align":"baseline"},attrs:{"active-text":t.model.datatype.trueText,"inactive-text":t.model.datatype.falseText,"active-value":1,"inactive-value":0},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"actionItem.value"}})],1):"enum"==t.model.datatype.type?a("div",[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择",size:"small"},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"actionItem.value"}},e._l(t.model.datatype.enumList,(function(e,t){return a("el-option",{key:t+"things",attrs:{label:e.text,value:e.value}})})),1)],1):"string"==t.model.datatype.type?a("div",[a("el-input",{attrs:{placeholder:"请输入字符串",max:t.model.datatype.maxLength,size:"small"},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"actionItem.value"}})],1):e._e()]):e._e()],1)],1)})),a("div",[e._v(" + "),a("a",{staticStyle:{color:"#409eff"},on:{click:function(t){return e.handleAddActionItem()}}},[e._v("添加执行动作")])])],2)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:add"],expression:"['iot:device:timer:add']"},{name:"show",rawName:"v-show",value:!e.form.jobId,expression:"!form.jobId\n "}],attrs:{type:"primary",loading:e.submitButtonLoading},on:{click:e.handleSubmitForm}},[e._v("新 增")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["iot:device:timer:edit"],expression:"['iot:device:timer:edit']"},{name:"show",rawName:"v-show",value:e.form.jobId,expression:"form.jobId"}],attrs:{type:"primary",loading:e.submitButtonLoading},on:{click:e.handleSubmitForm}},[e._v("修 改")]),a("el-button",{on:{click:e.handleCancel}},[e._v("取 消")])],1)],1),a("el-dialog",{staticClass:"scrollbar",attrs:{title:"Cron表达式生成器",visible:e.openCron,"append-to-body":"","destroy-on-close":""},on:{"update:visible":function(t){e.openCron=t}}},[a("crontab",{staticStyle:{"padding-bottom":"80px"},attrs:{expression:e.expression},on:{hide:function(t){e.openCron=!1},fill:e.crontabFill}})],1),a("el-dialog",{attrs:{title:"定时详细",visible:e.openView,width:"700px","append-to-body":""},on:{"update:visible":function(t){e.openView=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px",size:"mini"}},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"定时编号:"}},[e._v(e._s(e.form.jobId))]),a("el-form-item",{attrs:{label:"定时名称:"}},[e._v(e._s(e.form.jobName))])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"定时分组:"}},[e._v(e._s(e.jobGroupFormat(e.form)))]),a("el-form-item",{attrs:{label:"创建时间:"}},[e._v(e._s(e.form.createTime))])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"是否并发:"}},[0==e.form.concurrent?a("div",[e._v("允许")]):1==e.form.concurrent?a("div",[e._v("禁止")]):e._e()])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"cron表达式"}},[e._v(e._s(e.form.cronExpression))])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"执行策略:"}},[0==e.form.misfirePolicy?a("div",[e._v("默认策略")]):1==e.form.misfirePolicy?a("div",[e._v("立即执行")]):2==e.form.misfirePolicy?a("div",[e._v("执行一次")]):3==e.form.misfirePolicy?a("div",[e._v("放弃执行")]):e._e()])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"下次执行时间:"}},[e._v(e._s(e.parseTime(e.form.nextValidTime)))])],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"定时状态:"}},[0==e.form.status?a("div",[e._v("正常")]):1==e.form.status?a("div",[e._v("暂停")]):e._e()])],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"执行动作:"}},[a("div",{staticStyle:{border:"1px solid #ddd",padding:"10px","border-radius":"5px",width:"465px"},domProps:{innerHTML:e._s(e.formatActionsDisplay(e.form.actions))}})])],1)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.openView=!1}}},[e._v("关 闭")])],1)],1)],1)},n=[],o=a("5530"),r=(a("99af"),a("4de4"),a("7db0"),a("d81d"),a("14d9"),a("4e82"),a("a434"),a("b0c0"),a("e9c4"),a("a9e3"),a("b64b"),a("d3b7"),a("b775"));function l(e){return Object(r["a"])({url:"/iot/job/list",method:"get",params:e})}function s(e){return Object(r["a"])({url:"/iot/job/"+e,method:"get"})}function c(e){return Object(r["a"])({url:"/iot/job",method:"post",data:e})}function d(e){return Object(r["a"])({url:"/iot/job",method:"put",data:e})}function u(e){return Object(r["a"])({url:"/iot/job/"+e,method:"delete"})}function m(e,t){var a={jobId:e,status:t};return Object(r["a"])({url:"/iot/job/changeStatus",method:"put",data:a})}function p(e,t){var a={jobId:e,jobGroup:t};return Object(r["a"])({url:"/iot/job/run",method:"put",data:a})}var f=a("bdd0"),h={components:{Crontab:f["a"]},name:"device-timer",dicts:["sys_job_group","sys_job_status"],props:{device:{type:Object,default:null}},watch:{device:function(e,t){this.deviceInfo=e,this.deviceInfo&&0!==this.deviceInfo.deviceId&&(this.thingsModel=this.formatArrayIndex(e.cacheThingsModel),this.thingsModel.properties&&0!==this.thingsModel.properties.length&&(this.thingsModel.properties=this.thingsModel.properties.filter((function(e){return e.datatype.params&&0!==e.datatype.params.length&&(e.datatype.params=e.datatype.params.filter((function(e){return 0==e.isMonitor&&0==e.isReadonly}))),0==e.isMonitor&&0==e.isReadonly}))),this.thingsModel.functions&&0!==this.thingsModel.functions.length&&(this.thingsModel.functions=this.thingsModel.functions.filter((function(e){return e.datatype.params&&0!==e.datatype.params.length&&(e.datatype.params=e.datatype.params.filter((function(e){return 0==e.isMonitor&&0==e.isReadonly}))),0==e.isMonitor&&0==e.isReadonly}))),this.queryParams.deviceId=this.deviceInfo.deviceId)}},data:function(){return{deviceInfo:{},actionList:[],thingsModel:{},loading:!1,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,jobList:[],title:"",open:!1,openView:!1,openCron:!1,expression:"",submitButtonLoading:!1,queryParams:{pageNum:1,pageSize:10,deviceId:0,jobName:void 0,jobGroup:void 0,status:void 0},timerWeeks:[{value:1,label:"周一"},{value:2,label:"周二"},{value:3,label:"周三"},{value:4,label:"周四"},{value:5,label:"周五"},{value:6,label:"周六"},{value:7,label:"周日"}],timerWeekValue:[1,2,3,4,5,6,7],timerTimeValue:"",modelTypes:[{value:1,label:"属性"},{value:2,label:"功能"}],form:{},rules:{jobName:[{required:!0,message:"定时名称不能为空",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,l(this.queryParams).then((function(t){e.jobList=t.rows,e.total=t.total,e.loading=!1}))},jobGroupFormat:function(e,t){return this.selectDictLabel(this.dict.type.sys_job_group,e.jobGroup)},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.jobId})),this.single=1!=e.length,this.multiple=!e.length},handleStatusChange:function(e){var t=this,a="0"===e.status?"启用":"停用";this.$modal.confirm('确认要"'+a+'""'+e.jobName+'"定时吗?').then((function(){return m(e.jobId,e.status)})).then((function(){t.$modal.msgSuccess(a+"成功")})).catch((function(){e.status="0"===e.status?"1":"0"}))},handleRun:function(e){var t=this;this.$modal.confirm('确认要立即执行一次"'+e.jobName+'"定时吗?').then((function(){return p(e.jobId,e.jobGroup)})).then((function(){t.$modal.msgSuccess("执行成功")})).catch((function(){}))},handleView:function(e){var t=this;s(e.jobId).then((function(e){t.form=e.data,t.openView=!0}))},handleShowCron:function(){this.expression=this.form.cronExpression,this.openCron=!0},crontabFill:function(e){this.form.cronExpression=e},handleAdd:function(){this.reset(),this.open=!0,this.title="添加定时"},handleCancel:function(){this.open=!1,this.reset()},reset:function(){this.form={jobId:void 0,jobName:void 0,cronExpression:void 0,status:"0",jobGroup:"DEFAULT",misfirePolicy:2,concurrent:1,isAdvance:0,jobType:1,productId:0,productName:"",sceneId:0,alertId:0,actions:""},this.submitButtonLoading=!1,this.timerWeekValue=[1,2,3,4,5,6,7],this.timerTimeValue="",this.actionList=[{id:"",name:"",value:"",valueName:"",type:1,parentId:"",parentName:"",arrayIndex:"",arrayIndexName:"",model:null}],this.resetForm("form")},handleUpdate:function(e){var t=this;this.reset();var a=e.jobId||this.ids;s(a).then((function(e){t.form=e.data,t.actionList=JSON.parse(t.form.actions);for(var a=0;a<t.actionList.length;a++)1==t.actionList[a].type?t.setParentAndModelData(t.actionList[a],t.thingsModel.properties):2==t.actionList[a].type&&t.setParentAndModelData(t.actionList[a],t.thingsModel.functions);if(0==t.form.isAdvance){var i=t.form.cronExpression.substring(12).split(",").map(Number);t.timerWeekValue=i,t.timerTimeValue=t.form.cronExpression.substring(5,7)+":"+t.form.cronExpression.substring(2,4)}t.open=!0,t.title="修改定时"}))},setParentAndModelData:function(e,t){for(var a=0;a<t.length;a++)if(e.parentId==t[a].id){if(e.parentModel=t[a],"object"===e.parentModel.datatype.type)for(var i=0;i<e.parentModel.datatype.params.length;i++)e.id==e.parentModel.datatype.params[i].id&&(e.model=e.parentModel.datatype.params[i]);else if("object"===e.parentModel.datatype.arrayType&&"array"===e.parentModel.datatype.type){-1!=e.id.indexOf("array_")&&(e.id=e.id.substring(9));for(var n=0;n<e.parentModel.datatype.params.length;n++)e.id==e.parentModel.datatype.params[n].id&&(e.model=e.parentModel.datatype.params[n])}else"object"!==e.parentModel.datatype.arrayType&&"array"===e.parentModel.datatype.type?(-1!=e.id.indexOf("array_")&&(e.id=e.id.substring(9)),e.model={datatype:{type:e.parentModel.datatype.arrayType,maxLength:-1,min:-1,max:-1,unit:"无单位"}}):e.model=e.parentModel;break}},handleDelete:function(e){var t=this,a=e.jobId||this.ids;this.$modal.confirm('是否确认删除定时定时编号为"'+a+'"的数据项?').then((function(){return u(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("iot/job/export",Object(o["a"])({},this.queryParams),"job_".concat((new Date).getTime(),".xlsx"))},weekChange:function(e){this.gentCronExpression()},timeChange:function(e){this.gentCronExpression()},customerCronChange:function(e){0==e&&this.gentCronExpression()},gentCronExpression:function(){var e="00",t="00";null!=this.timerTimeValue&&""!=this.timerTimeValue&&(e=this.timerTimeValue.substring(0,2),t=this.timerTimeValue.substring(3));var a="*";this.timerWeekValue.length>0&&(a=this.timerWeekValue.sort()),this.form.cronExpression="0 "+t+" "+e+" ? * "+a},formatCronDisplay:function(e){var t="";if(0==e.isAdvance){var a='<br /><span style="color:#F56C6C">时间 '+e.cronExpression.substring(5,7)+":"+e.cronExpression.substring(2,4)+"</span>",i=e.cronExpression.substring(12);if("1,2,3,4,5,6,7"==i)t="每天 "+a;else{for(var n=i.split(","),o=0;o<n.length;o++)"1"==n[o]?t+="周一、":"2"==n[o]?t+="周二、":"3"==n[o]?t+="周三、":"4"==n[o]?t+="周四、":"5"==n[o]?t+="周五、":"6"==n[o]?t+="周六、":"7"==n[o]&&(t+="周日、");t=t.substring(0,t.length-1)+" "+a}}else t="自定义Cron表达式";return t},formatActionsDisplay:function(e){if(null!=e&&""!=e){for(var t=JSON.parse(e),a="",i=0;i<t.length;i++)t[i].arrayIndexName?a+="".concat(t[i].parentName," >> ").concat(t[i].arrayIndexName," >> ").concat(t[i].name,' <span style="color:#F56C6C"> ').concat(t[i].valueName?t[i].valueName:t[i].value,"</span><br />"):t[i].parentName!==t[i].name?a+="".concat(t[i].parentName," >> ").concat(t[i].name,' <span style="color:#F56C6C">').concat(t[i].valueName?t[i].valueName:t[i].value,"</span><br />"):a+="".concat(t[i].name,' <span style="color:#F56C6C">').concat(t[i].valueName?t[i].valueName:t[i].value,"</span><br />");return""==a?"无":a}},formatArrayIndex:function(e){var t=Object(o["a"])({},e);for(var a in t)t[a]=t[a].map((function(e){if("array"===e.datatype.type){for(var t=[],a=0;a<e.datatype.arrayCount;a++){var i=a>9?String(a):"0"+a;e.datatype.arrayType,t.push({id:i,name:e.name+" "+(a+1)})}e.datatype.arrayModel=t}return e}));return t},handleAddActionItem:function(){this.actionList.push({id:"",name:"",value:"",valueName:"",type:1,parentId:"",parentName:"",arrayIndex:"",arrayIndexName:"",model:null})},handleRemoveActionItem:function(e){this.actionList.splice(e,1)},handleActionTypeChange:function(e,t){this.actionList[t].id="",this.actionList[t].name="",this.actionList[t].value="",this.actionList[t].valueName="",this.actionList[t].parentId="",this.actionList[t].parentName="",this.actionList[t].arrayIndex="",this.actionList[t].arrayIndexName="",this.actionList[t].parentModel=null,this.actionList[t].model=null},handleActionIndexChange:function(e,t){this.actionList[t].arrayIndexName=this.actionList[t].parentModel.datatype.arrayModel.find((function(t){return t.id==e})).name,this.actionList[t].value="","object"===this.actionList[t].parentModel.datatype.arrayType&&(this.actionList[t].id="",this.actionList[t].name="")},handleActionParentModelChange:function(e,t){this.actionList[t].model=null,this.actionList[t].value="",this.actionList[t].arrayIndex="",this.actionList[t].arrayIndexName="";var a=[];1==this.actionList[t].type?a=this.thingsModel.properties:2==this.actionList[t].type&&(a=this.thingsModel.functions);for(var i=0;i<a.length;i++)if(a[i].id==e){this.actionList[t].parentName=a[i].name,this.actionList[t].parentModel=a[i],"object"===a[i].datatype.type||"array"===a[i].datatype.type&&"object"===a[i].datatype.arrayType?(this.actionList[t].id="",this.actionList[t].name=""):"array"===a[i].datatype.type&&"object"!==a[i].datatype.arrayType?(this.actionList[t].id=a[i].id,this.actionList[t].name=a[i].name,this.actionList[t].model={datatype:{type:a[i].datatype.arrayType,maxLength:-1,min:-1,max:-1,unit:"无单位"}}):(this.actionList[t].id=a[i].id,this.actionList[t].name=a[i].name,this.actionList[t].model=a[i]);break}},handleActionModelChange:function(e,t){this.actionList[t].value="";var a=null;"array"!==this.actionList[t].parentModel.datatype.type&&"object"!==this.actionList[t].parentModel.datatype.type||(a=this.actionList[t].parentModel.datatype.params.find((function(t){return t.id==e})),this.actionList[t].name=a.name,this.actionList[t].model=a)},handleSubmitForm:function(){var e=this;this.$refs["form"].validate((function(t){if(t){var a=[];if(0==e.form.isAdvance){if(""==e.timerTimeValue||null==e.timerTimeValue)return void e.$modal.alertError("执行时间不能空");if(null==e.timerWeekValue||""==e.timerWeekValue)return void e.$modal.alertError("请选择要执行的星期")}else if(1==e.form.isAdvance&&""==e.form.cronExpression)return void e.$modal.alertError("cron表达式不能为空");for(var i,n=function(){if(""===e.actionList[o].value)return e.$modal.alertError("执行动作中的选项和值不能为空"),{v:void 0};var t=e.actionList[o];""!=t.arrayIndex?(t.arrayIndex,t.id):t.id;var i="";i="bool"===t.model.datatype.type?1===t.value?t.model.datatype.trueText:t.model.datatype.falseText:"enum"===t.model.datatype.type?t.model.datatype.enumList.find((function(e){return e.value===t.value})).text:"",a[o]={type:t.type,id:t.id,name:t.name,value:t.value,valueName:i,parentId:t.parentId,parentName:t.parentName,arrayIndex:t.arrayIndex,arrayIndexName:t.arrayIndexName,deviceId:e.deviceInfo.deviceId,deviceName:e.deviceInfo.deviceName}},o=0;o<e.actionList.length;o++)if(i=n(),i)return i.v;e.form.actions=JSON.stringify(a),e.form.deviceId=e.deviceInfo.deviceId,e.form.deviceName=e.deviceInfo.deviceName,e.form.serialNumber=e.deviceInfo.serialNumber,e.form.productId=e.deviceInfo.productId,e.form.productName=e.deviceInfo.productName,e.submitButtonLoading=!0,void 0!=e.form.jobId?d(e.form).then((function(){e.$modal.msgSuccess("修改成功"),e.submitButtonLoading=!1,e.open=!1,e.getList()})):c(e.form).then((function(){e.$modal.msgSuccess("新增成功"),e.submitButtonLoading=!1,e.open=!1,e.getList()}))}}))}}},v=h,y=(a("377d"),a("2877")),b=Object(y["a"])(v,i,n,!1,null,"2aeb3c34",null);t["default"]=b.exports},a4a0:function(e,t,a){}}]);