Your Name
2022-10-25 df7046445cfdb39857f9fe1dc747ab04a61c860e
1
(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-e39a"],{"3YdI":function(e,t,a){"use strict";a.d(t,"c",function(){return o}),a.d(t,"b",function(){return i}),a.d(t,"a",function(){return r});var n=a("t3Un"),l=a("Ja5N");function o(){return Object(n.a)({headers:{token:Object(l.a)().token,verify:Object(l.a)().verify},url:"/taboi/download/standard_template",method:"get",responseType:"arraybuffer"})}function i(e){return Object(n.a)({headers:{token:Object(l.a)().token,verify:Object(l.a)().verify},url:"/taboi/excel/standard_import_do",method:"post",data:e})}function r(e){return Object(n.a)({headers:{token:Object(l.a)().token,verify:Object(l.a)().verify},url:"/taboi/danger/stand_list?standardType="+e,method:"GET"})}},Ja5N:function(e,t,a){"use strict";var n=a("jJIE"),l=a.n(n),o={username:"admin",password:"ahb9014",key:"TwIMUKr3xyjWuvZfgqwb"};a.d(t,"a",function(){return c});var i="hiddenDangerToken",r="hiddenDangerVerify",s="hiddenDangerUsername",d="hiddenDangerPassword";function c(){var e=l.a.get(i),t=l.a.get(r);return null!=e&&""!=e&&"undefined"!=e&&null!=t&&""!=t&&"undefined"!=t||function(){var e=l.a.get(s)?l.a.get(s):o.username,t=l.a.get(d)?l.a.get(d):o.password;$.ajax({url:"/taboi/account/login_do?username="+e+"&password="+t+"&key="+o.key,type:"GET",contentType:"multipart/form-data",async:!1,success:function(e){1==e.ok&&(l.a.set(i,e.data.token),l.a.set(r,e.data.verify))}})}(),{token:l.a.get(i),verify:l.a.get(r)}}},XEIX:function(e,t,a){"use strict";a.r(t);var n=a("3YdI"),l={name:"index",data:function(){return{data:[{id:1,label:"隐患排查清单",icon:"el-icon-folder",click:!0,children:[{id:4,label:"现场管理清单",icon:"el-icon-folder",click:!0},{id:5,label:"基础管理清单",icon:"el-icon-success",click:!0}]}],defaultProps:{children:"children",label:"label"},templateName:"",file:null,fullscreenLoading:!1}},mounted:function(){this.getAllColumns()},methods:{handleDragStart:function(e,t){console.log("drag start",e)},handleDragEnter:function(e,t,a){console.log("tree drag enter: ",t.label)},handleDragLeave:function(e,t,a){console.log("tree drag leave: ",t.label)},handleDragOver:function(e,t,a){console.log("tree drag over: ",t.label)},handleDragEnd:function(e,t,a,n){console.log("tree drag end: ",t&&t.label,a)},handleDrop:function(e,t,a,n){console.log("tree drop: ",t.label,a)},allowDrop:function(e,t,a){return"二级 3-1"!==t.data.label||"inner"!==a},allowDrag:function(e){return-1===e.data.label.indexOf("三级 3-2-2")},getAllColumns:function(){this.$route.query},handleChange:function(e,t){this.fileList=t.slice(-3)},clickType:function(e){e.click&&(this.templateName=e.label)},downTemplate:function(){Object(n.c)().then(function(e){var t=new Blob([e.data]),a=document.createElement("a"),n=window.URL.createObjectURL(t);a.href=n,a.download="隐患排查标准清单模板.xlsx",document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(n)}).catch(function(e){console.log(e)})},importData:function(){null!=this.file?(console.log(this.file),this.fullscreenLoading=!0,this.uploadByJsqd(this.file)):this.$message({type:"warning",message:"请添加Excel附件",duration:3e3})},changeFile:function(e){this.file=event.target.files[0]},uploadByJsqd:function(e){var t=this,a=new FormData;a.append("file",e),a.append("standardType",this.templateName),Object(n.b)(a).then(function(e){t.fullscreenLoading=!1,e.data.ok?(t.$message({type:"success",message:e.data.msg,duration:3e3}),t.getPageList()):t.$message({type:"error",message:e.data.msg,duration:3e3})})},preview:function(){this.$router.push({path:"/preview",query:{templateName:this.templateName}})}}},o=(a("ZgrX"),a("ZrdR")),i=Object(o.a)(l,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.fullscreenLoading,expression:"fullscreenLoading"}],staticClass:"whole"},[a("div",{staticClass:"left-tree"},[a("el-tree",{attrs:{data:e.data,"node-key":"id","default-expand-all":"",draggable:"","allow-drop":e.allowDrop,"allow-drag":e.allowDrag},on:{"node-click":e.clickType,"node-drag-start":e.handleDragStart,"node-drag-enter":e.handleDragEnter,"node-drag-leave":e.handleDragLeave,"node-drag-over":e.handleDragOver,"node-drag-end":e.handleDragEnd,"node-drop":e.handleDrop},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.node,l=t.data;return a("span",{staticClass:"slot-t-node"},[[l.ChildItems&&l.ChildItems.length?a("i",{class:{"el-icon-folder":!n.expanded,"el-icon-folder-opened":n.expanded},staticStyle:{color:"#409eff"}}):a("i",{staticClass:"el-icon-folder-add",staticStyle:{color:"#EC933A"}}),e._v(" "),a("span",[e._v(e._s(n.label))])]],2)}}])})],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:null!=e.templateName&&""!=e.templateName,expression:"templateName!=null && templateName !=''"}],staticClass:"right-table"},[a("table",{staticStyle:{background:"#FFFFFF",width:"100%"},attrs:{border:"1"}},[a("tr",[a("td",{staticClass:"table_td",staticStyle:{"text-align":"right"}},[e._v("模板名称:")]),e._v(" "),a("td",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.templateName,expression:"templateName"}],staticClass:"input",staticStyle:{"line-height":"24px",height:"24px"},domProps:{value:e.templateName},on:{input:function(t){t.target.composing||(e.templateName=t.target.value)}}})])]),e._v(" "),a("tr",[a("td",{staticClass:"table_td",staticStyle:{"text-align":"right"}},[e._v("模板导入:")]),e._v(" "),a("td",{staticStyle:{"line-height":"24px",height:"24px"}},[a("input",{staticClass:"input",staticStyle:{color:"red"},attrs:{type:"file",accept:".xlsx,.xls"},on:{change:e.changeFile}}),e._v(" "),a("button",{staticClass:"btn",staticStyle:{"margin-left":"120px"},on:{click:e.importData}},[e._v("导入\n                    ")]),e._v(" "),a("button",{staticClass:"btn",on:{click:e.downTemplate}},[e._v("下载模板")])])]),e._v(" "),a("tr",{staticClass:"table_tr"},[a("td",{attrs:{colspan:"4",align:"center"}},[a("button",{staticClass:"btn",on:{click:e.preview}},[e._v("预览")])])])])])])},[],!1,null,"63dc6391",null);i.options.__file="index.vue";t.default=i.exports},ZgrX:function(e,t,a){"use strict";var n=a("nQ5m");a.n(n).a},nQ5m:function(e,t,a){}}]);