diff --git a/components.d.ts b/components.d.ts index 11049e1..6458938 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,7 @@ declare module 'vue' { BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] NAvatar: typeof import('naive-ui')['NAvatar'] + NBackTop: typeof import('naive-ui')['NBackTop'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] @@ -21,6 +22,8 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] + NEllipsis: typeof import('naive-ui')['NEllipsis'] + NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] @@ -32,6 +35,7 @@ declare module 'vue' { NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NotPassed: typeof import('./src/components/NotPassed.vue')['default'] + NPopconfirm: typeof import('naive-ui')['NPopconfirm'] NPopover: typeof import('naive-ui')['NPopover'] NPopselect: typeof import('naive-ui')['NPopselect'] NProgress: typeof import('naive-ui')['NProgress'] @@ -41,7 +45,11 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] + NTabPane: typeof import('naive-ui')['NTabPane'] + NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] + NTimeline: typeof import('naive-ui')['NTimeline'] + NTimelineItem: typeof import('naive-ui')['NTimelineItem'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] NUploadDragger: typeof import('naive-ui')['NUploadDragger'] diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index 729f970..dab53b8 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -72,7 +72,10 @@ async function getHistory() { getHistory() function goPath(item, id) { - router.push({ name: item.path, query: { id } }) + const desiredObject = item.data.find(function (item) { + return item.id === id; + }); + router.push({ name: item.path, query: { id, searchContent: desiredObject.name } }) emit('close') } @@ -94,42 +97,30 @@ function highlightText(text, query) {
- +
-
+
历史搜索
-
+
{{ item.historyname }}
-
+
{{ item.title }}
@@ -148,13 +139,15 @@ function highlightText(text, query) { position: absolute; top: 20%; left: 20%; - box-shadow: none!important; - .ip_box{ + box-shadow: none !important; + + .ip_box { z-index: 0; position: relative; left: calc(50% - 40px); top: 30px; - img{ + + img { width: 80px; height: 80px; } @@ -169,6 +162,7 @@ function highlightText(text, query) { box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15), 0px 0px 0px 0.5px #d4e3fc; } + .list_box { background: #fefefe; border: 1px dashed #f4f4f4; @@ -176,6 +170,7 @@ function highlightText(text, query) { box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15); margin-top: 15px; padding: 8px 16px; + .list_classfiy_item { .list_title { font-size: 12px; @@ -185,6 +180,7 @@ function highlightText(text, query) { line-height: 17px; margin: 10px 0 10px 5px; } + .list_item { display: flex; flex-flow: row nowrap; @@ -194,28 +190,29 @@ function highlightText(text, query) { } } } + :deep(.n-input .n-input-wrapper) { margin: 8px; } -.history-list{ +.history-list { align-items: center; padding-bottom: 9px; } -.name{ +.name { margin-left: 5px; cursor: pointer; } -.tag-wrap{ +.tag-wrap { display: flex; align-items: center; flex: 1; overflow-y: hidden; overflow-x: auto; - .tag{ + .tag { padding: 0 12px; height: 22px; border: 1px solid #e4e7ed; @@ -230,11 +227,11 @@ function highlightText(text, query) { } } -.icon-delete{ +.icon-delete { cursor: pointer; } -.highlight{ +.highlight { color: #507AFD; } diff --git a/src/store/modules/task.ts b/src/store/modules/task.ts index f66b80c..658dccd 100644 --- a/src/store/modules/task.ts +++ b/src/store/modules/task.ts @@ -49,7 +49,7 @@ export const useTaskStore = defineStore({ back() { if (this.currentIndex === 0) return - + this.setActive(--this.currentIndex) }, async fetchApprovalList(pagination) { diff --git a/src/views/final/aside/Aside.vue b/src/views/final/aside/Aside.vue index fef3aef..7a743c6 100644 --- a/src/views/final/aside/Aside.vue +++ b/src/views/final/aside/Aside.vue @@ -344,6 +344,7 @@ function updateComponent(key, e) { @select="scrollHandler" @close="setShowSearch(false)" @inputChange="inputChange" + @showSearch="setShowSearch(true)" /> -import { ref } from 'vue' +import { nextTick, onMounted, ref } from 'vue' import { debounce } from 'lodash-es' import { asideMap } from '@/config/aside' import type { SearchEntity } from '/#/home' import { useConfig } from '@/store/modules/asideConfig' +import { useRoute } from 'vue-router' + +const route = useRoute() +const searchContent = route.query.searchContent as string; defineOptions({ name: 'Search' }) const emit = defineEmits<{ (e: 'close'): void (e: 'select', key: string): void (e: 'inputChange', value: string): void + (e: 'showSearch'): void }>() const data = ref([]) @@ -20,7 +25,7 @@ const searchKeyword = ref('') const inputHandler = debounce((keyword) => { searchKeyword.value = keyword; - emit('inputChange',keyword) + emit('inputChange', keyword) }, 300) configStore.$subscribe(() => { @@ -54,7 +59,7 @@ function selectHandler(item: SearchEntity) { // 模糊搜索 const searchName = () => { configStore.setSearchValue(searchKeyword.value); - emit('inputChange',searchKeyword.value); + emit('inputChange', searchKeyword.value); } const close = () => { @@ -63,16 +68,29 @@ const close = () => { emit('close'); } +const initSerach = () => { + if (searchContent) { + emit('showSearch') + const id_param = searchContent.match(/-\d+-/); + if (id_param) { + searchKeyword.value = id_param[0].slice(1, -1); + emit('inputChange', searchKeyword.value) + } + } +} +onMounted(() => { + initSerach() +}) +