Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
f311327c88
|
@ -16,3 +16,10 @@ export function getFileList(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function upFile(data) {
|
||||||
|
return request({
|
||||||
|
url: '/file/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -87,32 +87,6 @@
|
||||||
:title="tableForm.name"
|
:title="tableForm.name"
|
||||||
>
|
>
|
||||||
<el-form ref="Forms" label-width="80px" :model="checkForm">
|
<el-form ref="Forms" label-width="80px" :model="checkForm">
|
||||||
<el-row>
|
|
||||||
<!--canvas 不能与v-if同用-->
|
|
||||||
<el-form-item label="图表">
|
|
||||||
<div>
|
|
||||||
<img id="canvasImg" src="./../../assets/glass.png" style="width:300px;height: 200px;display: none">
|
|
||||||
<div style="position: relative;display: flex">
|
|
||||||
<canvas id="canvas" width="300" height="200">
|
|
||||||
您的浏览器不支持绘图,请升级或更换浏览器!
|
|
||||||
</canvas>
|
|
||||||
<input type="text" value="" class="hide" id="txt" placeholder="请输入文字">
|
|
||||||
<textarea class="hide" id="word" cols="15" rows="5" placeholder="请输入文字" autofocus></textarea>
|
|
||||||
<input id="inputV" type="hidden" value="1">
|
|
||||||
<div class="canvasBtnWrap">
|
|
||||||
<div class="canvasBtn" @click="error1">标记</div>
|
|
||||||
<div class="canvasBtn" @click="word1()">文字</div>
|
|
||||||
<!--<button @click="restuya()">清除批注</button>-->
|
|
||||||
<div class="canvasBtn" @click="back()">回退</div>
|
|
||||||
<div class="canvasBtn" @click="saveTu()">保存</div>
|
|
||||||
<!--<p>保存的图片</p>-->
|
|
||||||
</div>
|
|
||||||
<div id="res"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-row>
|
|
||||||
<el-row
|
<el-row
|
||||||
v-for="(item, $index) in fieldList.results"
|
v-for="(item, $index) in fieldList.results"
|
||||||
v-show="filterBlock(item.parent,item.rule_expression,item.need_judge)"
|
v-show="filterBlock(item.parent,item.rule_expression,item.need_judge)"
|
||||||
|
@ -214,6 +188,27 @@
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="图表" v-else-if="item.field_type === 'draw'">
|
||||||
|
<div>
|
||||||
|
<img id="canvasImg" src="./../../assets/glass.png" style="width:300px;height: 200px;display: none">
|
||||||
|
<div style="position: relative;display: flex">
|
||||||
|
<canvas id="canvas" width="300" height="200">
|
||||||
|
您的浏览器不支持绘图,请升级或更换浏览器!
|
||||||
|
</canvas>
|
||||||
|
<input type="text" value="" class="hide" id="txt" placeholder="请输入文字">
|
||||||
|
<textarea class="hide" id="word" cols="15" rows="5" placeholder="请输入文字" autofocus></textarea>
|
||||||
|
<input id="inputV" type="hidden" value="1">
|
||||||
|
<div class="canvasBtnWrap">
|
||||||
|
<div class="canvasBtn" @click="error1">标记</div>
|
||||||
|
<div class="canvasBtn" @click="word1()">文字</div>
|
||||||
|
<!--<button @click="restuya()">清除批注</button>-->
|
||||||
|
<div class="canvasBtn" @click="back()">回退</div>
|
||||||
|
<div class="canvasBtn" @click="saveTu()">保存</div>
|
||||||
|
</div>
|
||||||
|
<div id="res"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -458,7 +453,7 @@
|
||||||
<el-form-item label="表达式" v-if="field.need_judge === true">
|
<el-form-item label="表达式" v-if="field.need_judge === true">
|
||||||
<el-input v-model="field.rule_expression" type="textarea"/>
|
<el-input v-model="field.rule_expression" type="textarea"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="头像" v-if="field.field_type === 'img'">
|
<el-form-item label="模板图片" v-if="field.field_type === 'img'">
|
||||||
<el-upload
|
<el-upload
|
||||||
class="avatar-uploader"
|
class="avatar-uploader"
|
||||||
:action="upUrl"
|
:action="upUrl"
|
||||||
|
@ -468,7 +463,7 @@
|
||||||
:before-upload="beforeAvatarUpload"
|
:before-upload="beforeAvatarUpload"
|
||||||
:headers="upHeaders"
|
:headers="upHeaders"
|
||||||
>
|
>
|
||||||
<img v-if="field.TempPicture" :src="field.TempPicture" class="avatar" />
|
<img v-if="field.draw_template" :src="field.draw_template" class="avatar" />
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -513,6 +508,7 @@
|
||||||
updaterffield,
|
updaterffield,
|
||||||
deleterffield,
|
deleterffield,
|
||||||
} from "@/api/mtm";
|
} from "@/api/mtm";
|
||||||
|
import { upFile } from "@/api/file";
|
||||||
import {genTree} from "@/utils";
|
import {genTree} from "@/utils";
|
||||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
|
@ -546,7 +542,7 @@
|
||||||
field_name: "",
|
field_name: "",
|
||||||
sort: "",
|
sort: "",
|
||||||
parent: "",
|
parent: "",
|
||||||
TempPicture: "",
|
draw_template: "",//图片模板
|
||||||
field_choice: [""],
|
field_choice: [""],
|
||||||
},
|
},
|
||||||
field_choice: [""],
|
field_choice: [""],
|
||||||
|
@ -604,7 +600,7 @@
|
||||||
datetime: "日期时间",
|
datetime: "日期时间",
|
||||||
select: "单选",
|
select: "单选",
|
||||||
selects: "多选",
|
selects: "多选",
|
||||||
img: "图片",
|
draw: "绘图模板",
|
||||||
},
|
},
|
||||||
fieldtypeoptions: [
|
fieldtypeoptions: [
|
||||||
{
|
{
|
||||||
|
@ -640,8 +636,8 @@
|
||||||
label: "多选",
|
label: "多选",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "img",
|
value: "draw",
|
||||||
label: "图片",
|
label: "绘图模板",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
typeoptions: [
|
typeoptions: [
|
||||||
|
@ -671,8 +667,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAvatarSuccess(res, file) {
|
handleAvatarSuccess(res, file) {
|
||||||
this.field.TempPicture = res.data.path;
|
this.field.draw_template = res.data.path;
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeAvatarUpload(file) {
|
beforeAvatarUpload(file) {
|
||||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||||
|
@ -1012,10 +1007,21 @@
|
||||||
let image = new Image();
|
let image = new Image();
|
||||||
image = canvas.toDataURL('image/png');
|
image = canvas.toDataURL('image/png');
|
||||||
this.canvasImg = image;
|
this.canvasImg = image;
|
||||||
|
let img = image.split(";")[1];
|
||||||
|
debugger;
|
||||||
|
console.log(image);
|
||||||
|
debugger;
|
||||||
|
let imgData = {mime:'base64',file:img,type:'图片'};
|
||||||
|
upFile(imgData).then((res) => {
|
||||||
|
debugger;
|
||||||
|
console.log(res);
|
||||||
|
debugger;
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
// document.getElementById('res').innerHTML = '<img style="border: 1px solid #666666;" src="'+image+'">';
|
// document.getElementById('res').innerHTML = '<img style="border: 1px solid #666666;" src="'+image+'">';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//新增记录表
|
//新增记录表
|
||||||
handleCreate() {
|
handleCreate() {
|
||||||
this.recordform = Object.assign({}, defaultrecordform);
|
this.recordform = Object.assign({}, defaultrecordform);
|
||||||
|
|
Loading…
Reference in New Issue