Commit 71709f428c35d9df2fe3093ae174dd2d7260b50f

Authored by ww
1 parent 2c8eff3d

fix: 修复类型错误

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