Commit bfff4bb9 by 叶富雄

指定字符需要base64

parent 1beb1254
...@@ -5,9 +5,12 @@ ...@@ -5,9 +5,12 @@
:formLabelAligns="formLabelAlign" :formLabelAligns="formLabelAlign"
@submit="submit" @submit="submit"
:propTitle="title" :propTitle="title"
@handleRemove="handleRemove" @removePhoto="removePhoto"
pageBs="addsqfbzl" pageBs="addsqfbzl"
ref="formCompontent" ref="formCompontent"
:base64Transform="true"
:fileBase64="fileBase64"
@onBase64Transform="onBase64Transform"
> >
</form-compontent> </form-compontent>
</div> </div>
...@@ -16,10 +19,7 @@ ...@@ -16,10 +19,7 @@
<script> <script>
import formCompontent from "@c/form.vue"; import formCompontent from "@c/form.vue";
import { updateHm} from "@/api/dswtz/hmxx.js"; import { updateHm,selectHmzpList} from "@/api/dswtz/hmxx.js";
import {
selectDnaList
} from "@/api/dswtz/dnaxx.js";
export default { export default {
name: "addryxx", name: "addryxx",
components: { components: {
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
}, },
data() { data() {
return { return {
fileBase64:{
hmsjLeft:"",
hmsjRight:""
},
title: "新增虹膜信息", title: "新增虹膜信息",
propFormField: [ propFormField: [
{ {
...@@ -54,7 +58,7 @@ ...@@ -54,7 +58,7 @@
{ {
name: "左虹膜:", name: "左虹膜:",
id: "hmsjLeft", id: "hmsjLeft",
type: "file", type: "photo",
value: "", value: "",
placeholder: "请输入", placeholder: "请输入",
col: "22", col: "22",
...@@ -62,7 +66,7 @@ ...@@ -62,7 +66,7 @@
{ {
name: "右虹膜:", name: "右虹膜:",
id: "hmsjRight", id: "hmsjRight",
type: "file", type: "photo",
value: "", value: "",
placeholder: "请输入", placeholder: "请输入",
col: "22", col: "22",
...@@ -70,7 +74,11 @@ ...@@ -70,7 +74,11 @@
], ],
}, },
], ],
formLabelAlign: {}, formLabelAlign: {
xm:'',
gmsfhm:'',
hmsjLeft:'',
hmsjRight:''},
type: "", type: "",
xxzjbh: "", xxzjbh: "",
result: "", result: "",
...@@ -78,13 +86,27 @@ ...@@ -78,13 +86,27 @@
}; };
}, },
methods: { 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) { submit(params) {
params.append('rybh',this.rybh) params.append('rybh',this.rybh)
params.set('hmsjLeft',this.fileBase64['hmsjLeft'])
params.set('hmsjRight',this.fileBase64['hmsjRight'])
updateHm(params) updateHm(params)
}, },
handleRemove(val) { handleRemove(val) {
console.log(val);
this.removeFileXxzjbh.push(val.xxzjbh); this.removeFileXxzjbh.push(val.xxzjbh);
}, },
getshuju() { getshuju() {
...@@ -98,19 +120,28 @@ ...@@ -98,19 +120,28 @@
let params = new FormData(); let params = new FormData();
params.append("rybh", this.rybh); params.append("rybh", this.rybh);
selectDnaList(params).then((res) => { selectHmzpList(params).then((res) => {
var result = res.data.rows; var result = res.data.rows[0];
this.result = result; if(res.data.rows.length){
self.propFormField.forEach((fieldItem) => { this.$set(this.formLabelAlign, 'xm', res.data.rows[0]['xm']);
if (fieldItem.data && fieldItem.data.length > 0) { this.$set(this.formLabelAlign, 'gmsfhm', res.data.rows[0]['gmsfhm']);
fieldItem.data.forEach((i) => { for(let h of res.data.rows.values()){
this.$set(this.formLabelAlign, i.id, result[i.id]); 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); if(res.data.rows.length){
self.$forceUpdate(); this.result = result;
self.$set(self.formLabelAlign, "editing", true);
self.$forceUpdate();
}
setTimeout(() => { setTimeout(() => {
loading.close(); loading.close();
}, 500); }, 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