Browse Source

Merge branch 'dev-heart0629' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-heart0629

master
jiangyy 3 years ago
parent
commit
a507c107d8
  1. 4
      src/views/modules/communityParty/article/drafts.vue
  2. 6
      src/views/modules/communityParty/article/index.vue
  3. 39
      src/views/modules/cpts/base/cpts/edit.vue
  4. 18
      src/views/modules/cpts/base/index.vue

4
src/views/modules/communityParty/article/drafts.vue

@ -56,7 +56,7 @@ export default {
field: "创建时间",
keyName: "createdTime",
type: "date-range",
supKeys: ["startTime", "endTime"],
supKeys: ["startDate", "endDate"],
supValues: ["", ""],
},
],
@ -102,9 +102,11 @@ export default {
keyName: "imgArr",
type: "upload",
limit: 1,
listType: 'picture-card',
editDisabled: true,
rules: [],
value: () => [],
uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/article/upload",
supKeys: ["imgUrlArr", "imgUrl"],
supValues: [() => [], ""],
beforeImgUpload(file, item, that) {

6
src/views/modules/communityParty/article/index.vue

@ -151,6 +151,8 @@ export default {
"agencyId",
"subAgencyList"
)[vals.length - 1]["level"];
item["supValues"][1] =
item["supValues"][1] == "grid" ? "grid" : "agency";
} else {
item["supValues"][0] = "";
item["supValues"][1] = "";
@ -161,7 +163,7 @@ export default {
field: "发布时间",
keyName: "publishTime",
type: "date-range",
supKeys: ["startTime", "endTime"],
supKeys: ["startDate", "endDate"],
supValues: ["", ""],
},
],
@ -221,9 +223,11 @@ export default {
keyName: "imgArr",
type: "upload",
limit: 1,
listType: "picture-card",
editDisabled: true,
rules: [],
value: () => [],
uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/article/upload",
supKeys: ["imgUrlArr", "imgUrl"],
supValues: [() => [], ""],
beforeImgUpload(file, item, that) {

39
src/views/modules/cpts/base/cpts/edit.vue

@ -198,24 +198,24 @@
"
ref="upload"
class="avatar-uploader"
:action="uploadUrl"
:class="{ 'z-full': fmData[item.keyName].length >= item.limit }"
:action="item.uploadUrl || uploadUrl"
:data="{ customerId: customerId }"
:show-file-list="true"
:list-type="item.listType || 'picture'"
:limit="item.limit || 100"
:file-list="fmData[item.keyName]"
:on-success="(res, file) => handleImgSuccess(res, file, item)"
:on-error="(res, file) => handleImgError(res, file, item)"
:on-remove="(res) => handleImgRemove(res, item)"
:on-exceed="(res) => handleImgExceed(res, item)"
:before-upload="(file) => beforeImgUpload(file, item)"
>
<a
><i class="el-icon-plus avatar-uploader-icon"></i> 点击上传</a
>
<a><i class="el-icon-plus"></i> 点击上传</a>
</el-upload>
<el-image
v-else-if="fmData[item.keyName].length > 0"
style="width: 100px; height: 50px"
style="width: 100px; height: 100px"
:src="fmData[item.keyName][0].url"
fit="cover"
:preview-src-list="fmData[item.keyName].map((item) => item.url)"
@ -504,7 +504,7 @@ export default {
beforeImgUpload(file, item) {
if (typeof item.beforeImgUpload == "function") {
return item.beforeImgUpload(file, item, this);
if (!item.beforeImgUpload(file, item, this)) return false;
}
return true;
},
@ -532,7 +532,7 @@ export default {
},
handleImgExceed(res, item) {
console.log(e);
console.log(res);
// this.$message({
// type: "warning",
// message: "",
@ -575,6 +575,10 @@ export default {
}
},
handleImgError(res, file, item) {
console.log(res);
},
// init
initMap(item) {
let { latitude, longitude } = this.$store.state.user;
@ -874,7 +878,28 @@ export default {
}
}
}
.avatar-uploader {
&.z-full {
/deep/ .el-upload.el-upload--picture-card {
display: none !important;
}
}
a {
display: flex;
align-items: center;
justify-content: center;
color: #65a5f9;
i {
margin-right: 4px;
color: #65a5f9;
font-size: 18px;
}
&:hover {
text-decoration: none;
}
}
}
.item-rich-text {
width: 600px;
height: 500px;

18
src/views/modules/cpts/base/index.vue

@ -446,7 +446,7 @@ export default {
},
activated() {
console.log('-------------activated')
console.log("-------------activated");
this.$refs["ref_table"].doLayout();
},
@ -515,6 +515,7 @@ export default {
}
return fileType && isLt1M;
},
async uploadHttpRequest(file) {
let { importUrl: url } = this;
if (!url) return;
@ -725,8 +726,23 @@ export default {
},
resetSearch() {
console.log("----------------resetSearch", this.searchParams);
this.searchParams.forEach((item) => {
if (typeof item.value == "string") {
item.value = "";
} else if (Array.isArray(item.value)) {
item.value = [];
}
if (item.supValues) {
item.supValues = item.supValues.map((value, index) => {
if (typeof value == "string") {
return "";
} else if (Array.isArray(value)) {
return [];
}
return value;
});
}
});
},
},

Loading…
Cancel
Save