(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-7854de1b"],{
/***/3138:
/***/function(e,t,i){"use strict";
/* harmony import */i("5edd");
/* harmony import */},
/***/"5edd":
/***/function(e,t,i){
// extracted by mini-css-extract-plugin
/***/},
/***/"82ff":
/***/function(e,t,i){"use strict";
/* harmony import */i("a739");
/* harmony import */},
/***/"9cf1":
/***/function(e,t,i){"use strict";
// ESM COMPAT FLAG
i.r(t);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.js
i("a4d3"),i("e01a"),i("b0c0"),i("14d9"),i("d3b7"),i("25f0");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.symbol.description.js
var a=i("456a"),s=(i("ceac"),i("c2f7")),o=i("7424"),d=i("93d6"),l={name:"DisplayModelList",i18n:i("89fe"),data:function(){return{editIndex:0,isEditStatus:0,UserList:[],mockData:[],targetKeys:[],selectDisplayUuid:"",showSearch:!0,addAuthVisible:!1,AddModelForm:this.$form.createForm(this),loading:!1,uploadDisPlayUrl:o.DISPLAYIMAGEUPLOAD,visible:!1,listIndex:-1,pagination:{hideOnSinglePage:!0,showQuickJumper:!0,pageSize:3},modelList:[]}},components:{VueHoverMask:s.a},mounted:function(){},activated:function(){},created:function(){this.getModelList(),this.SystemUserList()},watch:{$route:function(){this.modelList=[],this.SystemUserList(),this.getModelList()}},methods:{filterOption:function(e,t){return t.description.indexOf(e)>-1},handleChange:function(e,t,i){this.targetKeys=[];for(var a=[],s=0;s<i.length;s++)for(var o=0;o<this.UserList.length;o++)i[s]==this.UserList[o].key&&a.push(this.UserList[o]);"right"==t?this.AddModelUser(a):"left"==t&&this.DelModelUser(a),this.targetKeys=e},ShowModelUser:function(e){this.targetKeys=[],this.selectDisplayUuid=e,this.addAuthVisible=!0,this.GetDisplayModelUser()},handleSearch:function(e,t){},updateImageIndex:function(e){this.listIndex=e},beforeUpload:function(){this.$message.loading({content:this.$t("dataModel.opcuaModel.ImportNodeIDLoading"),duration:0})},SystemUserList:function(){var e=this;e.UserList=[],this.messageShowLoad=!0,Object(d.i)().then((function(t){if(0==t.data.code)for(var i=0;i<t.data.List.length;i++){var a={key:i.toString(),title:t.data.List[i].name,uuid:t.data.List[i].uuid,Username:t.data.List[i].Username,chosen:2*Math.random()>1};e.UserList.push(a)}})).finally((function(t){e.messageShowLoad=!1,e.refIconLoading=!1}))},copyFn:function(e){e=location.protocol+"//"+location.hostname+":"+location.port+e;
// createElement() 方法通过指定名称创建一个元素
var t=document.createElement("input");
//val是要复制的内容
t.setAttribute("value",e),document.body.appendChild(t),t.select();try{document.execCommand("copy")&&(document.body.removeChild(t),this.$message.success(this.$t("device.CopySuccess")))}catch(e){this.$message.error(this.$t("device.CopyFailed"))}},afterUpload:function(e){if("done"===e.file.status){var t=e.file.response;this.$message.destroy(),200==t.Code?(this.modelList[this.listIndex].DisplayImage=t.Path,this.$message.success(this.$t("component.systemImageModel.uploadSuccess"))):this.$message.error(this.$t("component.systemImageModel.uploadFailed"))}},doWhat:function(e){0==this.isEditStatus?this.addModel(e):this.editModel()},addModel:function(e){var t=this;e.preventDefault(),this.AddModelForm.validateFields((function(e){if(!e){var i={name:t.AddModelForm.getFieldValue("name"),description:t.AddModelForm.getFieldValue("description")},s=t;Object(a.j)(i).then((function(e){4002==e.data.code?(s.getModelList(),s.visible=!1,s.$message.success(s.$t("displayModel.AddModelSuccess"),3)):4001==e.data.code?s.$message.error(s.$t("displayModel.ModelExist"),3):4003==e.data.code?s.$message.error(s.$t("displayModel.AddModelFailed"),3):4005==e.data.code&&s.$message.error(s.$t("displayModel.AppOutCount"),3)}))}}))},showEditModel:function(e,t){this.visible=!0,this.isEditStatus=1,this.editIndex=t;var i=this;setTimeout((function(){i.AddModelForm.setFieldsValue({name:e.name,uuid:e.uuid,description:e.description})}),300)},editModel:function(){var e=this;this.AddModelForm.validateFields((function(t){if(!t){var i={uuid:e.AddModelForm.getFieldValue("uuid"),updateData:{name:e.AddModelForm.getFieldValue("name"),description:e.AddModelForm.getFieldValue("description")}},s=e;Object(a.l)(i).then((function(e){if(200==e.data.code){s.visible=!1;for(var t=0;t<s.modelList.length;t++)if(s.modelList[t].uuid==i.uuid){s.modelList[t].name=i.updateData.name,s.modelList[t].description=i.updateData.description;break}s.$message.success(s.$t("displayModel.EditModelSuccess"),3)}else 500==e.data.code&&s.$message.error(s.$t("displayModel.EditModelFailed"),3)}))}}))},DelModelUser:function(e){var t=this,i=[];this.messageShowLoad=!0;for(var s=0;s<e.length;s++)i.push(e[s].uuid);var o={displayuuid:this.selectDisplayUuid,users:i};Object(a.b)(o).then((function(e){e.data.code})).finally((function(e){t.messageShowLoad=!1,t.refIconLoading=!1}))},AddModelUser:function(e){var t=this,i={displayuuid:this.selectDisplayUuid,users:e};this.messageShowLoad=!0,Object(a.a)(i).then((function(e){e.data.code})).finally((function(e){t.messageShowLoad=!1,t.refIconLoading=!1}))},GetDisplayModelUser:function(e){var t=this,i={displayuuid:this.selectDisplayUuid};this.messageShowLoad=!0,Object(a.h)(i).then((function(e){if(200==e.data.code)for(var i=0;i<e.data.List.length;i++)for(var a=0;a<t.UserList.length;a++)e.data.List[i].suuid==t.UserList[a].uuid&&t.targetKeys.push(t.UserList[a].key)})).finally((function(e){t.messageShowLoad=!1,t.refIconLoading=!1}))},delModel:function(e,t){var i=this;this.$confirm({title:i.$t("displayModel.DelModelConfirm"),okText:i.$t("displayModel.ConfirmOk"),onOk:function(){var t={displayUid:e};Object(a.k)(t).then((function(e){200==e.data.code?(i.getModelList(),i.$message.success(i.$t("displayModel.DelModelSuccess"),3)):2004==e.data.code?i.$message.error(i.$t("displayModel.modelHavedBind"),3):i.$message.error(i.$t("displayModel.DelModelFailed"),3)}))},cancelText:i.$t("displayModel.ConfirmCancel"),onCancel:function(){}})},handleCancel:function(e){this.visible=!1},getModelList:function(){this.modelList=[];var e=this;this.loading=!0,Object(a.m)({type:1}).then((function(t){if(null!=t.data.list)for(var i=0;i<t.data.list.length;i++){var a={};a.name=t.data.list[i].name,a.description=t.data.list[i].description,a.uuid=t.data.list[i].displayUid,""==t.data.list[i].DisplayImage?a.DisplayImage="":a.DisplayImage=t.data.list[i].DisplayImage,e.modelList.push(a),a={}}e.loading=!1}))}}},n=(i("82ff"),i("2877")),r=Object(n.a)(l,(function(){var e=this,t=e._self._c;return t("div",{staticStyle:{padding:"10px"}},[t("a-card",{staticClass:"project-list",staticStyle:{padding:"0px","min-height":"400px"},attrs:{loading:e.loading,bordered:!1,title:e.$t("displayModel.DisplayList")}},[t("a",{attrs:{slot:"extra"},slot:"extra"},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){e.visible=!0,e.isEditStatus=0}}},[e._v(" "+e._s(e.$t("displayModel.AddModel"))+" ")])],1),t("a-list",{attrs:{grid:{gutter:16,column:3},dataSource:e.modelList,pagination:e.pagination},scopedSlots:e._u([{key:"renderItem",fn:function(i,a){return t("a-list-item",{},[t("a-card",{staticStyle:{width:"300px","border-radius":"2px 2px 0 0"},attrs:{id:"displayCard",hoverable:""},scopedSlots:e._u([{key:"cover",fn:function(){return[t("vue-hover-mask",{scopedSlots:e._u([{key:"action",fn:function(){return[t("div",{staticStyle:{"margin-top":"20%"},on:{click:function(t){return e.updateImageIndex(a)}}},[t("a-upload",{attrs:{progress:"line",name:"file",multiple:!0,action:e.uploadDisPlayUrl+"/"+i.uuid,showUploadList:!1,beforeUpload:e.beforeUpload},on:{change:e.afterUpload}},[t("a-row",[t("span",{staticStyle:{display:"inline-block",height:"50px",width:"50px","border-radius":"50%","font-size":"25px","background-color":"#e5e5e5"}},[t("a-icon",{staticStyle:{color:"#b2b2b2","margin-top":"10px"},attrs:{type:"upload"}})],1)]),t("a-row",[t("span",{staticStyle:{color:"#fff","font-size":"15px"}},[e._v(e._s(e.$t("displayModel.UploadImage")))])])],1)],1)]},proxy:!0}],null,!0)},[t("img",{staticStyle:{width:"298px",height:"220px",cursor:"pointer"},attrs:{src:""==i.DisplayImage?"/static/images/pcDefaultCover.jpg":i.DisplayImage}})])]},proxy:!0},{key:"actions",fn:function(){return[t("router-link",{directives:[{name:"auth",rawName:"v-auth:role",value:"edit",expression:"`edit`",arg:"role"}],staticStyle:{"font-size":"16px"},attrs:{to:"/DisPlayEditor/".concat(i.uuid),target:"_blank"}},[t("a-icon",{attrs:{type:"form"}}),e._v(" "+e._s(e.$t("displayModel.ModelDesign")))],1),t("router-link",{staticStyle:{"font-size":"16px"},attrs:{to:"/AppRun/".concat(i.uuid),target:"_blank"}},[t("a-icon",{attrs:{type:"play-circle"}}),e._v(" "+e._s(e.$t("displayModel.modelRun")))],1),t("a-dropdown",{scopedSlots:e._u([{key:"overlay",fn:function(){return[t("a-menu",[t("a-menu-item",[t("a",{directives:[{name:"auth",rawName:"v-auth:role",value:"edit",expression:"`edit`",arg:"role"}],staticStyle:{color:"#565c64","font-size":"13px"},on:{click:function(t){return e.ShowModelUser(i.uuid)}}},[t("icon-font",{staticStyle:{color:"#565c64","font-size":"15px"},attrs:{type:"icon-authority"}}),e._v(" "+e._s(e.$t("displayModel.Auth")))],1)]),t("a-menu-item",[t("a",{directives:[{name:"auth",rawName:"v-auth:role",value:"edit",expression:"`edit`",arg:"role"}],staticStyle:{color:"#565c64","font-size":"13px"},on:{click:function(t){return e.copyFn("/#/AppRun/".concat(i.uuid))}}},[t("a-icon",{attrs:{type:"share-alt"}}),e._v(" "+e._s(e.$t("displayModel.ModelShare")))],1)]),t("a-menu-item",[t("a",{directives:[{name:"auth",rawName:"v-auth:role",value:"edit",expression:"`edit`",arg:"role"}],staticStyle:{color:"#565c64","font-size":"13px"},on:{click:function(t){return e.showEditModel(i,a)}}},[t("a-icon",{attrs:{type:"edit"}}),e._v(" "+e._s(e.$t("displayModel.ModelEdit")))],1)]),t("a-menu-item",[t("a",{directives:[{name:"auth",rawName:"v-auth:role",value:"delete",expression:"`delete`",arg:"role"}],staticStyle:{color:"#565c64","font-size":"13px"},on:{click:function(t){return e.delModel(i.uuid,a)}}},[t("a-icon",{attrs:{type:"delete"}}),e._v(" "+e._s(e.$t("displayModel.ModelDelete")))],1)])],1)]},proxy:!0}],null,!0)},[t("a",{staticClass:"ant-dropdown-link",staticStyle:{"font-size":"16px"},on:{click:function(e){e.preventDefault()}}},[e._v(" "+e._s(e.$t("displayModel.More"))+" "),t("a-icon",{attrs:{type:"down"}})],1)])]},proxy:!0}],null,!0)},[t("a-card-meta",{attrs:{title:i.name,description:i.description}})],1)],1)}}])})],1),t("a-modal",{attrs:{title:e.$t("displayModel.AddModel")},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[t("template",{slot:"footer"},[t("a-button",{attrs:{type:"primary"},on:{click:e.doWhat}},[e._v(" "+e._s(e.$t("displayModel.ModelSure"))+" ")]),t("a-button",{on:{click:e.handleCancel}},[e._v(" "+e._s(e.$t("displayModel.ModelCancel"))+" ")])],1),t("a-form",{attrs:{form:e.AddModelForm,"label-col":{span:3},"wrapper-col":{span:18}}},[t("a-form-item",{attrs:{label:e.$t("displayModel.ModelName")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:e.$t("displayModel.ModelName")}]}],expression:"['name', { rules: [{ required: true, message: $t('displayModel.ModelName') }] }]"}]})],1),t("a-form-item",{attrs:{label:e.$t("displayModel.ModelDescription")}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["description",{rules:[{required:!0,message:e.$t("displayModel.ModelDescription")}]}],expression:"['description', { rules: [{ required: true, message: $t('displayModel.ModelDescription') }] }]"}]})],1),t("a-form-item",{staticStyle:{display:"none"},attrs:{label:e.$t("displayModel.ModelDescription")}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["uuid",{rules:[{required:!1}]}],expression:"['uuid', { rules: [{ required: false }] }]"}]})],1)],1)],2),t("a-modal",{attrs:{footer:null,title:e.$t("displayModel.AuthManage"),bodyStyle:{height:"450px"}},model:{value:e.addAuthVisible,callback:function(t){e.addAuthVisible=t},expression:"addAuthVisible"}},[t("a-transfer",{attrs:{listStyle:{height:"400px",width:"200px"},titles:[e.$t("displayModel.UserList"),e.$t("displayModel.AuthUserList")],"data-source":e.UserList,"show-search":"","filter-option":e.filterOption,"target-keys":e.targetKeys,render:function(e){return e.title}},on:{change:e.handleChange,search:e.handleSearch}})],1)],1)}),[],!1,null,"159fe140",null)
/* harmony default export */;t.default=r.exports},
/***/a739:
/***/function(e,t,i){
// extracted by mini-css-extract-plugin
/***/},
/***/c2f7:
/***/function(e,t,i){"use strict";
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"411544a2-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/VueHoverMask/VueHoverMask.vue?vue&type=template&id=33dddccd
var a={name:"VueHoverMask",methods:{handleClick:function(){this.$emit("click")}}},s=(i("3138"),i("2877")),o=Object(s.a)(a,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"vue-hover-mask"},[e._t("default"),t("span",{staticClass:"vue-hover-mask_action",on:{click:e.handleClick}},[e._t("action")],2)],2)}),[],!1,null,null,null)
/* harmony default export */;t.a=o.exports}}]);