Commit e00bf5012ef76cb5bd9b9b81a7733509b8493e9a

Authored by xp.Huang
2 parents 2c8eff3d 71709f42

Merge branch 'ww' into 'main'

fix: 修复类型错误

See merge request yunteng/thingskit-view!10
@@ -7,7 +7,7 @@ export interface BaseSaveContentParams { @@ -7,7 +7,7 @@ export interface BaseSaveContentParams {
7 creator?: string 7 creator?: string
8 defaultConfig?: string 8 defaultConfig?: string
9 description?: string 9 description?: string
10 - enabled?: boolean 10 + enabled: boolean
11 icon?: string 11 icon?: string
12 id: string 12 id: string
13 name?: string 13 name?: string
@@ -27,11 +27,13 @@ export interface BaseSaveContentParams { @@ -27,11 +27,13 @@ export interface BaseSaveContentParams {
27 * @description: 大屏更新内容Model 27 * @description: 大屏更新内容Model
28 */ 28 */
29 export interface BaseUpdateContentParams { 29 export interface BaseUpdateContentParams {
  30 + id: string
30 dataViewContent: BaseSaveContentParams 31 dataViewContent: BaseSaveContentParams
31 - dataViewId?: string 32 + dataViewId: string
32 dataViewName: string 33 dataViewName: string
33 organizationId: string 34 organizationId: string
34 - state?: number 35 + state: number
  36 + thumbnail: string
35 } 37 }
36 38
37 export interface OrganizationDTO { 39 export interface OrganizationDTO {
@@ -144,7 +144,7 @@ import { FileTypeEnum } from '@/enums/fileTypeEnum' @@ -144,7 +144,7 @@ import { FileTypeEnum } from '@/enums/fileTypeEnum'
144 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' 144 import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
145 import { EditCanvasConfigEnum } from '@/store/modules/chartEditStore/chartEditStore.d' 145 import { EditCanvasConfigEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
146 import { StylesSetting } from '@/components/Pages/ChartItemSetting' 146 import { StylesSetting } from '@/components/Pages/ChartItemSetting'
147 -import { UploadCustomRequestOptions } from 'naive-ui' 147 +import { SelectOption, UploadCustomRequestOptions } from 'naive-ui'
148 import { fileToUrl, loadAsyncComponent } from '@/utils' 148 import { fileToUrl, loadAsyncComponent } from '@/utils'
149 import { PreviewScaleEnum } from '@/enums/styleEnum' 149 import { PreviewScaleEnum } from '@/enums/styleEnum'
150 import { icon } from '@/plugins' 150 import { icon } from '@/plugins'
@@ -10,6 +10,7 @@ import { saveDataViewList, contentUpdateApi, getDataView, uploadFile } from '@/a @@ -10,6 +10,7 @@ import { saveDataViewList, contentUpdateApi, getDataView, uploadFile } from '@/a
10 import { SyncEnum } from '@/enums/external/editPageEnum' 10 import { SyncEnum } from '@/enums/external/editPageEnum'
11 import { useProjectInfoStore } from '@/store/external/module/projectInfo' 11 import { useProjectInfoStore } from '@/store/external/module/projectInfo'
12 import { useSync } from '../useSync.hook' 12 import { useSync } from '../useSync.hook'
  13 +import { BaseUpdateContentParams } from '@/api/external/contentSave/model/contentModel'
13 14
14 /** 15 /**
15 * * base64转file 16 * * base64转file
@@ -45,13 +46,13 @@ export const useSyncRemote = () => { @@ -45,13 +46,13 @@ export const useSyncRemote = () => {
45 const updateStoreInfo = (projectData: { 46 const updateStoreInfo = (projectData: {
46 dataViewId: string 47 dataViewId: string
47 dataViewName: string 48 dataViewName: string
48 - indexImage: string 49 + thumbnail: string
49 id: string 50 id: string
50 state: number 51 state: number
51 organizationId: string 52 organizationId: string
52 dataViewContent: { id: string; content: string; enabled: boolean } 53 dataViewContent: { id: string; content: string; enabled: boolean }
53 }) => { 54 }) => {
54 - const { dataViewId, dataViewName, indexImage, state, dataViewContent, organizationId } = projectData 55 + const { dataViewId, dataViewName, thumbnail, state, dataViewContent, organizationId } = projectData
55 // ID 56 // ID
56 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.PROJECT_ID, dataViewId) 57 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.PROJECT_ID, dataViewId)
57 // 名称 58 // 名称
@@ -59,7 +60,7 @@ export const useSyncRemote = () => { @@ -59,7 +60,7 @@ export const useSyncRemote = () => {
59 // 描述 60 // 描述
60 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.REMARKS, dataViewContent?.id) 61 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.REMARKS, dataViewContent?.id)
61 // 缩略图 62 // 缩略图
62 - projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.THUMBNAIL, indexImage) 63 + projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.THUMBNAIL, thumbnail)
63 // 发布 64 // 发布
64 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.RELEASE, state === 1) 65 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.RELEASE, state === 1)
65 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.ORGANIZATION_ID, organizationId) 66 projectInfoStore.setProjectInfoByKey(ProjectInfoEnum.ORGANIZATION_ID, organizationId)
@@ -147,7 +148,7 @@ export const useSyncRemote = () => { @@ -147,7 +148,7 @@ export const useSyncRemote = () => {
147 dataViewId: projectId, 148 dataViewId: projectId,
148 projectId 149 projectId
149 } 150 }
150 - await contentUpdateApi(saveContent) 151 + await contentUpdateApi(saveContent as unknown as BaseUpdateContentParams)
151 window['$message'].success('保存成功!') 152 window['$message'].success('保存成功!')
152 // 成功状态 153 // 成功状态
153 setTimeout(() => { 154 setTimeout(() => {