Skip to content

Commit

Permalink
feat(template): 模板搜索,模板类别默认有folder icon
Browse files Browse the repository at this point in the history
  • Loading branch information
spongebody committed Aug 14, 2024
1 parent ed22470 commit b43f349
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/plugins/template/src/TemplateGeneral.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
模板类别
</tiny-radio>
<tiny-radio v-model="templateSettingState.currentTemplateData.type" class="page-type-radio" label="template">
模板实例
模板
</tiny-radio>
</tiny-form-item>
<tiny-form-item prop="name" label="名称">
Expand Down
22 changes: 14 additions & 8 deletions packages/plugins/template/src/TemplateTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
</tiny-dropdown>
</div>
</template>
<template #prefix="{ node }">
<div class="prefix-folder-icon" v-if="!node.data.isTemplate && !node.data.children.length">
<SvgIcon name="text-page-folder-closed" class="folder-icon"></SvgIcon>
</div>
</template>
</tiny-tree>
</div>
</template>

<script lang="jsx">
import { reactive, ref, watchEffect, nextTick } from 'vue'
import { reactive, ref, watchEffect } from 'vue'
import { Search, Tree } from '@opentiny/vue'
import {
Dropdown as TinyDropdown,
Expand Down Expand Up @@ -95,13 +100,7 @@ export default {
return tree;
}
const searchTemplateData = (value) => {
if (Array.isArray(templateTreeRefs?.value)) {
nextTick(() => {
templateTreeRefs.value.forEach((item) => {
item?.filter(value)
})
})
}
templateTreeRefs.value.filter(value)
}
const refreshTemplateList = async (appId, data) => {
const templateData = data ? data : await fetchTemplateList(appId)
Expand Down Expand Up @@ -320,6 +319,13 @@ export default {
.folder-icon {
color: var(--ti-lowcode-page-manage-content-tips-color);
}
.prefix-folder-icon {
position: relative;
top: -2px;
left: -8px;
}
}
.page-name-label {
Expand Down

0 comments on commit b43f349

Please sign in to comment.