|
|
@ -1,6 +1,10 @@ |
|
|
|
<template> |
|
|
|
<view class="page"> |
|
|
|
<navbar title="编辑模板" leftClick @leftClick="$utils.navigateBack" /> |
|
|
|
|
|
|
|
<view class="title"> |
|
|
|
<input type="text" placeholder="请输入标题" v-model="form.title"/> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="padding: 25rpx;background-color: #fff;"> |
|
|
|
<canvas-drag ref="canvasRef" |
|
|
@ -51,14 +55,14 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad({id}) { |
|
|
|
uni.request({ |
|
|
|
url : 'http://192.168.1.5:5173/arr', |
|
|
|
method: 'GET', |
|
|
|
success : res => { |
|
|
|
this.imageArr = res.data |
|
|
|
this.onChangeBgImage() |
|
|
|
} |
|
|
|
}) |
|
|
|
// uni.request({ |
|
|
|
// url : 'http://192.168.1.5:5173/arr', |
|
|
|
// method: 'GET', |
|
|
|
// success : res => { |
|
|
|
// this.imageArr = res.data |
|
|
|
// this.onChangeBgImage() |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
this.id = id |
|
|
|
this.getDetail() |
|
|
@ -89,14 +93,34 @@ |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
let a = {} |
|
|
|
let b = {} |
|
|
|
|
|
|
|
if(this.id){ |
|
|
|
a = JSON.parse(this.form.bossPosition) |
|
|
|
b = JSON.parse(this.form.employeePosition) |
|
|
|
|
|
|
|
for(let ak in a){ |
|
|
|
a[ak] = this.$utils.screenSystemInfoInt(a[ak]) - 0 |
|
|
|
} |
|
|
|
for(let bk in b){ |
|
|
|
b[bk] = this.$utils.screenSystemInfoInt(b[bk]) - 0 |
|
|
|
} |
|
|
|
|
|
|
|
console.log(a, b); |
|
|
|
} |
|
|
|
|
|
|
|
uni.getImageInfo({ |
|
|
|
src: 'https://img.teyizhao.com/2025-02-03/45a56422-7294-41a0-88af-cf2a41cb9554.png', |
|
|
|
src: 'https://img.teyizhao.com/2025-02-07/3d837c0e-91f4-4682-82d9-a04c2af737e8.png', |
|
|
|
success : res => { |
|
|
|
this.setData({ |
|
|
|
graph: { |
|
|
|
id : 'a', |
|
|
|
w: 100, |
|
|
|
h: 50, |
|
|
|
w: a.w || 100, |
|
|
|
h: a.h || 50, |
|
|
|
x: a.x || 30, |
|
|
|
y: a.y || 30, |
|
|
|
type: 'image', |
|
|
|
url : res.path |
|
|
|
} |
|
|
@ -108,13 +132,15 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
uni.getImageInfo({ |
|
|
|
src: 'https://img.teyizhao.com/2025-02-03/45a56422-7294-41a0-88af-cf2a41cb9554.png', |
|
|
|
src: 'https://img.teyizhao.com/2025-02-07/af4786c0-7b62-4a86-a090-9f28eca3674a.png', |
|
|
|
success : res => { |
|
|
|
this.setData({ |
|
|
|
graph: { |
|
|
|
id : 'b', |
|
|
|
w: 100, |
|
|
|
h: 50, |
|
|
|
w: b.w || 100, |
|
|
|
h: b.h || 50, |
|
|
|
x: b.x || 160, |
|
|
|
y: b.y || 30, |
|
|
|
type: 'image', |
|
|
|
url : res.path |
|
|
|
} |
|
|
@ -139,7 +165,7 @@ |
|
|
|
|
|
|
|
// this.form.template = pdfUrl |
|
|
|
|
|
|
|
// this.pdf2imagebase64() |
|
|
|
this.pdf2imagebase64() |
|
|
|
|
|
|
|
this.changeBgImage() |
|
|
|
|
|
|
@ -226,6 +252,12 @@ |
|
|
|
}, |
|
|
|
async submit() { |
|
|
|
|
|
|
|
if(this.$utils.verificationAll(this.form, { |
|
|
|
title : '请输入标题', |
|
|
|
})){ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let bossPosition = { |
|
|
|
// ...this.drawArr.a, |
|
|
|
x : this.$utils.rpxSystemInfoInt(this.drawArr.a.x), |
|
|
@ -251,13 +283,13 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
pdf2imagebase64(){ |
|
|
|
this.$api('pdf2imagebase64', { |
|
|
|
// pdf2imagebase64(){ |
|
|
|
// this.$api('pdf2imagebase64', { |
|
|
|
|
|
|
|
}, res => { |
|
|
|
// }, res => { |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
// 修改或者保存模板 |
|
|
|
saveOrUpdate(){ |
|
|
|
|
|
|
@ -275,6 +307,20 @@ |
|
|
|
this.onAddImage() |
|
|
|
return |
|
|
|
} |
|
|
|
this.$api('queryContractTemplateById', { |
|
|
|
contractTemplateId : this.id |
|
|
|
}).then(res => { |
|
|
|
if(res.code == 200){ |
|
|
|
this.form = res.result |
|
|
|
|
|
|
|
delete this.form.createBy |
|
|
|
delete this.form.createTime |
|
|
|
delete this.form.updateBy |
|
|
|
delete this.form.updateTime |
|
|
|
|
|
|
|
this.onAddImage() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
@ -283,6 +329,18 @@ |
|
|
|
<style scoped lang="scss"> |
|
|
|
.page { |
|
|
|
padding-bottom: 100rpx; |
|
|
|
.title{ |
|
|
|
padding: 10rpx 30rpx; |
|
|
|
background-color: #fff; |
|
|
|
margin-bottom: 10rpx; |
|
|
|
input{ |
|
|
|
padding: 20rpx; |
|
|
|
background-color: rgba($uni-color, 0.1); |
|
|
|
color: $uni-color; |
|
|
|
border: 1rpx solid $uni-color; |
|
|
|
border-radius: 10rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
.btn-list { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|