diff --git a/hb_client/src/api/file.js b/hb_client/src/api/file.js
index 01c683e..9ad01c7 100644
--- a/hb_client/src/api/file.js
+++ b/hb_client/src/api/file.js
@@ -15,4 +15,11 @@ export function getFileList(query) {
method: 'get',
params: query
})
-}
\ No newline at end of file
+}
+export function upFile(data) {
+ return request({
+ url: '/file/',
+ method: 'post',
+ data
+ })
+}
diff --git a/hb_client/src/views/mtm/materialdo.vue b/hb_client/src/views/mtm/materialdo.vue
index 029abea..421edae 100644
--- a/hb_client/src/views/mtm/materialdo.vue
+++ b/hb_client/src/views/mtm/materialdo.vue
@@ -87,32 +87,6 @@
:title="tableForm.name"
>
-
-
-
-
-

-
-
-
-
-
-
-
标记
-
文字
-
-
回退
-
保存
-
-
-
-
-
-
-
-
+
+
+

+
+
+
+
+
+
+
+
+
+
@@ -458,7 +453,7 @@
-
+
-
+
@@ -513,6 +508,7 @@
updaterffield,
deleterffield,
} from "@/api/mtm";
+ import { upFile } from "@/api/file";
import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
import Treeselect from '@riophae/vue-treeselect'
@@ -546,7 +542,7 @@
field_name: "",
sort: "",
parent: "",
- TempPicture: "",
+ draw_template: "",//图片模板
field_choice: [""],
},
field_choice: [""],
@@ -604,7 +600,7 @@
datetime: "日期时间",
select: "单选",
selects: "多选",
- img: "图片",
+ draw: "绘图模板",
},
fieldtypeoptions: [
{
@@ -640,8 +636,8 @@
label: "多选",
},
{
- value: "img",
- label: "图片",
+ value: "draw",
+ label: "绘图模板",
},
],
typeoptions: [
@@ -671,8 +667,7 @@
},
methods: {
handleAvatarSuccess(res, file) {
- this.field.TempPicture = res.data.path;
-
+ this.field.draw_template = res.data.path;
},
beforeAvatarUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 2;
@@ -1012,10 +1007,21 @@
let image = new Image();
image = canvas.toDataURL('image/png');
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 = '
';
},
-
//新增记录表
handleCreate() {
this.recordform = Object.assign({}, defaultrecordform);