diff --git a/frontend/desktop/src/pages/task/PeriodicList/ModifyPeriodicDialog.vue b/frontend/desktop/src/pages/task/PeriodicList/ModifyPeriodicDialog.vue index 1afa57db5..fbdbe7efd 100644 --- a/frontend/desktop/src/pages/task/PeriodicList/ModifyPeriodicDialog.vue +++ b/frontend/desktop/src/pages/task/PeriodicList/ModifyPeriodicDialog.vue @@ -477,7 +477,9 @@ pipeline_template__name__icontains: this.flowName || undefined, common: this.isCommon } - const templateListData = await this.loadTemplateList(params) + const templateListData = this.isCommon + ? await this.loadCommonTemplateList(params) + : await this.loadTemplateList(params) if (add) { this.templateList.push(...templateListData.results) } else { // 搜索 @@ -540,9 +542,7 @@ try { this.templateDataLoading = true const params = { templateId: id, common: this.isCommon } - const templateData = this.isCommon - ? await this.loadCommonTemplateList(params) - : await this.loadTemplateData(params) + const templateData = await this.loadTemplateData(params) // 获取流程模板的通知配置 const { notify_receivers, notify_type } = templateData this.notifyType = [notify_type.success.slice(0), notify_type.fail.slice(0)] diff --git a/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedCategorySelect.vue b/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedCategorySelect.vue new file mode 100644 index 000000000..a2e13b0d9 --- /dev/null +++ b/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedCategorySelect.vue @@ -0,0 +1,145 @@ + + + diff --git a/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedTplSlider.vue b/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedTplSlider.vue index b3603c134..4b6ecd058 100644 --- a/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedTplSlider.vue +++ b/frontend/desktop/src/pages/template/TemplateList/SharedTemplate/SharedTplSlider.vue @@ -69,31 +69,11 @@

- -
- {{ categorySelectPath }} - -
- - -
+ :category-list="categoryList" + :form-data="formData"> +
state.infoBasicConfig, 'username': state => state.username - }), - categorySelectPath () { - return this.findPathByCodePath(this.categoryList, this.formData.category) - } + }) }, watch: { isShow (val) { @@ -298,35 +277,6 @@ usage_content: { content } }) }, - onCategorySelect (node) { - this.formData.category = node.id - }, - findPathByCodePath (categoryList, targetCodePath) { - const traverse = (node, path) => { - const currentPath = [...path, node.name] - if (node.code_path === targetCodePath) { - return currentPath - } - - for (const child of node.children || []) { - const result = traverse(child, currentPath) - if (result) { - return result - } - } - - return null - } - - for (const rootNode of categoryList) { - const result = traverse(rootNode, []) - if (result) { - return result.join('/') - } - } - - return null - }, onSave () { this.$refs.formRef.validate().then(async result => { try { @@ -472,11 +422,6 @@ } } } - .category-select::before { - position: absolute; - content: attr(data-placeholder); - color: #c4c6cc; - } .editor-container { flex: 1; .bk-form-content {