fix: some type problems

This commit is contained in:
IchliebedichZhu 2024-09-25 00:54:54 +08:00
parent 85594e0210
commit 5f37f0e4b0
9 changed files with 4071 additions and 1624 deletions

View File

@ -55,7 +55,9 @@ module.exports = {
try {
const detail = fs.readFileSync(path.resolve(__dirname, `../mock/materials/${cate}.json`), 'utf8')
send.success(res, { list: JSON.parse(detail) })
} catch (error) {}
} catch (error) {
console.log(error)
}
},
// design/imgs 获取照片素材(虚拟)
async getPhotos(req: any, res: any) {

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/*
* @Author: ShawnPhang
* @Author: ShawnPhang <https://m.palxp.cn>
* @Date: 2021-08-27 14:42:15
* @Description:
* @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2024-08-11 19:27:41
* @LastEditors: Jeremy Yu <https://github.com/JeremyYu-cn>
* @LastEditTime: 2024-09-25 00:39:00
*/
import fetch from '@/utils/axios'
import _config from '@/config'
@ -15,7 +15,7 @@ export const getKinds = (params: Type.Object = {}) => fetch('design/cate', param
type TGetListParam = {
first_id?: number
second_id?: string
cate?: number
cate?: string | number
pageSize?: number
}

View File

@ -13,7 +13,7 @@
<!-- <div class="el-upload__text">在此拖入或选择<em>上传图片</em></div> -->
<div class="el-upload__text">自动抠图目前依赖后端服务需自行部署</div>
</div>
<div class="el-upload__tip el-upload__text"><em>体验前端效果演示以及修补编辑器随便上传一张图片即可触发</em></div>
<div class="el-upload__tip el-upload__text"><em>体验前端效果演示以及修补编辑器任意上传一张图片即可触发</em></div>
</uploader>
<el-progress v-if="!state.cutImage && state.progressText" :percentage="state.progress">
<el-button text>

View File

@ -1,9 +1,9 @@
<!--
* @Author: ShawnPhang
* @Author: ShawnPhang <https://m.palxp.cn>
* @Date: 2021-08-27 15:16:07
* @Description: 素材列表
* @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2024-08-14 18:48:34
* @LastEditors: Jeremy Yu <https://github.com/JeremyYu-cn>
* @LastEditTime: 2024-09-25 00:39:00
-->
<template>
<div class="wrap">
@ -65,7 +65,7 @@ type TState = {
currentCheck: number
colors: string[]
currentCategory: TCurrentCategory | null
types: []
types: { cate: string, name: string }[]
showList: TGetListData[][]
searchKeyword: string
}

View File

@ -1,9 +1,9 @@
/*
* @Author: ShawnPhang
* @Author: ShawnPhang <https://m.palxp.cn>
* @Date: 2024-04-05 06:23:23
* @Description:
* @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2024-08-12 09:27:06
* @LastEditors: Jeremy Yu <https://github.com/JeremyYu-cn>
* @LastEditTime: 2024-09-25 00:39:00
*/
export type TScreeData = {
/** 记录编辑界面的宽度 */
@ -53,13 +53,15 @@ export type TStoreAction = {
value: TPageState[T]
// pushHistory?: boolean
}): void
getDPage(data: TPageState): () => TPageState
getDPage(data: TPageState): TPageState
/** 设置dPage */
setDPage(data: TPageState): void
/** 更新 Page从layouts获取*/
updateDPage(): void
/** 设置底部工具栏高度 */
setBottomHeight(h: number): void
/** 更新当前页面下标 */
setDCurrentPage(n: number): void
}
export type TPageState = {

View File

@ -1,10 +1,10 @@
/*
* @Author: Jeremy Yu
* @Author: Jeremy Yu <https://github.com/JeremyYu-cn>
* @Date: 2024-03-18 21:00:00
* @Description:
* @LastEditors: ShawnPhang <https://m.palxp.cn>
* @LastEditTime: 2024-08-12 09:27:22
* @LastEditTime: 2024-09-25 00:39:00
*/
import { Store, defineStore } from 'pinia'
@ -95,6 +95,10 @@ const CanvasStore = defineStore<"canvasStore", TCanvasState, {}, TStoreAction>("
/** 设置底部工具栏高度 */
setBottomHeight(h: number) {
this.dBottomHeight = h
},
/** 更新当前页面下标 */
setDCurrentPage(n: number) {
this.dCurrentPage = n
}
}
})

View File

@ -20,6 +20,7 @@ import { TUpdateAlignData, updateAlign } from "./actions/align";
// import { TWidgetJsonData, widgetJsonData } from "./getter";
import { TupdateLayerIndexData, ungroup, updateLayerIndex } from "./actions/layer";
import pageDefault from "../canvas/page-default";
import { TCanvasStore } from "../canvas";
export type TdWidgetData = TPageState & Partial<TCommonItemData> & {
parent?: string
@ -125,7 +126,7 @@ type TAction = {
resize: (data: TSize) => void
setWidgetStyle: (data: TsetWidgetStyleData) => void
setDWidgets: (data: TdWidgetData[]) => void
setDLayouts: (data: TdLayout) => void
setDLayouts: (data: TdLayout[]) => void
updateDWidgets: () => void
lockWidgets: () => void
setMouseEvent: (e: MouseEvent | null) => void
@ -201,8 +202,10 @@ const WidgetStore = defineStore<"widgetStore", TWidgetState, TGetter, TAction>("
autoResizeAll(data) { autoResizeAll(this, data) },
setDLayouts(data) { setDLayouts(this, data) },
getWidgets() {
const pageStore = useCanvasStore()
!this.dLayouts[pageStore.dCurrentPage] && pageStore.dCurrentPage--
const pageStore = useCanvasStore() as TCanvasStore
!this.dLayouts[pageStore.dCurrentPage] && pageStore.setDCurrentPage(pageStore.dCurrentPage - 1)
// !this.dLayouts[pageStore.dCurrentPage] && pageStore.dCurrentPage--
return this.dLayouts[pageStore.dCurrentPage].layers
}
}

2443
yarn.lock Normal file

File diff suppressed because it is too large Load Diff