Commit efc1517c2801e6f870d6fc98352cd65f1bf979ea
Merge branch 'main_dev' into 'main'
fix: 修复大屏、看板、组织左侧组织树搜索无效 See merge request yunteng/thingskit-front!1327
Showing
4 changed files
with
40 additions
and
8 deletions
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | import { useRole } from '/@/hooks/business/useRole'; | 12 | import { useRole } from '/@/hooks/business/useRole'; |
| 13 | import configurationSrc from '/@/assets/icons/configuration.svg'; | 13 | import configurationSrc from '/@/assets/icons/configuration.svg'; |
| 14 | import { Platform } from '../center/center.data'; | 14 | import { Platform } from '../center/center.data'; |
| 15 | - import { computed, unref } from 'vue'; | 15 | + import { computed, unref, reactive } from 'vue'; |
| 16 | import { createScadaPageLink, ScadaModeEnum } from '../center/help'; | 16 | import { createScadaPageLink, ScadaModeEnum } from '../center/help'; |
| 17 | import { useDrawer } from '/@/components/Drawer'; | 17 | import { useDrawer } from '/@/components/Drawer'; |
| 18 | import { usePermission } from '/@/hooks/web/usePermission'; | 18 | import { usePermission } from '/@/hooks/web/usePermission'; |
| @@ -27,11 +27,14 @@ | @@ -27,11 +27,14 @@ | ||
| 27 | import { ShareModal } from '/@/views/common/ShareModal'; | 27 | import { ShareModal } from '/@/views/common/ShareModal'; |
| 28 | import { ViewTypeEnum, ViewTypeNameEnum } from '../../common/ShareModal/config'; | 28 | import { ViewTypeEnum, ViewTypeNameEnum } from '../../common/ShareModal/config'; |
| 29 | 29 | ||
| 30 | + const searchInfo = reactive<Recordable>({}); | ||
| 31 | + | ||
| 30 | const [register, { reload }] = useCardList({ | 32 | const [register, { reload }] = useCardList({ |
| 31 | api: getPage, | 33 | api: getPage, |
| 32 | useSearchForm: true, | 34 | useSearchForm: true, |
| 33 | title: '组态列表', | 35 | title: '组态列表', |
| 34 | gutter: 4, | 36 | gutter: 4, |
| 37 | + searchInfo: searchInfo, | ||
| 35 | formConfig: { | 38 | formConfig: { |
| 36 | schemas: searchFormSchema, | 39 | schemas: searchFormSchema, |
| 37 | labelWidth: 80, | 40 | labelWidth: 80, |
| @@ -121,11 +124,16 @@ | @@ -121,11 +124,16 @@ | ||
| 121 | await reload(); | 124 | await reload(); |
| 122 | } catch (error) {} | 125 | } catch (error) {} |
| 123 | }; | 126 | }; |
| 127 | + | ||
| 128 | + function handleSelect(organization) { | ||
| 129 | + searchInfo.organizationId = organization; | ||
| 130 | + reload(); | ||
| 131 | + } | ||
| 124 | </script> | 132 | </script> |
| 125 | 133 | ||
| 126 | <template> | 134 | <template> |
| 127 | <section class="flex w-full h-full"> | 135 | <section class="flex w-full h-full"> |
| 128 | - <OrganizationIdTree @register="registerOrgTree" /> | 136 | + <OrganizationIdTree @select="handleSelect" @register="registerOrgTree" /> |
| 129 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="register"> | 137 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="register"> |
| 130 | <template #toolbar> | 138 | <template #toolbar> |
| 131 | <div class="flex gap-3 justify-end"> | 139 | <div class="flex gap-3 justify-end"> |
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | import { useRole } from '/@/hooks/business/useRole'; | 11 | import { useRole } from '/@/hooks/business/useRole'; |
| 12 | import configurationSrc from '/@/assets/icons/configuration.svg'; | 12 | import configurationSrc from '/@/assets/icons/configuration.svg'; |
| 13 | import { Platform } from '../center/center.data'; | 13 | import { Platform } from '../center/center.data'; |
| 14 | - import { computed, unref } from 'vue'; | 14 | + import { computed, unref, reactive } from 'vue'; |
| 15 | import { createScadaPageLink, ScadaModeEnum } from '../center/help'; | 15 | import { createScadaPageLink, ScadaModeEnum } from '../center/help'; |
| 16 | import { useDrawer } from '/@/components/Drawer'; | 16 | import { useDrawer } from '/@/components/Drawer'; |
| 17 | import { usePermission } from '/@/hooks/web/usePermission'; | 17 | import { usePermission } from '/@/hooks/web/usePermission'; |
| @@ -22,11 +22,14 @@ | @@ -22,11 +22,14 @@ | ||
| 22 | import { OrganizationIdTree, useOrganizationTree } from '../../common/organizationIdTree'; | 22 | import { OrganizationIdTree, useOrganizationTree } from '../../common/organizationIdTree'; |
| 23 | import ConfigurationCenterDrawer from './ConfigurationCenterDrawer.vue'; | 23 | import ConfigurationCenterDrawer from './ConfigurationCenterDrawer.vue'; |
| 24 | 24 | ||
| 25 | + const searchInfo = reactive<Recordable>({}); | ||
| 26 | + | ||
| 25 | const [register, { reload }] = useCardList({ | 27 | const [register, { reload }] = useCardList({ |
| 26 | api: getPage, | 28 | api: getPage, |
| 27 | useSearchForm: true, | 29 | useSearchForm: true, |
| 28 | title: '模板列表', | 30 | title: '模板列表', |
| 29 | gutter: 4, | 31 | gutter: 4, |
| 32 | + searchInfo: searchInfo, | ||
| 30 | formConfig: { | 33 | formConfig: { |
| 31 | schemas: searchFormSchema, | 34 | schemas: searchFormSchema, |
| 32 | labelWidth: 80, | 35 | labelWidth: 80, |
| @@ -92,11 +95,16 @@ | @@ -92,11 +95,16 @@ | ||
| 92 | await reload(); | 95 | await reload(); |
| 93 | } catch (error) {} | 96 | } catch (error) {} |
| 94 | }; | 97 | }; |
| 98 | + | ||
| 99 | + function handleSelect(organization) { | ||
| 100 | + searchInfo.organizationId = organization; | ||
| 101 | + reload(); | ||
| 102 | + } | ||
| 95 | </script> | 103 | </script> |
| 96 | 104 | ||
| 97 | <template> | 105 | <template> |
| 98 | <section class="flex w-full h-full"> | 106 | <section class="flex w-full h-full"> |
| 99 | - <OrganizationIdTree @register="registerOrgTree" /> | 107 | + <OrganizationIdTree @select="handleSelect" @register="registerOrgTree" /> |
| 100 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="register"> | 108 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="register"> |
| 101 | <template #toolbar> | 109 | <template #toolbar> |
| 102 | <div class="flex gap-3 justify-end"> | 110 | <div class="flex gap-3 justify-end"> |
| 1 | <script setup lang="ts"> | 1 | <script setup lang="ts"> |
| 2 | import { Card, Button, Tooltip } from 'ant-design-vue'; | 2 | import { Card, Button, Tooltip } from 'ant-design-vue'; |
| 3 | - import { computed, unref } from 'vue'; | 3 | + import { computed, unref, reactive } from 'vue'; |
| 4 | import { OrganizationIdTree, useOrganizationTree } from '../common/organizationIdTree'; | 4 | import { OrganizationIdTree, useOrganizationTree } from '../common/organizationIdTree'; |
| 5 | import { | 5 | import { |
| 6 | bigScreenCancelPublish, | 6 | bigScreenCancelPublish, |
| @@ -38,11 +38,14 @@ | @@ -38,11 +38,14 @@ | ||
| 38 | }, | 38 | }, |
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | + const searchInfo = reactive<Recordable>({}); | ||
| 42 | + | ||
| 41 | const [registerCardList, { reload }] = useCardList({ | 43 | const [registerCardList, { reload }] = useCardList({ |
| 42 | api: getPage, | 44 | api: getPage, |
| 43 | title: '数据大屏', | 45 | title: '数据大屏', |
| 44 | useSearchForm: true, | 46 | useSearchForm: true, |
| 45 | gutter: 4, | 47 | gutter: 4, |
| 48 | + searchInfo: searchInfo, | ||
| 46 | formConfig: { | 49 | formConfig: { |
| 47 | labelWidth: 80, | 50 | labelWidth: 80, |
| 48 | schemas: searchFormSchema, | 51 | schemas: searchFormSchema, |
| @@ -128,11 +131,16 @@ | @@ -128,11 +131,16 @@ | ||
| 128 | createMessage.success(state === 0 ? '发布成功' : '取消发布成功'); | 131 | createMessage.success(state === 0 ? '发布成功' : '取消发布成功'); |
| 129 | reload(); | 132 | reload(); |
| 130 | }; | 133 | }; |
| 134 | + | ||
| 135 | + function handleSelect(organization) { | ||
| 136 | + searchInfo.organizationId = organization; | ||
| 137 | + reload(); | ||
| 138 | + } | ||
| 131 | </script> | 139 | </script> |
| 132 | 140 | ||
| 133 | <template> | 141 | <template> |
| 134 | <PageWrapper dense contentFullHeight contentClass="flex"> | 142 | <PageWrapper dense contentFullHeight contentClass="flex"> |
| 135 | - <OrganizationIdTree @register="registerOrgTree" /> | 143 | + <OrganizationIdTree @select="handleSelect" @register="registerOrgTree" /> |
| 136 | <BasicCardList | 144 | <BasicCardList |
| 137 | @register="registerCardList" | 145 | @register="registerCardList" |
| 138 | class="flex-auto p-4 w-3/4 xl:w-4/5 w-full configuration-list" | 146 | class="flex-auto p-4 w-3/4 xl:w-4/5 w-full configuration-list" |
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | import { Card, Statistic, Button, Tooltip } from 'ant-design-vue'; | 2 | import { Card, Statistic, Button, Tooltip } from 'ant-design-vue'; |
| 3 | - import { unref, computed } from 'vue'; | 3 | + import { unref, computed, reactive } from 'vue'; |
| 4 | import { MoreOutlined, ShareAltOutlined } from '@ant-design/icons-vue'; | 4 | import { MoreOutlined, ShareAltOutlined } from '@ant-design/icons-vue'; |
| 5 | import { useMessage } from '/@/hooks/web/useMessage'; | 5 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 6 | import Dropdown from '/@/components/Dropdown/src/Dropdown.vue'; | 6 | import Dropdown from '/@/components/Dropdown/src/Dropdown.vue'; |
| @@ -33,11 +33,14 @@ | @@ -33,11 +33,14 @@ | ||
| 33 | onSelect: () => reload(), | 33 | onSelect: () => reload(), |
| 34 | }); | 34 | }); |
| 35 | 35 | ||
| 36 | + const searchInfo = reactive<Recordable>({}); | ||
| 37 | + | ||
| 36 | const [registerCardList, { reload }] = useCardList({ | 38 | const [registerCardList, { reload }] = useCardList({ |
| 37 | title: '数据看板', | 39 | title: '数据看板', |
| 38 | api: getDataBoardList, | 40 | api: getDataBoardList, |
| 39 | baseLayout: { col: 3, row: 3 }, | 41 | baseLayout: { col: 3, row: 3 }, |
| 40 | useSearchForm: true, | 42 | useSearchForm: true, |
| 43 | + searchInfo: searchInfo, | ||
| 41 | formConfig: { | 44 | formConfig: { |
| 42 | schemas: formSchema, | 45 | schemas: formSchema, |
| 43 | labelWidth: 80, | 46 | labelWidth: 80, |
| @@ -144,11 +147,16 @@ | @@ -144,11 +147,16 @@ | ||
| 144 | router.push(`/visual/board/detail/${boardId}/${boardName}/${platform}/${organizationId}`); | 147 | router.push(`/visual/board/detail/${boardId}/${boardName}/${platform}/${organizationId}`); |
| 145 | } else createMessage.warning('没有权限'); | 148 | } else createMessage.warning('没有权限'); |
| 146 | }; | 149 | }; |
| 150 | + | ||
| 151 | + function handleSelect(organization) { | ||
| 152 | + searchInfo.organizationId = organization; | ||
| 153 | + reload(); | ||
| 154 | + } | ||
| 147 | </script> | 155 | </script> |
| 148 | 156 | ||
| 149 | <template> | 157 | <template> |
| 150 | <section class="flex"> | 158 | <section class="flex"> |
| 151 | - <OrganizationIdTree @register="registerOrgTree" /> | 159 | + <OrganizationIdTree @select="handleSelect" @register="registerOrgTree" /> |
| 152 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="registerCardList"> | 160 | <BasicCardList class="flex-auto p-4 w-3/4 xl:w-4/5 w-full" @register="registerCardList"> |
| 153 | <template #toolbar> | 161 | <template #toolbar> |
| 154 | <Authority :value="VisualBoardPermission.CREATE"> | 162 | <Authority :value="VisualBoardPermission.CREATE"> |