Merge remote-tracking branch 'origin/dev' into dev

wangbin 3 years ago
commit 1f6ba33599

@ -80,7 +80,7 @@ export default {
}, },
// localStorage gaeaDict // localStorage gaeaDict
getOptionsFromLocalStorage() { getOptionsFromLocalStorage() {
let dicts = JSON.parse(localStorage.getItem("gaeaDict")); let dicts = JSON.parse(localStorage.getItem("AJReportDict"));
let options = []; let options = [];
if (!dicts.hasOwnProperty(this.dictCode)) { if (!dicts.hasOwnProperty(this.dictCode)) {
return []; return [];

@ -244,9 +244,9 @@ export default {
} }
return result; return result;
}, },
// localStorage gaeaDict // localStorage AJReportDict
getOptionsFromLocalStorage() { getOptionsFromLocalStorage() {
let dicts = JSON.parse(localStorage.getItem("gaeaDict")); let dicts = JSON.parse(localStorage.getItem("AJReportDict"));
let options = []; let options = [];
if (!dicts.hasOwnProperty(this.dictCode)) { if (!dicts.hasOwnProperty(this.dictCode)) {
return []; return [];

@ -15,26 +15,9 @@
> >
<i slot="default" class="el-icon-plus" /> <i slot="default" class="el-icon-plus" />
<div slot="file" slot-scope="{ file }" class="imgBox"> <div slot="file" slot-scope="{ file }" class="imgBox">
<img <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
v-if="typeImgShow(file)"
class="el-upload-list__item-thumbnail"
:src="file.url"
alt=""
/>
<svg-icon
v-else-if="typePdfShow(file)"
icon-class="PDF"
class="iconFont"
/>
<svg-icon
v-else-if="typeExcelShow(file)"
icon-class="Excel"
class="iconFont"
/>
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span
v-if="typeImgShow(file)"
class="el-upload-list__item-preview" class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)" @click="handlePictureCardPreview(file)"
> >
@ -80,16 +63,7 @@ export default {
} }
}, },
value: { value: {
type: Array, type: Array | String
default: () => {
return [];
}
},
uploadType: {
type: String,
default: () => {
return "img";
}
} }
}, },
data() { data() {
@ -114,42 +88,15 @@ export default {
}; };
} }
}, },
watch: {
value(val) {
this.echoUpload(val);
}
},
mounted() { mounted() {
this.echoUpload(this.value); this.echoUpload(this.value);
}, },
methods: { methods: {
//
typeImgShow(file) {
if (!file.fileType) return;
const fileType = file.fileType.toLowerCase();
if (
fileType == "jpg" ||
fileType == "png" ||
fileType == "gif" ||
fileType == "icon"
) {
return true;
}
return false;
},
// pdf
typePdfShow(file) {
if (!file.fileType) return;
const fileType = file.fileType.toLowerCase();
if (fileType == "pdf") {
return true;
}
return false;
},
// excel
typeExcelShow(file) {
if (!file.fileType) return;
const fileType = file.fileType.toLowerCase();
if (fileType == "xlsx" || fileType == "xls" || fileType == "csv") {
return true;
}
return false;
},
handleRemove(file) { handleRemove(file) {
const fileList = []; const fileList = [];
this.fileList.forEach(el => { this.fileList.forEach(el => {
@ -185,6 +132,7 @@ export default {
// //
change() { change() {
const fileList = this.fileList; const fileList = this.fileList;
console.log(fileList);
this.$emit("input", fileList); this.$emit("input", fileList);
this.$emit("change", fileList); this.$emit("change", fileList);
}, },
@ -214,18 +162,13 @@ export default {
}, },
// //
echoUpload(val) { echoUpload(val) {
if (val && val.length > 0) { console.log(val);
const fileList = []; if (val) {
for (let i = 0; i < val.length; i++) { this.fileList = [
const obj = {}; {
obj.url = val[i].urlPath || val[i].url; url: val
obj.fileType = val[i].fileType;
obj.fileId = val[i].fileId;
fileList.push(obj);
} }
fileList.forEach((el, index) => { ];
this.$set(this.fileList, index, el);
});
} else { } else {
this.fileList = []; this.fileList = [];
} }

@ -4,7 +4,7 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2022-03-09 09:54:15 * @LastEditTime: 2022-05-14 15:42:53
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
@ -296,7 +296,12 @@ export default {
// fieldName input name // fieldName input name
// fieldVal input // fieldVal input
// fieldExtend select // fieldExtend select
formChange: (formData, fieldName, fieldVal, fieldExtend) => {} formChange: (formData, fieldName, fieldVal, fieldExtend) => {
console.log(formData);
if (fieldName == "reportImage" && fieldVal.length > 0) {
formData["reportImage"] = fieldVal && fieldVal[0].url;
}
}
} }
}; };
}, },
@ -350,8 +355,8 @@ export default {
// //
async copyReport(val) { async copyReport(val) {
const { code } = await reportCopy(val); const { code } = await reportCopy(val);
if (code != '200') { if (code != "200") {
return return;
} }
this.$message.success("复制成功"); this.$message.success("复制成功");
this.$refs.listPage.handleQueryForm("query"); this.$refs.listPage.handleQueryForm("query");

Loading…
Cancel
Save