diff --git a/package.json b/package.json index 971fdf85..36392bc2 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.26", + "jetlinks-ui-components": "^1.0.27", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/App.vue b/src/App.vue index c1c758c3..8c6581c2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,5 @@ diff --git a/src/api/data-collect/collector.ts b/src/api/data-collect/collector.ts index 191913ce..53304ef6 100644 --- a/src/api/data-collect/collector.ts +++ b/src/api/data-collect/collector.ts @@ -3,6 +3,9 @@ import server from '@/utils/request'; export const queryCollector = (data: any) => server.post(`/data-collect/collector/_query/no-paging?paging=false`, data); +export const queryCollectorTree = (data: any) => + server.post(`/data-collect/collector/_detail/no-paging?paging=false`, data); + export const queryChannelNoPaging = () => server.post(`/data-collect/channel/_query/no-paging`, { paging: false, diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 8f97ad37..92ab5f9d 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -1,12 +1,12 @@ @@ -54,14 +54,14 @@ const route = useRoute(); const menu = useMenuStore(); const system = useSystem(); -const {configInfo,layout} = storeToRefs(system); +const {configInfo,layout, basicLayout} = storeToRefs(system); const layoutConf = reactive({ theme: DefaultSetting.layout.theme, siderWidth: layout.value.siderWidth, logo: DefaultSetting.layout.logo, title: DefaultSetting.layout.title, - menuData: [...clearMenuItem(menu.siderMenus), AccountMenu], + menuData: [...menu.siderMenus, AccountMenu], // menuData: menu.siderMenus, splitMenus: true, }); @@ -72,87 +72,51 @@ watchEffect(() => { layoutConf.logo = configInfo.value.front?.logo || DefaultSetting.layout.logo; }) -const state = reactive({ - pure: false, - collapsed: false, // default value - openKeys: [], - selectedKeys: [], -}); +const components = computed(() => { + const componentName = route.matched[route.matched.length - 1]?.components?.default?.name + if (componentName !== 'BasicLayoutPage') { + return route.matched[route.matched.length - 1]?.components?.default + } + return undefined +}) + +/** + * 面包屑 + */ +const breadcrumbs = computed(() => + { + const paths = router.currentRoute.value.matched + + return paths.map((item, index) => { + return { + index, + isLast: index === (paths.length -1), + path: item.path, + breadcrumbName: (item.meta as any).title || '', + } + }) + } +); const routerBack = () => { router.go(-1) } -const findRouteMeta = (code: string) => { - let meta = [] - let menuItem: any = menu.menus[code] - while (menuItem) { - meta.unshift(menuItem) - if (menuItem.parentName) { - menuItem = menu.menus[menuItem.parentName] - } else { - menuItem = false - } - } - return meta -} const jump = (item: any) => { - let path = history.state.back - if (path) { - // 包含query参数,清除?参数 - if (path.includes('?')) { - const _path = path.split('?')[0] - path = _path === item.path ? path : item.path - } else if (path !== item.path) { - path = item.path - } - } else { - path = item.path - } - - // jumpPage(slotProps.route.path) - router.push(path) + router.push(item.path) } -const breadcrumb = computed(() => - { - const paths = router.currentRoute.value.name as string - const metas = findRouteMeta(paths) - return metas.map((item, index) => { - return { - index, - isLast: index === (metas.length - 1), - path: item.path, - breadcrumbName: item.title || '', - }; - }) + +watchEffect(() => { + if (router.currentRoute) { + const paths = router.currentRoute.value.matched + basicLayout.value.selectedKeys = paths.map(item => item.path) + basicLayout.value.openKeys = paths.map(item => item.path) + console.log(paths) // } -); - -watchEffect(() => { - if (router.currentRoute) { - const paths = router.currentRoute.value.name as string - if (paths) { - const _metas = findRouteMeta(paths) - state.selectedKeys = _metas.map(item => item.path) - state.openKeys = _metas.filter((r) => r !== router.currentRoute.value.path).map(item => item.path) - } - } -}); - -watchEffect(() => { - if ( - route.query && - 'layout' in route.query && - route.query.layout === 'false' - ) { - state.pure = true; - } else { - state.pure = false; - } -}); +}) const toDoc = () => window.open('http://doc.v2.jetlinks.cn/'); diff --git a/src/components/Layout/BlankLayoutPage.vue b/src/components/Layout/BlankLayoutPage.vue index 69d6fa16..72b16120 100644 --- a/src/components/Layout/BlankLayoutPage.vue +++ b/src/components/Layout/BlankLayoutPage.vue @@ -1,11 +1,21 @@ - \ No newline at end of file diff --git a/src/views/system/NoticeRule/components/Item/index.vue b/src/views/system/NoticeRule/components/Item/index.vue index 661ecd06..b4c49b9e 100644 --- a/src/views/system/NoticeRule/components/Item/index.vue +++ b/src/views/system/NoticeRule/components/Item/index.vue @@ -22,7 +22,7 @@ @@ -346,49 +348,53 @@ const onSwitchChange = (e: boolean) => { if (_checked) { onAction(e); } else { - Modal.confirm({ - title: e - ? '开启后默认平台所有用户都能接收到该通知' - : '关闭后平台所有用户都不能接收到该通知', - cancelText: '取消', - okText: e ? '确认开启' : '确认关闭', - content: h( - 'div', - { - style: { - display: 'flex', - justifyContent: 'flex-end', - marginTop: '20px', - }, - }, - [ - h( - Checkbox, - { - onChange: (_e: any) => { - LocalStore.set( - user.userInfos?.username, - e - ? { - ..._value, - open: _e.target?.checked, - } - : { - ..._value, - close: _e.target?.checked, - }, - ); - }, + if (e) { + onAction(e); + } else { + Modal.confirm({ + title: e + ? '开启后默认平台所有用户都能接收到该通知' + : '关闭后平台所有用户都不能接收到该通知', + cancelText: '取消', + okText: e ? '确认开启' : '确认关闭', + content: h( + 'div', + { + style: { + display: 'flex', + justifyContent: 'flex-end', + marginTop: '20px', }, - '不再提示', - ), - ], - ), - onOk() { - onAction(e); - }, - onCancel() {}, - }); + }, + [ + h( + Checkbox, + { + onChange: (_e: any) => { + LocalStore.set( + user.userInfos?.username, + e + ? { + ..._value, + open: _e.target?.checked, + } + : { + ..._value, + close: _e.target?.checked, + }, + ); + }, + }, + '不再提示', + ), + ], + ), + onOk() { + onAction(e); + }, + onCancel() {}, + }); + } } }; @@ -489,7 +495,7 @@ const onSave = (_data: any) => { .box-item-add { cursor: pointer; - background-color: #F7F8FA; + background-color: #f7f8fa; width: 54px; height: 54px; display: flex; diff --git a/src/views/system/NoticeRule/components/Role/index.vue b/src/views/system/NoticeRule/components/Role/index.vue index 4b1010af..7188b5ed 100644 --- a/src/views/system/NoticeRule/components/Role/index.vue +++ b/src/views/system/NoticeRule/components/Role/index.vue @@ -70,7 +70,7 @@ - + 钉钉群机器人类型的配置在当前页面将被过滤 -
+
已规定固定收信人的模板在当前页面将被过滤
-
+
{ iconUrl: iconMap.get(item.id), }; }); + emit('update:value', options.value?.[0]?.value); + emit('update:name', options.value?.[0]?.label); + emit('change', {label: options.value?.[0]?.label, value: options.value?.[0]?.value}); } loading.value = false; }); - notifyType.value = props.value; }); diff --git a/src/views/system/NoticeRule/components/Save/index.vue b/src/views/system/NoticeRule/components/Save/index.vue index a4c3d280..fca7e00c 100644 --- a/src/views/system/NoticeRule/components/Save/index.vue +++ b/src/views/system/NoticeRule/components/Save/index.vue @@ -11,11 +11,12 @@