1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-bc815762"],{1614:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABHNCSVQICAgIfAhkiAAAAWVJREFUSEu91stRwzAQBmBke3SFDogPfp1ICaETqIDQAVQAHUAngQ7CyZZ9cOggXD22xWhGnlE0lrU/zCS3xLv61pvNxuwCfLVte9V13U6lcc5v4zg+IkcwJNjA1jpvj6JkcAabaoVQEriAwagXJGAQuggCGBl1gn/ASKgTrKpqyxh7QaZ4ipVSPuZ5/jqXu9jSpmk2ZtIwDGu7CHV4GIZ7My5Jkg9Xod6hsROFEE/mZ1mWnbz3dQQGfQf6rsNgWZarKIqu1cF9338XRXHwIeZ1CFRYEAStecA4jjGCMiGEWr6XSJX/iD2eG/w5f0vR9uihWemhOSDfn8qB7hAtDt40doLerw/WD/8ZKYSy2uR0oF5tJztSSrmdWW2f8Gqr6/pOSvmGVD/FMsbu0zR9h1qq26eW8A2IfnHON66HK8ofMIIuYqQpBe7Ui5FAFURASRgZ9KBkDAIdKITBoIWqR33nNLom+xf/fdkS6x7eewAAAABJRU5ErkJggg=="},"1aba":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container bgHeight"},[i("el-card",{staticClass:"box-card",attrs:{shadow:"never"}},[i("div",{attrs:{slot:"header"},slot:"header"},[i("span",[t._v("安全生产二级看板设置")])]),t._v(" "),i("div",{staticClass:"radio-Box"},[i("el-radio-group",{on:{change:t.changeType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},t._l(t.typeList,(function(e,n){return i("el-radio-button",{key:n,attrs:{label:e.value}},[t._v(t._s(e.label))])})),1)],1),t._v(" "),i("div",{staticClass:"table-Box"},[i("div",{staticStyle:{width:"50%"}},[i("el-table",{attrs:{border:"",data:t.TrainingTypeListMap[t.type-1].list}},[i("el-table-column",{attrs:{label:"顺序",width:"80",align:"center",index:function(t){return t+1}},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.$index+1)+"\n ")]}}])}),t._v(" "),i("el-table-column",{attrs:{prop:"name",label:1==t.type?"培训类型":2==t.type?"应急演练执行场景":"历史事故事故后果",align:"center"}}),t._v(" "),i("el-table-column",{attrs:{label:"拖拽排序",prop:"isClick",align:"center"}},[[i("span",[i("img",{attrs:{src:n("1614"),alt:""}})])]],2),t._v(" "),i("el-table-column",{attrs:{label:"操作",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(n){return t.deleteItem(e.$index,e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),i("div",{staticClass:"btn-Box"},[i("el-button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("新增")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.save}},[t._v("保存")])],1)],1)])]),t._v(" "),i("el-dialog",{attrs:{"close-on-click-modal":!1,"close-on-press-escape":!1,title:t.dialogTitle,visible:t.addShow,width:"20%"},on:{close:t.addClose}},[i("div",{staticClass:"table-Box"},[1==t.type?i("el-select",{model:{value:t.TrainingType,callback:function(e){t.TrainingType=e},expression:"TrainingType"}},t._l(t.TrainingTypeListFilterList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.name,value:t.id}})})),1):2==t.type?i("el-select",{model:{value:t.TrainingType,callback:function(e){t.TrainingType=e},expression:"TrainingType"}},t._l(t.sceneMenuFilterList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1):i("el-select",{model:{value:t.TrainingType,callback:function(e){t.TrainingType=e},expression:"TrainingType"}},t._l(t.taskType2FilterList,(function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:t.sub}},[t._v("确定")]),t._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:t.addClose}},[t._v("取消")])],1)])],1)},a=[],r=(n("aa18"),n("982e"),n("1bc7"),n("e5b4"),n("a450"),n("90e7")),o=n("2a7b"),s=n("dce5"),c=n("e7e2"),u=n.n(c),l=(n("f753"),{data:function(){return{addShow:!1,taskType2:s["Eb"],taskType2FilterList:[],TrainingTypeListMap:[{list:[]},{list:[]},{list:[]}],TrainingTypeList:[],TrainingTypeListFilterList:[],TrainingType:"",test:"",msg:"",type:1,typeList:[{label:"培训类型",value:1},{label:"应急演练执行场景",value:2},{label:"历史事故事故后果",value:3}],dialogTitle:"新增培训类型",sceneMenuList:[],sceneMenuFilterList:[]}},mounted:function(){this.getSceneMenu(),this.getTrainingTypePageList(),this.initSortable(),this.taskType2FilterList=JSON.parse(JSON.stringify(this.taskType2))},methods:{getSceneMenu:function(){var t=this;Object(r["d"])().then((function(e){0==e.code&&e.data&&(t.sceneMenuList=e.data.map((function(t){return{label:t.sceneName,value:t.id}})))}))},changeType:function(){this.initSortable(),this.TrainingTypeListMap[this.type-1].list=[],this.getSet()},initSortable:function(){var t=document.querySelector(".el-table__body-wrapper tbody"),e=this;u.a.create(t,{onEnd:function(t){e.TrainingTypeListMap[e.type-1].list.splice(t.newIndex,0,e.TrainingTypeListMap[e.type-1].list.splice(t.oldIndex,1)[0]);var n=e.TrainingTypeListMap[e.type-1].list.slice(0);e.TrainingTypeListMap[e.type-1].list=[],e.$nextTick((function(){e.TrainingTypeListMap[e.type-1].list=n,e.postSort(e.TrainingTypeListMap[e.type-1].list)}))}})},save:function(){var t=this,e=JSON.parse(window.localStorage.getItem("memberInfor")),n=JSON.parse(localStorage.getItem("companyInfo")).osId,i={updaterName:e.name,targetIdArray:JSON.stringify(this.TrainingTypeListMap[this.type-1].list.map((function(t){return t.id}))),type:this.type,companyId:n};Object(r["c"])(i).then((function(e){0==e.code&&(t.$message.success("更新成功"),t.getSet())}))},deleteItem:function(t,e){this.TrainingTypeListMap[this.type-1].list.splice(t,1);var n=this.TrainingTypeListMap[this.type-1].list.map((function(t){return t.id}));this.filterTrainingTypeList(1,n),this.$message("操作成功,如要更新数据,请点击保存。")},sub:function(){var t=this;if(this.TrainingType){this.TrainingTypeListMap[this.type-1].list.push({name:1==this.type?this.TrainingTypeList.find((function(e){return e.id==t.TrainingType})).name:2==this.type?this.sceneMenuList.find((function(e){return e.value==t.TrainingType})).label:this.taskType2.find((function(e){return e.value==t.TrainingType})).label,id:this.TrainingType,type:this.type});var e=this.TrainingTypeListMap[this.type-1].list.map((function(t){return t.id}));console.log(e,"list==="),1==this.type?this.filterTrainingTypeList(1,e):3==this.type?this.filterTaskType2(1,e):this.filterSceneMenu(1,e),this.addClose()}else this.$message.error("请选择")},addClose:function(){this.addShow=!1,this.TrainingType=""},getTrainingTypePageList:function(){var t=this;Object(o["f"])({pageSize:-1,pageNumber:1}).then((function(e){0===e.code&&e.data.records.length>0&&(t.TrainingTypeList=e.data.records),setTimeout((function(){t.getSet()}),500)}))},postSort:function(t){var e=t;e.forEach((function(t,e){t.sort=e+1}))},getSet:function(){var t=this,e=JSON.parse(localStorage.getItem("companyInfo")).osId;Object(r["e"])({companyId:e,type:this.type}).then((function(e){0==e.code&&e.data&&e.data.targetIdArray&&"[]"!=e.data.targetIdArray?(e.data.targetIdArray=JSON.parse(e.data.targetIdArray),console.log("设置了内容"),Array.isArray(e.data.targetIdArray)&&e.data.targetIdArray.length>0&&(t.TrainingTypeListMap[t.type-1].list=e.data.targetIdArray.map((function(e){return{name:1==t.type?t.TrainingTypeList.find((function(t){return t.id==e})).name:2==t.type?t.sceneMenuList.find((function(t){return t.value==e})).label:t.taskType2.find((function(t){return t.value==e})).label,id:e,type:t.type}})),console.log(t.TrainingTypeListMap[t.type-1].list,"this.TrainingTypeListMap[this.type - 1].list+++"),console.log(e.data.targetIdArray,"res.data.targetIdArray+++"),1==t.type?t.filterTrainingTypeList(2,e.data.targetIdArray):3==t.type?t.filterTaskType2(2,e.data.targetIdArray):t.filterSceneMenu(2,e.data.targetIdArray))):(1==t.type&&(t.TrainingTypeListFilterList=t.TrainingTypeList,t.TrainingTypeListMap[t.type-1].list=[]),2==t.type&&(t.sceneMenuFilterList=t.sceneMenuList,t.TrainingTypeListMap[t.type-1].list=[]))}))},filterSceneMenu:function(t,e){var n=this;1==t&&1==this.TrainingTypeListMap[this.type-1].list.length?this.sceneMenuFilterList=this.sceneMenuList.filter((function(t){return t.value!==n.TrainingType})):this.sceneMenuFilterList=this.sceneMenuList.filter((function(t){return!e.includes(t.value)}))},filterTaskType2:function(t,e){var n=this;1==t&&1==this.TrainingTypeListMap[this.type-1].list.length?this.taskType2FilterList=this.taskType2.filter((function(t){return t.value!==n.TrainingType})):this.taskType2FilterList=this.taskType2.filter((function(t){return!e.includes(t.value)}))},filterTrainingTypeList:function(t,e){var n=this;1==t&&1==this.TrainingTypeListMap[this.type-1].list.length?this.TrainingTypeListFilterList=this.TrainingTypeList.filter((function(t){return t.id!==n.TrainingType})):this.TrainingTypeListFilterList=this.TrainingTypeList.filter((function(t){return!e.includes(t.id)}))},add:function(){var t=this;this.dialogTitle="新增"+this.typeList.find((function(e){return e.value==t.type})).label,this.addShow=!0,this.TrainingType=""}}}),p=l,d=(n("f266"),n("829d")),y=Object(d["a"])(p,i,a,!1,null,"0c652b55",null);e["default"]=y.exports},"2a7b":function(t,e,n){"use strict";n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return r})),n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return s})),n.d(e,"f",(function(){return c})),n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return l})),n.d(e,"e",(function(){return p}));var i=n("b775");function a(t){return Object(i["a"])({url:"/hakocompany/TrainingRecord/pageList",method:"post",data:t})}function r(t){return Object(i["a"])({url:"/hakocompany/TrainingRecord/create",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/hakocompany/TrainingRecord/update",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/hakocompany/TrainingRecord/updateStatus",method:"post",data:t})}function c(t){return Object(i["a"])({url:"/hakocompany/TrainingType/pageList",method:"post",data:t})}function u(t){return Object(i["a"])({url:"/hakocompany/AccidentPastRecords/companyTotal",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/hakocompany/EmergencyPlanExecuteRecord/companyTotal",method:"post",data:t})}function p(t){return Object(i["a"])({url:"/hakocompany/TrainingType/companyTotal",method:"post",data:t})}},"5fe7":function(t,e,n){},"90e7":function(t,e,n){"use strict";n.d(e,"g",(function(){return a})),n.d(e,"m",(function(){return r})),n.d(e,"f",(function(){return o})),n.d(e,"l",(function(){return s})),n.d(e,"h",(function(){return c})),n.d(e,"n",(function(){return u})),n.d(e,"a",(function(){return l})),n.d(e,"b",(function(){return p})),n.d(e,"c",(function(){return d})),n.d(e,"e",(function(){return y})),n.d(e,"d",(function(){return f})),n.d(e,"i",(function(){return g})),n.d(e,"j",(function(){return h})),n.d(e,"o",(function(){return T})),n.d(e,"k",(function(){return m}));var i=n("b775");function a(t){return Object(i["a"])({url:"/hakocompany/DeductionInfo/findById",method:"post",data:t})}function r(t){return Object(i["a"])({url:"/hakocompany/DeductionInfo/update",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/hakocompany/CollectionInfoApi/findById",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/hakocompany/CollectionInfoApi/update",method:"post",data:t})}function c(t){return Object(i["a"])({url:"/hakocompany/ChargePushConfigApi/findById",method:"post",data:t})}function u(t){return Object(i["a"])({url:"/hakocompany/ChargePushConfigApi/update",method:"post",data:t})}function l(t){return Object(i["a"])({url:"/company/ProjectSatisfactionConfig/pageList",method:"post",data:t})}function p(t){return Object(i["a"])({url:"/company/ProjectSatisfactionConfig/update",method:"post",data:t})}function d(t){return Object(i["a"])({url:"/hakocompany/CockpitConfig/create",method:"post",data:t})}function y(t){return Object(i["a"])({url:"/hakocompany/CockpitConfig/findByCompanyIdAndType",method:"post",data:t})}function f(t){return Object(i["a"])({url:"/hakocompany/CockpitConfig/sceneMenuList",method:"post",data:t})}function g(t){return Object(i["a"])({url:"/hakocompany/ProjectConfig/pageList",method:"post",data:t})}function h(t){return Object(i["a"])({url:"/hakocompany/ProjectConfig/updateExponentByProjectUuid",method:"post",data:t})}function T(t,e){return Object(i["a"])({url:"/oss/upload",isFile:!0,isReturnResponse:!0,headers:{"Content-Type":"multipart/form-data;charset=UTF-8"},method:"post",data:t,onUploadProgress:e&&e.onUploadProgress})}function m(t){return Object(i["a"])({url:"/hakocompany/ProjectConfig/updateVisitPollRateByProjectUuid",method:"post",data:t})}},f266:function(t,e,n){"use strict";n("5fe7")}}]); |