Commit 70861676e1f0d5a749a1f48a81483bda8bccc902
1 parent
ca055c46
pref:遵循修改的文件放入扩展文件夹里,并加上注释// THINGS_KIT
Showing
3 changed files
with
12 additions
and
6 deletions
| ... | ... | @@ -37,6 +37,7 @@ const settingStore = useSettingStore() |
| 37 | 37 | export const useChartEditStore = defineStore({ |
| 38 | 38 | id: 'useChartEditStore', |
| 39 | 39 | state: (): ChartEditStoreType => ({ |
| 40 | + // THINGS_KIT | |
| 40 | 41 | // 项目数据 |
| 41 | 42 | projectInfo: { |
| 42 | 43 | projectId: '', |
| ... | ... | @@ -143,6 +144,7 @@ export const useChartEditStore = defineStore({ |
| 143 | 144 | componentList: [] |
| 144 | 145 | }), |
| 145 | 146 | getters: { |
| 147 | + // THINGS_KIT | |
| 146 | 148 | getProjectInfo(): ProjectInfoType { |
| 147 | 149 | return this.projectInfo |
| 148 | 150 | }, |
| ... | ... | @@ -180,6 +182,7 @@ export const useChartEditStore = defineStore({ |
| 180 | 182 | } |
| 181 | 183 | }, |
| 182 | 184 | actions: { |
| 185 | + // THINGS_KIT | |
| 183 | 186 | // * 设置 peojectInfo 数据项 |
| 184 | 187 | setProjectInfo<T extends keyof ProjectInfoType, K extends ProjectInfoType[T]>(key: T, value: K) { |
| 185 | 188 | this.projectInfo[key] = value | ... | ... |
| 1 | +// THINGS_KIT | |
| 1 | 2 | import { getUUID, fetchRouteParamsLocation, JSONStringify, JSONParse } from '@/utils' |
| 2 | 3 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
| 3 | 4 | import { |
| ... | ... | @@ -17,6 +18,7 @@ import merge from 'lodash/merge' |
| 17 | 18 | import { onUnmounted } from 'vue' |
| 18 | 19 | import { saveInterval } from '@/settings/designSetting' |
| 19 | 20 | import throttle from 'lodash/throttle' |
| 21 | +// THINGS_KIT | |
| 20 | 22 | import html2canvas from 'html2canvas' |
| 21 | 23 | import { contentUpdateApi, getDataView, uploadFile } from '@/api/external/contentSave/content' |
| 22 | 24 | // 画布枚举 | ... | ... |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | lineNumbers: 'on', |
| 27 | 27 | minimap: { enabled: true } |
| 28 | 28 | }" |
| 29 | - /> | |
| 29 | + /> | |
| 30 | 30 | </n-layout-content> |
| 31 | 31 | </n-layout> |
| 32 | 32 | </div> |
| ... | ... | @@ -36,15 +36,16 @@ |
| 36 | 36 | import { computed, ref, watch } from 'vue' |
| 37 | 37 | import { MonacoEditor } from '@/components/Pages/MonacoEditor' |
| 38 | 38 | import { SavePageEnum } from '@/enums/editPageEnum' |
| 39 | -import { getSessionStorageInfo, } from '../preview/utils' | |
| 39 | +import { getSessionStorageInfo } from '../preview/utils' | |
| 40 | 40 | import type { ChartEditStorageType } from '../preview/index.d' |
| 41 | -import { setSessionStorage, JSONStringify, JSONParse, setTitle,fetchRouteParamsLocation } from '@/utils' | |
| 41 | +import { setSessionStorage, JSONStringify, JSONParse, setTitle, fetchRouteParamsLocation } from '@/utils' | |
| 42 | 42 | import { StorageEnum } from '@/enums/storageEnum' |
| 43 | 43 | import { icon } from '@/plugins' |
| 44 | +// THINGS_KIT | |
| 44 | 45 | import { useSync } from '@/views/chart/hooks/useSync.hook' |
| 45 | 46 | import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore' |
| 46 | 47 | import { ProjectInfoEnum } from '@/store/modules/chartEditStore/chartEditStore.d' |
| 47 | - | |
| 48 | +// THINGS_KIT | |
| 48 | 49 | const chartEditStore = useChartEditStore() |
| 49 | 50 | const { dataSyncUpdate } = useSync() |
| 50 | 51 | const { ChevronBackOutlineIcon, DownloadIcon } = icon.ionicons5 |
| ... | ... | @@ -52,7 +53,7 @@ const showOpenFilePicker: Function = (window as any).showOpenFilePicker |
| 52 | 53 | const content = ref('') |
| 53 | 54 | // 从sessionStorage 获取数据 |
| 54 | 55 | async function getDataBySession() { |
| 55 | - const localStorageInfo: ChartEditStorageType = await getSessionStorageInfo() as unknown as ChartEditStorageType | |
| 56 | + const localStorageInfo: ChartEditStorageType = (await getSessionStorageInfo()) as unknown as ChartEditStorageType | |
| 56 | 57 | setTitle(`编辑-${localStorageInfo.editCanvasConfig.projectName}`) |
| 57 | 58 | content.value = JSONStringify(localStorageInfo) |
| 58 | 59 | } |
| ... | ... | @@ -89,7 +90,7 @@ document.addEventListener('keydown', function (e) { |
| 89 | 90 | } |
| 90 | 91 | }) |
| 91 | 92 | addEventListener('blur', updateSync) |
| 92 | - | |
| 93 | +// THINGS_KIT | |
| 93 | 94 | // 同步更新 |
| 94 | 95 | async function updateSync() { |
| 95 | 96 | if (!window.opener) { | ... | ... |