Commit c7f83034d87bd9dc5cecf75fdca2c6739868eb20
1 parent
e1029d5f
perf: DEFECT-845 optimize configuration center page
Showing
2 changed files
with
16 additions
and
9 deletions
@@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = / | @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = / | ||
14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
15 | # 线上测试环境 | 15 | # 线上测试环境 |
16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
17 | -VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 17 | +# VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
18 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 18 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
19 | -# VITE_PROXY = [["/api","http://192.168.10.136:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]] | 19 | +VITE_PROXY = [["/api","http://192.168.10.103:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]] |
20 | 20 | ||
21 | # 实时数据的ws地址 | 21 | # 实时数据的ws地址 |
22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= | 22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= |
@@ -27,6 +27,7 @@ | @@ -27,6 +27,7 @@ | ||
27 | import { getBoundingClientRect } from '/@/utils/domUtils'; | 27 | import { getBoundingClientRect } from '/@/utils/domUtils'; |
28 | import configurationSrc from '/@/assets/icons/configuration.svg'; | 28 | import configurationSrc from '/@/assets/icons/configuration.svg'; |
29 | import { cloneDeep } from 'lodash'; | 29 | import { cloneDeep } from 'lodash'; |
30 | + import { usePermission } from '/@/hooks/web/usePermission'; | ||
30 | 31 | ||
31 | const listColumn = ref(4); | 32 | const listColumn = ref(4); |
32 | 33 | ||
@@ -112,8 +113,9 @@ | @@ -112,8 +113,9 @@ | ||
112 | const { VITE_GLOB_CONFIGURATION } = import.meta.env; | 113 | const { VITE_GLOB_CONFIGURATION } = import.meta.env; |
113 | const isDev = isDevMode(); | 114 | const isDev = isDevMode(); |
114 | 115 | ||
116 | + const { hasPermission } = usePermission(); | ||
115 | const handlePreview = (record: ConfigurationCenterItemsModal) => { | 117 | const handlePreview = (record: ConfigurationCenterItemsModal) => { |
116 | - console.log(record); | 118 | + if (!hasPermission('api:yt:configuration:center:get_configuration_info:get')) return; |
117 | window.open( | 119 | window.open( |
118 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${ | 120 | `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${ |
119 | record!.id | 121 | record!.id |
@@ -206,7 +208,12 @@ | @@ -206,7 +208,12 @@ | ||
206 | <Card hoverable> | 208 | <Card hoverable> |
207 | <template #cover> | 209 | <template #cover> |
208 | <div class="h-full w-full !flex justify-center items-center text-center"> | 210 | <div class="h-full w-full !flex justify-center items-center text-center"> |
209 | - <img class="w-36 h-36" alt="example" :src="item.thumbnail || configurationSrc" /> | 211 | + <img |
212 | + class="w-36 h-36" | ||
213 | + alt="example" | ||
214 | + :src="item.thumbnail || configurationSrc" | ||
215 | + @click="handlePreview(item)" | ||
216 | + /> | ||
210 | </div> | 217 | </div> |
211 | </template> | 218 | </template> |
212 | <template class="ant-card-actions" #actions> | 219 | <template class="ant-card-actions" #actions> |
@@ -215,18 +222,18 @@ | @@ -215,18 +222,18 @@ | ||
215 | <EyeOutlined key="setting" @click="handlePreview(item)" /> | 222 | <EyeOutlined key="setting" @click="handlePreview(item)" /> |
216 | </Tooltip> | 223 | </Tooltip> |
217 | </Authority> | 224 | </Authority> |
218 | - <Authority value="api:yt:configuration:center:update"> | ||
219 | - <Tooltip title="编辑"> | ||
220 | - <EditOutlined key="edit" @click="handleCreateOrUpdate(item)" /> | 225 | + <Authority value="api:yt:configuration:center:get_configuration_info:get"> |
226 | + <Tooltip title="设计"> | ||
227 | + <EditOutlined key="edit" @click="handleDesign(item)" /> | ||
221 | </Tooltip> | 228 | </Tooltip> |
222 | </Authority> | 229 | </Authority> |
223 | <Dropdown | 230 | <Dropdown |
224 | :dropMenuList="[ | 231 | :dropMenuList="[ |
225 | { | 232 | { |
226 | text: '设计', | 233 | text: '设计', |
227 | - auth: 'api:yt:configuration:center:get_configuration_info:get', | 234 | + auth: 'api:yt:configuration:center:update', |
228 | icon: 'clarity:note-edit-line', | 235 | icon: 'clarity:note-edit-line', |
229 | - onClick: handleDesign.bind(null, item), | 236 | + onClick: handleCreateOrUpdate.bind(null, item), |
230 | }, | 237 | }, |
231 | { | 238 | { |
232 | text: '删除', | 239 | text: '删除', |