1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4dfd855c"],{"035f":function(t,e,a){},"064f":function(t,e,a){},1831:function(t,e,a){},"24d2":function(t,e,a){"use strict";a.d(e,"h",(function(){return r})),a.d(e,"a",(function(){return o})),a.d(e,"k",(function(){return c})),a.d(e,"e",(function(){return i})),a.d(e,"c",(function(){return s})),a.d(e,"i",(function(){return l})),a.d(e,"b",(function(){return u})),a.d(e,"l",(function(){return d})),a.d(e,"f",(function(){return p})),a.d(e,"d",(function(){return m})),a.d(e,"g",(function(){return f})),a.d(e,"j",(function(){return g}));var n=a("b775");function r(t){return Object(n["a"])({url:"/project/category/search",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/project/category/create",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/project/category/update",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/project/category/info",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/project/category/delete",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/project/search",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/project/create",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/project/update",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/project/info",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/project/delete",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/project/relate",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/template/searchTemplateList",method:"post",data:t})}},3672:function(t,e,a){"use strict";a("eb4d")},"424e":function(t,e,a){"use strict";a.d(e,"h",(function(){return r})),a.d(e,"i",(function(){return o})),a.d(e,"e",(function(){return c})),a.d(e,"m",(function(){return i})),a.d(e,"a",(function(){return s})),a.d(e,"g",(function(){return l})),a.d(e,"c",(function(){return u})),a.d(e,"j",(function(){return d})),a.d(e,"b",(function(){return p})),a.d(e,"n",(function(){return m})),a.d(e,"f",(function(){return f})),a.d(e,"d",(function(){return g})),a.d(e,"k",(function(){return b})),a.d(e,"l",(function(){return h}));var n=a("b775");function r(t){return Object(n["a"])({url:"/document/pageDocument",method:"post",data:t})}function o(t){return Object(n["a"])({url:"/document/search",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/document/export",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/document/update",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/document/create",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/document/info",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/document/delete",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/document/category/search",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/document/category/create",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/document/category/update",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/document/category/info",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/document/category/delete",method:"post",data:t})}function b(t){return Object(n["a"])({url:"/template/searchList",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/document/searchlistDoc",method:"post",data:t})}},5869:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"project-search"},[a("dataSearch",{on:{bindSetQuery:t.setQuery}}),a("dataList",{attrs:{queryForm:t.queryForm}})],1)},r=[],o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-search"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.queryForm}},[a("el-form-item",{attrs:{label:"项目名称:"}},[a("el-input",{attrs:{placeholder:"请填写项目名称"},model:{value:t.queryForm.name,callback:function(e){t.$set(t.queryForm,"name",e)},expression:"queryForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择分类",size:"large"},model:{value:t.queryForm.categoryId,callback:function(e){t.$set(t.queryForm,"categoryId",e)},expression:"queryForm.categoryId"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.queryForm.status,callback:function(e){t.$set(t.queryForm,"status",e)},expression:"queryForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.onSubmit}},[a("svg-icon",{attrs:{"icon-class":"search"}}),t._v(" 搜索")],1),a("el-button",{attrs:{type:"success"},on:{click:t.onCreate}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v(" 新项目")],1)],1)],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"","custom-class":"prod-verify",title:"创建新项目"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{on:{onClose:t.onClose}})],1)],1)},c=[],i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{ref:"dataFormRef",attrs:{model:t.dataForm,rules:t.rules,"label-width":"120px"}},[a("el-form-item",{staticClass:"form-item-half",attrs:{label:"项目名称:",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入项目名称"},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),a("el-form-item",{staticClass:"form-item-half",attrs:{label:"所属分类:",prop:"category_id"}},[a("el-select",{attrs:{placeholder:"请选择所属分类",size:"large"},model:{value:t.dataForm.category_id,callback:function(e){t.$set(t.dataForm,"category_id",e)},expression:"dataForm.category_id"}},t._l(t.allCategories,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{staticClass:"form-item-half",attrs:{label:"项目状态:",prop:"status"}},[a("el-select",{attrs:{placeholder:"请选择状态",size:"large"},model:{value:t.dataForm.status,callback:function(e){t.$set(t.dataForm,"status",e)},expression:"dataForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),a("el-form-item",{staticClass:"form-item-half",attrs:{label:"项目介绍:",prop:"intro"}},[a("el-input",{attrs:{rows:"3",placeholder:"请输入项目介绍",type:"textarea"},model:{value:t.dataForm.intro,callback:function(e){t.$set(t.dataForm,"intro",e)},expression:"dataForm.intro"}})],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},s=[],l=(a("a9e3"),a("8256")),u=a("24d2"),d=a("f6b0"),p=a("424e"),m={components:{Tinymce:l["default"]},emits:["onClose"],props:{id:{type:Number,default:0}},watch:{id:{handler:function(t){var e=this;null!=t&&(0!=t?e.getInfo(t):this.dataForm={id:0,name:"",intro:"",customer_id:"",category_id:"",status:5})},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],allCategories:[],imageUrl:"",customerList:[],articleList:[],dataForm:{id:0,name:"",intro:"",customer_id:"",category_id:"",status:5},statusOptions:[{status:5,name:"启用"},{status:6,name:"停用"}],rules:{name:[{required:!0,message:"请输入项目名称",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符之间",trigger:"blur"}],category_id:[{required:!0,message:"请选择所属分类",trigger:"change"}],status:[{required:!0,message:"请选择项目状态",trigger:"change"}]}}},mounted:function(){var t=this;t.uploadUrl="http://183.195.216.54:8084/upload",t.initAllCategory(),this.initCustomer()},methods:{initDocList:function(){var t=this;Object(p["i"])({page:1,pageSize:10}).then((function(e){200==e.status&&(t.articleList=e.data.dataList)}))},onUploadSuccess:function(t){console.log("onUploadSuccess",t)},btnSave:function(t){var e=this;e.$refs.dataFormRef.validate((function(t){if(!t)return!1;var a=e.dataForm.id>0?Object(u["l"])(e.dataForm):Object(u["b"])(e.dataForm);a.then((function(t){200===t.status&&(e.$message.success(e.dataForm.id>0?"项目信息更新成功":"项目信息创建成功"),setTimeout((function(){e.$emit("onClose",!0)}),0))})).catch((function(t){console.error("Save failed:",t)}))}))},getInfo:function(t){var e=this,a={id:t};Object(u["f"])(a).then((function(t){t&&200==t.status&&(e.dataForm=t.data,e.dataForm.category_id=t.data.categoryId,e.dataForm.customer_id=t.data.customerId)}))},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;e.dataForm.categoryId=t},initAllCategory:function(){var t=this,e={page:1,pageSize:9999,status:5};Object(u["h"])(e).then((function(e){t.allCategories=e.data.dataList}))},initCustomer:function(){var t=this,e={page:1,pageSize:99};Object(d["a"])(e).then((function(e){t.customerList=e.data.dataList}))}}},f=m,g=(a("ce6c"),a("2877")),b=Object(g["a"])(f,i,s,!1,null,null,null),h=b.exports,v=a("a888"),y={components:{dataInfo:h},directives:{elDragDialog:v["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",category_id:"",status:"",isUpdate:!1}}}},data:function(){return{statusOptions:[{value:5,label:"启用"},{value:6,label:"停用"}],dialogVisible:!1,categoryList:[]}},created:function(){this.initCategory()},methods:{initCategory:function(){var t=this,e={page:1,pageSize:999,status:5};Object(u["h"])(e).then((function(e){t.categoryList=e.data.dataList}))},onCreate:function(t){this.dialogVisible=!0},onClose:function(t){this.dialogVisible=!1,this.queryForm.isUpdate=!this.queryForm.isUpdate},onSubmit:function(){this.queryForm.isUpdate=!this.queryForm.isUpdate,this.$emit("bindSetQuery",this.$props.queryForm)}}},j=y,O=(a("f7d1"),Object(g["a"])(j,o,c,!1,null,null,null)),T=O.exports,w=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-list"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有项目信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"categoryId",label:"所属分类",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.getCategoryName(e.row.categoryId)))])]}}])}),a("el-table-column",{attrs:{prop:"name",label:"项目名称",align:"left"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center"}}),a("el-table-column",{attrs:{prop:"updateTime",label:"更新时间",align:"center"}}),a("el-table-column",{attrs:{prop:"",label:"完成度",align:"center"}}),a("el-table-column",{attrs:{prop:"statusName",label:"项目状态",align:"center",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-tag",{attrs:{type:5===e.row.status?"success":"danger",effect:"plain"}},[t._v(" "+t._s(5===e.row.status?"启用":"停用")+" ")])]}}])}),a("el-table-column",{attrs:{label:"操作",align:"center",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-dropdown",{attrs:{data:e.row},on:{command:t.handleCommand},scopedSlots:t._u([{key:"dropdown",fn:function(){return[a("el-dropdown-menu",[a("el-dropdown-item",{attrs:{command:{type:"viewTemplates",row:e.row}}},[t._v(" 已绑定模版 ")]),a("el-dropdown-item",{attrs:{command:{type:"template",row:e.row}}},[t._v("选择模版")]),a("el-dropdown-item",{attrs:{command:{type:"enter",row:e.row}}},[t._v("输入项目")]),a("el-dropdown-item",{attrs:{command:{type:"edit",row:e.row}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑 ")],1),a("el-dropdown-item",{attrs:{command:{type:"delete",row:e.row}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除 ")],1)],1)]},proxy:!0}],null,!0)},[a("span",{staticClass:"el-dropdown-link"},[a("el-button",{staticClass:"operation-button",staticStyle:{"font-size":"15px","margin-left":"10px"},attrs:{type:"text",size:"small",circle:"",icon:"el-icon-more"}})],1)])]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:t.queryForm.page,"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"","custom-class":"prod-verify",title:"创建项目信息"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("dataInfo",{attrs:{id:t.currentDataId},on:{onClose:t.onClose}})],1),a("el-dialog",{attrs:{title:"选择模版",visible:t.templateDialogVisible,width:"50%","append-to-body":""},on:{"update:visible":function(e){t.templateDialogVisible=e}}},[a("el-table",{ref:"templateTable",staticStyle:{width:"100%"},attrs:{data:t.templateList},on:{"selection-change":t.handleTemplateSelect}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",align:"center"}}),a("el-table-column",{attrs:{prop:"title",label:"模版名称",align:"left"}}),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间",align:"center"}})],1),a("div",{staticClass:"pagination-container"},[a("el-pagination",{attrs:{"current-page":t.templateQueryForm.page,"page-size":t.templateQueryForm.pageSize,total:t.templateTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.handleTemplatePageChange}})],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.templateDialogVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.confirmTemplateSelection}},[t._v("确 定")])],1)],1),a("el-dialog",{attrs:{title:"已绑定模版",visible:t.boundTemplatesDialogVisible,width:"50%","append-to-body":""},on:{"update:visible":function(e){t.boundTemplatesDialogVisible=e}}},[a("el-table",{ref:"boundTemplateTable",staticStyle:{width:"100%"},attrs:{data:t.boundTemplateList},on:{"selection-change":t.handleBoundTemplateSelect}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80",align:"center"}}),a("el-table-column",{attrs:{prop:"title",label:"模版名称",align:"left"}}),a("el-table-column",{attrs:{prop:"create_time",label:"绑定时间",align:"center"}}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.previewTemplate(e.row)}}},[t._v("预览")]),a("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.replaceTemplate(e.row)}}},[t._v("替换")])]}}])})],1),a("div",{staticClass:"dialog-footer",staticStyle:{"margin-top":"20px","text-align":"right"}},[a("el-button",{attrs:{type:"primary",loading:t.batchReplaceLoading,disabled:0===t.selectedBoundTemplates.length},on:{click:t.batchReplace}},[t._v(" 批量替换 ")])],1)],1),a("el-dialog",{attrs:{title:"",visible:t.replaceVisible,width:"50%","append-to-body":""},on:{"update:visible":function(e){t.replaceVisible=e}}},[t.matchResults.length?a("div",{staticClass:"match-results"},[t._l(t.matchResults,(function(e,n){return a("div",{key:n,staticClass:"match-item"},[a("div",{staticClass:"match-content"},[a("span",[t._v("原始值: "+t._s(e))])]),a("div",{staticClass:"actions"},[a("el-button",{attrs:{size:"small"},on:{click:function(a){return t.replaceItem(e)}}},[t._v("替换")])],1)])})),a("div",{staticStyle:{display:"flex","justify-content":"flex-end","margin-top":"20px"}},[a("el-button",{attrs:{type:"primary"},on:{click:t.replaceAll}},[t._v("批量替换")])],1)],2):t._e()])],1)},_=[],x=a("ade3"),C=a("3835"),k=a("0d21"),L=a("db90"),S=a("06c5"),F=a("3d8c");function A(t){return Object(k["a"])(t)||Object(L["a"])(t)||Object(S["a"])(t)||Object(F["a"])()}var $,E=a("2909"),R=a("c7eb"),D=a("b85c"),q=a("1da1"),I=(a("99af"),a("4de4"),a("7db0"),a("a630"),a("caad"),a("a15b"),a("d81d"),a("fb6a"),a("b0c0"),a("e9c4"),a("b64b"),a("d3b7"),a("4d63"),a("ac1f"),a("2c3e"),a("25f0"),a("6062"),a("2532"),a("3ca3"),a("5319"),a("841c"),a("2ca0"),a("498a"),a("ad9d"),a("159b"),a("ddb0"),a("bc3a")),V=a.n(I),N={components:{dataInfo:h},directives:{elDragDialog:v["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",category_id:"",status:""}}}},watch:{queryForm:{handler:function(t){this.search()},deep:!0}},data:function(){return{templateQueryForm:{page:1,pageSize:10},templateTotal:0,dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{},categoryList:[],templateDialogVisible:!1,templateList:[],selectedTemplates:[],boundTemplatesDialogVisible:!1,previewDialogVisible:!1,boundTemplateList:[],templatePreviewContent:"",currentTemplateId:null,replaceVisible:!1,loading:!1,searchResult:{},matchResults:[],TemList:[],docAttr:{},templateLoading:!1,boundTemplateLoading:!1,selectedBoundTemplates:[],batchReplaceLoading:!1}},mounted:function(){this.search(),this.init()},methods:($={handleCommand:function(t){switch(t.type){case"template":this.selTemplate(t.row);break;case"enter":this.enterPro(t.row);break;case"edit":this.btnEdit(t.row);break;case"delete":this.btnDelete(t.row.id);break;case"viewTemplates":this.viewBoundTemplates(t.row);break}},viewBoundTemplates:function(t){var e=this;this.currentData=t,this.boundTemplateLoading=!0,Object(u["j"])({ids:t.documentIds.join(",")}).then((function(t){200===t.status&&(e.boundTemplateList=t.data,e.boundTemplatesDialogVisible=!0)})).finally((function(){e.boundTemplateLoading=!1}))},previewTemplate:function(t){var e=document.createElement("a");e.href="#/document/viewCreate?articleId="+t.id,e.target="_blank",e.click()},replaceTemplate:function(t){this.docAttr=t;var e=JSON.parse(t.data);this.replaceVisible=!0,this.searchEx(e)},handleBoundTemplateSelect:function(t){this.selectedBoundTemplates=t},batchReplace:function(){var t=this;return Object(q["a"])(Object(R["a"])().mark((function e(){var a,n,r,o;return Object(R["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(0!==t.selectedBoundTemplates.length){e.next=3;break}return t.$message.warning("请选择需要替换的模版"),e.abrupt("return");case 3:t.batchReplaceLoading=!0,e.prev=4,a=Object(D["a"])(t.selectedBoundTemplates),e.prev=6,a.s();case 8:if((n=a.n()).done){e.next=19;break}return r=n.value,t.docAttr=r,o=JSON.parse(r.data),e.next=14,t.searchEx(o);case 14:if(!(t.matchResults.length>0)){e.next=17;break}return e.next=17,t.replaceAll();case 17:e.next=8;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e["catch"](6),a.e(e.t0);case 24:return e.prev=24,a.f(),e.finish(24);case 27:t.$message.success("批量替换完成"),t.boundTemplatesDialogVisible=!1,e.next=35;break;case 31:e.prev=31,e.t1=e["catch"](4),console.error("批量替换失败:",e.t1),t.$message.error("批量替换过程中发生错误");case 35:return e.prev=35,t.batchReplaceLoading=!1,e.finish(35);case 38:case"end":return e.stop()}}),e,null,[[4,31,35,38],[6,21,24,27]])})))()},searchEx:function(t){var e=this;return new Promise((function(a){var n=[];e.TemList=t,e.TemList.forEach((function(t){var e=document.createElement("div");e.innerHTML=t.content;var a=e.textContent||e.innerText,r=[/【([A-Z]{1,4}[0-9]{0,2})-([A-Z]{1,4}[0-9]{0,2})-([0-9]{2})-([0-9]{2,3})】/g,/\[([A-Z]{1,4}[0-9]{0,2})-([A-Z]{1,4}[0-9]{0,2})-([0-9]{2})-([0-9]{2,3})\]/g];r.forEach((function(t){var e;while(null!==(e=t.exec(a))){var r=e[0],o=[e[1],e[2],e[3],e[4]],c=o.every((function(t){return t.length>0}));c&&n.push(r)}}))})),e.matchResults=Object(E["a"])(new Set(n)),e.matchResults.forEach((function(t){var e=(t.startsWith("【"),t.slice(1,-1));e.split("-")})),a()}))},getDocumentType:function(t){return t.includes("-RP-")?"template_location":t.includes("-IR-")?"middle_layer_location":t.includes("-WE-")?"tech_report_location":"other_location"},formatRequestParams:function(t){var e=this,a=Array.isArray(t)?t:[t],n={template_location:[],middle_layer_location:[],tech_report_location:[],other_location:[]};return a.forEach((function(t){var a=t.replace(/[\[\]]/g,""),r=e.getDocumentType(a);console.log("params",r),Object.keys(n).forEach((function(t){r===t?n[t].push(a):n[t].push("")}))})),n},parseContent:function(t){if(!t)return"";var e=t;return e=e.replace(/\[图片:(.*?)\|style=(.*?)\|class=(.*?)\]/g,(function(t,e,a,n){return'<img src="'.concat(e,'" alt="图片" style="').concat(a,'" class="').concat(n,'">')})),e=e.replace(/\[表格\|style=(.*?)\|class=(.*?)\]\n([\s\S]*?)(?=\[|$)/g,(function(t,e,a,n){var r=n.trim().split("\n"),o='<table style="'.concat(e,'" class="').concat(a,'">');return r.forEach((function(t){o+="<tr>";var e=t.split(" | ").map((function(t){var e=t.split("[style="),a=A(e),n=a[0],r=a.slice(1);if(r.length){var o=r[0].slice(0,-1).split("|class="),c=Object(C["a"])(o,2),i=c[0],s=c[1];return'<td style="'.concat(i,'" class="').concat(s,'">').concat(n,"</td>")}return"<td>".concat(n,"</td>")}));o+=e.join("")+"</tr>"})),o+="</table>",o})),e=e.replace(/\[文本:(.*?)\|style=(.*?)\|class=(.*?)\]/g,(function(t,e,a,n){return'<span style="'.concat(a,'" class="').concat(n,'">').concat(e,"</span>")})),e},containsTableOrImage:function(t){return t.includes("<table")||t.includes("<img")},getTextNodes:function(t){var e,a=[],n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1);while(e=n.nextNode())a.push(e);return a},onUpload:function(){var t=this;t.TemList.length<=0?t.$message.error("增加组件"):""!=t.docAttr.title?(t.docAttr.links=JSON.stringify(t.docAttr.linkProduct),t.docAttr.projects=JSON.stringify(t.docAttr.linkProject),t.docAttr.data=JSON.stringify(t.TemList),t.docAttr.is_template=1,t.docAttr.id=t.docAttr.id,t.docAttr.user_name=t.docAttr.name,t.docAttr.user_id=t.docAttr.id,Object(p["m"])(t.docAttr).then((function(e){200==e.status&&(t.docAttr.id=e.data,t.$message.success("模版更新成功"))}))):t.$message.error("请填写模版标题")},processAndReplaceContent:function(t,e){var a=this;return Object(q["a"])(Object(R["a"])().mark((function t(){var n,r,o,c;return Object(R["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,n=a.formatRequestParams(e),t.next=4,V.a.post("".concat("http://183.195.216.54:8084","/project-raw-data/batch-content"),n,{headers:{"Content-Type":"application/json"}});case 4:if(r=t.sent,200!==r.status||!r.data){t.next=10;break}if(c=null===(o=r.data.data.matched_data[0])||void 0===o?void 0:o.content,!c){t.next=10;break}return a.TemList.forEach((function(t,n){var r=a.processTableContent(t.content,e,c);a.$set(a.TemList[n],"content",r)})),t.abrupt("return",!0);case 10:return t.abrupt("return",!1);case 13:return t.prev=13,t.t0=t["catch"](0),console.error("处理内容失败:",t.t0),t.abrupt("return",!1);case 17:case"end":return t.stop()}}),t,null,[[0,13]])})))()},replaceItem:function(t){var e=this;return Object(q["a"])(Object(R["a"])().mark((function a(){var n,r;return Object(R["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.processAndReplaceContent(e.TemList,t);case 3:n=a.sent,n?(e.matchResults=e.matchResults.filter((function(e){return e!==t})),e.onUpload(),e.$message.success("替换成功")):e.$message.warning("未获取到替换内容"),a.next=11;break;case 7:a.prev=7,a.t0=a["catch"](0),console.error("替换失败:",a.t0),e.$message.error((null===(r=a.t0.response)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.message)||"替换失败");case 11:case"end":return a.stop()}}),a,null,[[0,7]])})))()},replaceAll:function(){var t=this;return Object(q["a"])(Object(R["a"])().mark((function e(){var a,n,r,o,c;return Object(R["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.batchReplaceLoading=!0,e.prev=1,a=t.matchResults.map((function(t){return t.replace(/[\[\]【】]/g,"")})),n={template_location:[],middle_layer_location:[],tech_report_location:[],other_location:[]},a.forEach((function(e){var a=t.getDocumentType(e);Object.keys(n).forEach((function(t){a===t?n[t].push(e):n[t].push("")}))})),e.next=7,V.a.post("".concat("http://183.195.216.54:8084","/project-raw-data/batch-content"),n,{headers:{"Content-Type":"application/json"}});case 7:if(r=e.sent,200!==r.status||!r.data){e.next=20;break}if(o=r.data.data.matched_data,!(o&&o.length>0)){e.next=19;break}return t.TemList.forEach((function(e,a){var n=e.content;t.matchResults.forEach((function(e,a){var r,c=null===(r=o[a])||void 0===r?void 0:r.content;c&&(n=t.processTableContent(n,e,c))})),t.$set(t.TemList[a],"content",n)})),e.next=14,t.onUpload();case 14:t.matchResults=[],t.$message.success("批量替换成功"),t.replaceVisible=!1,e.next=20;break;case 19:t.$message.warning("未获取到替换内容");case 20:e.next=26;break;case 22:e.prev=22,e.t0=e["catch"](1),console.error("批量替换失败:",e.t0),t.$message.error((null===(c=e.t0.response)||void 0===c||null===(c=c.data)||void 0===c?void 0:c.message)||"批量替换失败");case 26:return e.prev=26,t.batchReplaceLoading=!1,e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[1,22,26,29]])})))()}},Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])($,"getDocumentType",(function(t){return t.includes("-RP-")?"template_location":t.includes("-IR-")?"middle_layer_location":t.includes("-WE-")?"tech_report_location":"other_location"})),"processTableContent",(function(t,e,a){var n=this,r=document.createElement("div");r.innerHTML=t;var o=r.getElementsByTagName("table");Array.from(o).forEach((function(t){var r="border-collapse: collapse; width: 100%; margin: 10px 0;",o="border: 1px solid #dcdfe6; padding: 8px; text-align: left;",c=t.getAttribute("style")||"";t.setAttribute("style","".concat(r," ").concat(c));var i=t.getElementsByTagName("td");Array.from(i).forEach((function(t){var r=t.getAttribute("style")||"";if(t.setAttribute("style","".concat(o," ").concat(r)),t.textContent.includes(e)){var c=t.getAttribute("class")||"",i=n.parseContent(a);n.containsTableOrImage(i)?t.innerHTML=i:t.innerHTML=t.innerHTML.replace(new RegExp(n.escapeRegExp(e),"g"),i),c&&t.setAttribute("class",c)}}));var s=t.getElementsByTagName("th");Array.from(s).forEach((function(t){var e=t.getAttribute("style")||"";t.setAttribute("style","".concat(o," background-color: #f5f7fa; font-weight: bold; ").concat(e))}))}));var c=this.getTextNodes(r);return c.forEach((function(t){if(t.textContent.includes(e)){var r=n.parseContent(a),o=document.createElement("span");o.innerHTML=t.textContent.replace(new RegExp(n.escapeRegExp(e),"g"),r),t.parentNode.replaceChild(o,t)}})),r.innerHTML})),"convertTextToHtml",(function(t){if(!t)return"";var e=t;return e=e.replace(/\[表格\|style=(.*?)\|class=(.*?)\]([\s\S]*?)(?=\[|$)/g,(function(t,e,a,n){var r=n.trim().split("\n"),o='<table style="'.concat(e,'; border-collapse: collapse;" class="').concat(a,'">');return r.forEach((function(t,e){var a=t.split("|").map((function(t){return t.trim()})),n=Object(C["a"])(a,2),r=n[0],c=n[1];r&&(o+="<tr>",o+=c?'\n <td style="border: 1px solid #000; padding: 8px;">'.concat(r,'</td>\n <td style="border: 1px solid #000; padding: 8px;">').concat(c,"</td>\n "):'\n <td style="border: 1px solid #000; padding: 8px; font-weight: '.concat(0===e?"bold":"normal",'">').concat(r,"</td>\n "),o+="</tr>")})),o+="</table>",o})),e=e.replace(/\[图片:(.*?)\|style=(.*?)\|class=(.*?)\]/g,(function(t,e,a,n){return'<img src="'.concat(e,'" alt="图片" style="').concat(a,'" class="').concat(n,'">')})),e=e.replace(/\[文本:(.*?)\|style=(.*?)\|class=(.*?)\]/g,(function(t,e,a,n){return'<span style="'.concat(a,'" class="').concat(n,'">').concat(e,"</span>")})),e})),"escapeRegExp",(function(t){var e=t.startsWith("【"),a=e?t.replace(/^【|】$/g,""):t.replace(/^\[|\]$/g,""),n=a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return e?"\\【".concat(n,"\\】"):"\\[".concat(n,"\\]")})),"selTemplate",(function(t){this.currentData=t,this.selectedTemplates=[],this.templateQueryForm.page=1,this.loadTemplateList()})),"handleTemplatePageChange",(function(t){this.templateQueryForm.page=t,this.loadTemplateList()})),"loadTemplateList",(function(){var t=this;this.templateLoading=!0,Object(p["k"])(this.templateQueryForm).then((function(e){200===e.status&&(t.templateList=e.data.dataList,t.templateTotal=e.data.totalRecord,t.templateDialogVisible=!0)})).finally((function(){t.templateLoading=!1}))})),"handleTemplateSelect",(function(t){this.selectedTemplates=t})),"closeTemplateDialog",(function(){this.templateDialogVisible=!1,this.selectedTemplates=[],this.$refs.templateTable.clearSelection()})),"confirmTemplateSelection",(function(){var t=this;if(0!==this.selectedTemplates.length){var e=this.selectedTemplates.map((function(t){return t.id}));Object(u["g"])({project_id:this.currentData.id,doc_ids:JSON.stringify(e)}).then((function(e){200===e.status&&(t.$message.success("模版关联成功"),t.closeTemplateDialog(),t.search())}))}else this.$message.warning("请至少选择一个模版")})),Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])(Object(x["a"])($,"toggleRowSelection",(function(t,e){this.$refs.templateTable.toggleRowSelection(t,e)})),"toggleAllSelection",(function(){this.$refs.templateTable.toggleAllSelection()})),"enterPro",(function(t){this.$router.push({path:"/project/ProjectInput",query:{id:t.id}})})),"getCategoryName",(function(t){var e=this.categoryList.find((function(e){return e.id===t}));return e?e.name:t})),"searchData",(function(){var t=this;t.dialogVisible=!1,t.search()})),"btnDelete",(function(t){var e=this,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(u["d"])(a).then((function(t){e.search()}))})).catch((function(){}))})),"btnEdit",(function(t){var e=this;e.currentDataId=t.id,e.dialogVisible=!0})),"onClose",(function(t){console.log("onClose triggered with needRefresh:",t),this.currentDataId=0,this.dialogVisible=!1,t&&this.search()})),"handleUpdate",(function(){this.search()})),"search",(function(){console.log("search triggered");var t=this;Object(u["i"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)}))})),Object(x["a"])(Object(x["a"])($,"ChangePage",(function(t){var e=this;e.queryForm.page=t,e.search()})),"init",(function(){var t=this;Object(u["h"])().then((function(e){200===e.status&&(t.categoryList=e.data.dataList)}))})))},z=N,P=(a("f9de"),Object(g["a"])(z,w,_,!1,null,null,null)),B=P.exports,U={components:{dataSearch:T,dataList:B},data:function(){return{queryForm:{page:1,pageSize:10,name:"",category_id:"",status:"",isUpdate:!1}}},methods:{setQuery:function(t){this.queryForm=t}}},Q=U,H=(a("3672"),Object(g["a"])(Q,n,r,!1,null,null,null));e["default"]=H.exports},ad9d:function(t,e,a){"use strict";var n=a("23e7"),r=a("1d80"),o=a("44e7"),c=a("ad6d"),i=a("b622"),s=a("c430"),l=i("replace"),u=RegExp.prototype;n({target:"String",proto:!0},{replaceAll:function t(e,a){var n,i,d,p,m,f,g,b,h,v=r(this);if(null!=e){if(n=o(e),n&&(i=String(r("flags"in u?e.flags:c.call(e))),!~i.indexOf("g")))throw TypeError("`.replaceAll` does not allow non-global regexes");if(d=e[l],void 0!==d)return d.call(e,v,a);if(s&&n)return String(v).replace(e,a)}if(p=String(v),m=String(e),""===m)return t.call(p,/(?:)/g,a);if(f=p.split(m),"function"!==typeof a)return f.join(String(a));for(g=f[0],b=g.length,h=1;h<f.length;h++)g+=String(a(m,b,p)),b+=m.length+f[h].length,g+=f[h];return g}})},ce6c:function(t,e,a){"use strict";a("1831")},eb4d:function(t,e,a){},f6b0:function(t,e,a){"use strict";a.d(e,"a",(function(){return r})),a.d(e,"b",(function(){return o}));var n=a("b775");function r(t){return Object(n["a"])({url:"/customer/search",method:"post",data:t})}function o(){return Object(n["a"])({url:"/customer/sync",method:"post"})}},f7d1:function(t,e,a){"use strict";a("035f")},f9de:function(t,e,a){"use strict";a("064f")}}]);
|