mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
commit
84a93e4344
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@ node_modules
|
||||
/dist
|
||||
config.json
|
||||
/.vite
|
||||
yarn.lock
|
||||
|
||||
screenshot/node_modules/
|
||||
screenshot/dist/
|
||||
|
1
service/.gitignore
vendored
1
service/.gitignore
vendored
@ -11,6 +11,7 @@ yarn-error.log*
|
||||
static
|
||||
config.json
|
||||
config.js
|
||||
yarn.lock
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
|
@ -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) {
|
||||
|
2190
service/yarn.lock
2190
service/yarn.lock
File diff suppressed because it is too large
Load Diff
@ -96,7 +96,7 @@ type TGetCompListParam = {
|
||||
search?: string
|
||||
page?: number
|
||||
type?: number
|
||||
pageSize: number
|
||||
pageSize?: number
|
||||
cate?: number | string
|
||||
}
|
||||
|
||||
@ -109,6 +109,7 @@ export type TGetCompListResult = {
|
||||
title: string
|
||||
width: number
|
||||
name?: string
|
||||
cate?: string
|
||||
}
|
||||
|
||||
type getCompListReturn = TPageRequestResult<TGetCompListResult[]>
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -55,7 +55,7 @@ type TState = {
|
||||
list: TGetCompListResult[]
|
||||
searchValue: string
|
||||
currentCategory: TGetCompListResult | null
|
||||
types: []
|
||||
types: {cate: string, name: string}[]
|
||||
showList: TGetCompListResult[][]
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ const load = async (init: boolean = false) => {
|
||||
|
||||
const res = await api.home.getCompList({
|
||||
...pageOptions,
|
||||
cate: state.currentCategory?.id,
|
||||
cate: state.currentCategory?.id || state.currentCategory?.cate,
|
||||
})
|
||||
if (init) {
|
||||
state.list = res?.list
|
||||
|
@ -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,13 +65,14 @@ type TState = {
|
||||
currentCheck: number
|
||||
colors: string[]
|
||||
currentCategory: TCurrentCategory | null
|
||||
types: []
|
||||
types: { cate: string, name: string }[]
|
||||
showList: TGetListData[][]
|
||||
searchKeyword: string
|
||||
}
|
||||
|
||||
type TCurrentCategory = {
|
||||
name: string
|
||||
cate?: string | number
|
||||
id?: number
|
||||
}
|
||||
|
||||
@ -149,7 +150,7 @@ const load = async (init: boolean = false) => {
|
||||
state.loading = true
|
||||
pageOptions.page += 1
|
||||
const list = await api.material.getList({
|
||||
...{ cate: state.currentCategory?.id, search: state.searchKeyword, ...pageOptions },
|
||||
...{ cate: state.currentCategory?.id || state.currentCategory?.cate, search: state.searchKeyword, ...pageOptions },
|
||||
})
|
||||
if (init) {
|
||||
state.list = list?.list
|
||||
@ -168,6 +169,7 @@ const searchChange = (_: Event) => {
|
||||
}
|
||||
|
||||
const selectTypes = (item: TCurrentCategory) => {
|
||||
console.log(item)
|
||||
state.currentCategory = item
|
||||
load(true)
|
||||
}
|
||||
|
@ -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 = {
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user