Commit c7f83034d87bd9dc5cecf75fdca2c6739868eb20

Authored by ww
1 parent e1029d5f

perf: DEFECT-845 optimize configuration center page

... ... @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = /
14 14 # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]]
15 15 # 线上测试环境
16 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 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 21 # 实时数据的ws地址
22 22 # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token=
... ...
... ... @@ -27,6 +27,7 @@
27 27 import { getBoundingClientRect } from '/@/utils/domUtils';
28 28 import configurationSrc from '/@/assets/icons/configuration.svg';
29 29 import { cloneDeep } from 'lodash';
  30 + import { usePermission } from '/@/hooks/web/usePermission';
30 31
31 32 const listColumn = ref(4);
32 33
... ... @@ -112,8 +113,9 @@
112 113 const { VITE_GLOB_CONFIGURATION } = import.meta.env;
113 114 const isDev = isDevMode();
114 115
  116 + const { hasPermission } = usePermission();
115 117 const handlePreview = (record: ConfigurationCenterItemsModal) => {
116   - console.log(record);
  118 + if (!hasPermission('api:yt:configuration:center:get_configuration_info:get')) return;
117 119 window.open(
118 120 `${VITE_GLOB_CONFIGURATION}/${isDev ? '?dev=1&' : '?'}configurationId=${
119 121 record!.id
... ... @@ -206,7 +208,12 @@
206 208 <Card hoverable>
207 209 <template #cover>
208 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 217 </div>
211 218 </template>
212 219 <template class="ant-card-actions" #actions>
... ... @@ -215,18 +222,18 @@
215 222 <EyeOutlined key="setting" @click="handlePreview(item)" />
216 223 </Tooltip>
217 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 228 </Tooltip>
222 229 </Authority>
223 230 <Dropdown
224 231 :dropMenuList="[
225 232 {
226 233 text: '设计',
227   - auth: 'api:yt:configuration:center:get_configuration_info:get',
  234 + auth: 'api:yt:configuration:center:update',
228 235 icon: 'clarity:note-edit-line',
229   - onClick: handleDesign.bind(null, item),
  236 + onClick: handleCreateOrUpdate.bind(null, item),
230 237 },
231 238 {
232 239 text: '删除',
... ...