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

wangbin 2 years ago
commit 1f6ba33599

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

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

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

@ -4,7 +4,7 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
* @LastEditTime: 2022-03-09 09:54:15
* @LastEditTime: 2022-05-14 15:42:53
-->
<template>
<anji-crud ref="listPage" :option="crudOption">
@ -29,7 +29,7 @@ import {
} from "@/api/reportmanage";
import Share from "./components/share";
import { validateEngOrNum } from "@/utils/validate";
import {verificationSet} from "@/api/report";
import { verificationSet } from "@/api/report";
export default {
name: "Report",
components: {
@ -296,7 +296,12 @@ export default {
// fieldName input name
// fieldVal input
// 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) {
const { code } = await reportCopy(val);
if (code != '200') {
return
if (code != "200") {
return;
}
this.$message.success("复制成功");
this.$refs.listPage.handleQueryForm("query");

Loading…
Cancel
Save