Commit dec4e007afd82f0069eaa4105840c2d811989b3e

Authored by xp.Huang
2 parents fe107532 93f10289

Merge branch 'main_dev' into 'main'

Main dev

See merge request yunteng/thingskit-view!282
Showing 22 changed files with 266 additions and 52 deletions
1 import { defHttp } from '@/utils/external/http/axios' 1 import { defHttp } from '@/utils/external/http/axios'
2 -import {CameraRecord, ConfigurationItemType, DictItem, OrganizationListItem, UploadResponse} from './model' 2 +import { CameraRecord, ConfigurationItemType, DictItem, OrganizationListItem, UploadResponse } from './model'
3 import { PaginationResult } from '/#/external/axios' 3 import { PaginationResult } from '/#/external/axios'
4 import { isShareMode } from '@/views/share/hook' 4 import { isShareMode } from '@/views/share/hook'
5 5
@@ -22,6 +22,7 @@ enum Api { @@ -22,6 +22,7 @@ enum Api {
22 GET_DEVICE_LATEST = '/plugins/telemetry/DEVICE/', 22 GET_DEVICE_LATEST = '/plugins/telemetry/DEVICE/',
23 DEVICE_ATTR = '/device/attributes', 23 DEVICE_ATTR = '/device/attributes',
24 ALARM_LIST = '/alarm', 24 ALARM_LIST = '/alarm',
  25 + BASE_DELETE_URL = '/oss',
25 } 26 }
26 27
27 export const getDictItemByCode = (value: string) => { 28 export const getDictItemByCode = (value: string) => {
@@ -89,7 +90,7 @@ export const getOrganizationList = (params?: OrganizationListItem) => @@ -89,7 +90,7 @@ export const getOrganizationList = (params?: OrganizationListItem) =>
89 90
90 //获取视频列表 91 //获取视频列表
91 export const getVideoList = (params?: object) => 92 export const getVideoList = (params?: object) =>
92 - defHttp.get<{data: CameraRecord[]}>({ 93 + defHttp.get<{ data: CameraRecord[] }>({
93 url: Api.VIDEO, 94 url: Api.VIDEO,
94 params 95 params
95 }) 96 })
@@ -160,6 +161,17 @@ export const getAlarmList = (params?: object) => @@ -160,6 +161,17 @@ export const getAlarmList = (params?: object) =>
160 url: Api.ALARM_LIST, 161 url: Api.ALARM_LIST,
161 params 162 params
162 }, 163 },
163 - {  
164 - withShareToken: true  
165 - }) 164 + {
  165 + withShareToken: true
  166 + })
  167 +
  168 +
  169 +/**
  170 + * 删除上传的图片
  171 + * @description deleteFilePath图片url
  172 + */
  173 +export const deleteFilePath = (deleteFilePath?: string) => {
  174 + return defHttp.delete({
  175 + url: `${Api.BASE_DELETE_URL}?deleteFilePath=${deleteFilePath}`,
  176 + });
  177 +};
@@ -67,5 +67,6 @@ export interface DateViewConfigurationInfoType { @@ -67,5 +67,6 @@ export interface DateViewConfigurationInfoType {
67 id: string 67 id: string
68 enabled: boolean, 68 enabled: boolean,
69 content: string 69 content: string
70 - } 70 + },
  71 + thumbnail?: string
