diff --git a/core/core-frontend/src/views/template/component/DeTemplateList.vue b/core/core-frontend/src/views/template/component/DeTemplateList.vue index 05fcbacd7d..d43ba69808 100644 --- a/core/core-frontend/src/views/template/component/DeTemplateList.vue +++ b/core/core-frontend/src/views/template/component/DeTemplateList.vue @@ -11,6 +11,16 @@ :description="'没有找到相关内容'" /> - - {{ t('visualization.add_category') }} - @@ -92,8 +99,7 @@ const state = reactive({ }) const templateListComputed = computed(() => { - if (!state.templateFilterText) return [...props.templateList] - return props.templateList.filter(ele => ele['name']?.includes(state.templateFilterText)) + return props.templateList.filter(ele => ele['id'] !== '1') }) const clickMore = (type, data) => { @@ -247,4 +253,11 @@ defineExpose({ width: 20px; height: 20px; } + +.custom-line { + margin: 4px; + background: rgba(31, 35, 41, 0.15); + border: 0; + height: 1px; +} diff --git a/core/core-frontend/src/views/template/index.vue b/core/core-frontend/src/views/template/index.vue index dbb7c96a03..f869455626 100644 --- a/core/core-frontend/src/views/template/index.vue +++ b/core/core-frontend/src/views/template/index.vue @@ -36,9 +36,15 @@
- {{ state.currentTemplateLabel }}  ({{ - state.currentTemplateShowList.length - }}) + {{ state.currentTemplateLabel }}  ({{ + state.currentTemplateShowList.length + }}) + + {{ state.currentTemplateLabel }}   + 的搜索结果 {{ currentTemplateShowListComputed.length }} 个 +
{ + if (!state.templateFilterText) return [...state.currentTemplateShowList] + return state.currentTemplateShowList.filter(ele => + ele['name']?.includes(state.templateFilterText) + ) +}) + const nameList = computed(() => { const { nodeType } = state.templateEditForm || {} if (nodeType === 'template') { @@ -186,6 +199,18 @@ const nameList = computed(() => { return [] }) +const initStyle = () => { + nextTick(() => { + const tree = document.querySelector('.ed-tree') + // 创建横线元素 + const line = document.createElement('hr') + line.classList.add('custom-line') + + // 将横线元素插入到第一个选项后面 + tree.firstElementChild.appendChild(line) + }) +} + const nameRepeat = value => { if (!nameList.value) { return false @@ -357,6 +382,7 @@ onMounted(() => { state.templateCurWidth = Math.trunc(offsetWidth / curSeparator) - 24 - curSeparator }) }) + initStyle() })