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. 20
      src/views/modules/cpts/base/index.vue

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

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

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

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

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

@ -198,24 +198,24 @@
" "
ref="upload" ref="upload"
class="avatar-uploader" class="avatar-uploader"
:action="uploadUrl" :class="{ 'z-full': fmData[item.keyName].length >= item.limit }"
:action="item.uploadUrl || uploadUrl"
:data="{ customerId: customerId }" :data="{ customerId: customerId }"
:show-file-list="true" :show-file-list="true"
:list-type="item.listType || 'picture'" :list-type="item.listType || 'picture'"
:limit="item.limit || 100" :limit="item.limit || 100"
:file-list="fmData[item.keyName]" :file-list="fmData[item.keyName]"
:on-success="(res, file) => handleImgSuccess(res, file, item)" :on-success="(res, file) => handleImgSuccess(res, file, item)"
:on-error="(res, file) => handleImgError(res, file, item)"
:on-remove="(res) => handleImgRemove(res, item)" :on-remove="(res) => handleImgRemove(res, item)"
:on-exceed="(res) => handleImgExceed(res, item)" :on-exceed="(res) => handleImgExceed(res, item)"
:before-upload="(file) => beforeImgUpload(file, item)" :before-upload="(file) => beforeImgUpload(file, item)"
> >
<a <a><i class="el-icon-plus"></i> 点击上传</a>
><i class="el-icon-plus avatar-uploader-icon"></i> 点击上传</a
>
</el-upload> </el-upload>
<el-image <el-image
v-else-if="fmData[item.keyName].length > 0" v-else-if="fmData[item.keyName].length > 0"
style="width: 100px; height: 50px" style="width: 100px; height: 100px"
:src="fmData[item.keyName][0].url" :src="fmData[item.keyName][0].url"
fit="cover" fit="cover"
:preview-src-list="fmData[item.keyName].map((item) => item.url)" :preview-src-list="fmData[item.keyName].map((item) => item.url)"
@ -504,7 +504,7 @@ export default {
beforeImgUpload(file, item) { beforeImgUpload(file, item) {
if (typeof item.beforeImgUpload == "function") { if (typeof item.beforeImgUpload == "function") {
return item.beforeImgUpload(file, item, this); if (!item.beforeImgUpload(file, item, this)) return false;
} }
return true; return true;
}, },
@ -532,7 +532,7 @@ export default {
}, },
handleImgExceed(res, item) { handleImgExceed(res, item) {
console.log(e); console.log(res);
// this.$message({ // this.$message({
// type: "warning", // type: "warning",
// message: "", // message: "",
@ -575,6 +575,10 @@ export default {
} }
}, },
handleImgError(res, file, item) {
console.log(res);
},
// init // init
initMap(item) { initMap(item) {
let { latitude, longitude } = this.$store.state.user; 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 { .item-rich-text {
width: 600px; width: 600px;
height: 500px; height: 500px;

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

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