查询接口修改加了New

master
十七 3 years ago
parent e4920e221a
commit e19f1d3e38

@ -141,7 +141,6 @@ export default {
.then((res) => {
var list = [];
res.pageInfo.list.forEach((item) => {
item = JSON.parse(JSON.stringify(item).replace(/jobName/g, "job"));
item = JSON.parse(
JSON.stringify(item).replace(/gradeName/g, "grade")
);
@ -173,10 +172,6 @@ export default {
if (res.code == "000000") {
var list = [];
res.pageInfo.list.forEach((item) => {
item = JSON.parse(JSON.stringify(item).replace(/jobName/g, "job"));
item = JSON.parse(
JSON.stringify(item).replace(/gradeName/g, "grade")
);
if (item.sex == 1) {
item.sex = "男";
} else if (item.sex == 0) {

@ -189,7 +189,6 @@ export default {
.then((res) => {
var list = [];
res.pageInfo.list.forEach((item) => {
item = JSON.parse(JSON.stringify(item).replace(/jobName/g, "job"));
item = JSON.parse(
JSON.stringify(item).replace(/gradeName/g, "grade")
);
@ -221,10 +220,6 @@ export default {
if (res.code == "000000") {
var list = [];
res.pageInfo.list.forEach((item) => {
item = JSON.parse(JSON.stringify(item).replace(/jobName/g, "job"));
item = JSON.parse(
JSON.stringify(item).replace(/gradeName/g, "grade")
);
if (item.sex == 1) {
item.sex = "男";
} else if (item.sex == 0) {

@ -31,7 +31,6 @@
<el-radio :label="1">比例赠送</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="赠送金额:" prop="giftMoney">
<el-input type="number" :placeholder="form.donateType==0?'固定金额':form.donateType==1?'比例赠送(%)':''" class="form-width" oninput="this.value=this.value.replace(/\D*(\d*)(\.?)(\d{0,2})\d*/,'$1$2$3')" pattern="[0-9]*\.?[0-9]{0,2}" v-model="form.giftMoney" autocomplete="on" :disabled="form.type === 1">
</el-input>

@ -1,134 +1,134 @@
<template>
<div>
<canvas id="myCanvas"></canvas>
<div class="footers">
<el-button type="primary" plain size="mini" @click="clearArea()"></el-button>
<el-button type="primary" size="mini" @click="saveImageInfo()"></el-button>
<div>
<input v-model="strokeStyle" type="color">
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
touchPressed: false,
ctx: null,
strokeStyle: "#EE2F2F",
lineWidth: 2,
lastX: null,
lastY: null,
canvas: null,
};
},
mounted() {
this.$nextTick(() => {
let canvas = document.getElementById("myCanvas");
this.canvas = canvas;
this.ctx = canvas.getContext("2d");
let winW = window.innerWidth;
let winH = window.innerHeight;
canvas.width = winW;
canvas.height = winH;
this.Init();
});
},
methods: {
Init() {
this.canvas.addEventListener(
"touchstart",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
var touch = event.targetTouches[0];
this.touchPressed = true;
this.draw(
touch.pageX - this.canvas.offsetLeft,
touch.pageY - this.canvas.offsetTop,
false
);
}
},
false
);
this.canvas.addEventListener(
"touchmove",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
var touch = event.targetTouches[0];
if (this.touchPressed) {
this.draw(
touch.pageX - this.canvas.offsetLeft,
touch.pageY - this.canvas.offsetTop,
true
);
}
}
},
false
);
this.canvas.addEventListener(
"touchend",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
this.touchPressed = false;
}
},
false
);
},
draw(x, y, isDown) {
let ctx = this.ctx;
if (isDown) {
ctx.beginPath();
ctx.strokeStyle = this.strokeStyle;
ctx.lineWidth = this.lineWidth;
ctx.lineJoin = "round";
ctx.moveTo(this.lastX, this.lastY);
ctx.lineTo(x, y);
ctx.closePath();
ctx.stroke();
}
this.lastX = x;
this.lastY = y;
},
clearArea() {
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
},
saveImageInfo() {
let a = document.createElement("a");
a.href = this.canvas.toDataURL();
a.download = "sign";
a.click();
},
},
};
</script>
<style scoped>
.footers {
position: fixed;
z-index: 10;
display: flex;
border-top: 1px solid #ccc;
margin: 0 150px;
}
.footers div {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
#myCanvas {
width: 50%;
height: 50vh;
border: #ccc 1px solid;
}
</style>
<template>
<div>
<canvas id="myCanvas"></canvas>
<div class="footers">
<el-button type="primary" plain size="mini" @click="clearArea()"></el-button>
<el-button type="primary" size="mini" @click="saveImageInfo()"></el-button>
<div>
<input v-model="strokeStyle" type="color">
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
touchPressed: false,
ctx: null,
strokeStyle: "#EE2F2F",
lineWidth: 2,
lastX: null,
lastY: null,
canvas: null,
};
},
mounted() {
this.$nextTick(() => {
let canvas = document.getElementById("myCanvas");
this.canvas = canvas;
this.ctx = canvas.getContext("2d");
let winW = window.innerWidth;
let winH = window.innerHeight;
canvas.width = winW;
canvas.height = winH;
this.Init();
});
},
methods: {
Init() {
this.canvas.addEventListener(
"touchstart",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
var touch = event.targetTouches[0];
this.touchPressed = true;
this.draw(
touch.pageX - this.canvas.offsetLeft,
touch.pageY - this.canvas.offsetTop,
false
);
}
},
false
);
this.canvas.addEventListener(
"touchmove",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
var touch = event.targetTouches[0];
if (this.touchPressed) {
this.draw(
touch.pageX - this.canvas.offsetLeft,
touch.pageY - this.canvas.offsetTop,
true
);
}
}
},
false
);
this.canvas.addEventListener(
"touchend",
(event) => {
if (event.targetTouches.length == 1) {
event.preventDefault(); //
this.touchPressed = false;
}
},
false
);
},
draw(x, y, isDown) {
let ctx = this.ctx;
if (isDown) {
ctx.beginPath();
ctx.strokeStyle = this.strokeStyle;
ctx.lineWidth = this.lineWidth;
ctx.lineJoin = "round";
ctx.moveTo(this.lastX, this.lastY);
ctx.lineTo(x, y);
ctx.closePath();
ctx.stroke();
}
this.lastX = x;
this.lastY = y;
},
clearArea() {
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
},
saveImageInfo() {
let a = document.createElement("a");
a.href = this.canvas.toDataURL();
a.download = "sign";
a.click();
},
},
};
</script>
<style scoped>
.footers {
position: fixed;
z-index: 10;
display: flex;
border-top: 1px solid #ccc;
margin: 0 150px;
}
.footers div {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
#myCanvas {
width: 50%;
height: 50vh;
border: #ccc 1px solid;
}
</style>

Loading…
Cancel
Save