@gitee-code/plugin-xtreme 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,4 +28,4 @@
28
28
  }
29
29
 
30
30
  .view_log[data-v-a169622c]{color:var(--blue-6)}.new_knowledge_dialog .el-dialog__footer[data-v-a169622c]{display:none}
31
- .tabs-container[data-v-27dff7de]{position:relative}.filter_icon[data-v-27dff7de]{position:absolute;top:10px;right:0}
31
+ .tabs-container[data-v-6f8f6caf]{position:relative}.filter_icon[data-v-6f8f6caf]{position:absolute;top:10px;right:0}
@@ -1 +1 @@
1
- (()=>{"use strict";var t=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("PageTitle",[t._v(t._s(t.$t("conversation_manage.title")))]),t._v(" "),o("div",{staticClass:"tabs-container"},[o("ElTabs",{on:{"tab-click":t.changeTab},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[o("ElTabPane",{attrs:{label:t.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}}),t._v(" "),o("ElTabPane",{attrs:{label:t.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}})],1),t._v(" "),o("FilterIcon",{staticClass:"filter_icon",attrs:{"show-search-filter":t.showSearchFilter},on:{"update:showSearchFilter":function(e){t.showSearchFilter=e},"update:show-search-filter":function(e){t.showSearchFilter=e}}})],1),t._v(" "),o("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage}},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent},scopedSlots:t._u([{key:"header",fn:function(){return[o("SearchFilter",{ref:"searchFilter",attrs:{opened:t.showSearchFilter},on:{search:t.handleSearch}})]},proxy:!0}])})],1)};t._withStripped=!0;var e=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"node_count cursor-pointer",on:{click:t.showNotes}},[t._v("\n "+t._s(t.noteCount)+"\n")])};e._withStripped=!0;var o=function(){var t=this,e=t.$createElement;return(t._self._c||e)("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage},disableMinHeight:!0},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent}})};function a(t,e,o,a,i,s,n,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=o,c._compiled=!0),a&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),n?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},c._ssrRegister=l):i&&(l=r?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var h=c.render;c.render=function(t,e){return l.call(e),h(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}o._withStripped=!0;const i=a({name:"NoteList",props:{rowData:{type:Object}},data:()=>({tableData:[],loading:!1,totalCount:0,page:1,perPage:10}),computed:{columns(){return[{label:this.$t("conversation_manage.file_path"),prop:"file","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.location"),prop:"location",width:100,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.content"),prop:"content","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.level"),prop:"level","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.isAdopted"),prop:"is_adopted",width:100,formatter:t=>t.is_adopted?this.$t("site.yes"):this.$t("site.no")}]}},mounted(){this.getList()},methods:{changeCurrent(t){this.page=t,this.getList()},changeSize(t){this.perPage=t,this.page=1,this.getList()},getList(){this.loading=!0,this.api.conversationManage.getNoteList(this.rowData.id,{page:this.page,per_page:this.perPage}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=t.data||[]})).finally((()=>{this.loading=!1}))}}},o,[],!1,null,null,null).exports,s=a({name:"NoteCount",props:{rowData:{type:Object,required:!0}},computed:{noteCount(){return this.rowData.comment_count||0}},methods:{showNotes(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_report"),width:"60%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(i,{props:{rowData:this.rowData}})},footer:{render:t=>t(null)}}}),this.$store.commit("showDialog")}}},e,[],!1,null,"495d7414",null).exports;var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"conversation_status",class:t.conversationStatus.class},[t._v("\n "+t._s(t.conversationStatus.text)+"\n")])};n._withStripped=!0;const r=a({name:"ConversationStatus",props:{rowData:{type:Object}},computed:{conversationStatus(){const t=this.rowData.status;return{text:t,class:{RUNNING:"iconrunning",SUCCESS:"text-green",FAIL:"text-red",INIT:"warn",STOP:"text-muted"}[t]||""}}}},n,[],!1,null,"6a2bde98",null).exports;var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("span",{staticClass:"view_log cursor-pointer",on:{click:t.showLogs}},[t._v(t._s(t.$t("conversation_manage.view_detail")))])])};l._withStripped=!0;var c=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.execLog||t.loading?o("div",{ref:"logDetail",staticClass:"log_detail_wrap"},[o("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]),t._v(" "),t.loading?o("i",{staticClass:"el-icon-loading"}):t._e()]):o("NoData",{staticClass:"no_data"}),t._v(" "),o("div",{staticClass:"footer_wrap"},[o("el-button",{attrs:{type:"primary"},on:{click:t.handleRefresh}},[t._v("\n "+t._s(t.$t("conversation_manage.refresh"))+"\n ")])],1)],1)};c._withStripped=!0;const h=a({name:"LogDialog",props:{rowData:{type:Object}},data:()=>({loading:!0,execLog:"",timer:null}),computed:{isCodeReview(){return"code_review"===this.rowData.tab}},mounted(){this.getExecLog()},beforeDestroy(){this.stopGetDetail()},methods:{stopGetDetail(){this.timer&&clearTimeout(this.timer)},getExecLog(){this.toBottom();let t=null;t=this.isCodeReview?this.api.conversationManage.logDetail(this.rowData.id):this.api.conversationManage.unitTestLogDetail(this.rowData.uuid),t.then((({data:t})=>{this.isCodeReview?this.execLog=t.logs.map((t=>`[${moment(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}] ${t.step} ${t.message} ${t.duration?`${this.$t("conversation_manage.use_time")}(${t.duration})`:""}`)).join("\n"):this.execLog=t.logs.join("\n"),this.$emit("update:rowData",{...t}),this.toBottom(),["INIT","RUNNING"].includes(this.rowData.status)&&["INIT","RUNNING"].includes(t.status)&&(this.timer=setTimeout((()=>{this.getExecLog()}),5e3)),["INIT","RUNNING"].includes(t.status)||(this.loading=!1)}))},toBottom(){this.$nextTick((()=>{this.$refs.logDetail&&(this.$refs.logDetail.scrollTop=this.$refs.logDetail.scrollHeight)}))},handleRefresh(){this.stopGetDetail(),this.getExecLog()}}},c,[],!1,null,null,null).exports,p=a({name:"LogDetail",props:{rowData:{type:Object,required:!0}},data:()=>({loading:!1,row:null}),methods:{showLogs(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_logs"),width:"40%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(h,{ref:"logDialog",props:{rowData:this.rowData},on:{"update:rowData":t=>{this.row=t}}})},footer:{render:t=>t(null)}},events:{close:this.handleCancel}}),this.$store.commit("showDialog")},handleCancel(){this.$emit("action","updateRow",{...this.rowData,...this.row}),this.$store.commit("hideDialog")}}},l,[],!1,null,"a169622c",null).exports;var d=function(){var t=this,e=t.$createElement;return(t._self._c||e)("MoreActions",{attrs:{menu:t.actions,width:"80"}})};d._withStripped=!0;const g=a({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("conversation_manage.restart_run"),prop:"restart",action:this.reStart,visible:!["RUNNING"].includes(this.rowData.status)},{label:this.$t("conversation_manage.stop_task"),prop:"stop",action:this.delete,visible:["INIT","RUNNING"].includes(this.rowData.status)}].filter((t=>t.visible))}},methods:{reStart(){this.$emit("action","restartTask",this.rowData)},delete(){this.$emit("action","stopTask",this.rowData)}}},d,[],!1,null,null,null).exports;var m=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("CommonListFilter",{attrs:{"clear-disabled":t.clearDisabled,opened:t.opened,placeholder:t.$t_join("please_enter","conversation_manage.repo_name")},on:{search:t.handleSearch,clearFilter:t.clearFilter},scopedSlots:t._u([{key:"filterRight",fn:function(){return[o("DropDown",{attrs:{label:t.$t("conversation_manage.conversation_status"),options:t.types,value:t.status},on:{input:t.handleCommand}})]},proxy:!0}]),model:{value:t.keywords,callback:function(e){t.keywords=e},expression:"keywords"}})};m._withStripped=!0;const u=a({name:"SearchFilter",components:{DropDown:window.comps.DropDown,CommonListFilter:window.comps.CommonListFilter},props:{opened:Boolean},data:()=>({keywords:"",status:null}),computed:{clearDisabled(){return!this.keywords&&!this.status},types:()=>[{label:"RUNNING",value:"RUNNING"},{label:"SUCCESS",value:"SUCCESS"},{label:"FAIL",value:"FAIL"},{label:"INIT",value:"INIT"},{label:"STOP",value:"STOP"}]},methods:{handleSearch(){this.$emit("search",{keywords:this.keywords,status:this.status})},handleCommand(t){this.status=t,this.handleSearch()},clearFilter(){this.clearSearchData(),this.handleSearch()},clearSearchData(){this.keywords="",this.status=null}}},m,[],!1,null,null,null).exports,_=a({name:"ConversationManage",components:{FilterIcon:window.comps.FilterIcon,SearchFilter:u},data:()=>({tab:"code_review",tableData:[],totalCount:0,page:1,perPage:20,loading:!1,showSearchFilter:!0,params:null}),computed:{codeReviewColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_pr"),prop:"pr_title","show-overflow-tooltip":!0,formatter:t=>`!${t.pr_iid} ${t.pr_title}`},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.note_count"),prop:"comment_count",component:s,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:p,action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:g,action:this.handleRowAction}]},unitTestColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_branch"),prop:"target_branch","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.change_count"),prop:"commit_interval","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?moment(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?moment(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:p},{label:this.$t("conversation_manage.adoption_status"),prop:"is_adopted",formatter:t=>t.is_adopted?this.$t("conversation_manage.adoption_yes"):this.$t("conversation_manage.adoption_no"),action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:g,action:this.handleRowAction}]},isCodeReview(){return"code_review"===this.tab},columns(){return this.isCodeReview?this.codeReviewColumns:this.unitTestColumns}},mounted(){this.getList()},methods:{changeSize(t){this.perPage=t,this.page=1,this.getList()},changeCurrent(t){this.page=t,this.getList()},changeTab(){this.$refs.searchFilter.clearFilter(),this.params=null,this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.conversationManage[this.isCodeReview?"getCodeReviewList":"getUnitTestList"]({page:this.page,per_page:this.perPage,...this.params}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=(t.data||[]).map((t=>({...t,tab:this.tab})))||[]})).finally((()=>{this.loading=!1}))},restartTask(t){this.$confirm(this.$t("conversation_manage.restart_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.reStartTask(t.id):this.api.conversationManage.reStartUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})},stopTask(t){this.$confirm(this.$t("conversation_manage.stop_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.stopTask(t.id):this.api.conversationManage.stopUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})},handleSearch(t){this.params=t,this.page=1,this.getList()},updateRow(t){const e=this.tableData.findIndex((e=>e.id===t.id));this.$set(this.tableData,e,{...t})}}},t,[],!1,null,"27dff7de",null).exports;function w(){const{enterprise_uuid:t}=window.gon.info;return`api/enterprises/${t}/`}window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#xtreme",component:_,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/${w()}unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/${w()}unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${w()}unit_test_tasks/${t}/logs`)))})();
1
+ (()=>{"use strict";var t=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("PageTitle",[t._v(t._s(t.$t("conversation_manage.title")))]),t._v(" "),o("div",{staticClass:"tabs-container"},[o("ElTabs",{on:{"tab-click":t.changeTab},model:{value:t.tab,callback:function(e){t.tab=e},expression:"tab"}},[o("ElTabPane",{attrs:{label:t.$t("conversation_manage.code_review_helper_tab"),name:"code_review"}}),t._v(" "),o("ElTabPane",{attrs:{label:t.$t("conversation_manage.unit_test_helper_tab"),name:"unit_test"}})],1),t._v(" "),o("FilterIcon",{staticClass:"filter_icon",attrs:{"show-search-filter":t.showSearchFilter},on:{"update:showSearchFilter":function(e){t.showSearchFilter=e},"update:show-search-filter":function(e){t.showSearchFilter=e}}})],1),t._v(" "),o("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage}},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent},scopedSlots:t._u([{key:"header",fn:function(){return[o("SearchFilter",{ref:"searchFilter",attrs:{opened:t.showSearchFilter},on:{search:t.handleSearch}})]},proxy:!0}])})],1)};t._withStripped=!0;var e=function(){var t=this,e=t.$createElement;return(t._self._c||e)("span",{staticClass:"node_count cursor-pointer",on:{click:t.showNotes}},[t._v("\n "+t._s(t.noteCount)+"\n")])};e._withStripped=!0;var o=function(){var t=this,e=t.$createElement;return(t._self._c||e)("CommonList",{attrs:{"table-data":t.tableData,columns:t.columns,loading:t.loading,pending:t.loading&&!!t.tableData.length,pagination:{count:t.totalCount,page:t.page,per_page:t.perPage},disableMinHeight:!0},on:{changeSize:t.changeSize,changeCurrent:t.changeCurrent}})};function a(t,e,o,a,i,s,n,r){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=o,c._compiled=!0),a&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),n?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},c._ssrRegister=l):i&&(l=r?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var h=c.render;c.render=function(t,e){return l.call(e),h(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}o._withStripped=!0;const i=a({name:"NoteList",props:{rowData:{type:Object}},data:()=>({tableData:[],loading:!1,totalCount:0,page:1,perPage:10}),computed:{columns(){return[{label:this.$t("conversation_manage.file_path"),prop:"file","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.location"),prop:"location",width:100,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.content"),prop:"content","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.level"),prop:"level","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.isAdopted"),prop:"is_adopted",width:100,formatter:t=>t.is_adopted?this.$t("site.yes"):this.$t("site.no")}]}},mounted(){this.getList()},methods:{changeCurrent(t){this.page=t,this.getList()},changeSize(t){this.perPage=t,this.page=1,this.getList()},getList(){this.loading=!0,this.api.conversationManage.getNoteList(this.rowData.id,{page:this.page,per_page:this.perPage}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=t.data||[]})).finally((()=>{this.loading=!1}))}}},o,[],!1,null,null,null).exports,s=a({name:"NoteCount",props:{rowData:{type:Object,required:!0}},computed:{noteCount(){return this.rowData.comment_count||0}},methods:{showNotes(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_report"),width:"60%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(i,{props:{rowData:this.rowData}})},footer:{render:t=>t(null)}}}),this.$store.commit("showDialog")}}},e,[],!1,null,"495d7414",null).exports;var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"conversation_status",class:t.conversationStatus.class},[t._v("\n "+t._s(t.conversationStatus.text)+"\n")])};n._withStripped=!0;const r=a({name:"ConversationStatus",props:{rowData:{type:Object}},computed:{conversationStatus(){const t=this.rowData.status;return{text:t,class:{RUNNING:"iconrunning",SUCCESS:"text-green",FAIL:"text-red",INIT:"warn",STOP:"text-muted"}[t]||""}}}},n,[],!1,null,"6a2bde98",null).exports;var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("span",{staticClass:"view_log cursor-pointer",on:{click:t.showLogs}},[t._v(t._s(t.$t("conversation_manage.view_detail")))])])};l._withStripped=!0;var c=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[t.execLog||t.loading?o("div",{ref:"logDetail",staticClass:"log_detail_wrap"},[o("pre",{staticClass:"log_detail"},[t._v(t._s(t.execLog))]),t._v(" "),t.loading?o("i",{staticClass:"el-icon-loading"}):t._e()]):o("NoData",{staticClass:"no_data"}),t._v(" "),o("div",{staticClass:"footer_wrap"},[o("el-button",{attrs:{type:"primary"},on:{click:t.handleRefresh}},[t._v("\n "+t._s(t.$t("conversation_manage.refresh"))+"\n ")])],1)],1)};function h(){const{enterprise_uuid:t}=window.gon.info;return`api/enterprises/${t}/`}function p(){return window.GITEE.tools.moment||moment}c._withStripped=!0;const d=a({name:"LogDialog",props:{rowData:{type:Object}},data:()=>({loading:!0,execLog:"",timer:null}),computed:{isCodeReview(){return"code_review"===this.rowData.tab}},mounted(){this.getExecLog()},beforeDestroy(){this.stopGetDetail()},methods:{stopGetDetail(){this.timer&&clearTimeout(this.timer)},getExecLog(){this.toBottom();let t=null;t=this.isCodeReview?this.api.conversationManage.logDetail(this.rowData.id):this.api.conversationManage.unitTestLogDetail(this.rowData.uuid),t.then((({data:t})=>{this.isCodeReview?this.execLog=t.logs.map((t=>`[${p(t.timestamp).format("YYYY-MM-DD HH:mm:ss")}] ${t.step} ${t.message} ${t.duration?`${this.$t("conversation_manage.use_time")}(${t.duration})`:""}`)).join("\n"):this.execLog=t.logs.join("\n"),this.$emit("update:rowData",{...t}),this.toBottom(),["INIT","RUNNING"].includes(this.rowData.status)&&["INIT","RUNNING"].includes(t.status)&&(this.timer=setTimeout((()=>{this.getExecLog()}),5e3)),["INIT","RUNNING"].includes(t.status)||(this.loading=!1)}))},toBottom(){this.$nextTick((()=>{this.$refs.logDetail&&(this.$refs.logDetail.scrollTop=this.$refs.logDetail.scrollHeight)}))},handleRefresh(){this.stopGetDetail(),this.getExecLog()}}},c,[],!1,null,null,null).exports,g=a({name:"LogDetail",props:{rowData:{type:Object,required:!0}},data:()=>({loading:!1,row:null}),methods:{showLogs(){this.$store.commit("updateDialog",{props:{title:this.$t("conversation_manage.view_logs"),width:"40%",customClass:"conversation_note_dialog"},slots:{default:{render:t=>t(d,{ref:"logDialog",props:{rowData:this.rowData},on:{"update:rowData":t=>{this.row=t}}})},footer:{render:t=>t(null)}},events:{close:this.handleCancel}}),this.$store.commit("showDialog")},handleCancel(){this.$emit("action","updateRow",{...this.rowData,...this.row}),this.$store.commit("hideDialog")}}},l,[],!1,null,"a169622c",null).exports;var u=function(){var t=this,e=t.$createElement;return(t._self._c||e)("MoreActions",{attrs:{menu:t.actions,width:"80"}})};u._withStripped=!0;const m=a({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("conversation_manage.restart_run"),prop:"restart",action:this.reStart,visible:!["RUNNING"].includes(this.rowData.status)},{label:this.$t("conversation_manage.stop_task"),prop:"stop",action:this.delete,visible:["INIT","RUNNING"].includes(this.rowData.status)}].filter((t=>t.visible))}},methods:{reStart(){this.$emit("action","restartTask",this.rowData)},delete(){this.$emit("action","stopTask",this.rowData)}}},u,[],!1,null,null,null).exports;var _=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("CommonListFilter",{attrs:{"clear-disabled":t.clearDisabled,opened:t.opened,placeholder:t.$t_join("please_enter","conversation_manage.repo_name")},on:{search:t.handleSearch,clearFilter:t.clearFilter},scopedSlots:t._u([{key:"filterRight",fn:function(){return[o("DropDown",{attrs:{label:t.$t("conversation_manage.conversation_status"),options:t.types,value:t.status},on:{input:t.handleCommand}})]},proxy:!0}]),model:{value:t.keywords,callback:function(e){t.keywords=e},expression:"keywords"}})};_._withStripped=!0;const w=a({name:"SearchFilter",components:{DropDown:window.comps.DropDown,CommonListFilter:window.comps.CommonListFilter},props:{opened:Boolean},data:()=>({keywords:"",status:null}),computed:{clearDisabled(){return!this.keywords&&!this.status},types:()=>[{label:"RUNNING",value:"RUNNING"},{label:"SUCCESS",value:"SUCCESS"},{label:"FAIL",value:"FAIL"},{label:"INIT",value:"INIT"},{label:"STOP",value:"STOP"}]},methods:{handleSearch(){this.$emit("search",{keywords:this.keywords,status:this.status})},handleCommand(t){this.status=t,this.handleSearch()},clearFilter(){this.clearSearchData(),this.handleSearch()},clearSearchData(){this.keywords="",this.status=null}}},_,[],!1,null,null,null).exports,v=a({name:"ConversationManage",components:{FilterIcon:window.comps.FilterIcon,SearchFilter:w},data:()=>({tab:"code_review",tableData:[],totalCount:0,page:1,perPage:20,loading:!1,showSearchFilter:!0,params:null}),computed:{codeReviewColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_pr"),prop:"pr_title","show-overflow-tooltip":!0,formatter:t=>`!${t.pr_iid} ${t.pr_title}`},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?p(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?p(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.note_count"),prop:"comment_count",component:s,"show-overflow-tooltip":!0},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:g,action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:m,action:this.handleRowAction}]},unitTestColumns(){return[{label:this.$t("conversation_manage.conversation_id"),prop:"id","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.belong_branch"),prop:"target_branch","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.change_count"),prop:"commit_interval","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.repo"),prop:"project_name","show-overflow-tooltip":!0},{label:this.$t("conversation_manage.conversation_status"),prop:"status","show-overflow-tooltip":!0,component:r},{label:this.$t("conversation_manage.create_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:t=>t.created_at?p(t.created_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.ent_time"),prop:"finished_at","show-overflow-tooltip":!0,formatter:t=>t.finished_at?p(t.finished_at).format("YYYY-MM-DD HH:mm:ss"):""},{label:this.$t("conversation_manage.exec_log"),prop:"exec_log","show-overflow-tooltip":!0,component:g},{label:this.$t("conversation_manage.adoption_status"),prop:"is_adopted",formatter:t=>t.is_adopted?this.$t("conversation_manage.adoption_yes"):this.$t("conversation_manage.adoption_no"),action:this.handleRowAction},{label:this.$t("action"),prop:"action",width:100,component:m,action:this.handleRowAction}]},isCodeReview(){return"code_review"===this.tab},columns(){return this.isCodeReview?this.codeReviewColumns:this.unitTestColumns}},mounted(){this.getList()},methods:{changeSize(t){this.perPage=t,this.page=1,this.getList()},changeCurrent(t){this.page=t,this.getList()},changeTab(){this.$refs.searchFilter.clearFilter(),this.params=null,this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.conversationManage[this.isCodeReview?"getCodeReviewList":"getUnitTestList"]({page:this.page,per_page:this.perPage,...this.params}).then((({data:t})=>{this.totalCount=t.meta.total_count,this.tableData=(t.data||[]).map((t=>({...t,tab:this.tab})))||[]})).finally((()=>{this.loading=!1}))},restartTask(t){this.$confirm(this.$t("conversation_manage.restart_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.reStartTask(t.id):this.api.conversationManage.reStartUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})},stopTask(t){this.$confirm(this.$t("conversation_manage.stop_task_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(e,o,a)=>{if("confirm"===e){o.confirmButtonLoading=!0;let e=null;e=this.isCodeReview?this.api.conversationManage.stopTask(t.id):this.api.conversationManage.stopUnitTestTask(t.uuid),e.then((()=>{this.getList(),a()})).finally((()=>{o.confirmButtonLoading=!1}))}else a()}})},handleSearch(t){this.params=t,this.page=1,this.getList()},updateRow(t){const e=this.tableData.findIndex((e=>e.id===t.id));this.$set(this.tableData,e,{...t})}}},t,[],!1,null,"6f8f6caf",null).exports;window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/conversation_manage`,name:"company#xtreme",component:v,meta:{title:()=>"会话管理"}}]),window.GITEE.api.register("conversationManage","getCodeReviewList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}review_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getUnitTestList",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}unit_test_tasks`,{params:t}))),window.GITEE.api.register("conversationManage","getNoteList",((t,e)=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}review_tasks/${t}/notes`,{params:e}))),window.GITEE.api.register("conversationManage","reStartTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}review_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","stopTask",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}review_tasks/${t}/break`))),window.GITEE.api.register("conversationManage","logDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}review_tasks/${t}/logs`))),window.GITEE.api.register("conversationManage","stopUnitTestTask",(t=>window.GITEE.tools.$http.delete(`/api/xtreme/${h()}unit_test_tasks/${t}/cancel`))),window.GITEE.api.register("conversationManage","reStartUnitTestTask",(t=>window.GITEE.tools.$http.post(`/api/xtreme/${h()}unit_test_tasks/${t}/retry`))),window.GITEE.api.register("conversationManage","unitTestLogDetail",(t=>window.GITEE.tools.$http.get(`/api/xtreme/${h()}unit_test_tasks/${t}/logs`)))})();
@@ -1 +1 @@
1
- (()=>{var e={1989:(e,t,o)=>{var r=o(1789),n=o(401),i=o(7667),s=o(1327),a=o(1866);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},8407:(e,t,o)=>{var r=o(7040),n=o(4125),i=o(2117),s=o(7518),a=o(4705);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},7071:(e,t,o)=>{var r=o(852)(o(5639),"Map");e.exports=r},3369:(e,t,o)=>{var r=o(4785),n=o(1285),i=o(6e3),s=o(9916),a=o(5265);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},6384:(e,t,o)=>{var r=o(8407),n=o(7465),i=o(3779),s=o(7599),a=o(4758),l=o(4309);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,o)=>{var r=o(5639).Symbol;e.exports=r},1149:(e,t,o)=>{var r=o(5639).Uint8Array;e.exports=r},6874:e=>{e.exports=function(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}},4636:(e,t,o)=>{var r=o(2545),n=o(5694),i=o(1469),s=o(4144),a=o(5776),l=o(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var o=i(e),d=!o&&n(e),p=!o&&!d&&s(e),u=!o&&!d&&!p&&l(e),h=o||d||p||u,m=h?r(e.length,String):[],f=m.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||p&&("offset"==g||"parent"==g)||u&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,f))||m.push(g);return m}},6556:(e,t,o)=>{var r=o(9465),n=o(7813);e.exports=function(e,t,o){(void 0!==o&&!n(e[t],o)||void 0===o&&!(t in e))&&r(e,t,o)}},4865:(e,t,o)=>{var r=o(9465),n=o(7813),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,o){var s=e[t];i.call(e,t)&&n(s,o)&&(void 0!==o||t in e)||r(e,t,o)}},8470:(e,t,o)=>{var r=o(7813);e.exports=function(e,t){for(var o=e.length;o--;)if(r(e[o][0],t))return o;return-1}},9465:(e,t,o)=>{var r=o(8777);e.exports=function(e,t,o){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}},3118:(e,t,o)=>{var r=o(3218),n=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(n)return n(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();e.exports=i},8483:(e,t,o)=>{var r=o(5063)();e.exports=r},4239:(e,t,o)=>{var r=o(2705),n=o(9607),i=o(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?n(e):i(e)}},9454:(e,t,o)=>{var r=o(4239),n=o(7005);e.exports=function(e){return n(e)&&"[object Arguments]"==r(e)}},8458:(e,t,o)=>{var r=o(3560),n=o(5346),i=o(3218),s=o(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,p=c.hasOwnProperty,u=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||n(e))&&(r(e)?u:a).test(s(e))}},8749:(e,t,o)=>{var r=o(4239),n=o(1780),i=o(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&n(e.length)&&!!s[r(e)]}},313:(e,t,o)=>{var r=o(3218),n=o(5726),i=o(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=n(e),o=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&o.push(a);return o}},2980:(e,t,o)=>{var r=o(6384),n=o(6556),i=o(8483),s=o(9783),a=o(3218),l=o(1704),c=o(6390);e.exports=function e(t,o,d,p,u){t!==o&&i(o,(function(i,l){if(u||(u=new r),a(i))s(t,o,l,d,e,p,u);else{var h=p?p(c(t,l),i,l+"",t,o,u):void 0;void 0===h&&(h=i),n(t,l,h)}}),l)}},9783:(e,t,o)=>{var r=o(6556),n=o(4626),i=o(7133),s=o(278),a=o(8517),l=o(5694),c=o(1469),d=o(9246),p=o(4144),u=o(3560),h=o(3218),m=o(8630),f=o(6719),g=o(6390),_=o(9881);e.exports=function(e,t,o,v,w,b,y){var x=g(e,o),$=g(t,o),E=y.get($);if(E)r(e,o,E);else{var k=b?b(x,$,o+"",e,t,y):void 0,C=void 0===k;if(C){var j=c($),O=!j&&p($),D=!j&&!O&&f($);k=$,j||O||D?c(x)?k=x:d(x)?k=s(x):O?(C=!1,k=n($,!0)):D?(C=!1,k=i($,!0)):k=[]:m($)||l($)?(k=x,l(x)?k=_(x):h(x)&&!u(x)||(k=a($))):C=!1}C&&(y.set($,k),w(k,$,v,b,y),y.delete($)),r(e,o,k)}}},5976:(e,t,o)=>{var r=o(6557),n=o(5357),i=o(61);e.exports=function(e,t){return i(n(e,t,r),e+"")}},6560:(e,t,o)=>{var r=o(5703),n=o(8777),i=o(6557),s=n?function(e,t){return n(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=s},2545:e=>{e.exports=function(e,t){for(var o=-1,r=Array(e);++o<e;)r[o]=t(o);return r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4318:(e,t,o)=>{var r=o(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},4626:(e,t,o)=>{e=o.nmd(e);var r=o(5639),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,s=i&&i.exports===n?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var o=e.length,r=a?a(o):new e.constructor(o);return e.copy(r),r}},7133:(e,t,o)=>{var r=o(4318);e.exports=function(e,t){var o=t?r(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var o=-1,r=e.length;for(t||(t=Array(r));++o<r;)t[o]=e[o];return t}},8363:(e,t,o)=>{var r=o(4865),n=o(9465);e.exports=function(e,t,o,i){var s=!o;o||(o={});for(var a=-1,l=t.length;++a<l;){var c=t[a],d=i?i(o[c],e[c],c,o,e):void 0;void 0===d&&(d=e[c]),s?n(o,c,d):r(o,c,d)}return o}},4429:(e,t,o)=>{var r=o(5639)["__core-js_shared__"];e.exports=r},1463:(e,t,o)=>{var r=o(5976),n=o(6612);e.exports=function(e){return r((function(t,o){var r=-1,i=o.length,s=i>1?o[i-1]:void 0,a=i>2?o[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,a&&n(o[0],o[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var l=o[r];l&&e(t,l,r,s)}return t}))}},5063:e=>{e.exports=function(e){return function(t,o,r){for(var n=-1,i=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++n];if(!1===o(i[l],l,i))break}return t}}},8777:(e,t,o)=>{var r=o(852),n=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},1957:(e,t,o)=>{var r="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g;e.exports=r},5050:(e,t,o)=>{var r=o(7019);e.exports=function(e,t){var o=e.__data__;return r(t)?o["string"==typeof t?"string":"hash"]:o.map}},852:(e,t,o)=>{var r=o(8458),n=o(7801);e.exports=function(e,t){var o=n(e,t);return r(o)?o:void 0}},5924:(e,t,o)=>{var r=o(5569)(Object.getPrototypeOf,Object);e.exports=r},9607:(e,t,o)=>{var r=o(2705),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),o=e[a];try{e[a]=void 0;var r=!0}catch(e){}var n=s.call(e);return r&&(t?e[a]=o:delete e[a]),n}},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,o)=>{var r=o(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,o)=>{var r=o(4536),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(t,e)?t[e]:void 0}},1327:(e,t,o)=>{var r=o(4536),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:n.call(t,e)}},1866:(e,t,o)=>{var r=o(4536);e.exports=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,o)=>{var r=o(3118),n=o(5924),i=o(5726);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(n(e))}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,o){var r=typeof e;return!!(o=null==o?9007199254740991:o)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<o}},6612:(e,t,o)=>{var r=o(7813),n=o(8612),i=o(5776),s=o(3218);e.exports=function(e,t,o){if(!s(o))return!1;var a=typeof t;return!!("number"==a?n(o)&&i(t,o.length):"string"==a&&t in o)&&r(o[t],e)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,o)=>{var r,n=o(4429),i=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var o=e&&e.constructor;return e===("function"==typeof o&&o.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,o)=>{var r=o(8470),n=Array.prototype.splice;e.exports=function(e){var t=this.__data__,o=r(t,e);return!(o<0||(o==t.length-1?t.pop():n.call(t,o,1),--this.size,0))}},2117:(e,t,o)=>{var r=o(8470);e.exports=function(e){var t=this.__data__,o=r(t,e);return o<0?void 0:t[o][1]}},7518:(e,t,o)=>{var r=o(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,o)=>{var r=o(8470);e.exports=function(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}},4785:(e,t,o)=>{var r=o(1989),n=o(8407),i=o(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||n),string:new r}}},1285:(e,t,o)=>{var r=o(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,o)=>{var r=o(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,o)=>{var r=o(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,o)=>{var r=o(5050);e.exports=function(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}},4536:(e,t,o)=>{var r=o(852)(Object,"create");e.exports=r},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}},1167:(e,t,o)=>{e=o.nmd(e);var r=o(1957),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,s=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(o){return e(t(o))}}},5357:(e,t,o)=>{var r=o(6874),n=Math.max;e.exports=function(e,t,o){return t=n(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=n(i.length-t,0),l=Array(a);++s<a;)l[s]=i[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=i[s];return c[t]=o(l),r(e,this,c)}}},5639:(e,t,o)=>{var r=o(1957),n="object"==typeof self&&self&&self.Object===Object&&self,i=r||n||Function("return this")();e.exports=i},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},61:(e,t,o)=>{var r=o(6560),n=o(1275)(r);e.exports=n},1275:e=>{var t=Date.now;e.exports=function(e){var o=0,r=0;return function(){var n=t(),i=16-(n-r);if(r=n,i>0){if(++o>=800)return arguments[0]}else o=0;return e.apply(void 0,arguments)}}},7465:(e,t,o)=>{var r=o(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,o)=>{var r=o(8407),n=o(7071),i=o(3369);e.exports=function(e,t){var o=this.__data__;if(o instanceof r){var s=o.__data__;if(!n||s.length<199)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,o)=>{var r=o(9454),n=o(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return n(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,o)=>{var r=o(3560),n=o(1780);e.exports=function(e){return null!=e&&n(e.length)&&!r(e)}},9246:(e,t,o)=>{var r=o(8612),n=o(7005);e.exports=function(e){return n(e)&&r(e)}},4144:(e,t,o)=>{e=o.nmd(e);var r=o(5639),n=o(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||n;e.exports=l},3560:(e,t,o)=>{var r=o(4239),n=o(3218);e.exports=function(e){if(!n(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,o)=>{var r=o(4239),n=o(5924),i=o(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,d=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=n(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&l.call(o)==d}},6719:(e,t,o)=>{var r=o(8749),n=o(1717),i=o(1167),s=i&&i.isTypedArray,a=s?n(s):r;e.exports=a},1704:(e,t,o)=>{var r=o(4636),n=o(313),i=o(8612);e.exports=function(e){return i(e)?r(e,!0):n(e)}},2492:(e,t,o)=>{var r=o(2980),n=o(1463)((function(e,t,o){r(e,t,o)}));e.exports=n},5062:e=>{e.exports=function(){return!1}},9881:(e,t,o)=>{var r=o(8363),n=o(1704);e.exports=function(e){return r(e,n(e))}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,o),i.loaded=!0,i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("PageTitle",[e._v("\n "+e._s(e.$t("knowledge.knowledge"))+"\n "),o("ElButton",{attrs:{type:"osc"},on:{click:e.handleNewKnowledge}},[o("i",{staticClass:"iconfont-new iconadd-code"}),e._v("\n "+e._s(e.$t_join("create","knowledge.knowledge"))+"\n ")])],1),e._v(" "),e.knowledgeList.length||e.loading?[o("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"knowledge-list"},e._l(e.knowledgeList,(function(t,r){return o("KnowledgeCard",{key:r,attrs:{item:t},on:{update:function(o){return e.handleUpdate(t)},delete:function(o){return e.handleDelete(t)}}})})),1),e._v(" "),e.loading?e._e():o("ElPagination",{attrs:{"current-page":e.page,"page-size":e.perPage,"page-sizes":[10,20,30,40],layout:"prev, adaption, next, jumper, sizes",total:e.totalCount,background:""},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})]:o("NoData")],2)};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"knowledge_card_item cursor-pointer",on:{click:e.handleclick}},[o("div",{staticClass:"knowledge_card_item_header"},[o("svg",{staticClass:"icon",attrs:{t:"1757991239604",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6796",width:"40",height:"40"}},[o("path",{attrs:{d:"M0 0m307.2 0l409.6 0q307.2 0 307.2 307.2l0 409.6q0 307.2-307.2 307.2l-409.6 0q-307.2 0-307.2-307.2l0-409.6q0-307.2 307.2-307.2Z",fill:"#1389FF","p-id":"6797"}}),e._v(" "),o("path",{attrs:{d:"M716.8 215.296H307.2a307.2 307.2 0 0 0-307.2 307.2v201.728a307.2 307.2 0 0 1 307.2-307.2h409.6a307.2 307.2 0 0 1 307.2 307.2v-201.728a307.2 307.2 0 0 0-307.2-307.2z",fill:"#2993FF",opacity:".5","p-id":"6798"}}),e._v(" "),o("path",{attrs:{d:"M716.8 417.024H307.2A307.2 307.2 0 0 0 0 720.384a298.752 298.752 0 0 0 18.432 100.864A307.2 307.2 0 0 1 307.2 618.752h409.6a307.2 307.2 0 0 1 288.512 202.496 298.752 298.752 0 0 0 18.688-100.864 307.2 307.2 0 0 0-307.2-303.36z",fill:"#42A1FF",opacity:".5","p-id":"6799"}}),e._v(" "),o("path",{attrs:{d:"M1007.104 821.76a307.2 307.2 0 0 0-288.512-202.752h-409.6c-136.448 0-252.16 75.008-292.096 192.768a304.64 304.64 0 0 0 55.04 100.352 304.896 304.896 0 0 1 237.056-112.896h409.6a305.664 305.664 0 0 1 237.312 112.896 311.552 311.552 0 0 0 51.2-90.368z",fill:"#5AACFF",opacity:".5","p-id":"6800"}}),e._v(" "),o("path",{attrs:{d:"M716.8 799.232H307.2a304.896 304.896 0 0 0-237.056 112.896A307.2 307.2 0 0 0 307.2 1024h409.6a307.2 307.2 0 0 0 237.056-111.872A304.896 304.896 0 0 0 716.8 799.232z",fill:"#76BBFF",opacity:".5","p-id":"6801"}}),o("path",{attrs:{d:"M715.264 225.28v163.584L632.576 307.2l-80.896 82.688V225.28h-204.8v573.44H716.8a82.688 82.688 0 0 0 82.688-81.92V307.2a85.248 85.248 0 0 0-84.224-81.92z m0 409.6h-286.72v-40.192h286.72z m0-123.136h-286.72v-40.192h286.72zM224.512 307.2v409.6A82.432 82.432 0 0 0 307.2 798.72V225.28A82.688 82.688 0 0 0 224.512 307.2z",fill:"#FFFFFF","p-id":"6802"}})]),e._v(" "),o("div",{staticClass:"knowledge_card_content"},[o("ElTooltip",{attrs:{content:e.item.name,"show-overflow-tooltip":""}},[o("div",{staticClass:"knowledge_card_content_name"},[e._v(e._s(e.item.name))])]),e._v(" "),o("ElTooltip",{attrs:{content:e.item.description}},[o("div",{staticClass:"knowledge_card_content_desc"},[e._v(e._s(e.item.description))])])],1)]),e._v(" "),o("div",{staticClass:"knowledge_card_action"},[o("GiteePopover",{attrs:{"popper-class":"code-popover-wrap"}},[o("ul",{staticClass:"action-menu-container",attrs:{slot:"popover"},slot:"popover"},e._l(e.menu,(function(t){return o("li",{key:t.prop,staticClass:"action-item",on:{click:t.action}},[o("div",{staticClass:"item"},[e._v("\n "+e._s(t.label)+"\n ")])])})),0),e._v(" "),o("i",{staticClass:"el-icon-more",attrs:{slot:"reference"},slot:"reference"})])],1)])};function r(e,t,o,r,n,i,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=o,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):n&&(l=a?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}t._withStripped=!0;const n=r({name:"KnowledgeCard",components:{GiteePopover:window.comps.GiteePopover},props:{item:{type:Object,default:()=>({})}},data(){return{menu:[{label:this.$t("edit"),prop:"edit",action:this.edit},{label:this.$t("delete"),prop:"delete",action:this.delete}]}},methods:{edit(){this.$emit("update",this.item)},delete(){this.$emit("delete",this.item)},handleclick(){this.$router.push({name:"company#knowledge_base_detail",query:{id:this.item.id}})}}},t,[],!1,null,null,null).exports;var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("FormCommon",{ref:"form",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"KUNOWLEDGE_SETTINGS"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.loading},on:{click:e.handleOk}},[e._v("\n "+e._s(this.isDetail?this.$t("save"):this.$t("create"))+"\n ")])],1)],1)};i._withStripped=!0;var s=o(2492),a=o.n(s);const l={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const o=this.getDotObj(e),r=this.getDotObj(t);o.forEach((e=>{e.key_not_in_form||this.$set(r,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(r,t,e.extraValue[t])}))}))},setRule(e,t){const o=this.getDotObj(e);let r=this.getDotObj(t);o.forEach((e=>{r=a()(r,e.rule)}))},getParams(e,t){const o=this.getDotObj(e),r=this.getDotObj(t);return o.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=r[t]})),t.key_not_in_form||(e[t.key]=r[t.key])),e)),{})},handleFormChange(e,t="form"){const o=this.getDotObj(t);Object.keys(e).forEach((t=>{o[t]=e[t]}))}}},c=r({name:"NewKnowledge",components:{FormCommon:window.comps.FormCommon},mixins:[l],props:{model:{type:Object,default:()=>({})}},data:()=>({loading:!1,form:{},rules:{}}),computed:{formItems(){return[{key:"name",value:"",label:this.$t("name"),visible:!0,customComponent:"ElInput",meta:{maxlength:"100",placeholder:this.$t_join("please_enter","name")},rule:{name:[{required:!0,trigger:"blur",message:this.$t_join("please_enter","name")}]}},{key:"description",value:"",label:this.$t("description"),visible:!0,customComponent:"ElInput",meta:{type:"textarea",maxlength:"255",autosize:{minRows:3,maxRows:5},placeholder:this.$t_join("please_enter","description")}}]},isDetail(){return this.model&&this.model.id}},watch:{model:{handler(){this.form={...this.model}}}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.model&&(this.form={...this.model})},methods:{closeDialog(){this.SCHEMA.FORM_MAPS.KUNOWLEDGE_SETTINGS.clearValidate(),this.$store.commit("hideDialog")},saveLabel(){this.loading=!0;let e=null;if(this.isDetail){const t={name:this.form.name,description:this.form.description};e=this.api.knowledge.updateKnowledge(this.model.id,t)}else e=this.api.knowledge.newKnowledge(this.form);e.then((e=>{this.closeDialog(),this.$emit("submit"),this.$message.success(this.$t("company_settings.save_success"))})).finally((()=>{this.loading=!1}))},handleOk(){this.form.name&&(this.form.name=this.form.name.trim()),this.SCHEMA.FORM_MAPS.KUNOWLEDGE_SETTINGS.validate((e=>{e&&this.saveLabel()}))}}},i,[],!1,null,"09891ff9",null).exports,d=r({name:"KnowledgeBase",components:{KnowledgeCard:n},data:()=>({knowledgeList:[],page:1,perPage:20,totalCount:0,model:null,loading:!1}),computed:{isDetail(){return this.model&&this.model.id}},created(){this.getListData()},methods:{getListData(){this.loading=!0,this.api.knowledge.getKnowledgeList({page:this.page,per_page:this.perPage}).then((({data:e})=>{this.totalCount=e.meta.total_count,this.knowledgeList=e.data||[]})).finally((()=>{this.loading=!1}))},handleNewKnowledge(){this.model=null,this.toEditKnowloege()},handleUpdate(e){this.model=e,this.toEditKnowloege()},toEditKnowloege(){this.$store.commit("updateDialog",{props:{title:this.isDetail?this.$t_join("edit","knowledge.knowledge"):this.$t_join("create","knowledge.knowledge"),width:"600px",customClass:"new_knowledge_dialog"},slots:{default:{render:e=>e(c,{props:{model:this.model},on:{submit:this.newLabelCallBack}})},footer:{render:e=>e(null)}}}),this.$store.commit("showDialog")},handleDelete(e){this.$confirm(this.$t("knowledge.delete_knowledge_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(t,o,r)=>{"confirm"===t?(o.confirmButtonLoading=!0,this.api.knowledge.deleteKnowledge(e.id).then((()=>{this.$message.success(this.$t("delete_success")),this.getListData(),r()})).finally((()=>{o.confirmButtonLoading=!1}))):r()}})},newLabelCallBack(){!this.isDetail&&(this.page=1),this.getListData()},handleSizeChange(e){this.perPage=e,this.page=1,this.getListData()},handleCurrentChange(e){this.page=e,this.getListData()}}},e,[],!1,null,"0336bef9",null).exports;var p=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("PageTitle",[o("div",{staticClass:"page-title-breadcrumb"},[o("RouterLink",{attrs:{to:{name:"company#knowledge_base"}}},[e._v("\n "+e._s(""+e.$t("knowledge.knowledge"))+"\n ")]),e._v(" "),o("span",[e._v(e._s(">"))]),e._v(" "),o("ElTooltip",{attrs:{content:e.knowledgeName,"show-overflow-tooltip":""}},[o("span",{staticClass:"knowledge_name"},[e._v(e._s(e.knowledgeName))])])],1),e._v(" "),o("ElButton",{attrs:{type:"osc"},on:{click:e.handleNewFile}},[o("i",{staticClass:"iconfont-new iconadd-code"}),e._v("\n "+e._s(e.$t("knowledge.add_file"))+"\n ")])],1),e._v(" "),o("CommonList",{attrs:{"table-data":e.tableData,columns:e.columns,loading:e.loading,pending:e.loading&&!!e.tableData.length,pagination:{count:e.totalCount,page:e.page,per_page:e.perPage}},on:{changeSize:e.changeSize,changeCurrent:e.changeCurrent}})],1)};p._withStripped=!0;var u=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"knowledge_import_file_wrap"},[o("FormCommon",{ref:"formCommon",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"KUNOWLEDGE_FILE"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.handleClose}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.form.files&&0===e.form.files.length||e.uploading},on:{click:e.handleSubmit}},[e._v("\n "+e._s(e.$t("save"))+"\n ")])],1)],1)};u._withStripped=!0;var h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return e.disabledUpload?o("ElUpload",{ref:"fileUploader",staticClass:"file-upload-box",attrs:{drag:"",action:e.action,accept:e.accept.map((function(e){return"."+e})).join(","),"on-progress":e.onProgress,"on-success":e.onSuccess,"on-error":e.onError,"before-upload":e.beforeUpload,"file-list":e.files,"auto-upload":e.autoUpload,"on-change":e.handleChange,limit:e.limit}},[o("div",{staticClass:"dropzone-message"},[o("i",{staticClass:"el-icon-upload",staticStyle:{"font-size":"32px"}}),e._v(" "),o("div",[e._v(e._s(e.$t("code.new.drag_drop_upload_files")))])]),e._v(" "),e._t("tip")],2):e._e()};h._withStripped=!0;const m=r({name:"FileUploader",props:{action:{type:String,required:!0},value:{type:Array,default:()=>[]},path:{type:String,default:""},uploading:Boolean,type:{type:String,required:!0},disabledUpload:{type:Boolean,default:!0},accept:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!1},limit:{type:Number,default:1}},data:()=>({files:[]}),computed:{maxSize:()=>200},watch:{value:{immediate:!0,handler(e){this.files=e.slice()}}},methods:{onProgress(e,t){},onSuccess(e,t){this.$emit("success",e)},onError(e,t){this.showError(e)},beforeUpload(e){if(this.accept.length){const t=e.name.split(".").pop().toLowerCase();if(!this.accept.includes(t))return this.$message.error(this.$t("knowledge.not_support_file")),!1}return this.files.some((t=>t.name===e.name))?(this.$message.error(this.$t("lfs.file_already")),!1):e.size>1024*this.maxSize*1024?(this.$message.error(`${this.$t("lfs.file_size")} ${window.GITEE.tools.fileSizeFilter(e.size)} ${this.$t("lfs.has_exceeded")} ${this.maxSize}M ${this.$t("lfs.limit")}`),!1):void this.$emit("update:uploading",!0)},showError(e){e.message?this.$message.error(JSON.parse(e.message).message):this.$message.error(this.$t("lfs.upload_failed"))},handleChange(e){if(!this.autoUpload&&this.accept.length){const t=e.name.split(".").pop().toLowerCase();if(!this.accept.includes(t))return this.$message.error(this.$t("knowledge.not_support_file")),void this.$refs.fileUploader.clearFiles()}}}},h,[],!1,null,"3386e3a6",null).exports,f=r({name:"KnowlegeImportFile",components:{FormCommon:window.comps.FormCommon},mixins:[l],data:()=>({loading:!1,form:{},rules:{},acceptFile:["md","csv"],uploading:!1}),computed:{formItems(){return[{key:"files",visible:!0,ref:"uploadFile",customComponent:m,extraComponent:{template:`<div class="knowledge_support_file">${this.$t("knowledge.support_file")}</div>`},meta:{action:this.attachFilePath,limit:1,type:"import_knowledge",accept:this.acceptFile,autoUpload:!1},listeners:{progress:this.onProgress,success:this.fileUploadSuccess}}]},attachFilePath(){return this.api.knowledge.uploadKnowlegeFile(this.$route.query.id)}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules")},methods:{onProgress(e){this.uploading=100!==e},handleClose(){this.$store.commit("hideDialog")},handleSubmit(){this.$refs.formCommon.$refs.uploadFile[0].$refs.fileUploader.submit()},fileUploadSuccess(){this.handleClose(),this.$emit("success")}}},u,[],!1,null,"e060f3e6",null).exports;var g=function(){var e=this,t=e.$createElement;return(e._self._c||t)("MoreActions",{attrs:{menu:e.actions,width:"80"}})};g._withStripped=!0;const _=r({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("wiki.tree.rename"),prop:"rename",action:this.rename},{label:this.$t("delete"),prop:"delete",action:this.delete}]}},methods:{rename(){this.$emit("action","renameDocument",this.rowData)},delete(){this.$emit("action","deleteDocument",this.rowData)}}},g,[],!1,null,null,null).exports;var v=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("FormCommon",{ref:"form",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"RENAME_KNOW_FILE"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.loading},on:{click:e.handleOk}},[e._v("\n "+e._s(this.$t("save"))+"\n ")])],1)],1)};v._withStripped=!0;const w=r({name:"RenameDoc",components:{FormCommon:window.comps.FormCommon},mixins:[l],props:{model:{type:Object,default:()=>({})}},data:()=>({loading:!1,form:{},rules:{}}),computed:{formItems(){return[{key:"document_name",value:"",label:this.$t("wiki.tree.rename"),visible:!0,customComponent:"ElInput",meta:{maxlength:"100",placeholder:this.$t_join("please_enter","name")},rule:{name:[{required:!0,trigger:"blur",message:this.$t_join("please_enter","name")}]}}]},isDetail(){return this.model&&this.model.id}},watch:{model:{handler(){this.form.document_name=this.model.document_name}}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.model&&(this.form.document_name=this.model.document_name)},methods:{closeDialog(){this.SCHEMA.FORM_MAPS.RENAME_KNOW_FILE.clearValidate(),this.$store.commit("hideDialog")},saveLabel(){this.loading=!0,this.api.knowledge.updateknowledgeFileName(this.$route.query.id,this.model.id,{document_name:this.form.document_name}).then((e=>{this.closeDialog(),this.$emit("submit"),this.$message.success(this.$t("company_settings.save_success"))})).finally((()=>{this.loading=!1}))},handleOk(){this.form.name&&(this.form.name=this.form.name.trim()),this.SCHEMA.FORM_MAPS.RENAME_KNOW_FILE.validate((e=>{e&&this.saveLabel()}))}}},v,[],!1,null,"f1ddd7ce",null).exports;var b=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"document_status",class:e.documentStatus.class},[e._v("\n "+e._s(e.documentStatus.text)+"\n")])};b._withStripped=!0;const y=r({name:"DocumentStatus",props:{rowData:{type:Object}},computed:{documentStatus(){const e=this.rowData.index_status;return{text:e,class:{索引中:"text-muted",可用:"text-green"}[e]||""}}}},b,[],!1,null,"3d36e0c4",null).exports,x=r({name:"KnowledgeDetail",components:{KnowlegeImportFile:f},data:()=>({tableData:[],totalCount:0,page:1,perPage:20,loading:!1,visible:!1,knowledgeName:""}),computed:{columns(){return[{label:"ID",prop:"id"},{label:this.$t("name"),prop:"document_name","show-overflow-tooltip":!0},{label:this.$t("knowledge.chart_total"),prop:"char_total","show-overflow-tooltip":!0},{label:this.$t("knowledge.upload_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:e=>moment(e.created_at).format("YYYY-MM-DD HH:mm:ss")},{label:this.$t("status"),prop:"index_status","show-overflow-tooltip":!0,component:y},{label:this.$t("action"),prop:"action",width:80,component:_,action:this.handleRowAction}]}},mounted(){this.getKnowlegeDetail(),this.getList()},methods:{getKnowlegeDetail(){this.api.knowledge.getKnowledgeDetail(this.$route.query.id).then((({data:e})=>{this.knowledgeName=e.name}))},changeSize(e){this.perPage=e,this.page=1,this.getList()},changeCurrent(e){this.page=e,this.getList()},changeTab(){this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.knowledge.knowledgeDetailList(this.$route.query.id,{page:this.page,per_page:this.perPage}).then((({data:e})=>{this.totalCount=e.meta.total_count,this.tableData=e.data||[]})).finally((()=>{this.loading=!1}))},handleNewFile(){this.$store.commit("updateDialog",{props:{title:this.$t("knowledge.upload_doc"),width:"600px",customClass:"knowledge_import_file_dialog"},slots:{default:{render:e=>e(f,{on:{success:this.uploadSuccess}})},footer:{render:()=>null}}}),this.$store.commit("showDialog"),this.visible=!0},renameDocument(e){this.$store.commit("updateDialog",{props:{title:this.$t("wiki.tree.rename"),width:"600px",customClass:"rename_doc_dialog"},slots:{default:{render:t=>t(w,{props:{model:e},on:{submit:this.getList}})},footer:{render:e=>e(null)}}}),this.$store.commit("showDialog")},deleteDocument(e){this.$confirm(this.$t("knowledge.delete_document_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(t,o,r)=>{"confirm"===t?(o.confirmButtonLoading=!0,this.api.knowledge.deleteknowledgeFile(this.$route.query.id,e.id).then((()=>{this.$message.success(this.$t("delete_success")),this.getList(),r()})).finally((()=>{o.confirmButtonLoading=!1}))):r()}})},uploadSuccess(){this.page=1,this.getList()}}},p,[],!1,null,null,null).exports;function $(){const{enterprise_uuid:e}=window.gon.info;return`api/enterprises/${e}/`}window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/knowledge_base`,name:"company#knowledge_base",component:d,meta:{title:()=>"知识库"}},{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/knowledge_base/detail`,name:"company#knowledge_base_detail",component:x,meta:{title:()=>"知识库"}}]),GITEE.schema.update({FORM:{KUNOWLEDGE_SETTINGS:{VISIBLE:null,DISABLED:null,ITEMS:[]},KUNOWLEDGE_FILE:{VISIBLE:null,DISABLED:null,ITEMS:[]},RENAME_KNOW_FILE:{VISIBLE:null,DISABLED:null,ITEMS:[]}}}),window.GITEE.api.register("knowledge","getKnowledgeList",(e=>window.GITEE.tools.$http.get(`/api/xtreme/${$()}knowledge_bases`,{params:e}))),window.GITEE.api.register("knowledge","newKnowledge",(e=>window.GITEE.tools.$http.post(`/api/xtreme/${$()}knowledge_bases`,e))),window.GITEE.api.register("knowledge","deleteKnowledge",(e=>window.GITEE.tools.$http.delete(`/api/xtreme/${$()}knowledge_bases/${e}`))),window.GITEE.api.register("knowledge","updateKnowledge",((e,t)=>window.GITEE.tools.$http.put(`/api/xtreme/${$()}knowledge_bases/${e}`,t))),window.GITEE.api.register("knowledge","getKnowledgeDetail",(e=>window.GITEE.tools.$http.get(`/api/xtreme/${$()}knowledge_bases/${e}`))),window.GITEE.api.register("knowledge","knowledgeDetailList",((e,t)=>window.GITEE.tools.$http.get(`/api/xtreme/${$()}knowledge_bases/${e}/documents`,{params:t}))),window.GITEE.api.register("knowledge","uploadKnowlegeFile",(e=>`/api/xtreme/${$()}knowledge_bases/${e}/documents`)),window.GITEE.api.register("knowledge","knowledgeModels",(()=>window.GITEE.tools.$http.get(`/api/xtreme/${$()}index_models`))),window.GITEE.api.register("knowledge","updateknowledgeFileName",((e,t,o)=>window.GITEE.tools.$http.put(`/api/xtreme/${$()}knowledge_bases/${e}/documents/${t}`,o))),window.GITEE.api.register("knowledge","deleteknowledgeFile",((e,t)=>window.GITEE.tools.$http.delete(`/api/xtreme/${$()}knowledge_bases/${e}/documents/${t}`)))})()})();
1
+ (()=>{var e={1989:(e,t,o)=>{var r=o(1789),n=o(401),i=o(7667),s=o(1327),a=o(1866);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},8407:(e,t,o)=>{var r=o(7040),n=o(4125),i=o(2117),s=o(7518),a=o(4705);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},7071:(e,t,o)=>{var r=o(852)(o(5639),"Map");e.exports=r},3369:(e,t,o)=>{var r=o(4785),n=o(1285),i=o(6e3),s=o(9916),a=o(5265);function l(e){var t=-1,o=null==e?0:e.length;for(this.clear();++t<o;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=a,e.exports=l},6384:(e,t,o)=>{var r=o(8407),n=o(7465),i=o(3779),s=o(7599),a=o(4758),l=o(4309);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=n,c.prototype.delete=i,c.prototype.get=s,c.prototype.has=a,c.prototype.set=l,e.exports=c},2705:(e,t,o)=>{var r=o(5639).Symbol;e.exports=r},1149:(e,t,o)=>{var r=o(5639).Uint8Array;e.exports=r},6874:e=>{e.exports=function(e,t,o){switch(o.length){case 0:return e.call(t);case 1:return e.call(t,o[0]);case 2:return e.call(t,o[0],o[1]);case 3:return e.call(t,o[0],o[1],o[2])}return e.apply(t,o)}},4636:(e,t,o)=>{var r=o(2545),n=o(5694),i=o(1469),s=o(4144),a=o(5776),l=o(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var o=i(e),d=!o&&n(e),p=!o&&!d&&s(e),u=!o&&!d&&!p&&l(e),h=o||d||p||u,m=h?r(e.length,String):[],f=m.length;for(var g in e)!t&&!c.call(e,g)||h&&("length"==g||p&&("offset"==g||"parent"==g)||u&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,f))||m.push(g);return m}},6556:(e,t,o)=>{var r=o(9465),n=o(7813);e.exports=function(e,t,o){(void 0!==o&&!n(e[t],o)||void 0===o&&!(t in e))&&r(e,t,o)}},4865:(e,t,o)=>{var r=o(9465),n=o(7813),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,o){var s=e[t];i.call(e,t)&&n(s,o)&&(void 0!==o||t in e)||r(e,t,o)}},8470:(e,t,o)=>{var r=o(7813);e.exports=function(e,t){for(var o=e.length;o--;)if(r(e[o][0],t))return o;return-1}},9465:(e,t,o)=>{var r=o(8777);e.exports=function(e,t,o){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[t]=o}},3118:(e,t,o)=>{var r=o(3218),n=Object.create,i=function(){function e(){}return function(t){if(!r(t))return{};if(n)return n(t);e.prototype=t;var o=new e;return e.prototype=void 0,o}}();e.exports=i},8483:(e,t,o)=>{var r=o(5063)();e.exports=r},4239:(e,t,o)=>{var r=o(2705),n=o(9607),i=o(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?n(e):i(e)}},9454:(e,t,o)=>{var r=o(4239),n=o(7005);e.exports=function(e){return n(e)&&"[object Arguments]"==r(e)}},8458:(e,t,o)=>{var r=o(3560),n=o(5346),i=o(3218),s=o(346),a=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,p=c.hasOwnProperty,u=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||n(e))&&(r(e)?u:a).test(s(e))}},8749:(e,t,o)=>{var r=o(4239),n=o(1780),i=o(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&n(e.length)&&!!s[r(e)]}},313:(e,t,o)=>{var r=o(3218),n=o(5726),i=o(3498),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=n(e),o=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&o.push(a);return o}},2980:(e,t,o)=>{var r=o(6384),n=o(6556),i=o(8483),s=o(9783),a=o(3218),l=o(1704),c=o(6390);e.exports=function e(t,o,d,p,u){t!==o&&i(o,(function(i,l){if(u||(u=new r),a(i))s(t,o,l,d,e,p,u);else{var h=p?p(c(t,l),i,l+"",t,o,u):void 0;void 0===h&&(h=i),n(t,l,h)}}),l)}},9783:(e,t,o)=>{var r=o(6556),n=o(4626),i=o(7133),s=o(278),a=o(8517),l=o(5694),c=o(1469),d=o(9246),p=o(4144),u=o(3560),h=o(3218),m=o(8630),f=o(6719),g=o(6390),_=o(9881);e.exports=function(e,t,o,v,w,b,y){var x=g(e,o),$=g(t,o),E=y.get($);if(E)r(e,o,E);else{var k=b?b(x,$,o+"",e,t,y):void 0,C=void 0===k;if(C){var j=c($),O=!j&&p($),D=!j&&!O&&f($);k=$,j||O||D?c(x)?k=x:d(x)?k=s(x):O?(C=!1,k=n($,!0)):D?(C=!1,k=i($,!0)):k=[]:m($)||l($)?(k=x,l(x)?k=_(x):h(x)&&!u(x)||(k=a($))):C=!1}C&&(y.set($,k),w(k,$,v,b,y),y.delete($)),r(e,o,k)}}},5976:(e,t,o)=>{var r=o(6557),n=o(5357),i=o(61);e.exports=function(e,t){return i(n(e,t,r),e+"")}},6560:(e,t,o)=>{var r=o(5703),n=o(8777),i=o(6557),s=n?function(e,t){return n(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:i;e.exports=s},2545:e=>{e.exports=function(e,t){for(var o=-1,r=Array(e);++o<e;)r[o]=t(o);return r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4318:(e,t,o)=>{var r=o(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},4626:(e,t,o)=>{e=o.nmd(e);var r=o(5639),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,s=i&&i.exports===n?r.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var o=e.length,r=a?a(o):new e.constructor(o);return e.copy(r),r}},7133:(e,t,o)=>{var r=o(4318);e.exports=function(e,t){var o=t?r(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}},278:e=>{e.exports=function(e,t){var o=-1,r=e.length;for(t||(t=Array(r));++o<r;)t[o]=e[o];return t}},8363:(e,t,o)=>{var r=o(4865),n=o(9465);e.exports=function(e,t,o,i){var s=!o;o||(o={});for(var a=-1,l=t.length;++a<l;){var c=t[a],d=i?i(o[c],e[c],c,o,e):void 0;void 0===d&&(d=e[c]),s?n(o,c,d):r(o,c,d)}return o}},4429:(e,t,o)=>{var r=o(5639)["__core-js_shared__"];e.exports=r},1463:(e,t,o)=>{var r=o(5976),n=o(6612);e.exports=function(e){return r((function(t,o){var r=-1,i=o.length,s=i>1?o[i-1]:void 0,a=i>2?o[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,a&&n(o[0],o[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r<i;){var l=o[r];l&&e(t,l,r,s)}return t}))}},5063:e=>{e.exports=function(e){return function(t,o,r){for(var n=-1,i=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++n];if(!1===o(i[l],l,i))break}return t}}},8777:(e,t,o)=>{var r=o(852),n=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},1957:(e,t,o)=>{var r="object"==typeof o.g&&o.g&&o.g.Object===Object&&o.g;e.exports=r},5050:(e,t,o)=>{var r=o(7019);e.exports=function(e,t){var o=e.__data__;return r(t)?o["string"==typeof t?"string":"hash"]:o.map}},852:(e,t,o)=>{var r=o(8458),n=o(7801);e.exports=function(e,t){var o=n(e,t);return r(o)?o:void 0}},5924:(e,t,o)=>{var r=o(5569)(Object.getPrototypeOf,Object);e.exports=r},9607:(e,t,o)=>{var r=o(2705),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),o=e[a];try{e[a]=void 0;var r=!0}catch(e){}var n=s.call(e);return r&&(t?e[a]=o:delete e[a]),n}},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,o)=>{var r=o(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,o)=>{var r=o(4536),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var o=t[e];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(t,e)?t[e]:void 0}},1327:(e,t,o)=>{var r=o(4536),n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:n.call(t,e)}},1866:(e,t,o)=>{var r=o(4536);e.exports=function(e,t){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},8517:(e,t,o)=>{var r=o(3118),n=o(5924),i=o(5726);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:r(n(e))}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,o){var r=typeof e;return!!(o=null==o?9007199254740991:o)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<o}},6612:(e,t,o)=>{var r=o(7813),n=o(8612),i=o(5776),s=o(3218);e.exports=function(e,t,o){if(!s(o))return!1;var a=typeof t;return!!("number"==a?n(o)&&i(t,o.length):"string"==a&&t in o)&&r(o[t],e)}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,o)=>{var r,n=o(4429),i=(r=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var o=e&&e.constructor;return e===("function"==typeof o&&o.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,o)=>{var r=o(8470),n=Array.prototype.splice;e.exports=function(e){var t=this.__data__,o=r(t,e);return!(o<0||(o==t.length-1?t.pop():n.call(t,o,1),--this.size,0))}},2117:(e,t,o)=>{var r=o(8470);e.exports=function(e){var t=this.__data__,o=r(t,e);return o<0?void 0:t[o][1]}},7518:(e,t,o)=>{var r=o(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,o)=>{var r=o(8470);e.exports=function(e,t){var o=this.__data__,n=r(o,e);return n<0?(++this.size,o.push([e,t])):o[n][1]=t,this}},4785:(e,t,o)=>{var r=o(1989),n=o(8407),i=o(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||n),string:new r}}},1285:(e,t,o)=>{var r=o(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,o)=>{var r=o(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,o)=>{var r=o(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,o)=>{var r=o(5050);e.exports=function(e,t){var o=r(this,e),n=o.size;return o.set(e,t),this.size+=o.size==n?0:1,this}},4536:(e,t,o)=>{var r=o(852)(Object,"create");e.exports=r},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var o in Object(e))t.push(o);return t}},1167:(e,t,o)=>{e=o.nmd(e);var r=o(1957),n=t&&!t.nodeType&&t,i=n&&e&&!e.nodeType&&e,s=i&&i.exports===n&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(o){return e(t(o))}}},5357:(e,t,o)=>{var r=o(6874),n=Math.max;e.exports=function(e,t,o){return t=n(void 0===t?e.length-1:t,0),function(){for(var i=arguments,s=-1,a=n(i.length-t,0),l=Array(a);++s<a;)l[s]=i[t+s];s=-1;for(var c=Array(t+1);++s<t;)c[s]=i[s];return c[t]=o(l),r(e,this,c)}}},5639:(e,t,o)=>{var r=o(1957),n="object"==typeof self&&self&&self.Object===Object&&self,i=r||n||Function("return this")();e.exports=i},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},61:(e,t,o)=>{var r=o(6560),n=o(1275)(r);e.exports=n},1275:e=>{var t=Date.now;e.exports=function(e){var o=0,r=0;return function(){var n=t(),i=16-(n-r);if(r=n,i>0){if(++o>=800)return arguments[0]}else o=0;return e.apply(void 0,arguments)}}},7465:(e,t,o)=>{var r=o(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,o)=>{var r=o(8407),n=o(7071),i=o(3369);e.exports=function(e,t){var o=this.__data__;if(o instanceof r){var s=o.__data__;if(!n||s.length<199)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},6557:e=>{e.exports=function(e){return e}},5694:(e,t,o)=>{var r=o(9454),n=o(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return n(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=l},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,o)=>{var r=o(3560),n=o(1780);e.exports=function(e){return null!=e&&n(e.length)&&!r(e)}},9246:(e,t,o)=>{var r=o(8612),n=o(7005);e.exports=function(e){return n(e)&&r(e)}},4144:(e,t,o)=>{e=o.nmd(e);var r=o(5639),n=o(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?r.Buffer:void 0,l=(a?a.isBuffer:void 0)||n;e.exports=l},3560:(e,t,o)=>{var r=o(4239),n=o(3218);e.exports=function(e){if(!n(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,o)=>{var r=o(4239),n=o(5924),i=o(7005),s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,d=l.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=n(e);if(null===t)return!0;var o=c.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&l.call(o)==d}},6719:(e,t,o)=>{var r=o(8749),n=o(1717),i=o(1167),s=i&&i.isTypedArray,a=s?n(s):r;e.exports=a},1704:(e,t,o)=>{var r=o(4636),n=o(313),i=o(8612);e.exports=function(e){return i(e)?r(e,!0):n(e)}},2492:(e,t,o)=>{var r=o(2980),n=o(1463)((function(e,t,o){r(e,t,o)}));e.exports=n},5062:e=>{e.exports=function(){return!1}},9881:(e,t,o)=>{var r=o(8363),n=o(1704);e.exports=function(e){return r(e,n(e))}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,o),i.loaded=!0,i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";var e=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("PageTitle",[e._v("\n "+e._s(e.$t("knowledge.knowledge"))+"\n "),o("ElButton",{attrs:{type:"osc"},on:{click:e.handleNewKnowledge}},[o("i",{staticClass:"iconfont-new iconadd-code"}),e._v("\n "+e._s(e.$t_join("create","knowledge.knowledge"))+"\n ")])],1),e._v(" "),e.knowledgeList.length||e.loading?[o("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"knowledge-list"},e._l(e.knowledgeList,(function(t,r){return o("KnowledgeCard",{key:r,attrs:{item:t},on:{update:function(o){return e.handleUpdate(t)},delete:function(o){return e.handleDelete(t)}}})})),1),e._v(" "),e.loading?e._e():o("ElPagination",{attrs:{"current-page":e.page,"page-size":e.perPage,"page-sizes":[10,20,30,40],layout:"prev, adaption, next, jumper, sizes",total:e.totalCount,background:""},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})]:o("NoData")],2)};e._withStripped=!0;var t=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"knowledge_card_item cursor-pointer",on:{click:e.handleclick}},[o("div",{staticClass:"knowledge_card_item_header"},[o("svg",{staticClass:"icon",attrs:{t:"1757991239604",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6796",width:"40",height:"40"}},[o("path",{attrs:{d:"M0 0m307.2 0l409.6 0q307.2 0 307.2 307.2l0 409.6q0 307.2-307.2 307.2l-409.6 0q-307.2 0-307.2-307.2l0-409.6q0-307.2 307.2-307.2Z",fill:"#1389FF","p-id":"6797"}}),e._v(" "),o("path",{attrs:{d:"M716.8 215.296H307.2a307.2 307.2 0 0 0-307.2 307.2v201.728a307.2 307.2 0 0 1 307.2-307.2h409.6a307.2 307.2 0 0 1 307.2 307.2v-201.728a307.2 307.2 0 0 0-307.2-307.2z",fill:"#2993FF",opacity:".5","p-id":"6798"}}),e._v(" "),o("path",{attrs:{d:"M716.8 417.024H307.2A307.2 307.2 0 0 0 0 720.384a298.752 298.752 0 0 0 18.432 100.864A307.2 307.2 0 0 1 307.2 618.752h409.6a307.2 307.2 0 0 1 288.512 202.496 298.752 298.752 0 0 0 18.688-100.864 307.2 307.2 0 0 0-307.2-303.36z",fill:"#42A1FF",opacity:".5","p-id":"6799"}}),e._v(" "),o("path",{attrs:{d:"M1007.104 821.76a307.2 307.2 0 0 0-288.512-202.752h-409.6c-136.448 0-252.16 75.008-292.096 192.768a304.64 304.64 0 0 0 55.04 100.352 304.896 304.896 0 0 1 237.056-112.896h409.6a305.664 305.664 0 0 1 237.312 112.896 311.552 311.552 0 0 0 51.2-90.368z",fill:"#5AACFF",opacity:".5","p-id":"6800"}}),e._v(" "),o("path",{attrs:{d:"M716.8 799.232H307.2a304.896 304.896 0 0 0-237.056 112.896A307.2 307.2 0 0 0 307.2 1024h409.6a307.2 307.2 0 0 0 237.056-111.872A304.896 304.896 0 0 0 716.8 799.232z",fill:"#76BBFF",opacity:".5","p-id":"6801"}}),o("path",{attrs:{d:"M715.264 225.28v163.584L632.576 307.2l-80.896 82.688V225.28h-204.8v573.44H716.8a82.688 82.688 0 0 0 82.688-81.92V307.2a85.248 85.248 0 0 0-84.224-81.92z m0 409.6h-286.72v-40.192h286.72z m0-123.136h-286.72v-40.192h286.72zM224.512 307.2v409.6A82.432 82.432 0 0 0 307.2 798.72V225.28A82.688 82.688 0 0 0 224.512 307.2z",fill:"#FFFFFF","p-id":"6802"}})]),e._v(" "),o("div",{staticClass:"knowledge_card_content"},[o("ElTooltip",{attrs:{content:e.item.name,"show-overflow-tooltip":""}},[o("div",{staticClass:"knowledge_card_content_name"},[e._v(e._s(e.item.name))])]),e._v(" "),o("ElTooltip",{attrs:{content:e.item.description}},[o("div",{staticClass:"knowledge_card_content_desc"},[e._v(e._s(e.item.description))])])],1)]),e._v(" "),o("div",{staticClass:"knowledge_card_action"},[o("GiteePopover",{attrs:{"popper-class":"code-popover-wrap"}},[o("ul",{staticClass:"action-menu-container",attrs:{slot:"popover"},slot:"popover"},e._l(e.menu,(function(t){return o("li",{key:t.prop,staticClass:"action-item",on:{click:t.action}},[o("div",{staticClass:"item"},[e._v("\n "+e._s(t.label)+"\n ")])])})),0),e._v(" "),o("i",{staticClass:"el-icon-more",attrs:{slot:"reference"},slot:"reference"})])],1)])};function r(e,t,o,r,n,i,s,a){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=o,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):n&&(l=a?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var d=c.render;c.render=function(e,t){return l.call(t),d(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:e,options:c}}t._withStripped=!0;const n=r({name:"KnowledgeCard",components:{GiteePopover:window.comps.GiteePopover},props:{item:{type:Object,default:()=>({})}},data(){return{menu:[{label:this.$t("edit"),prop:"edit",action:this.edit},{label:this.$t("delete"),prop:"delete",action:this.delete}]}},methods:{edit(){this.$emit("update",this.item)},delete(){this.$emit("delete",this.item)},handleclick(){this.$router.push({name:"company#knowledge_base_detail",query:{id:this.item.id}})}}},t,[],!1,null,null,null).exports;var i=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("FormCommon",{ref:"form",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"KUNOWLEDGE_SETTINGS"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.loading},on:{click:e.handleOk}},[e._v("\n "+e._s(this.isDetail?this.$t("save"):this.$t("create"))+"\n ")])],1)],1)};i._withStripped=!0;var s=o(2492),a=o.n(s);const l={methods:{getDotObj(e){return e.split(".").reduce(((e,t)=>e[t]),this)},setForm(e,t){const o=this.getDotObj(e),r=this.getDotObj(t);o.forEach((e=>{e.key_not_in_form||this.$set(r,e.key,e.value),e.extraValue&&Object.keys(e.extraValue).forEach((t=>{this.$set(r,t,e.extraValue[t])}))}))},setRule(e,t){const o=this.getDotObj(e);let r=this.getDotObj(t);o.forEach((e=>{r=a()(r,e.rule)}))},getParams(e,t){const o=this.getDotObj(e),r=this.getDotObj(t);return o.reduce(((e,t)=>(Object.hasOwnProperty.call(t,"visible")&&!t.visible||(t.extraValue&&Object.keys(t.extraValue).forEach((t=>{e[t]=r[t]})),t.key_not_in_form||(e[t.key]=r[t.key])),e)),{})},handleFormChange(e,t="form"){const o=this.getDotObj(t);Object.keys(e).forEach((t=>{o[t]=e[t]}))}}},c=r({name:"NewKnowledge",components:{FormCommon:window.comps.FormCommon},mixins:[l],props:{model:{type:Object,default:()=>({})}},data:()=>({loading:!1,form:{},rules:{}}),computed:{formItems(){return[{key:"name",value:"",label:this.$t("name"),visible:!0,customComponent:"ElInput",meta:{maxlength:"100",placeholder:this.$t_join("please_enter","name")},rule:{name:[{required:!0,trigger:"blur",message:this.$t_join("please_enter","name")}]}},{key:"description",value:"",label:this.$t("description"),visible:!0,customComponent:"ElInput",meta:{type:"textarea",maxlength:"255",autosize:{minRows:3,maxRows:5},placeholder:this.$t_join("please_enter","description")}}]},isDetail(){return this.model&&this.model.id}},watch:{model:{handler(){this.form={...this.model}}}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.model&&(this.form={...this.model})},methods:{closeDialog(){this.SCHEMA.FORM_MAPS.KUNOWLEDGE_SETTINGS.clearValidate(),this.$store.commit("hideDialog")},saveLabel(){this.loading=!0;let e=null;if(this.isDetail){const t={name:this.form.name,description:this.form.description};e=this.api.knowledge.updateKnowledge(this.model.id,t)}else e=this.api.knowledge.newKnowledge(this.form);e.then((e=>{this.closeDialog(),this.$emit("submit"),this.$message.success(this.$t("company_settings.save_success"))})).finally((()=>{this.loading=!1}))},handleOk(){this.form.name&&(this.form.name=this.form.name.trim()),this.SCHEMA.FORM_MAPS.KUNOWLEDGE_SETTINGS.validate((e=>{e&&this.saveLabel()}))}}},i,[],!1,null,"09891ff9",null).exports,d=r({name:"KnowledgeBase",components:{KnowledgeCard:n},data:()=>({knowledgeList:[],page:1,perPage:20,totalCount:0,model:null,loading:!1}),computed:{isDetail(){return this.model&&this.model.id}},created(){this.getListData()},methods:{getListData(){this.loading=!0,this.api.knowledge.getKnowledgeList({page:this.page,per_page:this.perPage}).then((({data:e})=>{this.totalCount=e.meta.total_count,this.knowledgeList=e.data||[]})).finally((()=>{this.loading=!1}))},handleNewKnowledge(){this.model=null,this.toEditKnowloege()},handleUpdate(e){this.model=e,this.toEditKnowloege()},toEditKnowloege(){this.$store.commit("updateDialog",{props:{title:this.isDetail?this.$t_join("edit","knowledge.knowledge"):this.$t_join("create","knowledge.knowledge"),width:"600px",customClass:"new_knowledge_dialog"},slots:{default:{render:e=>e(c,{props:{model:this.model},on:{submit:this.newLabelCallBack}})},footer:{render:e=>e(null)}}}),this.$store.commit("showDialog")},handleDelete(e){this.$confirm(this.$t("knowledge.delete_knowledge_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(t,o,r)=>{"confirm"===t?(o.confirmButtonLoading=!0,this.api.knowledge.deleteKnowledge(e.id).then((()=>{this.$message.success(this.$t("delete_success")),this.getListData(),r()})).finally((()=>{o.confirmButtonLoading=!1}))):r()}})},newLabelCallBack(){!this.isDetail&&(this.page=1),this.getListData()},handleSizeChange(e){this.perPage=e,this.page=1,this.getListData()},handleCurrentChange(e){this.page=e,this.getListData()}}},e,[],!1,null,"0336bef9",null).exports;var p=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("PageTitle",[o("div",{staticClass:"page-title-breadcrumb"},[o("RouterLink",{attrs:{to:{name:"company#knowledge_base"}}},[e._v("\n "+e._s(""+e.$t("knowledge.knowledge"))+"\n ")]),e._v(" "),o("span",[e._v(e._s(">"))]),e._v(" "),o("ElTooltip",{attrs:{content:e.knowledgeName,"show-overflow-tooltip":""}},[o("span",{staticClass:"knowledge_name"},[e._v(e._s(e.knowledgeName))])])],1),e._v(" "),o("ElButton",{attrs:{type:"osc"},on:{click:e.handleNewFile}},[o("i",{staticClass:"iconfont-new iconadd-code"}),e._v("\n "+e._s(e.$t("knowledge.add_file"))+"\n ")])],1),e._v(" "),o("CommonList",{attrs:{"table-data":e.tableData,columns:e.columns,loading:e.loading,pending:e.loading&&!!e.tableData.length,pagination:{count:e.totalCount,page:e.page,per_page:e.perPage}},on:{changeSize:e.changeSize,changeCurrent:e.changeCurrent}})],1)};p._withStripped=!0;var u=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"knowledge_import_file_wrap"},[o("FormCommon",{ref:"formCommon",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"KUNOWLEDGE_FILE"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.handleClose}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.form.files&&0===e.form.files.length||e.uploading},on:{click:e.handleSubmit}},[e._v("\n "+e._s(e.$t("save"))+"\n ")])],1)],1)};u._withStripped=!0;var h=function(){var e=this,t=e.$createElement,o=e._self._c||t;return e.disabledUpload?o("ElUpload",{ref:"fileUploader",staticClass:"file-upload-box",attrs:{drag:"",action:e.action,accept:e.accept.map((function(e){return"."+e})).join(","),"on-progress":e.onProgress,"on-success":e.onSuccess,"on-error":e.onError,"before-upload":e.beforeUpload,"file-list":e.files,"auto-upload":e.autoUpload,"on-change":e.handleChange,limit:e.limit}},[o("div",{staticClass:"dropzone-message"},[o("i",{staticClass:"el-icon-upload",staticStyle:{"font-size":"32px"}}),e._v(" "),o("div",[e._v(e._s(e.$t("code.new.drag_drop_upload_files")))])]),e._v(" "),e._t("tip")],2):e._e()};h._withStripped=!0;const m=r({name:"FileUploader",props:{action:{type:String,required:!0},value:{type:Array,default:()=>[]},path:{type:String,default:""},uploading:Boolean,type:{type:String,required:!0},disabledUpload:{type:Boolean,default:!0},accept:{type:Array,default:()=>[]},autoUpload:{type:Boolean,default:!1},limit:{type:Number,default:1}},data:()=>({files:[]}),computed:{maxSize:()=>200},watch:{value:{immediate:!0,handler(e){this.files=e.slice()}}},methods:{onProgress(e,t){},onSuccess(e,t){this.$emit("success",e)},onError(e,t){this.showError(e)},beforeUpload(e){if(this.accept.length){const t=e.name.split(".").pop().toLowerCase();if(!this.accept.includes(t))return this.$message.error(this.$t("knowledge.not_support_file")),!1}return this.files.some((t=>t.name===e.name))?(this.$message.error(this.$t("lfs.file_already")),!1):e.size>1024*this.maxSize*1024?(this.$message.error(`${this.$t("lfs.file_size")} ${window.GITEE.tools.fileSizeFilter(e.size)} ${this.$t("lfs.has_exceeded")} ${this.maxSize}M ${this.$t("lfs.limit")}`),!1):void this.$emit("update:uploading",!0)},showError(e){e.message?this.$message.error(JSON.parse(e.message).message):this.$message.error(this.$t("lfs.upload_failed"))},handleChange(e){if(!this.autoUpload&&this.accept.length){const t=e.name.split(".").pop().toLowerCase();if(!this.accept.includes(t))return this.$message.error(this.$t("knowledge.not_support_file")),void this.$refs.fileUploader.clearFiles()}}}},h,[],!1,null,"3386e3a6",null).exports,f=r({name:"KnowlegeImportFile",components:{FormCommon:window.comps.FormCommon},mixins:[l],data:()=>({loading:!1,form:{},rules:{},acceptFile:["md","csv"],uploading:!1}),computed:{formItems(){return[{key:"files",visible:!0,ref:"uploadFile",customComponent:m,extraComponent:{template:`<div class="knowledge_support_file">${this.$t("knowledge.support_file")}</div>`},meta:{action:this.attachFilePath,limit:1,type:"import_knowledge",accept:this.acceptFile,autoUpload:!1},listeners:{progress:this.onProgress,success:this.fileUploadSuccess}}]},attachFilePath(){return this.api.knowledge.uploadKnowlegeFile(this.$route.query.id)}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules")},methods:{onProgress(e){this.uploading=100!==e},handleClose(){this.$store.commit("hideDialog")},handleSubmit(){this.$refs.formCommon.$refs.uploadFile[0].$refs.fileUploader.submit()},fileUploadSuccess(){this.handleClose(),this.$emit("success")}}},u,[],!1,null,"e060f3e6",null).exports;var g=function(){var e=this,t=e.$createElement;return(e._self._c||t)("MoreActions",{attrs:{menu:e.actions,width:"80"}})};g._withStripped=!0;const _=r({name:"LabelColumnAction",components:{MoreActions:window.comps.MoreActions},props:{rowData:Object},computed:{actions(){return[{label:this.$t("wiki.tree.rename"),prop:"rename",action:this.rename},{label:this.$t("delete"),prop:"delete",action:this.delete}]}},methods:{rename(){this.$emit("action","renameDocument",this.rowData)},delete(){this.$emit("action","deleteDocument",this.rowData)}}},g,[],!1,null,null,null).exports;var v=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",[o("FormCommon",{ref:"form",staticClass:"w100",attrs:{"form-items":e.formItems,form:e.form,rules:e.rules,"form-key":"RENAME_KNOW_FILE"},on:{"form-change":e.handleFormChange}}),e._v(" "),o("div",{staticClass:"dialog-footer"},[o("ElButton",{on:{click:e.closeDialog}},[e._v(e._s(e.$t("cancel")))]),e._v(" "),o("ElButton",{attrs:{type:"primary",disabled:e.loading},on:{click:e.handleOk}},[e._v("\n "+e._s(this.$t("save"))+"\n ")])],1)],1)};v._withStripped=!0;const w=r({name:"RenameDoc",components:{FormCommon:window.comps.FormCommon},mixins:[l],props:{model:{type:Object,default:()=>({})}},data:()=>({loading:!1,form:{},rules:{}}),computed:{formItems(){return[{key:"document_name",value:"",label:this.$t("wiki.tree.rename"),visible:!0,customComponent:"ElInput",meta:{maxlength:"100",placeholder:this.$t_join("please_enter","name")},rule:{name:[{required:!0,trigger:"blur",message:this.$t_join("please_enter","name")}]}}]},isDetail(){return this.model&&this.model.id}},watch:{model:{handler(){this.form.document_name=this.model.document_name}}},created(){this.setForm("formItems","form"),this.setRule("formItems","rules"),this.model&&(this.form.document_name=this.model.document_name)},methods:{closeDialog(){this.SCHEMA.FORM_MAPS.RENAME_KNOW_FILE.clearValidate(),this.$store.commit("hideDialog")},saveLabel(){this.loading=!0,this.api.knowledge.updateknowledgeFileName(this.$route.query.id,this.model.id,{document_name:this.form.document_name}).then((e=>{this.closeDialog(),this.$emit("submit"),this.$message.success(this.$t("company_settings.save_success"))})).finally((()=>{this.loading=!1}))},handleOk(){this.form.name&&(this.form.name=this.form.name.trim()),this.SCHEMA.FORM_MAPS.RENAME_KNOW_FILE.validate((e=>{e&&this.saveLabel()}))}}},v,[],!1,null,"f1ddd7ce",null).exports;var b=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{staticClass:"document_status",class:e.documentStatus.class},[e._v("\n "+e._s(e.documentStatus.text)+"\n")])};b._withStripped=!0;const y=r({name:"DocumentStatus",props:{rowData:{type:Object}},computed:{documentStatus(){const e=this.rowData.index_status;return{text:e,class:{索引中:"text-muted",可用:"text-green"}[e]||""}}}},b,[],!1,null,"3d36e0c4",null).exports;function x(){const{enterprise_uuid:e}=window.gon.info;return`api/enterprises/${e}/`}const $=r({name:"KnowledgeDetail",components:{KnowlegeImportFile:f},data:()=>({tableData:[],totalCount:0,page:1,perPage:20,loading:!1,visible:!1,knowledgeName:""}),computed:{columns(){return[{label:"ID",prop:"id"},{label:this.$t("name"),prop:"document_name","show-overflow-tooltip":!0},{label:this.$t("knowledge.chart_total"),prop:"char_total","show-overflow-tooltip":!0},{label:this.$t("knowledge.upload_at"),prop:"created_at","show-overflow-tooltip":!0,formatter:e=>(e.created_at,window.GITEE.tools.moment||moment).format("YYYY-MM-DD HH:mm:ss")},{label:this.$t("status"),prop:"index_status","show-overflow-tooltip":!0,component:y},{label:this.$t("action"),prop:"action",width:80,component:_,action:this.handleRowAction}]}},mounted(){this.getKnowlegeDetail(),this.getList()},methods:{getKnowlegeDetail(){this.api.knowledge.getKnowledgeDetail(this.$route.query.id).then((({data:e})=>{this.knowledgeName=e.name}))},changeSize(e){this.perPage=e,this.page=1,this.getList()},changeCurrent(e){this.page=e,this.getList()},changeTab(){this.page=1,this.tableData=[],this.totalCount=0,this.getList()},getList(){this.loading=!0,this.api.knowledge.knowledgeDetailList(this.$route.query.id,{page:this.page,per_page:this.perPage}).then((({data:e})=>{this.totalCount=e.meta.total_count,this.tableData=e.data||[]})).finally((()=>{this.loading=!1}))},handleNewFile(){this.$store.commit("updateDialog",{props:{title:this.$t("knowledge.upload_doc"),width:"600px",customClass:"knowledge_import_file_dialog"},slots:{default:{render:e=>e(f,{on:{success:this.uploadSuccess}})},footer:{render:()=>null}}}),this.$store.commit("showDialog"),this.visible=!0},renameDocument(e){this.$store.commit("updateDialog",{props:{title:this.$t("wiki.tree.rename"),width:"600px",customClass:"rename_doc_dialog"},slots:{default:{render:t=>t(w,{props:{model:e},on:{submit:this.getList}})},footer:{render:e=>e(null)}}}),this.$store.commit("showDialog")},deleteDocument(e){this.$confirm(this.$t("knowledge.delete_document_tips"),this.$t("tips"),{dangerouslyUseHTMLString:!0,beforeClose:(t,o,r)=>{"confirm"===t?(o.confirmButtonLoading=!0,this.api.knowledge.deleteknowledgeFile(this.$route.query.id,e.id).then((()=>{this.$message.success(this.$t("delete_success")),this.getList(),r()})).finally((()=>{o.confirmButtonLoading=!1}))):r()}})},uploadSuccess(){this.page=1,this.getList()}}},p,[],!1,null,null,null).exports;window.GITEE.router.getRouter().addRoutes([{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/knowledge_base`,name:"company#knowledge_base",component:d,meta:{title:()=>"知识库"}},{path:`/:enterprise/${window.GITEE.breakingChanges?.URL_FLAG?":flag(_source|_code)":"_source"}/_/knowledge_base/detail`,name:"company#knowledge_base_detail",component:$,meta:{title:()=>"知识库"}}]),GITEE.schema.update({FORM:{KUNOWLEDGE_SETTINGS:{VISIBLE:null,DISABLED:null,ITEMS:[]},KUNOWLEDGE_FILE:{VISIBLE:null,DISABLED:null,ITEMS:[]},RENAME_KNOW_FILE:{VISIBLE:null,DISABLED:null,ITEMS:[]}}}),window.GITEE.api.register("knowledge","getKnowledgeList",(e=>window.GITEE.tools.$http.get(`/api/xtreme/${x()}knowledge_bases`,{params:e}))),window.GITEE.api.register("knowledge","newKnowledge",(e=>window.GITEE.tools.$http.post(`/api/xtreme/${x()}knowledge_bases`,e))),window.GITEE.api.register("knowledge","deleteKnowledge",(e=>window.GITEE.tools.$http.delete(`/api/xtreme/${x()}knowledge_bases/${e}`))),window.GITEE.api.register("knowledge","updateKnowledge",((e,t)=>window.GITEE.tools.$http.put(`/api/xtreme/${x()}knowledge_bases/${e}`,t))),window.GITEE.api.register("knowledge","getKnowledgeDetail",(e=>window.GITEE.tools.$http.get(`/api/xtreme/${x()}knowledge_bases/${e}`))),window.GITEE.api.register("knowledge","knowledgeDetailList",((e,t)=>window.GITEE.tools.$http.get(`/api/xtreme/${x()}knowledge_bases/${e}/documents`,{params:t}))),window.GITEE.api.register("knowledge","uploadKnowlegeFile",(e=>`/api/xtreme/${x()}knowledge_bases/${e}/documents`)),window.GITEE.api.register("knowledge","knowledgeModels",(()=>window.GITEE.tools.$http.get(`/api/xtreme/${x()}index_models`))),window.GITEE.api.register("knowledge","updateknowledgeFileName",((e,t,o)=>window.GITEE.tools.$http.put(`/api/xtreme/${x()}knowledge_bases/${e}/documents/${t}`,o))),window.GITEE.api.register("knowledge","deleteknowledgeFile",((e,t)=>window.GITEE.tools.$http.delete(`/api/xtreme/${x()}knowledge_bases/${e}/documents/${t}`)))})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitee-code/plugin-xtreme",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "gitee前端插件-xtreme",
5
5
  "main": "index.js",
6
6
  "scripts": {