mirror of
https://github.com/palxiao/poster-design.git
synced 2025-07-15 16:02:19 +08:00
update: res data
This commit is contained in:
parent
2d3b7a808f
commit
0af432a8d0
@ -1,13 +0,0 @@
|
||||
|
||||
import axios from 'axios'
|
||||
|
||||
const httpRequest = axios.create({
|
||||
maxContentLength: Infinity,
|
||||
maxBodyLength: Infinity,
|
||||
})
|
||||
|
||||
httpRequest.interceptors.response.use((config) => {
|
||||
return config.data
|
||||
})
|
||||
|
||||
export default httpRequest
|
@ -74,24 +74,5 @@ export const rndNum = (n: number, m: number) => {
|
||||
const random = Math.floor(Math.random() * (m - n + 1) + n)
|
||||
return random
|
||||
}
|
||||
/** 检测苹果手机 */
|
||||
// export const isIOS = () => {
|
||||
// const u = navigator.userAgent
|
||||
// // var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; // android终端
|
||||
// const isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
|
||||
// return isiOS
|
||||
// }
|
||||
/**
|
||||
* 判断是否微信客户端
|
||||
*/
|
||||
// export const isWX = () => {
|
||||
// const ua = window.navigator.userAgent.toLowerCase()
|
||||
// const match = String(ua.match(/MicroMessenger/i)) || ''
|
||||
// if (match === 'micromessenger') {
|
||||
// return true
|
||||
// } else {
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
|
||||
export default {}
|
||||
|
@ -84,7 +84,7 @@ export default defineComponent({
|
||||
}
|
||||
} catch (e) {}
|
||||
})
|
||||
// TODO: 背景图无法检测是否加载完毕,考虑应该将设置背景作为独立事件
|
||||
// TODO优化: 背景图无法检测是否加载完毕,考虑应该将设置背景作为独立事件
|
||||
if (content.page.backgroundImage) {
|
||||
const preloadBg = new Preload([content.page.backgroundImage])
|
||||
await preloadBg.imgs()
|
||||
@ -127,7 +127,7 @@ export default defineComponent({
|
||||
async font2style(fontContent: any, fontData: any = []) {
|
||||
return new Promise((resolve: Function) => {
|
||||
Promise.all(
|
||||
// 拿到字体子集,只有ttf/otf这种原始字体支持提取,如没有则不能实现此步,只能加载整个字体文件
|
||||
// 拿到字体子集。只有ttf/otf这种原始字体支持提取,如服务端不具备该功能则没有此步骤,在页面加载整个字体。
|
||||
Object.keys(fontContent).map(async (key) => {
|
||||
const font = fontData.find((font: any) => font.value === key) as any
|
||||
if (font.id) {
|
||||
|
@ -52,7 +52,7 @@ import HeaderOptions from './components/HeaderOptions.vue'
|
||||
import ProgressLoading from '@/components/common/ProgressLoading/index.vue'
|
||||
|
||||
const beforeUnload = function (e: any) {
|
||||
const confirmationMessage = '系统可能不会保存您修改的内容'
|
||||
const confirmationMessage = '系统不会自动保存您未修改的内容'
|
||||
;(e || window.event).returnValue = confirmationMessage // Gecko and Trident
|
||||
return confirmationMessage // Gecko and WebKit
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Date: 2022-01-10 14:57:53
|
||||
* @Description: Psd文件解析
|
||||
* @LastEditors: ShawnPhang <site: book.palxp.com>
|
||||
* @LastEditTime: 2023-07-14 00:51:19
|
||||
* @LastEditTime: 2023-07-25 15:56:22
|
||||
-->
|
||||
<template>
|
||||
<div id="page-design-index" ref="pageDesignIndex">
|
||||
@ -12,8 +12,8 @@
|
||||
<div class="top-left">
|
||||
<div class="name" style="font-size: 15px">在线PSD解析</div>
|
||||
</div>
|
||||
<div style="flex: 1"><el-button plain type="primary" @click="jump2word">说明及PSD规范文档</el-button></div>
|
||||
<el-button v-show="isDone" @click="clear">清空模板内容</el-button>
|
||||
<div style="flex: 1"><el-button plain type="primary" @click="jump2word">说明文档及PSD规范</el-button></div>
|
||||
<el-button v-show="isDone" @click="clear">清空模板</el-button>
|
||||
<div class="v-tips">
|
||||
<HeaderOptions :isDone="isDone" @change="optionsChange" />
|
||||
</div>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Date: 2022-01-12 11:26:53
|
||||
* @Description: 顶部操作按钮组
|
||||
* @LastEditors: ShawnPhang <site: book.palxp.com>
|
||||
* @LastEditTime: 2023-07-17 10:45:09
|
||||
* @LastEditTime: 2023-07-25 16:02:13
|
||||
-->
|
||||
<template>
|
||||
<div class="top-title"><el-input v-model="title" placeholder="未命名的设计" class="input-wrap" /></div>
|
||||
@ -74,36 +74,6 @@ export default defineComponent({
|
||||
const { stat } = await api.home.saveTemp({ id: tempid, title: proxy.title || '未命名模板', content: JSON.stringify({ page: proxy.dPage, widgets: proxy.dWidgets }), width: proxy.dPage.width, height: proxy.dPage.height })
|
||||
stat != 0 && useNotification('保存成功', '模板内容已变更')
|
||||
}
|
||||
// 保存前处理数据校正
|
||||
// function reviseData() {
|
||||
// const data = JSON.parse(JSON.stringify(proxy.dWidgets))
|
||||
// for (let i = 0; i < data.length; i++) {
|
||||
// if (!data[i].cache) {
|
||||
// continue
|
||||
// }
|
||||
// const valueLeft = data[i].cache.left
|
||||
// const valueTop = data[i].cache.top
|
||||
// const widget = data[i]
|
||||
// if (widget.isContainer) {
|
||||
// let dL = widget.left - valueLeft
|
||||
// let dT = widget.top - valueTop
|
||||
// const len = data.length
|
||||
// for (let i = 0; i < len; ++i) {
|
||||
// const child = data[i]
|
||||
// if (child.parent === widget.uuid) {
|
||||
// const t = child['left']
|
||||
// child.left -= dL
|
||||
// child.top -= dT
|
||||
// console.log(child.left, t, dL)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// data[i].left = valueLeft
|
||||
// data[i].top = valueTop
|
||||
// delete data[i].cache
|
||||
// }
|
||||
// return data
|
||||
// }
|
||||
// 停用启用
|
||||
async function stateChange(e: any) {
|
||||
const { tempid } = route.query
|
||||
@ -161,11 +131,6 @@ export default defineComponent({
|
||||
computed: {
|
||||
...mapGetters(['dPage', 'dWidgets', 'tempEditing', 'dHistory', 'dPageHistory']),
|
||||
},
|
||||
// watch: {
|
||||
// tempEditing(val) {
|
||||
// console.log(val)
|
||||
// },
|
||||
// },
|
||||
methods: {
|
||||
...mapActions(['pushHistory']),
|
||||
async load(id: any, tempId: any, cb: Function) {
|
||||
@ -202,9 +167,6 @@ export default defineComponent({
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// .wrap {
|
||||
// padding: 0 1rem;
|
||||
// }
|
||||
.top-icon-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
Loading…
x
Reference in New Issue
Block a user