Showing
1 changed file
with
23 additions
and
5 deletions
| @@ -14,12 +14,14 @@ | @@ -14,12 +14,14 @@ | ||
| 14 | import { ConfigurationPermission, Platform, searchFormSchema } from './center.data'; | 14 | import { ConfigurationPermission, Platform, searchFormSchema } from './center.data'; |
| 15 | import { useMessage } from '/@/hooks/web/useMessage'; | 15 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 16 | import { Authority } from '/@/components/Authority'; | 16 | import { Authority } from '/@/components/Authority'; |
| 17 | + import { isDevMode } from '/@/utils/env'; | ||
| 17 | import ConfigurationCenterDrawer from './ConfigurationCenterDrawer.vue'; | 18 | import ConfigurationCenterDrawer from './ConfigurationCenterDrawer.vue'; |
| 18 | import { useDrawer } from '/@/components/Drawer'; | 19 | import { useDrawer } from '/@/components/Drawer'; |
| 19 | import { getBoundingClientRect } from '/@/utils/domUtils'; | 20 | import { getBoundingClientRect } from '/@/utils/domUtils'; |
| 20 | import configurationSrc from '/@/assets/icons/configuration.svg'; | 21 | import configurationSrc from '/@/assets/icons/configuration.svg'; |
| 21 | import { cloneDeep } from 'lodash'; | 22 | import { cloneDeep } from 'lodash'; |
| 22 | import { usePermission } from '/@/hooks/web/usePermission'; | 23 | import { usePermission } from '/@/hooks/web/usePermission'; |
| 24 | + import { useGlobSetting } from '/@/hooks/setting'; | ||
| 23 | import { AuthIcon, CardLayoutButton } from '/@/components/Widget'; | 25 | import { AuthIcon, CardLayoutButton } from '/@/components/Widget'; |
| 24 | import AuthDropDown from '/@/components/Widget/AuthDropDown.vue'; | 26 | import AuthDropDown from '/@/components/Widget/AuthDropDown.vue'; |
| 25 | import { ShareModal } from '/@/views/common/ShareModal'; | 27 | import { ShareModal } from '/@/views/common/ShareModal'; |
| @@ -29,7 +31,6 @@ | @@ -29,7 +31,6 @@ | ||
| 29 | import { useRole } from '/@/hooks/business/useRole'; | 31 | import { useRole } from '/@/hooks/business/useRole'; |
| 30 | import { useClipboard } from '@vueuse/core'; | 32 | import { useClipboard } from '@vueuse/core'; |
| 31 | import { Icon } from '/@/components/Icon'; | 33 | import { Icon } from '/@/components/Icon'; |
| 32 | - import { createScadaPageLink, ScadaModeEnum } from './help'; | ||
| 33 | 34 | ||
| 34 | const listColumn = ref(5); | 35 | const listColumn = ref(5); |
| 35 | 36 | ||
| @@ -129,15 +130,25 @@ | @@ -129,15 +130,25 @@ | ||
| 129 | } | 130 | } |
| 130 | }; | 131 | }; |
| 131 | 132 | ||
| 133 | + const { configurationPrefix } = useGlobSetting(); | ||
| 134 | + const isDev = isDevMode(); | ||
| 135 | + | ||
| 132 | const handlePreview = (record: ConfigurationCenterItemsModal) => { | 136 | const handlePreview = (record: ConfigurationCenterItemsModal) => { |
| 133 | if (!unref(getPreviewFlag)) return; | 137 | if (!unref(getPreviewFlag)) return; |
| 134 | - createScadaPageLink(record, ScadaModeEnum.LIGHTBOX); | 138 | + window.open( |
| 139 | + `${configurationPrefix}/${isDev ? '?dev=1&' : '?'}configurationId=${ | ||
| 140 | + record!.id | ||
| 141 | + }&lightbox=1&organizationId=${record.organizationId}` | ||
| 142 | + ); | ||
| 135 | }; | 143 | }; |
| 136 | 144 | ||
| 137 | const handleDesign = (record: ConfigurationCenterItemsModal) => { | 145 | const handleDesign = (record: ConfigurationCenterItemsModal) => { |
| 138 | if (!unref(getDesignFlag)) return; | 146 | if (!unref(getDesignFlag)) return; |
| 139 | - | ||
| 140 | - createScadaPageLink(record, ScadaModeEnum.DESIGN); | 147 | + window.open( |
| 148 | + `${configurationPrefix}/${isDev ? '?dev=1&' : '?'}configurationId=${ | ||
| 149 | + record!.id | ||
| 150 | + }&organizationId=${record.organizationId}` | ||
| 151 | + ); | ||
| 141 | }; | 152 | }; |
| 142 | 153 | ||
| 143 | const handleDelete = async (record: ConfigurationCenterItemsModal) => { | 154 | const handleDelete = async (record: ConfigurationCenterItemsModal) => { |
| @@ -154,7 +165,14 @@ | @@ -154,7 +165,14 @@ | ||
| 154 | }; | 165 | }; |
| 155 | 166 | ||
| 156 | const createShareUrl = (record: ConfigurationCenterItemsModal) => { | 167 | const createShareUrl = (record: ConfigurationCenterItemsModal) => { |
| 157 | - return createScadaPageLink(record, ScadaModeEnum.SHARE, false); | 168 | + const searchParams = new URLSearchParams(); |
| 169 | + isDev && searchParams.set('dev', '1'); | ||
| 170 | + searchParams.set('share', 'SCADA'); | ||
| 171 | + searchParams.set('configurationId', record.id); | ||
| 172 | + searchParams.set('publicId', record.publicId || ''); | ||
| 173 | + searchParams.set('lightbox', '1'); | ||
| 174 | + searchParams.set('organizationId', record!.organizationId || ''); | ||
| 175 | + return `${origin}${configurationPrefix}/?${searchParams.toString()}`; | ||
| 158 | }; | 176 | }; |
| 159 | 177 | ||
| 160 | const { copied, copy } = useClipboard({ legacy: true }); | 178 | const { copied, copy } = useClipboard({ legacy: true }); |