71 } 72 }
@@ -31,6 +31,7 @@ interface uploadSizeFormatIF { @@ -31,6 +31,7 @@ interface uploadSizeFormatIF {
31 } 31 }
32 32
33 const props = defineProps({ 33 const props = defineProps({
  34 + uploadIndex: Number,
34 uploadImageUrl: { 35 uploadImageUrl: {
35 type: String as PropType<string>, 36 type: String as PropType<string>,
36 default: '' 37 default: ''
@@ -60,7 +61,7 @@ const customRequest = (options: UploadCustomRequestOptions) => { @@ -60,7 +61,7 @@ const customRequest = (options: UploadCustomRequestOptions) => {
60 uploadParams.append('file', newNameFile) 61 uploadParams.append('file', newNameFile)
61 const uploadRes = await uploadFile(uploadParams) 62 const uploadRes = await uploadFile(uploadParams)
62 if (!uploadRes) return 63 if (!uploadRes) return
63 - emit('sendFile', uploadRes?.fileStaticUri) 64 + emit('sendFile', uploadRes?.fileStaticUri, props.uploadIndex)
64 window['$message'].success('上传文件成功!') 65 window['$message'].success('上传文件成功!')
65 } else { 66 } else {
66 window['$message'].error('上传文件失败,请稍后重试!') 67 window['$message'].error('上传文件失败,请稍后重试!')
@@ -88,7 +89,7 @@ const beforeUploadHandle = (file: UploadFileInfo) => { @@ -88,7 +89,7 @@ const beforeUploadHandle = (file: UploadFileInfo) => {
88 //单个点击删除 89 //单个点击删除
89 const remove = () => { 90 const remove = () => {
90 fileList.value = [] 91 fileList.value = []
91 - emit('removeFile', true) 92 + emit('removeFile', true, props.uploadIndex)
92 } 93 }
93 </script> 94 </script>
94 95
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 </template> 7 </template>
8 8
9 <script setup lang="ts"> 9 <script setup lang="ts">
10 -import { PropType, toRefs, watch, ref, computed, unref } from 'vue' 10 +import { PropType, toRefs, watch, ref } from 'vue'
11 import { CreateComponentType } from '@/packages/index.d' 11 import { CreateComponentType } from '@/packages/index.d'
12 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 12 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
13 import { useChartDataFetch } from '@/hooks' 13 import { useChartDataFetch } from '@/hooks'
@@ -25,16 +25,19 @@ const props = defineProps({ @@ -25,16 +25,19 @@ const props = defineProps({
25 25
26 const { w, h } = toRefs(props.chartConfig.attr) 26 const { w, h } = toRefs(props.chartConfig.attr)
27 27
28 -const { targetData, chartEditStore } = useTargetData() 28 +const { targetData } = useTargetData()
29 29
  30 +/**
  31 + * 递归判断是否是ws会造成页面崩溃,浏览器无法点击
  32 + *
30 const isWebsocket = computed(() => { 33 const isWebsocket = computed(() => {
31 - const result = query(chartEditStore.getComponentList) 34 + const result = query(chartEditStore.getComponentList) as unknown as any
32 if (result === false) return false 35 if (result === false) return false
33 -  
34 - if (result.id === targetData.value.id) 36 + if (!targetData.value) return
  37 + if (result?.id === targetData.value.id)
35 return targetData.value.request.requestContentType as RequestContentTypeEnum === RequestContentTypeEnum.WEB_SOCKET 38 return targetData.value.request.requestContentType as RequestContentTypeEnum === RequestContentTypeEnum.WEB_SOCKET
36 else { 39 else {
37 - return result.request.requestContentType as RequestContentTypeEnum === RequestContentTypeEnum.WEB_SOCKET 40 + return result?.request.requestContentType as RequestContentTypeEnum === RequestContentTypeEnum.WEB_SOCKET
38 } 41 }
39 }) 42 })
40 43
@@ -42,19 +45,20 @@ function query(list: CreateComponentType[]) { @@ -42,19 +45,20 @@ function query(list: CreateComponentType[]) {
42 if (!list || !list?.length) return false 45 if (!list || !list?.length) return false
43 46
44 for (const item of list) { 47 for (const item of list) {
  48 + if (!targetData.value) return
45 if (item.id === targetData.value.id) { 49 if (item.id === targetData.value.id) {
46 return item 50 return item
47 } 51 }
48 if (item.groupList && item.groupList?.length) { 52 if (item.groupList && item.groupList?.length) {
49 - const flag = query(list) 53 + const flag = query(item.groupList) // 不能使用list递归,页面报内存溢出
50 if (flag) { 54 if (flag) {
51 return item 55 return item
52 } 56 }
53 } 57 }
54 } 58 }
55 -  
56 return false 59 return false
57 } 60 }
  61 +*/
58 62
59 const { 63 const {
60 flipperLength, 64 flipperLength,
@@ -97,7 +101,7 @@ watch( @@ -97,7 +101,7 @@ watch(
97 ) 101 )
98 102
99 useChartDataFetch(props.chartConfig, useChartEditStore, (newVal: string | number) => { 103 useChartDataFetch(props.chartConfig, useChartEditStore, (newVal: string | number) => {
100 - if (unref(isWebsocket)) return 104 + if(targetData.value?.request?.requestContentType === RequestContentTypeEnum.WEB_SOCKET) return //请求类型是ws,则终止
101 updateDatasetHandler(newVal) 105 updateDatasetHandler(newVal)
102 }) 106 })
103 </script> 107 </script>
1 <template> 1 <template>
2 <div> 2 <div>
3 - <n-input :style="`width:${w}px;`" type="text" 3 + <n-input :style="`width:${w}px;height:${h}px;`" type="text"
4 v-model:value="option.value.dataset" 4 v-model:value="option.value.dataset"
5 placeholder="请输入" 5 placeholder="请输入"
6 - @update="onChange"> 6 + @blur="onBlur">
7 7
8 </n-input> 8 </n-input>
9 </div> 9 </div>
@@ -25,6 +25,7 @@ const props = defineProps({ @@ -25,6 +25,7 @@ const props = defineProps({
25 }) 25 })
26 26
27 const { w, h } = toRefs(props.chartConfig.attr) 27 const { w, h } = toRefs(props.chartConfig.attr)
  28 +
28 const option = shallowReactive({ 29 const option = shallowReactive({
29 value: { 30 value: {
30 inputValue: props.chartConfig.option.inputValue, 31 inputValue: props.chartConfig.option.inputValue,
@@ -32,8 +33,7 @@ const option = shallowReactive({ @@ -32,8 +33,7 @@ const option = shallowReactive({
32 } 33 }
33 }) 34 })
34 35
35 -const onChange = (v: string) => {  
36 - // if(v == undefined) return; 36 +const onBlur = () => {
37 // 存储到联动数据 37 // 存储到联动数据
38 useChartInteract( 38 useChartInteract(
39 props.chartConfig, 39 props.chartConfig,
@@ -49,7 +49,6 @@ watch( @@ -49,7 +49,6 @@ watch(
49 () => props.chartConfig.option, 49 () => props.chartConfig.option,
50 (newData: any) => { 50 (newData: any) => {
51 option.value = newData 51 option.value = newData
52 - onChange(newData.inputValue)  
53 }, 52 },
54 { 53 {
55 immediate: true, 54 immediate: true,
@@ -123,9 +123,14 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => { @@ -123,9 +123,14 @@ const createInfoWindow = async (extraInfo: dataExtraInfoType) => {
123 devicePartInfo.name = name 123 devicePartInfo.name = name
124 devicePartInfo.deviceProfileId = deviceProfileId 124 devicePartInfo.deviceProfileId = deviceProfileId
125 if (tbDeviceId.startsWith('@')) return //假的模拟数据则终止 125 if (tbDeviceId.startsWith('@')) return //假的模拟数据则终止
  126 + let deviceLastUpdateTs = null
126 const res = await getDeviceActiveTime(tbDeviceId) //查询设备最后离线时间 127 const res = await getDeviceActiveTime(tbDeviceId) //查询设备最后离线时间
127 - let { lastUpdateTs } = res[0]  
128 - const lastUpdateFormatTs = dayjs(lastUpdateTs).format('YYYY-MM-DD HH:mm:ss') 128 + if (!res) {
  129 + deviceLastUpdateTs = null
  130 + } else {
  131 + deviceLastUpdateTs = res[0]['lastUpdateTs']
  132 + }
  133 + const lastUpdateFormatTs = deviceLastUpdateTs ? dayjs(deviceLastUpdateTs).format('YYYY-MM-DD HH:mm:ss'): ''
129 //以render方式渲染小组件里的边框组件 134 //以render方式渲染小组件里的边框组件
130 const BorderInstance = await import(`../../../../Decorates/Borders/${mpBorderConfig.value.value}/index.vue`) 135 const BorderInstance = await import(`../../../../Decorates/Borders/${mpBorderConfig.value.value}/index.vue`)
131 const config = await import(`../../../../Decorates/Borders/${mpBorderConfig.value.value}/config.ts`) 136 const config = await import(`../../../../Decorates/Borders/${mpBorderConfig.value.value}/config.ts`)
@@ -194,11 +199,11 @@ const handleOpenDrawer = async () => { @@ -194,11 +199,11 @@ const handleOpenDrawer = async () => {
194 } 199 }
195 200
196 onMounted(() => { 201 onMounted(() => {
197 - ;(window as any).handleOpenDrawer = handleOpenDrawer 202 + (window as any).handleOpenDrawer = handleOpenDrawer
198 }) 203 })
199 204
200 onUnmounted(() => { 205 onUnmounted(() => {
201 - ;(window as any).handleOpenDrawer = null 206 + (window as any).handleOpenDrawer = null
202 }) 207 })
203 208
204 //地图鼠标hover 209 //地图鼠标hover
@@ -233,13 +238,15 @@ const dataHandle = (newData: dataJsonType) => { @@ -233,13 +238,15 @@ const dataHandle = (newData: dataJsonType) => {
233 // 记录新标记 238 // 记录新标记
234 if (mapMarkerType.value === MarkerEnum.MARKER) { 239 if (mapMarkerType.value === MarkerEnum.MARKER) {
235 newData.markers.forEach((markerItem: dataJsonMarkersType) => { 240 newData.markers.forEach((markerItem: dataJsonMarkersType) => {
  241 + console.log("🚀 ~ newData.markers.forEach ~ markerItem:", markerItem.extraInfo.deviceState)
236 const markerInstance = new AMapIns.Marker({ 242 const markerInstance = new AMapIns.Marker({
237 position: [markerItem.position[0], markerItem.position[1]], 243 position: [markerItem.position[0], markerItem.position[1]],
238 offset: new AMapIns.Pixel(-13, 5), 244 offset: new AMapIns.Pixel(-13, 5),
239 icon: new AMapIns.Icon({ 245 icon: new AMapIns.Icon({
240 - image: iconMarker.value,  
241 - size: new AMapIns.Size(22, 22), //图标所处区域大小  
242 - imageSize: new AMapIns.Size(22, 22) //图标大小 246 + // image: iconMarker.value,
  247 + image: markerItem.extraInfo.deviceState === 'ONLINE' ? online : markerItem.extraInfo.deviceState === 'INACTIVE' ? inactive : offline,
  248 + size: new AMapIns.Size(35, 35), //图标所处区域大小
  249 + imageSize: new AMapIns.Size(35, 35) //图标大小
243 }) 250 })
244 }) 251 })
245 // 原作者这种方式添加,属于JS API 1.4.8版本的 252 // 原作者这种方式添加,属于JS API 1.4.8版本的
  1 +import { PublicConfigClass } from '@/packages/public'
  2 +import { CreateComponentType } from '@/packages/index.d'
  3 +import { chartInitConfig } from '@/settings/designSetting'
  4 +import { VariableImageConfig } from './index'
  5 +import cloneDeep from 'lodash/cloneDeep'
  6 +
  7 +export const option = {
  8 + dataset: '',
  9 + valueConfig: [
  10 + {
  11 + value: '',
  12 + imageUrl: ''
  13 + }
  14 + ]
  15 +}
  16 +
  17 +export default class Config extends PublicConfigClass implements CreateComponentType {
  18 + public key = VariableImageConfig.key
  19 + public attr = { ...chartInitConfig, w: 500, h: 300, zIndex: -1 }
  20 + public chartConfig = cloneDeep(VariableImageConfig)
  21 + public option = cloneDeep(option)
  22 +}
  1 +<template>
  2 + <collapse-item name="配置" :expanded="true">
  3 + <template v-for="(item, index) in optionData.valueConfig" :key="index">
  4 + <setting-item-box name="变量值" :alone="true">
  5 + <setting-item>
  6 + <n-input v-model:value="item.value"></n-input>
  7 + </setting-item>
  8 + </setting-item-box>
  9 + <div style="height: 10px"></div>
  10 + <setting-item-box name="变量图片" :alone="true">
  11 + <setting-item>
  12 + <TKUpload
  13 + :uploadIndex="index"
  14 + :uploadImageUrl="item.imageUrl"
  15 + @sendFile="handleSendFile"
  16 + @removeFile="handleRemoveFile"
  17 + />
  18 + </setting-item>
  19 + </setting-item-box>
  20 + <n-button size="small" @click="optionData.valueConfig.splice(index, 1)"> - </n-button>
  21 + </template>
  22 + <n-button
  23 + style="margin-left: 10px"
  24 + v-if="optionData.valueConfig"
  25 + size="small"
  26 + @click="
  27 + optionData.valueConfig.push({
  28 + value: '',
  29 + imageUrl: '',
  30 + })
  31 + "
  32 + >
  33 + +
  34 + </n-button>
  35 + </collapse-item>
  36 +</template>
  37 +
  38 +<script setup lang="ts">
  39 +import { PropType } from 'vue'
  40 +import { option } from './config'
  41 +import { TKUpload } from '@/components/external/Common/TKUpload'
  42 +import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
  43 +
  44 +const props = defineProps({
  45 + optionData: {
  46 + type: Object as PropType<typeof option>,
  47 + required: true
  48 + }
  49 +})
  50 +
  51 +const handleSendFile = (file: string, index: number) => {
  52 + if (!file) return
  53 + props.optionData.valueConfig[index].imageUrl = file
  54 +}
  55 +
  56 +const handleRemoveFile = (status: boolean, index: number) =>
  57 + status ? (props.optionData.valueConfig[index].imageUrl = '') : null
  58 +</script>
  1 +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d'
  2 +import { ChatCategoryEnum, ChatCategoryEnumName } from '@/packages/components/Informations/index.d'
  3 +import { useWidgetKey } from '@/packages/external/useWidgetKey'
  4 +
  5 +const { key, conKey, chartKey } = useWidgetKey('VariableImage', true)
  6 +
  7 +export const VariableImageConfig: ConfigType = {
  8 + key,
  9 + chartKey,
  10 + conKey,
  11 + title: '变量图片(适合ws)',
  12 + category: ChatCategoryEnum.MORE,
  13 + categoryName: ChatCategoryEnumName.MORE,
  14 + package: PackagesCategoryEnum.INFORMATIONS,
  15 + chartFrame: ChartFrameEnum.COMMON,
  16 + image: 'iframe.png'
  17 +}
  1 +<template>
  2 + <div>
  3 + <n-image
  4 + preview-disabled
  5 + :fallback-src="requireErrorImg()"
  6 + :src="!dataset ? logo : dataset"
  7 + :width="w"
  8 + :height="h"
  9 + ></n-image>
  10 + </div>
  11 +</template>
  12 +
  13 +<script setup lang="ts">
  14 +import { PropType, toRefs, watch } from 'vue'
  15 +import { requireErrorImg } from '@/utils'
  16 +import { useChartDataFetch } from '@/hooks'
  17 +import { CreateComponentType } from '@/packages/index.d'
  18 +import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
  19 +import { option } from './config'
  20 +import logo from '@/assets/logo.png'
  21 +
  22 +const props = defineProps({
  23 + chartConfig: {
  24 + type: Object as PropType<CreateComponentType>,
  25 + required: true
  26 + }
  27 +})
  28 +
  29 +const { w, h } = toRefs(props.chartConfig.attr)
  30 +
  31 +const { dataset, valueConfig } = toRefs(props.chartConfig.option as unknown as typeof option)
  32 +
  33 +watch(
  34 + () => dataset?.value,
  35 + newValue => {
  36 + const findImageUrl = valueConfig?.value.find(
  37 + (valueConfigItem: typeof option['valueConfig'][0]) => String(valueConfigItem.value) === String(newValue)
  38 + )
  39 + if (findImageUrl) {
  40 + dataset.value = findImageUrl?.imageUrl
  41 + }
  42 + },
  43 + {
  44 + immediate: true
  45 + }
  46 +)
  47 +
  48 +// 预览更新
  49 +useChartDataFetch(props.chartConfig, useChartEditStore)
  50 +</script>
@@ -8,7 +8,7 @@ export const OverrideTextEnumCommonConfig: ConfigType = { @@ -8,7 +8,7 @@ export const OverrideTextEnumCommonConfig: ConfigType = {
8 key, 8 key,
9 chartKey, 9 chartKey,
10 conKey, 10 conKey,
11 - title: '自定义文字(支持枚举)', 11 + title: '文字枚举(适合ws)',
12 category: ChatCategoryEnum.TEXT, 12 category: ChatCategoryEnum.TEXT,
13 categoryName: ChatCategoryEnumName.TEXT, 13 categoryName: ChatCategoryEnumName.TEXT,
14 package: PackagesCategoryEnum.INFORMATIONS, 14 package: PackagesCategoryEnum.INFORMATIONS,
@@ -21,6 +21,7 @@ import { CameraConfig } from '@/packages/components/external/Informations/Mores/ @@ -21,6 +21,7 @@ import { CameraConfig } from '@/packages/components/external/Informations/Mores/
21 import { SingleCameraConfig } from '@/packages/components/external/Informations/Mores/SingleCamera' 21 import { SingleCameraConfig } from '@/packages/components/external/Informations/Mores/SingleCamera'
22 import { OverrideILoadConfigurationframeConfig } from '@/packages/components/external/Informations/Mores/OverrideILoadConfigurationframe' 22 import { OverrideILoadConfigurationframeConfig } from '@/packages/components/external/Informations/Mores/OverrideILoadConfigurationframe'
23 import { CustomEchartsConfig } from '@/packages/components/external/Informations/Mores/CustomEcharts' 23 import { CustomEchartsConfig } from '@/packages/components/external/Informations/Mores/CustomEcharts'
  24 +import { VariableImageConfig } from '@/packages/components/external/Informations/Mores/VariableImage'
24 import { OverrideBarCommonConfig } from '@/packages/components/external/Charts/Bars/OverrideBarCommon' 25 import { OverrideBarCommonConfig } from '@/packages/components/external/Charts/Bars/OverrideBarCommon'
25 import { OverrideLineCommonConfig } from '@/packages/components/external/Charts/Lines/OverrideLineCommon' 26 import { OverrideLineCommonConfig } from '@/packages/components/external/Charts/Lines/OverrideLineCommon'
26 import { OverrideLineGradientsConfig } from '@/packages/components/external/Charts/Lines/OverrideLineGradients' 27 import { OverrideLineGradientsConfig } from '@/packages/components/external/Charts/Lines/OverrideLineGradients'
@@ -145,6 +146,7 @@ export function useInjectLib(packagesList: EPackagesType) { @@ -145,6 +146,7 @@ export function useInjectLib(packagesList: EPackagesType) {
145 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, SingleCameraConfig)//新增信息下的单个摄像头 146 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, SingleCameraConfig)//新增信息下的单个摄像头
146 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, OverrideILoadConfigurationframeConfig)//新增信息下的加载组态 147 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, OverrideILoadConfigurationframeConfig)//新增信息下的加载组态
147 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, CustomEchartsConfig)//新增信息下的自定义ecahrts组件 148 addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, CustomEchartsConfig)//新增信息下的自定义ecahrts组件
  149 + addWidgetToCategoryByCategoryName(packagesList, PackagesCategoryEnum.INFORMATIONS, VariableImageConfig)//新增信息下的变量图片组件
148 // 150 //
149 151
150 //图表 152 //图表
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 </template> 50 </template>
51 51
52 <script setup lang="ts"> 52 <script setup lang="ts">
53 -import { PropType, watch, ref, Ref, computed, nextTick } from 'vue' 53 +import { PropType, watch, ref, Ref, computed, nextTick, onMounted } from 'vue'
54 import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index' 54 import { MacOsControlBtn } from '@/components/Tips/MacOsControlBtn/index'
55 import { ChartGlobImage } from '@/components/Pages/ChartGlobImage' 55 import { ChartGlobImage } from '@/components/Pages/ChartGlobImage'
56 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 56 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
@@ -166,6 +166,18 @@ watch( @@ -166,6 +166,18 @@ watch(
166 } 166 }
167 } 167 }
168 ) 168 )
  169 +
  170 +/**
  171 + * 修复vue draggable拖拽插件在火狐浏览器上确实会存在拖拽会新开一个窗口,属于官方问题,其他浏览器不存在此问题。
  172 + * 解决代码如下
  173 + */
  174 +onMounted(() => {
  175 + document.body.ondrop = function (event) {
  176 + event.preventDefault()
  177 + event.stopPropagation()
  178 + }
  179 +})
  180 +//
169 </script> 181 </script>
170 182
171 <style lang="scss" scoped> 183 <style lang="scss" scoped>
@@ -451,6 +451,8 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => { @@ -451,6 +451,8 @@ export const useDynamicPublicForm = (paramsItemList: Ref<ParamsItemType[]>) => {
451 params[BuiltInVariable.SELECT_TIME_AGGREGATION].agg = null 451 params[BuiltInVariable.SELECT_TIME_AGGREGATION].agg = null
452 params[BuiltInVariable.SELECT_TIME_AGGREGATION].limit = 7 452 params[BuiltInVariable.SELECT_TIME_AGGREGATION].limit = 7
453 params[BuiltInVariable.SELECT_TIME_AGGREGATION].interval = null 453 params[BuiltInVariable.SELECT_TIME_AGGREGATION].interval = null
  454 + params.page = null
  455 + params.pageSize = null
454 getSelectDeviceAttr.value.value = null 456 getSelectDeviceAttr.value.value = null
455 getSelectOrgTree.value.value = null 457 getSelectOrgTree.value.value = null
456 getSelectDeviceProfile.value.value = null 458 getSelectDeviceProfile.value.value = null
@@ -163,7 +163,6 @@ const setConfigurationData = async (request: ExtraRequestConfigType) => { @@ -163,7 +163,6 @@ const setConfigurationData = async (request: ExtraRequestConfigType) => {
163 * 源代码 selectedPublicInterface.value = requestDataPondId 163 * 源代码 selectedPublicInterface.value = requestDataPondId
164 * 修改后代码 selectedPublicInterface.value = publicInterfaceList.value.find(it=>it.id === requestDataPondId)?.id||'' 164 * 修改后代码 selectedPublicInterface.value = publicInterfaceList.value.find(it=>it.id === requestDataPondId)?.id||''
165 */ 165 */
166 - console.log(publicInterfaceList.value)  
167 selectedPublicInterface.value = publicInterfaceList.value.find(it => it.id === publicInterfaceSelectId)?.id || '' 166 selectedPublicInterface.value = publicInterfaceList.value.find(it => it.id === publicInterfaceSelectId)?.id || ''
168 //ft 167 //ft
169 requestContentTypeRef.value = requestContentType 168 requestContentTypeRef.value = requestContentType
@@ -275,7 +275,7 @@ const fnEventsOptions = (): Array<SelectOption | SelectGroupOption> => { @@ -275,7 +275,7 @@ const fnEventsOptions = (): Array<SelectOption | SelectGroupOption> => {
275 const requestDataPond = chartEditStore.getRequestGlobalConfig.requestDataPond.map(item => ({ 275 const requestDataPond = chartEditStore.getRequestGlobalConfig.requestDataPond.map(item => ({
276 id: item.dataPondId, 276 id: item.dataPondId,
277 title: item.dataPondName, 277 title: item.dataPondName,
278 - disabled: false, 278 + disabled: true,
279 type: 'requestDataPond' 279 type: 'requestDataPond'
280 })) 280 }))
281 const tarArr = requestDataPond.concat(mapOptionList) 281 const tarArr = requestDataPond.concat(mapOptionList)
@@ -193,13 +193,13 @@ const btnList: BtnListType[] = [ @@ -193,13 +193,13 @@ const btnList: BtnListType[] = [
193 icon: DownloadIcon, 193 icon: DownloadIcon,
194 handle: exportHandle 194 handle: exportHandle
195 }, 195 },
196 - {  
197 - key: 'edit',  
198 - type: TypeEnum.BUTTON,  
199 - name: '编辑',  
200 - icon: CreateIcon,  
201 - handle: editHandle  
202 - }, 196 + // {
  197 + // key: 'edit',
  198 + // type: TypeEnum.BUTTON,
  199 + // name: '编辑',
  200 + // icon: CreateIcon,
  201 + // handle: editHandle
  202 + // },
203 { 203 {
204 key: 'setting', 204 key: 'setting',
205 type: TypeEnum.BUTTON, 205 type: TypeEnum.BUTTON,
@@ -13,14 +13,16 @@ @@ -13,14 +13,16 @@
13 {{ props.componentData.chartConfig.title }} 13 {{ props.componentData.chartConfig.title }}
14 </span> 14 </span>
15 </n-ellipsis> 15 </n-ellipsis>
16 - <layers-status :isGroup="isGroup" :hover="hover" :status="status"></layers-status> 16 + <div class="list-layers">
  17 + <layers-status :isGroup="isGroup" :hover="hover" :status="status"></layers-status>
  18 + </div>
17 </div> 19 </div>
18 <div :class="{ 'select-modal': select }"></div> 20 <div :class="{ 'select-modal': select }"></div>
19 </div> 21 </div>
20 </template> 22 </template>
21 23
22 <script setup lang="ts"> 24 <script setup lang="ts">
23 -import { computed, PropType, ref } from 'vue' 25 +import { computed, PropType, ref } from 'vue'
24 import { requireErrorImg } from '@/utils' 26 import { requireErrorImg } from '@/utils'
25 import { useDesignStore } from '@/store/modules/designStore/designStore' 27 import { useDesignStore } from '@/store/modules/designStore/designStore'
26 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 28 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
@@ -141,8 +143,24 @@ $textSize: 10px; @@ -141,8 +143,24 @@ $textSize: 10px;
141 } 143 }
142 144
143 .list-text { 145 .list-text {
  146 + position: absolute;
  147 + z-index: 99;
  148 + left: 70px;
  149 + top: 20px;
144 padding-left: 6px; 150 padding-left: 6px;
  151 + width: 60px;
145 font-size: $textSize; 152 font-size: $textSize;
  153 + overflow: hidden;
  154 + text-align: left;
  155 + text-overflow: ellipsis;
  156 + white-space: nowrap;
  157 + }
  158 +
  159 + .list-layers {
  160 + position: absolute;
  161 + z-index: 99;
  162 + left: 140px;
  163 + top: 15px;
146 } 164 }
147 165
148 /* 选中样式 */ 166 /* 选中样式 */
@@ -11,6 +11,7 @@ import { useSync } from '../useSync.hook' @@ -11,6 +11,7 @@ import { useSync } from '../useSync.hook'
11 import { BaseUpdateContentParams, DateViewConfigurationInfoType } from '@/api/external/contentSave/model/contentModel' 11 import { BaseUpdateContentParams, DateViewConfigurationInfoType } from '@/api/external/contentSave/model/contentModel'
12 import { useRole } from './business/useRole' 12 import { useRole } from './business/useRole'
13 import { ChartEditStoreType, PageChartEditStoreType } from '@/store/modules/chartEditStore/chartEditStore.d' 13 import { ChartEditStoreType, PageChartEditStoreType } from '@/store/modules/chartEditStore/chartEditStore.d'
  14 +import { deleteFilePath } from '@/api/external/common'
14 15
15 /** 16 /**
16 * * base64转file 17 * * base64转file
@@ -180,7 +181,8 @@ export const useSyncRemote = () => { @@ -180,7 +181,8 @@ export const useSyncRemote = () => {
180 181
181 //thumbnailSyncUpdate 缩略图保存 182 //thumbnailSyncUpdate 缩略图保存
182 const thumbnailSyncUpdate = throttle(async (updateImg = true) => { 183 const thumbnailSyncUpdate = throttle(async (updateImg = true) => {
183 - const { state, organizationId, dataViewName } = projectInfoStore.getProjectInfo 184 + console.log(projectInfoStore.getProjectInfo, 'projectInfoStore.getProjectInfo')
  185 + const { state, organizationId, dataViewName, thumbnail } = projectInfoStore.getProjectInfo
184 if (updateImg) { 186 if (updateImg) {
185 // 获取缩略图片 187 // 获取缩略图片
186 const range = document.querySelector('.go-edit-range') as HTMLElement 188 const range = document.querySelector('.go-edit-range') as HTMLElement
@@ -198,6 +200,9 @@ export const useSyncRemote = () => { @@ -198,6 +200,9 @@ export const useSyncRemote = () => {
198 base64toFile(canvasImage.toDataURL(), `${fetchRouteParamsLocation()}_index_preview.png`) 200 base64toFile(canvasImage.toDataURL(), `${fetchRouteParamsLocation()}_index_preview.png`)
199 ) 201 )
200 const uploadRes = await uploadFile(uploadParams) 202 const uploadRes = await uploadFile(uploadParams)
  203 + if (thumbnail) {
  204 + await deleteFilePath(thumbnail)
  205 + }
201 // 保存预览图 206 // 保存预览图
202 if (uploadRes) { 207 if (uploadRes) {
203 await saveDataViewList({ 208 await saveDataViewList({
@@ -13,13 +13,18 @@ import Preview from './index.vue' @@ -13,13 +13,18 @@ import Preview from './index.vue'
13 13
14 let key = ref(Date.now()) 14 let key = ref(Date.now())
15 15
16 -// 数据变更 -> 组件销毁重建  
17 -;[SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW].forEach((saveEvent: string) => {  
18 - if (!window.opener && !window.opener.addEventListener) return  
19 - window.opener.addEventListener(saveEvent, async (e: any) => {  
20 - const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType  
21 - setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])  
22 - key.value = Date.now()  
23 - })  
24 -}) 16 +// 数据变更 -> 组件销毁重建
  17 +try {
  18 + const listenerArr = [SavePageEnum.JSON, SavePageEnum.CHART_TO_PREVIEW]
  19 + listenerArr.forEach((saveEvent: string) => {
  20 + if (!window.opener || !window.opener.addEventListener) return
  21 + window.opener.addEventListener(saveEvent, async (e: any) => {
  22 + const localStorageInfo: ChartEditStorageType = (await getSessionStorageInfo()) as unknown as ChartEditStorageType
  23 + setSessionStorage(StorageEnum.GO_CHART_STORAGE_LIST, [{ ...e.detail, id: localStorageInfo.id }])
  24 + key.value = Date.now()
  25 + })
  26 + })
  27 +} catch (error) {
  28 + console.log(error)
  29 +}
25 </script> 30 </script>