Commit bfff4bb9 by 叶富雄

指定字符需要base64

parent 1beb1254
......@@ -5,9 +5,12 @@
:formLabelAligns="formLabelAlign"
@submit="submit"
:propTitle="title"
@handleRemove="handleRemove"
@removePhoto="removePhoto"
pageBs="addsqfbzl"
ref="formCompontent"
:base64Transform="true"
:fileBase64="fileBase64"
@onBase64Transform="onBase64Transform"
>
</form-compontent>
</div>
......@@ -16,10 +19,7 @@
<script>
import formCompontent from "@c/form.vue";
import { updateHm} from "@/api/dswtz/hmxx.js";
import {
selectDnaList
} from "@/api/dswtz/dnaxx.js";
import { updateHm,selectHmzpList} from "@/api/dswtz/hmxx.js";
export default {
name: "addryxx",
components: {
......@@ -27,6 +27,10 @@
},
data() {
return {
fileBase64:{
hmsjLeft:"",
hmsjRight:""
},
title: "新增虹膜信息",
propFormField: [
{
......@@ -54,7 +58,7 @@
{
name: "左虹膜:",
id: "hmsjLeft",
type: "file",
type: "photo",
value: "",
placeholder: "请输入",
col: "22",
......@@ -62,7 +66,7 @@
{
name: "右虹膜:",
id: "hmsjRight",
type: "file",
type: "photo",
value: "",
placeholder: "请输入",
col: "22",
......@@ -70,7 +74,11 @@
],
},
],
formLabelAlign: {},
formLabelAlign: {
xm:'',
gmsfhm:'',
hmsjLeft:'',
hmsjRight:''},
type: "",
xxzjbh: "",
result: "",
......@@ -78,13 +86,27 @@
};
},
methods: {
onBase64Transform(p){
this.fileBase64 = p
},
removePhoto(item) {
let loading = this.$loading({
lock: true,
text: "正在删除...",
spinner: "el-icon-loading",
background: "rgba(255, 255, 255, 0.7)",
});
let id= item.id
this.$set(this.formLabelAlign, id, '');
loading.close();
},
submit(params) {
params.append('rybh',this.rybh)
params.set('hmsjLeft',this.fileBase64['hmsjLeft'])
params.set('hmsjRight',this.fileBase64['hmsjRight'])
updateHm(params)
},
handleRemove(val) {
console.log(val);
this.removeFileXxzjbh.push(val.xxzjbh);
},
getshuju() {
......@@ -98,19 +120,28 @@
let params = new FormData();
params.append("rybh", this.rybh);
selectDnaList(params).then((res) => {
var result = res.data.rows;
this.result = result;
self.propFormField.forEach((fieldItem) => {
if (fieldItem.data && fieldItem.data.length > 0) {
fieldItem.data.forEach((i) => {
this.$set(this.formLabelAlign, i.id, result[i.id]);
});
selectHmzpList(params).then((res) => {
var result = res.data.rows[0];
if(res.data.rows.length){
this.$set(this.formLabelAlign, 'xm', res.data.rows[0]['xm']);
this.$set(this.formLabelAlign, 'gmsfhm', res.data.rows[0]['gmsfhm']);
for(let h of res.data.rows.values()){
let hmywdm = h.hmywdm;
let tg = "data:image/jpeg;base64,"+h.hmsj
if(hmywdm==='0'){
this.$set(this.formLabelAlign, 'hmsjLeft', tg);
}
else {
this.$set(this.formLabelAlign, 'hmsjRight', tg);
}
}
this.$forceUpdate();
});
self.$set(self.formLabelAlign, "editing", true);
self.$forceUpdate();
}
if(res.data.rows.length){
this.result = result;
self.$set(self.formLabelAlign, "editing", true);
self.$forceUpdate();
}
setTimeout(() => {
loading.close();
}, 500);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment