Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

1 rinda
5.3 KiB

  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-655d6881"],{"0a95":function(e,t,a){},"86d3":function(e,t,a){"use strict";var i=a("0a95"),n=a.n(i);n.a},be38:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"template_market"},[a("app-header",{attrs:{theme:"basis",showBackBtn:!0,backBtnTitle:"模板与应用"},scopedSlots:e._u([{key:"center",fn:function(){return[e._v("模板市场")]},proxy:!0}])}),a("section",{staticClass:"card"},[a("div",{staticClass:"card_left"},[a("div",{staticClass:"card_search_box"},[a("el-input",{staticClass:"el-input_mini",attrs:{placeholder:"搜索模板","prefix-icon":"Cicon icon font_family icon-icon_sousuo iconsize_mini"},model:{value:e.searchKeywords,callback:function(t){e.searchKeywords=t},expression:"searchKeywords"}})],1),a("div",{staticClass:"list"},e._l(e.templateTreeList,(function(t){return a("div",{key:t.id,staticClass:"list_item",class:{list_item_active:e.currentHeadNode===t},attrs:{title:t.label},on:{click:function(a){a.stopPropagation(),e.currentHeadNode=t}}},[e._v(e._s(t.label))])})),0)]),a("div",{staticClass:"card_right"},[e.currentHeadNode&&e.currentHeadNode?e._l(e.filterViewList(e.currentHeadNode.children),(function(t){return a("div",{key:t.id,staticClass:"block"},[a("div",{staticClass:"block_label"},[e._v(e._s(t.label))]),a("div",{staticClass:"block_item_box"},[e._l(t.children,(function(t){return a("div",{key:t.id,staticClass:"block_item"},[a("div",{staticClass:"block_item_split_line"}),a("div",{staticClass:"block_item_left",on:{click:function(a){return a.stopPropagation(),e.checkTemplateDetail(t)}}},[a("i",{staticClass:"Cicon icon font_family icon-gerenshezhi block_item_logo"})]),a("div",{staticClass:"block_item_right"},[a("div",{staticClass:"block_item_right_label",on:{click:function(a){return a.stopPropagation(),e.checkTemplateDetail(t)}}},[e._v(e._s(t.label))]),a("div",{staticClass:"block_item_right_intro",on:{click:function(a){return a.stopPropagation(),e.checkTemplateDetail(t)}}},[e._v(e._s(t.data.introduce||"暂无简介"))]),a("el-button",{staticClass:"block_item_right_button",attrs:{disabled:!!e.addedTemplateIdMap[t.id]},on:{click:function(a){return a.stopPropagation(),e.addTemplate(t)}}},[e._v(e._s(e.addedTemplateIdMap[t.id]?"已添加":"添加"))])],1)])})),e._l(Array.from({length:(3-t.children.length%3)%3},(function(e,t){return"empty_"+t})),(function(e){return a("div",{key:e,staticClass:"block_item empty"})}))],2)])})):e._e()],2)])],1)},n=[],r=(a("99af"),a("4de4"),a("4160"),a("c975"),a("13d5"),a("a434"),a("b0c0"),a("d3b7"),a("3ca3"),a("159b"),a("ddb0"),a("ade3")),c=a("3835"),s=(a("96cf"),a("1da1")),d=a("5530"),l=a("01a8"),o=a("b3b1"),u=a("b0f9"),p=a("3de1"),m=a("2827"),f={components:{appHeader:l["a"]},data:function(){return{companyId:sessionStorage.companyId,templateTreeList:[],currentHeadNode:null,addedTemplateIdMap:{},searchKeywords:""}},mounted:function(){this.loadTemplateList()},methods:{filterViewList:function(e){var t=this.searchKeywords;return t?e.reduce((function(e,a){var i=a.children.filter((function(e){return-1!==e.label.indexOf(t)}));if(i.length){var n=Object(d["a"])(Object(d["a"])({},a),{},{children:i});e.push(n)}return e}),[]):e},checkTemplateDetail:function(e){this.$router.push({name:"company_template_detail",params:{name:e.label,id:e.id,prevViewName:"模板市场"}})},loadTemplateList:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,i,n,r,s,d,l,p;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([Object(u["n"])(),Object(o["a"])(),Object(u["l"])(e.companyId)]);case 2:a=t.sent,i=Object(c["a"])(a,3),n=i[0],r=i[1],s=i[2],d=b(n.Data||[],r),l=Object(c["a"])(d,1),p=l[0],e.templateTreeList=p,e.currentHeadNode=p[0],s.Data&&(e.addedTemplateIdMap=s.Data.reduce((function(e,t){return e[t.Id]=!0,e}),{}));case 11:case"end":return t.stop()}}),t)})))()},addTemplate:function(e){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function a(){var i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(m["a"])(t.companyId,e.id);case 2:if(i=a.sent,!i.Code){a.next=5;break}return a.abrupt("return");case 5:t.$notify({message:"添加成功",type:"success"}),t.addedTemplateIdMap=Object(d["a"])(Object(d["a"])({},t.addedTemplateIdMap),{},Object(r["a"])({},e.id,!0));case 7:case"end":return a.stop()}}),a)})))()}}};function b(e,t){var a={},i=e.reduce((function(e,t){var a=Object(p["b"])(t),i=a.detailIndustryId,n={id:a.id,label:a.tempName,parentId:i,isLeaf:!0,type:"template",data:a};return e[i]=(e[i]||[]).concat(n),e}),{}),n=t.reduce((function(e,t){var i=Object(p["b"])(t);if(i.level>2)return e;var n="0"!==i.superId&&i.superId?i.superId:null,r={id:i.id,label:i.name,parentId:n,data:i,type:"industry",children:[],isLeaf:!1};return e[0][r.id]=r,e[1].unshift(r),a[r.id]=r,n&&(e[2][n]||(e[2][n]=[]),e[2][n].push(r)),1===i.level&&e[3].push(r),e}),[{},[],{},[]]),r=Object(c["a"])(n,4),s=r[0],d=r[1],l=r[2],o=r[3];return d.forEach((function(e){var t=l[e.id];t&&(e.children=e.children.concat(t));var a=i[e.id];if(a&&(e.children=e.children.concat(a)),0===e.children.length){var n=s[e.parentId],r=n?l[n.id]:o;r.splice(r.indexOf(e),1)}})),[o,a]}var _=f,h=(a("86d3"),a("2877")),v=Object(h["a"])(_,i,n,!1,null,"7f690d34",null);t["default"]=v.exports}}]);