Commit e266b5f2 by 前端

修复照片命名规则

1 parent dbf1d3d3
...@@ -68,14 +68,18 @@ export default { ...@@ -68,14 +68,18 @@ export default {
readStatus: "", readStatus: "",
acceptFile: ".jpg,.png", acceptFile: ".jpg,.png",
previewList: [], previewList: [],
nameIndex:0
}; };
}, },
watch: { watch: {
value: { value: {
handler: function (n, o) { handler: function (n, o) {
this.imgList = n; this.imgList = n;
if(!this.nameIndex){
this.nameIndex = n.length;
}
console.log('666666666')
}, },
immediate: true,
}, },
status: { status: {
handler: function (n, o) { handler: function (n, o) {
...@@ -84,7 +88,8 @@ export default { ...@@ -84,7 +88,8 @@ export default {
immediate: true, immediate: true,
}, },
}, },
mounted() {}, mounted() {
},
methods: { methods: {
// 监听选择图片 // 监听选择图片
onChange(file, fileList) { onChange(file, fileList) {
...@@ -145,8 +150,9 @@ export default { ...@@ -145,8 +150,9 @@ export default {
console.log(res); console.log(res);
let response = res.data; let response = res.data;
if (response.returnCode == 0) { if (response.returnCode == 0) {
_this.imgList.push({ path: response.data, name: `照片${_this.imgList.length+1}` }); _this.imgList.push({ path: response.data, name: `照片${_this.nameIndex+1}` });
_this.previewList.push(res.data); _this.previewList.push(res.data);
_this.nameIndex +=1;
console.log(_this.imgList); console.log(_this.imgList);
// //
//this.$emit("change", response.data); //this.$emit("change", response.data);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!