Your Name
2022-09-29 6f954f70f54e492157b97db314eaaaeb12192580
1
(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-3830","chunk-1c22"],{"6dTo":function(t,e,r){"use strict";r.r(e);var n=r("cLjf"),o=r.n(n),i=r("hDQ3"),a=r.n(i),s=r("omC7"),c=r.n(s),l=r("iDGX"),u={name:"SafetyActionDialog",data:function(){return{title:"",disabled:!1,personTime:!1,departmentList:[],isShowSafetyActionDialog:!1,workTypeList:[{id:1,name:"动火作业"},{id:2,name:"受限空间作业"},{id:3,name:"吊装作业"},{id:4,name:"动土作业"},{id:5,name:"断路作业"},{id:6,name:"高处作业"},{id:7,name:"临时用电作业"},{id:8,name:"盲板抽堵作业"}],typeList:[{id:1,name:"选择"},{id:2,name:"填空"}],typeTwoList:[{id:1,name:"是"},{id:2,name:"否"}],safetyActionForm:{workType:null,type:null,correctVal:null,context:null},safetyActionFormRules:{workType:[{required:!0,message:"请选择作业类型",trigger:"change"}],type:[{required:!0,message:"请选择措施类型",trigger:"change"}],correctVal:[{required:!0,message:"请选择正确值",trigger:"change"}],context:[{required:!0,message:"请填写措施内容",trigger:"blur"}]}}},methods:{showSafetyActionDialog:function(t,e,r){var n=this;this.isShowSafetyActionDialog=!0,this.departmentList=r,this.$nextTick(function(){n.$refs.safetyActionFormRef.clearValidate()}),"新增"===t?(this.disabled=!0,this.personTime=!1,this.title="新增安全措施",this.safetyActionForm={workType:null,type:null,correctVal:null,context:null}):"查看"===t?(this.disabled=!1,this.personTime=!0,this.title="查看安全措施",this.safetyActionForm=JSON.parse(c()(e))):(this.disabled=!0,this.personTime=!1,this.title="修改安全措施",this.safetyActionForm=JSON.parse(c()(e)))},submitSafetyAction:function(){var t=this;this.$refs.safetyActionFormRef.validate(function(){var e=a()(o.a.mark(function e(r){var n,i;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=14;break}if("新增安全措施"!==t.title){e.next=8;break}return e.next=4,Object(l.a)().addSafetyAction(t.safetyActionForm);case 4:"200"===(n=e.sent).data.code?(t.$message({type:"success",message:"安全措施新增成功",duration:2e3}),t.isShowSafetyActionDialog=!1,context.emit("refreshSafetyAction")):t.$message({type:"warning",message:n.data.msg}),e.next=12;break;case 8:return e.next=10,Object(l.a)().modSafetyAction(t.safetyActionForm);case 10:"200"===(i=e.sent).data.code?(t.$message({type:"success",message:"安全措施改成功",duration:2e3}),t.isShowSafetyActionDialog=!1,context.emit("refreshSafetyAction")):t.$message({type:"warning",message:i.data.msg});case 12:e.next=15;break;case 14:t.$message({type:"warning",message:"请完善基本信息"});case 15:case"end":return e.stop()}},e,t)}));return function(t){return e.apply(this,arguments)}}())}}},f=(r("X/1o"),r("ZrdR")),h=Object(f.a)(u,function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"system-add-menu-container"},[r("el-dialog",{attrs:{title:t.title,visible:t.isShowSafetyActionDialog,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(e){t.isShowSafetyActionDialog=e}}},[r("el-form",{ref:"safetyActionFormRef",attrs:{model:t.safetyActionForm,rules:t.safetyActionFormRules,size:"default","label-width":"120px"}},[r("el-row",{attrs:{gutter:35}},[r("el-col",{staticClass:"mb20",attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[r("el-form-item",{attrs:{label:"作业类型",prop:"workType"}},[r("el-select",{staticClass:"input-add",attrs:{disabled:!t.disabled,placeholder:"请选择作业类型",filterable:"",clearable:""},model:{value:t.safetyActionForm.workType,callback:function(e){t.$set(t.safetyActionForm,"workType",e)},expression:"safetyActionForm.workType"}},t._l(t.workTypeList,function(t){return r("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1)],1),t._v(" "),r("el-col",{staticClass:"mb20",attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[r("el-form-item",{attrs:{label:"措施类型",prop:"type"}},[r("el-select",{staticClass:"input-add",attrs:{disabled:!t.disabled,placeholder:"请选择措施类型",clearable:"",filterable:""},model:{value:t.safetyActionForm.type,callback:function(e){t.$set(t.safetyActionForm,"type",e)},expression:"safetyActionForm.type"}},t._l(t.typeList,function(t){return r("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1)],1),t._v(" "),1===t.safetyActionForm.type?r("el-col",{staticClass:"mb20",attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[r("el-form-item",{attrs:{label:"正确值",prop:"correctVal"}},[r("el-select",{staticClass:"input-add",attrs:{disabled:!t.disabled,placeholder:"请选择正确值",clearable:"",filterable:""},model:{value:t.safetyActionForm.correctVal,callback:function(e){t.$set(t.safetyActionForm,"correctVal",e)},expression:"safetyActionForm.correctVal"}},t._l(t.typeTwoList,function(t){return r("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}))],1)],1):t._e(),t._v(" "),r("el-col",{staticClass:"mb20",attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[r("el-form-item",{attrs:{label:"措施内容",prop:"context"}},[r("el-input",{staticClass:"input-add",attrs:{disabled:!t.disabled,rows:3,type:"textarea",placeholder:"请输入描述"},model:{value:t.safetyActionForm.context,callback:function(e){t.$set(t.safetyActionForm,"context","string"==typeof e?e.trim():e)},expression:"safetyActionForm.context"}})],1)],1)],1)],1),t._v(" "),[r("div",{directives:[{name:"show",rawName:"v-show",value:t.disabled,expression:"disabled"}],staticClass:"dialog-footer",attrs:{align:"right"}},[r("el-button",{attrs:{size:"default"},on:{click:function(e){t.isShowSafetyActionDialog=!t.isShowSafetyActionDialog}}},[t._v("取 消")]),t._v(" "),r("el-button",{attrs:{type:"primary",size:"default"},on:{click:t.submitSafetyAction}},[t._v("确 定")])],1)]],2)],1)},[],!1,null,"1acb1f7d",null);h.options.__file="safetyActionDialog.vue";e.default=h.exports},"X/1o":function(t,e,r){"use strict";var n=r("agYO");r.n(n).a},agYO:function(t,e,r){},cLjf:function(t,e,r){t.exports=r("xOJF")},hDQ3:function(t,e,r){"use strict";e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(r("Asgo"));e.default=function(t){return function(){var e=t.apply(this,arguments);return new n.default(function(t,r){return function o(i,a){try{var s=e[i](a),c=s.value}catch(t){return void r(t)}if(!s.done)return n.default.resolve(c).then(function(t){o("next",t)},function(t){o("throw",t)});t(c)}("next")})}}},iDGX:function(t,e,r){"use strict";r.d(e,"a",function(){return i});var n=r("t3Un"),o=r("X4fA");function i(){return{getSafetyActionList:function(t){return Object(n.a)({headers:{Authorization:Object(o.a)()},url:"http://222.92.213.22:8006/zhongtai/rule/measure/page/list",method:"post",data:t})},addSafetyAction:function(t){return Object(n.a)({headers:{Authorization:Object(o.a)()},url:"http://222.92.213.22:8006/zhongtai/rule/measure/save",method:"post",data:t})},modSafetyAction:function(t){return Object(n.a)({headers:{Authorization:Object(o.a)()},url:"http://222.92.213.22:8006/zhongtai/rule/measure/mod",method:"post",data:t})},deleteSafetyAction:function(t){return Object(n.a)({headers:{Authorization:Object(o.a)()},url:"http://222.92.213.22:8006/zhongtai/rule/measure/delete",method:"post",data:t})},getAllSafetyActionList:function(t){return Object(n.a)({headers:{Authorization:Object(o.a)()},url:"http://222.92.213.22:8006/zhongtai/rule/measure/list",method:"post",data:t})}}}},k4Ii:function(t,e){!function(e){"use strict";var r,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",l="object"==typeof t,u=e.regeneratorRuntime;if(u)l&&(t.exports=u);else{(u=e.regeneratorRuntime=l?t.exports:{}).wrap=w;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",m={},y={};y[a]=function(){return this};var g=Object.getPrototypeOf,v=g&&g(g(T([])));v&&v!==n&&o.call(v,a)&&(y=v);var b=k.prototype=A.prototype=Object.create(y);L.prototype=b.constructor=k,k.constructor=L,k[c]=L.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===L||"GeneratorFunction"===(e.displayName||e.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},u.awrap=function(t){return{__await:t}},S(F.prototype),F.prototype[s]=function(){return this},u.AsyncIterator=F,u.async=function(t,e,r,n){var o=new F(w(t,e,r,n));return u.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},u.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},u.values=T,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return s.type="throw",s.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),j(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;j(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),m}}}function w(t,e,r,n){var o=e&&e.prototype instanceof A?e:A,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return D()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=_(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=x(t,e,r);if("normal"===c.type){if(n=r.done?p:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function x(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function A(){}function L(){}function k(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function F(t){var e;this._invoke=function(r,n){function i(){return new Promise(function(e,i){!function e(r,n,i,a){var s=x(t[r],t,n);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&o.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){c.value=t,i(c)},a)}a(s.arg)}(r,n,e,i)})}return e=e?e.then(i,i):i()}}function _(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,_(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=x(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,m;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}return{next:D}}function D(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},xOJF:function(t,e,r){var n=function(){return this}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=r("k4Ii"),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}}}]);