You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 line
35 KiB

  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-edf65c70"],{"076e":function(e,t,n){},"15fd":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n("a4d3"),n("c975"),n("b64b");function r(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}function a(e,t){if(null==e)return{};var n,a,i=r(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)n=s[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},"45fc":function(e,t,n){"use strict";var r=n("23e7"),a=n("b727").some,i=n("a640"),s=n("ae40"),o=i("some"),c=s("some");r({target:"Array",proto:!0,forced:!o||!c},{some:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"4c3b":function(e,t,n){"use strict";var r=n("f111"),a=n.n(r);a.a},"6c6e":function(e,t,n){"use strict";var r=n("076e"),a=n.n(r);a.a},"74d3":function(e,t,n){},b0f9:function(e,t,n){"use strict";n.d(t,"o",(function(){return i})),n.d(t,"m",(function(){return o})),n.d(t,"t",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"n",(function(){return m})),n.d(t,"q",(function(){return h})),n.d(t,"f",(function(){return v})),n.d(t,"s",(function(){return g})),n.d(t,"l",(function(){return w})),n.d(t,"k",(function(){return I})),n.d(t,"b",(function(){return j})),n.d(t,"p",(function(){return k})),n.d(t,"j",(function(){return T})),n.d(t,"h",(function(){return M})),n.d(t,"i",(function(){return D})),n.d(t,"a",(function(){return P})),n.d(t,"g",(function(){return $})),n.d(t,"c",(function(){return z})),n.d(t,"e",(function(){return B})),n.d(t,"r",(function(){return A}));n("4de4"),n("96cf");var r=n("1da1"),a=n("b775");function i(){return s.apply(this,arguments)}function s(){return s=Object(r["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryTemplateList");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),s.apply(this,arguments)}function o(e){return c.apply(this,arguments)}function c(){return c=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryTemplateByCompanyId",{companyId:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)}function u(e){return l.apply(this,arguments)}function l(){return l=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/uploadingXmind",t,{headers:{"Content-Type":"application/octet-stream"}});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),l.apply(this,arguments)}function d(e){return p.apply(this,arguments)}function p(){return p=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/createTemplate",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),p.apply(this,arguments)}function m(e){return f.apply(this,arguments)}function f(){return f=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryTemplateByTemplateId",{id:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),f.apply(this,arguments)}function h(e){return b.apply(this,arguments)}function b(){return b=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryTemplateQuoteCountByTempId",{templateId:t});case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)}))),b.apply(this,arguments)}function v(e){return y.apply(this,arguments)}function y(){return y=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/deleteTemplateByTemplateId",{id:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),y.apply(this,arguments)}function g(e){return _.apply(this,arguments)}function _(){return _=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/updateTemplate",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),_.apply(this,arguments)}function w(e){return x.apply(this,arguments)}function x(){return x=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryNestTemplateByTemplateId",{id:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),x.apply(this,arguments)}function I(e){return O.apply(this,arguments)}function O(){return O=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryNestTemplateIdByProjectId",{projectId:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),O.apply(this,arguments)}function j(e){return C.apply(this,arguments)}function C(){return C=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/connectNestTemplateFolder",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),C.apply(this,arguments)}function k(e){return N.apply(this,arguments)}function N(){return N=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryTemplateNodeByTemplateId",{templateId:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}function T(e,t,n){return R.apply(this,arguments)}function R(){return R=Object(r["a"])(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryFileExchange",{currentTemplateId:t,currentNodeId:n,nestedNodeId:r});case 2:return i=e.sent,e.abrupt("return",Object(a["c"])(i));case 4:case"end":return e.stop()}}),e)}))),R.apply(this,arguments)}function M(e){return L.apply(this,arguments)}function L(){return L=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/fileExchange",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),L.apply(this,arguments)}function D(e,t){return E.apply(this,arguments)}function E(){return E=Object(r["a"])(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/queryAllTemplateNodeModelFile",{templateNodeId:t,companyId:n?void 0:"0"});case 2:return r=e.sent,n&&r.Data&&(r.Data=r.Data.filter((function(e){return"0"===e.CompanyId||e.CompanyId===n}))),e.abrupt("return",Object(a["c"])(r));case 5:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)}function P(e){return S.apply(this,arguments)}function S(){return S=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/addTemplateNodeModelFile",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),S.apply(this,arguments)}function $(e){return F.apply(this,arguments)}function F(){return F=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/deleteTemplateNodeModelFile",{id:t});case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),F.apply(this,arguments)}function z(e){return q.apply(this,arguments)}function q(){return q=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/createNestedRelevance",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),q.apply(this,arguments)}function B(e){return V.apply(this,arguments)}function V(){return V=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/deleteNestedRelevance",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),V.apply(this,arguments)}function A(e){return U.apply(this,arguments)}function U(){return U=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("template/renameTemplate",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),U.apply(this,arguments)}},b3b1:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));n("96cf");var r=n("1da1"),a=n("b775");function i(){return s.apply(this,arguments)}function s(){return s=Object(r["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("industry/queryAllIndustry");case 2:return t=e.sent,e.abrupt("return",t.Data||[]);case 4:case"end":return e.stop()}}),e)}))),s.apply(this,arguments)}function o(e){return c.apply(this,arguments)}function c(){return c=Object(r["a"])(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(a["b"])("industry/renameIndustry",t);case 2:return n=e.sent,e.abrupt("return",Object(a["c"])(n));case 4:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)}},ccf7:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"template_detail"},[n("app-header",{attrs:{theme:"basis",showBackBtn:!0,backBtnTitle:"返回"},scopedSlots:e._u([{key:"center",fn:function(){return[e._v(e._s(e.templateName))]},proxy:!0}])}),n("main",{staticClass:"template_detail_main"},[n("div",{staticClass:"template_detail_main_left"},[n("div",{staticClass:"nav_subtitle"},[e._v("模板概况")]),n("div",{staticClass:"nav_list_group"},[n("div",{staticClass:"nav_list_item",class:{item_active:"template"===e.viewType},on:{click:function(t){t.stopPropagation(),e.viewType="template"}}},[e._v("模板结构")]),n("div",{staticClass:"nav_list_item",class:{item_active:"info"===e.viewType},on:{click:function(t){t.stopPropagation(),e.viewType="info"}}},[e._v("模板信息")]),n("div",{staticClass:"nav_list_item",class:{item_active:"matrix"===e.viewType},on:{click:function(t){t.stopPropagation(),e.viewType="matrix"}}},[e._v("文件交换")])]),n("div",{staticClass:"nav_subtitle"},[e._v("细化")]),n("div",{staticClass:"nav_list_group"},[n("div",{staticClass:"nav_list_item",class:{item_active:"files"===e.viewType},on:{click:function(t){t.stopPropagation(),e.viewType="files"}}},[e._v("管理样板文件")])]),n("div",{staticClass:"board"},[n("div",{staticClass:"board-item"},[n("span",[e._v("模板使用数")]),n("span",[e._v(e._s(0===e.templateApplyCount||e.templateApplyCount?e.templateApplyCount:""))])]),n("div",{staticClass:"board-item"},[n("span",[e._v("启用模板")]),n("el-switch",{attrs:{value:0===e.templateInfo.disable},on:{change:function(t){return e.toggleTemplateState("disable")}}})],1),n("div",{staticClass:"board-item"},[n("span",[e._v("锁定模板")]),n("el-switch",{attrs:{value:1===e.templateInfo.locked},on:{change:function(t){return e.toggleTemplateState("locked")}}})],1)]),n("div",{staticClass:"nav_list_group bottom"},[n("div",{staticClass:"nav_list_item",on:{click:function(t){return t.stopPropagation(),e.deleteTemplate(t)}}},[e._v("删除模板"),n("i",{staticClass:"item_icon el-icon-delete-solid"})])])]),n("div",{staticClass:"template_detail_main_right"},["template"===e.viewType?n("nodes-viewer",{staticClass:"viewer",attrs:{node:e.node}}):e._e(),"info"===e.viewType?n("info",{staticClass:"content_info",attrs:{templateId:e.templateId,templateInfo:e.templateInfo},on:{"info-change":e.onInfoChange}}):e._e(),"files"===e.viewType?n("template-files",{staticClass:"content_files",attrs:{nodeList:e.plainNodeList,templateId:e.templateId,companyId:e.companyId}}):e._e(),"matrix"===e.viewType?n("matrix",{staticClass:"content_files"}):e._e()],1)])],1)},a=[],i=(n("4160"),n("d81d"),n("b0c0"),n("d3b7"),n("3ca3"),n("159b"),n("ddb0"),n("ade3")),s=n("5530"),o=n("3835"),c=(n("96cf"),n("1da1")),u=n("01a8"),l=n("de58"),d=n("b0f9"),p=n("3de1"),m=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"template_info_popup"},[n("div",{staticClass:"popup_head"},[n("i",{staticClass:"popup_head_icon font_family icon-gerenshezhi"}),n("div",{staticClass:"popup_head_center"},[e._v("模板信息")]),n("div",{staticClass:"popup_head_buttons"},[e.isEdit?[n("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.modifyTemplate}},[e._v("保存")]),n("el-button",{on:{click:e.cancelEdit}},[e._v("取消")])]:n("el-button",{attrs:{type:"primary"},on:{click:function(t){e.isEdit=!0}}},[e._v("编辑")])],2)]),n("el-form",{ref:"form",attrs:{model:e.formData,"label-width":"120px","label-position":"left",size:"small",rules:e.templateRules,"hide-required-asterisk":""}},[n("el-form-item",{attrs:{label:"模板名称",prop:"tempName"}},[e.isEdit?n("el-input",{attrs:{placeholder:"模板名称"},model:{value:e.formData.tempName,callback:function(t){e.$set(e.formData,"tempName",t)},expression:"formData.tempName"}}):n("span",[e._v(e._s(e.templateInfo.tempName))])],1),n("el-form-item",{attrs:{label:"行业",prop:"industry"}},[n("span",[e._v(e._s(e.mainIndustry))])]),n("el-form-item",{attrs:{label:"细分行业"}},[n("span",[e._v(e._s(e.customIndustry))])]),n("el-form-item",{attrs:{label:"介绍"}},[e.isEdit?n("el-input",{attrs:{placeholder:"请输入模板简介"},model:{value:e.formData.introduce,callback:function(t){e.$set(e.formData,"introduce",t)},expression:"formData.introduce"}}):n("span",[e._v(e._s(e.templateInfo.introduce))])],1),n("div",{staticClass:"form-subtitle"},[e._v("模板自定义字段")]),n("div",{staticClass:"divider"}),n("div",{staticClass:"properties-container"},[e._l(e.formData.properties,(function(t){return n("el-form-item",{key:t.Id,attrs:{label:"自定义字段"}},[e.isEdit?n("el-input",{staticClass:"inp-with-outside-suffix",attrs:{autofocus:""},model:{value:t.propertyName,callback:function(n){e.$set(t,"propertyName",n)},expression:"property.propertyName"}}):e._e(),e.isEdit?n("i",{staticClass:"el-icon-delete",attrs:{title:"删除"},on:{click:function(n){return e.removeProperty(t,e.formData)}}}):n("span",[e._v(e._s(t.propertyName))])],1)})),e.isEdit?n("el-form-item",{attrs:{label:"字段"}},[n("el-button",{on:{click:function(t){return e.addProperty(e.formData)}}},[e._v("新增填写项目")])],1):e._e()],2)],1)],1)},f=[],h=(n("99af"),n("4de4"),n("a15b"),n("fb6a"),n("15fd")),b=n("2ef0"),v=n("b3b1"),y={props:{templateInfo:{type:Object,default:function(){return{}}}},data:function(){return{isEdit:!1,formData:Object(b["cloneDeep"])(this.templateInfo),industryOptions:[],loading:!1,mapIndustryCodeToData:null,mapIndustryCodeToName:{},templateRules:{tempName:[{required:!0,message:"请输入模板名称",trigger:["blur","change"]}],industry:[{required:!0,message:" ",trigger:["blur","change"]}]}}},mounted:function(){this.fetchIndustryDict()},watch:{templateInfo:function(e){this.formData=Object(b["cloneDeep"])(e)}},computed:{mainIndustry:function(){var e=Object(o["a"])(this.templateInfo.industry,2),t=e[0],n=e[1],r=this.mapIndustryCodeToName;return"".concat(r[t]||""," / ").concat(r[n]||"")},customIndustry:function(){var e=this.templateInfo.customCode,t=this.mapIndustryCodeToData;if(!t)return"";if(!e||"0"===e)return"";var n=t[e],r="";if(4===n.level){var a=t[n.parentId];r="".concat(a.label," / ")}return"".concat(r).concat(n.label)}},methods:{cancelEdit:function(){this.isEdit=!1,this.formData=Object(b["cloneDeep"])(this.templateInfo)},modifyTemplate:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(c["a"])(regeneratorRuntime.mark((function t(n){var r,a,i,c,u,l,m,f,b,v,y,g,_;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:return r=e.formData,a=r.industry,i=r.properties,c=r.indLevel3,u=r.indLevel4,l=Object(h["a"])(r,["industry","properties","indLevel3","indLevel4"]),m=e.isEdit,f=m?"编辑":"创建",b=Object(o["a"])(a,2),v=b[0],y=b[1],g={ChildIndustry:[c,u].filter((function(e){return e})).join(","),Templepeoperty:i.map((function(e){return e.propertyName})).join(","),Temple:Object(s["a"])(Object(s["a"])({CompanyId:e.companyId},Object(p["b"])(l)),{},{FirstIndustryId:v,DetailIndustryId:y})},e.loading=!0,t.next=10,m?d["s"](g):d["d"](g);case 10:if(_=t.sent,e.loading=!1,0===_.Code){t.next=14;break}return t.abrupt("return");case 14:p["d"].success("模板“".concat(l.tempName,"”").concat(f,"完成。")),e.isEdit=!1,e.$emit("info-change",e.formData);case 17:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},fetchIndustryDict:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a,i,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(v["a"])();case 2:n=t.sent,r={},a={},i=[],s=[],n.forEach((function(e){var t={value:e.Id,label:e.Name,level:e.Level,parentId:e.SuperId};r[t.value]=t,a[t.value]=t.label,e.Level>2||(1===e.Level?i.push(t):s.push(e))})),s.forEach((function(e){var t=r[e.Id],n=r[e.SuperId];n&&t?(n.children||(n.children=[]),n.children.push(t)):console.log("lose industry node:",e)})),e.industryOptions=i.filter((function(e){return e.children})),e.mapIndustryCodeToData=r,e.mapIndustryCodeToName=a;case 12:case"end":return t.stop()}}),t)})))()},addProperty:function(e){var t={PropertyName:"",Id:"".concat(Math.random()).slice(2,6),CreateTime:new Date};e.properties.push(t)},removeProperty:function(e,t){t.properties=t.properties.filter((function(t){return t!==e}))}}},g=y,_=(n("6c6e"),n("2877")),w=Object(_["a"])(g,m,f,!1,null,"89a8c208",null),x=w.exports,I=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"template_files"},[n("div",{staticClass:"template_files_left"},e._l(e.nodeList,(function(t){return n("div",{key:t.id,staticClass:"node_list_item",class:{item_active:t===e.selectedNode},on:{click:function(n){n.stopPropagation(),e.selectedNode=t}}},[e._v(" "+e._s(t.label)+" ")])})),0),n("div",{staticClass:"template_files_right"},[n("div",{staticClass:"template_files_right_title"},[e._v(" 管理样板文件 "),n("file-uploader",{attrs:{"on-success":e.uploadFileSuccess}},[n("el-button",{staticClass:"title_button"},[e._v("上传文件")])],1)],1),n("div",{staticClass:"template_files_right_list"},e._l(e.commonFileList,(function(t){return n("div",{key:t.id,staticClass:"template_files_right_list_item"},[n("div",[e._v(e._s(t.fileName))]),n("div",[e._v(e._s(t.extension))]),n("div",[e._v(e._s(e._f("resolveFileSize")(t.fileSize)))]),n("div",[n("el-button",{staticClass:"del_button",attrs:{type:"text"}},[e._v("删除")])],1)])})),0)])])},O=[],j=(n("13d5"),n("ac1f"),n("1276"),n("9e5b")),C=n("5ab9"),k={components:{FileUploader:j["a"]},props:{companyId:String,templateId:String,nodeList:Array},watch:{nodeList:function(e){this.selectedNode=e[0]},selectedNode:function(e){this.commonFileList=[],this.companyFileList=[],e&&this.fetchNodeTemplateFiles(e)}},data:function(){return{selectedNode:this.nodeList[0],commonFileList:[]}},mounted:function(){this.fetchNodeTemplateFiles(this.selectedNode)},methods:{fetchNodeTemplateFiles:function(e){var t=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){var r,a,i,s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(d["i"])(e.id,t.companyId);case 2:r=n.sent,a=(r.Data||[]).reduce((function(e,n){var r=Object(p["b"])(n);return"0"===r.companyId?e[0].push(r):r.companyId===t.companyId&&e[1].push(r),e}),[[],[]]),i=Object(o["a"])(a,2),s=i[0],i[1],t.commonFileList=s;case 5:case"end":return n.stop()}}),n)})))()},uploadFileSuccess:function(e){var t=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){var r,a,i,s,o,c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.selectedNode,a=Object(C["c"])(e.ossUrl),i=e.name.split("."),s=i.pop(),o={Extension:s,FileName:i.join("."),FileSize:e.size,OssUrl:a,templateNodeId:r.id,CompanyId:"0"},n.next=7,Object(d["a"])(o);case 7:if(c=n.sent,0===c.Code){n.next=10;break}return n.abrupt("return");case 10:p["d"].success("文件已上传。"),t.fetchNodeTemplateFiles(r);case 12:case"end":return n.stop()}}),n)})))()}}},N=k,T=(n("d525"),Object(_["a"])(N,I,O,!1,null,"6eab8660",null)),R=T.exports,M=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"template_matrix"},[n("div",{staticClass:"template_matrix_extra"},[n("el-input",{staticClass:"search_inp",attrs:{placeholder:"矩阵搜索",size:"small","prefix-icon":"icon font_family icon-icon_sousuo searchsize"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searhTempNode(t)}},model:{value:e.searhNodeName,callback:function(t){e.searhNodeName=t},expression:"searhNodeName"}})],1),n("div",{staticClass:"fixtable template_matrix_body"},[n("table",{directives:[{name:"show",rawName:"v-show",value:!!e.nodeList.length,expression:"!!nodeList.length"}],staticClass:"bg1",attrs:{cellspacing:"0",cellpadding:"0"}},[e._m(0)]),n("table",{staticClass:"bg2",attrs:{cellspacing:"0",cellpadding:"0"}},[n("tbody",[n("tr",e._l(e.nodeList,(function(t,r){return n("td",{key:t.id,class:-1!==e.searchedNodeIds.indexOf(t.id)?"highlight":"",staticStyle:{"background-color":"#e2e2e2"},attrs:{id:t.id}},[n("div",{staticClass:"row-w-130 col-h-30 bg_write"},[n("div",{staticClass:"mark"},[e._v(e._s(r+1))])])])})),0),n("tr",e._l(e.nodeList,(function(t){return n("td",{key:t.id,class:-1!==e.searchedNodeIds.indexOf(t.id)?"highlight":"",attrs:{id:t.id}},[n("div",{staticClass:"row-w-130 col-h-60 bg_druk"},[n("div",{staticClass:"mark"},[e._v(e._s(t.name))])])])})),0)])]),n("table",{staticClass:"bg3",attrs:{cellspacing:"0",cellpadding:"0"}},[n("tbody",e._l(e.nodeList,(function(t,r){return n("tr",{key:t.id,staticClass:"tdheight",attrs:{id:t.id}},[n("td",{class:-1!==e.searchedNodeIds.indexOf(t.id)?"highlight":""},[n("div",{staticClass:"row-w-60 col-h-60 bg_write"},[n("div",{staticClass:"mark"},[e._v(e._s(r+1))])])]),n("td",{class:-1!==e.searchedNodeIds.indexOf(t.id)?"highlight":""},[n("div",{staticClass:"row-w-130 col-h-60 bg_gray_th"},[n("div",{staticClass:"mark"},[e._v(e._s(t.name))])])])])})),0)]),n("table",{staticClass:"bg4 table-unit",attrs:{cellspacing:"0",cellpadding:"0"}},[n("tbody",e._l(e.nodeList,(function(t,r){return n("tr",{key:"row_"+t.id,attrs:{id:t.id}},[e._l(e.nodeList,(function(a,i){return[i===r?n("td",{key:t.id+"_"+a.id,staticClass:"matixEquallyName"},[n("div",{staticClass:"row-w-130 col-h-58"},[n("div",{staticClass:"nullbg",staticStyle:{"text-align":"center","font-size":"12px"}},[e._v(" "+e._s(a.name)+" ")])])]):n("td",{key:t.id+"_"+a.id,class:[i%2==1&&i>r||r%2==1&&i<r?"matixTdColor":"whiteSpace",-1!==e.searchedNodeIds.indexOf(a.id)||-1!==e.searchedNodeIds.indexOf(t.id)?"highlight":"",e.canEditUnit(a,t)?"":"disabled"].filter((function(e){return e})).join(" "),attrs:{id:a.id},on:{contextmenu:function(n){return e.MatrixLookInfoMenu(n,a,t)}}},[n("div",{staticClass:"row-w-130 col-h-58"},[n("div",{staticClass:"mark"},e._l(e.listCodeComputed(a,t),(function(e){return n("div",{key:e.Id},[n("i",i!==r?{class:"icon font_family icon-icon_"+(i>r?"zhuanchu":"zhuanru")+" circle_"+(1==e.Permission?"actived":"defualt")}:{})])})),0)])])]}))],2)})),0)])]),n("context-menu",{staticClass:"automenu",attrs:{id:"MatrixLookInfoMenu",show:e.MatrixLookInfoMenuVisible},on:{"update:show":function(t){return e.MatrixLookInfoMenuVisible=t}}},[n("ul",[n("li",{staticClass:"menu__item"},[e._v(e._s(e.matrixVerticalName))]),n("li",{staticClass:"menu__item"},[n("el-button",{class:e.btnMatrixLookInfo,on:{click:e.matrixRightNodeClick}},[e._v("输出数据")])],1),n("li",{staticClass:"menu__item"},[e._v(e._s(e.matrixHorizontalName))])])])],1)},L=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("tbody",[n("tr",[n("td",[n("div",{staticClass:"row-w-60 col-h-30 bg_write"})]),n("td",[n("div",{staticClass:"row-w-130 col-h-30 bg_gray_th"},[e._v("接收")])])]),n("tr",[n("td",[n("div",{staticClass:"row-w-60 col-h-60 bg_druk"},[e._v("输出")])]),n("td",[n("div",{staticClass:"row-w-130 col-h-60",staticStyle:{"background-color":"rgb(255, 210, 78)"}},[e._v(" 矩阵节点 ")])])])])}],D=(n("c975"),n("45fc"),{components:{},data:function(){return{MatrixLookInfoMenuVisible:!1,isShowListTemplatePane:!0,isShowMatrixTemplatePane:!1,isShowXmindBtn:!1,el_formLabelcolor:"textlabelgray",listMatirxPermission:[],matrixRightNodeData:"",searhNodeName:"",matrixVerticalName:"",matrixHorizontalName:"",btnMatrixLookInfo:"martixLeaveColor",loading:!1,topNodeId:this.$route.params.id,topNodeName:this.$route.params.name,topNodeTemplateId:this.$route.params.templateId||this.$route.params.id,subTemplateId:this.$route.params.subTemplateId,nodeList:[],unitMap:{},searchedNodeIds:[],targetUnit:{}}},created:function(){this.scanMatrix()},methods:{onBackBtnClick:function(){this.$router.push({name:"system_template",params:{data:this.$route.params.data}})},scanMatrix:function(){0==this.listMatirxPermission.length&&this.getMatirxPermission(),this.isShowMatrixTemplatePane=!0},searhTempNode:function(){var e=this.searhNodeName,t=[];e?(this.nodeList.some((function(n,r){return-1!==n.name.toLowerCase().indexOf(e)&&(t.push(n.id),!0)})),this.searchedNodeIds=t):this.searchedNodeIds=t},matrixRightNodeClick:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.targetUnit,r=Object.assign({},n),r.Permission=1===r.Permission?0:1,t.next=5,d["h"](r);case 5:if(a=t.sent,0===a.Code){t.next=8;break}return t.abrupt("return");case 8:p["d"].success("更新成功"),Object.assign(n,r);case 10:case"end":return t.stop()}}),t)})))()},getMatirxPermission:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a,i,s,c,u,l,p,m;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.loading=!0,n=e.topNodeId,r=e.topNodeName,a=e.topNodeTemplateId,i=e.subTemplateId,n){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Promise.all([d["j"](a,n,i),d["p"](i||n)]);case 9:s=t.sent,c=Object(o["a"])(s,2),u=c[0],l=c[1],p=E(l.Data||{}),i&&p.unshift({id:n,name:r}),m=u.Data||[],e.loading=!1,e.nodeList=p,e.unitMap=m.reduce((function(e,t){var n="".concat(t.SysCode,"->").concat(t.PermCode);return t.Editable=t.TemplateId!==i,e[n]=t,e}),{});case 19:case"end":return t.stop()}}),t)})))()},getData:function(e){if(e.listChildren.length>0)for(var t=0;t<e.listChildren.length;t++)this.listMatirxPermission.push(e.listChildren[t]),this.getData(e.listChildren[t])},foo:function(){this.closeMenu(),document.removeEventListener("click",this.foo),this.tableRightEventData=[]},MatrixLookInfoMenu:function(e,t,n){this.loading=!0,this.closeMenu(),this.MatrixLookInfoMenuVisible=!0;var r=this.unitMap,a="".concat(t.id,"->").concat(n.id),i=r[a];1==i.Permission?this.btnMatrixLookInfo="btnMatrixLookInfo":this.btnMatrixLookInfo="martixLeaveColor",this.matrixVerticalName=t.name,this.matrixHorizontalName=n.name;var s=document.querySelector("#MatrixLookInfoMenu");this.styleMenu(s),this.targetUnit=i,this.loading=!1},canEditUnit:function(e,t){var n=this.unitMap,r="".concat(e.id,"->").concat(t.id),a=n[r]||{Editable:!0};return a.Editable},closeMenu:function(){this.MatrixLookInfoMenuVisible=!1},styleMenu:function(e){event.clientX>1800?e.style.left=event.clientX-100+"px":e.style.left=event.clientX+1+"px",document.addEventListener("click",this.foo),event.clientY>700?1==this.MatrixLookInfoMenuVisible?e.style.top=event.clientY-145+"px":e.style.top=event.clientY-30+"px":e.style.top=event.clientY-55+"px"}},computed:{listCodeComputed:function(){return function(e,t){var n=this.unitMap,r="".concat(e.id,"->").concat(t.id),a=n[r]||{};return a||(a.Id="unknow",console.error("文件交换关系对象匹配失败: 找不到".concat(r,"的交换关系"))),[a]}}}});function E(e){return P(e.children,[])}function P(e,t){return e&&0!==e.length?(e.forEach((function(e){if(!e.isNest){var n={id:e.id,name:e.topic,isNest:e.isNest};t.push(n),P(e.children,t)}})),t):t}var S=D,$=(n("e529"),Object(_["a"])(S,M,L,!1,null,"08a2a166",null)),F=$.exports,z={components:{appHeader:u["a"],nodesViewer:l["a"],Info:x,TemplateFiles:R,Matrix:F},data:function(){var e=this.$route.params,t=e.id,n=e.name;return{companyId:sessionStorage.companyId,listTemplateMindTree:[],mindZoom:60,templateId:t,templateName:n,node:null,templateInfo:{},viewType:"template",plainNodeList:[],templateApplyCount:void 0}},created:function(){this.fetchTemplateNodes(),this.fetchTemplateInfo()},methods:{onInfoChange:function(e){this.templateInfo=e},fetchTemplateNodes:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["p"])(e.templateId);case 2:n=t.sent,e.node=n.Data,e.plainNodeList=q(n.Data);case 5:case"end":return t.stop()}}),t)})))()},fetchTemplateInfo:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n,r,a,i,c,u,l,m,f,h,b,v,y;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([Object(d["n"])(e.templateId),Object(d["q"])(e.templateId)]);case 2:if(n=t.sent,r=Object(o["a"])(n,2),a=r[0],i=r[1],e.templateApplyCount=i.Data,0===a.Code){t.next=9;break}return t.abrupt("return");case 9:if(c=a.Data,u=c.propertys,l=c.template,m=u.map((function(e){var t=Object(p["b"])(e);return t.id=t.id||t.propertyName,t})),f=e.templateInfo=Object(s["a"])(Object(s["a"])({},Object(p["b"])(l)),{},{properties:m,industry:[l.FirstIndustryId,l.DetailIndustryId]}),h=e.mapIndustryCodeToData,h){t.next=15;break}return t.abrupt("return");case 15:b=f.customCode,b&&"0"!==b&&(v=h[b],4===v.level?(f.indLevel4=v.label,y=h[v.parentId],f.indLevel3=y.label):f.indLevel3=v.label);case 17:case"end":return t.stop()}}),t)})))()},toggleTemplateState:function(e){var t=this;return Object(c["a"])(regeneratorRuntime.mark((function n(){var r,a,o,c;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.templateInfo[e]?0:1,a={Temple:Object(s["a"])(Object(s["a"])({},Object(p["c"])(t.templateInfo)),Object(p["c"])(Object(i["a"])({},e,r)))},n.next=4,Object(d["s"])(a);case 4:if(o=n.sent,0===o.Code){n.next=7;break}return n.abrupt("return");case 7:c="disable"===e?0===r?"已启用":"已禁用":1===r?"已锁定":"已解除锁定",p["d"].success("模板".concat(c)),t.templateInfo=Object.assign({},t.templateInfo,Object(i["a"])({},e,r));case 10:case"end":return n.stop()}}),n)})))()},deleteTemplate:function(){var e=this;return Object(c["a"])(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log(e.templateInfo),n=e.templateInfo.tempName,!(e.templateApplyCount>0)){t.next=5;break}return e.$notify({type:["error"],message:"当前有项目使用该模板 无法删除模板"}),t.abrupt("return");case 5:e.$confirm("您正在删除 ["+n+"] 模板是否继续?",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(c["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(d["f"])(e.templateInfo.id);case 2:if(r=t.sent,0===r.Code){t.next=5;break}return t.abrupt("return");case 5:p["d"].success("模板“".concat(n,"”删除成功")),e.$router.go(-1);case 7:case"end":return t.stop()}}),t)}))));case 6:case"end":return t.stop()}}),t)})))()}}};function q(e){var t=[],n=function e(n){n.forEach((function(n){var r={id:n.id,label:n.topic};t.push(r),n.children&&n.children.length&&e(n.children)}))};return n(e.children||[]),t}var B=z,V=(n("4c3b"),Object(_["a"])(B,r,a,!1,null,"ceb7854a",null));t["default"]=V.exports},d525:function(e,t,n){"use strict";var r=n("f0f9"),a=n.n(r);a.a},de58:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"mindDom",staticClass:"nodes-viewer",style:{width:e.width,height:e.height},attrs:{id:e.domId},on:{mousewheel:function(t){return t.stopPropagation(),e.onWheel(t)}}})},a=[],i=(n("fb6a"),function(){return"xmind_".concat("".concat(Math.random()).slice(2,8))}),s=window.jsMind,o={props:{node:{type:Object,default:null},width:{type:String,default:""},height:{type:String,default:""}},data:function(){return{domId:i(),mindIns:null,domMindInner:null,zoom:1}},mounted:function(){this.init()},watch:{node:function(e){e&&this.show()}},methods:{init:function(){var e={container:this.domId,editable:!1,theme:"",mode:"side",support_html:!1,view:{engine:"canvas",hmargin:100,vmargin:50,line_width:1,line_color:"#cccdd7"}},t=new s(e);t.disable_edit(),t.end_edit(),this.mindIns=t,this.node&&this.show()},getMindInnerDom:function(){if(this.domMindInner)return this.domMindInner;if(this.$refs.mindDom){var e=this.$refs.mindDom.querySelector(".jsmind-inner");return this.domMindInner=e,e}},onWheel:function(e){if(e.ctrlKey){e.returnValue=!1;var t=-e.wheelDelta||e.detail,n=this.getMindInnerDom();if(n){var r=this.zoom+(t>0?-.1:.1),a=Math.max(.2,Math.min(r,1.8));this.zoom=a,n.style.zoom=this.zoom}}},show:function(){var e={meta:{name:"mindhh",author:"hh",version:"0.2"},format:"node_tree",data:this.node};this.mindIns.show(e)}}},c=o,u=n("2877"),l=Object(u["a"])(c,r,a,!1,null,"2aa6cc14",null);t["a"]=l.exports},e529:function(e,t,n){"use strict";var r=n("74d3"),a=n.n(r);a.a},f0f9:function(e,t,n){},f111:function(e,t,n){}}]);