提交 3b163d65 authored 作者: 龙菲's avatar 龙菲

增加布展单元

上级 14854e65
...@@ -32,3 +32,10 @@ export function getRCDetailById(params) { ...@@ -32,3 +32,10 @@ export function getRCDetailById(params) {
}) })
} }
export function deleteCultralRelic(data) {
return request({
url: '/bizCulturalRelic/delete',
method: 'delete',
data
})
}
...@@ -22,4 +22,20 @@ export function editDisplay(data) { ...@@ -22,4 +22,20 @@ export function editDisplay(data) {
method: 'put', method: 'put',
data data
}) })
} }
\ No newline at end of file
export function getDisplayById(data) {
return request({
url: '/bizExhibition/listById',
method: 'get',
data
})
}
export function deleteDisplay(data) {
return request({
url: '/bizExhibition/delete',
method: 'delete',
data
})
}
...@@ -12,8 +12,6 @@ class Dict { ...@@ -12,8 +12,6 @@ class Dict {
} }
async init(names) { async init(names) {
console.log('names', names);
// const ps = [];
// 先判断list中的name是否存在,如果不存在,把不存在的放置在一个list中,再对list进行获取 // 先判断list中的name是否存在,如果不存在,把不存在的放置在一个list中,再对list进行获取
var nonExistentNames = [] var nonExistentNames = []
// debugger // debugger
...@@ -43,7 +41,6 @@ class Dict { ...@@ -43,7 +41,6 @@ class Dict {
value: Object.freeze(literatureList), value: Object.freeze(literatureList),
}); });
} }
} }
if (nonExistentNames.length > 0) { if (nonExistentNames.length > 0) {
// debugger // debugger
...@@ -55,11 +52,6 @@ class Dict { ...@@ -55,11 +52,6 @@ class Dict {
if (res.code == 0) { if (res.code == 0) {
res.data.map(item => { res.data.map(item => {
if (item.dictType === n) { if (item.dictType === n) {
// arr.push(item)
// console.log(' obj[item.value]', obj[item.value]);
// console.log(' obj[item.label]', obj[item.label]);
// console.log('item',item);
// debugger
obj[item.value]=item.label obj[item.value]=item.label
} }
}) })
...@@ -75,10 +67,6 @@ class Dict { ...@@ -75,10 +67,6 @@ class Dict {
} }
loadDictCode() {
}
} }
const install = function (Vue) { const install = function (Vue) {
......
...@@ -19,13 +19,12 @@ ...@@ -19,13 +19,12 @@
<span> <span>
<span v-for="(op, index) in operations" :key="index"> <span v-for="(op, index) in operations" :key="index">
<span v-if="op.type == 'delete'"> <span v-if="op.type == 'delete'">
<el-popconfirm title="确定删除吗?"> <el-popconfirm title="确定删除吗?" @onConfirm="clickOperation(op)">
<el-button <el-button
type="danger" type="danger"
size="mini" size="mini"
slot="reference" slot="reference"
:icon="icons[op.type]" :icon="icons[op.type]"
@click="clickOperation(op)"
style="margin-right: 4px" style="margin-right: 4px"
> >
{{ op.title }}</el-button {{ op.title }}</el-button
...@@ -67,6 +66,7 @@ export default { ...@@ -67,6 +66,7 @@ export default {
}, },
methods: { methods: {
clickOperation(operation) { clickOperation(operation) {
console.log('123');
this.$emit("handleOperation", operation, this.rawData); this.$emit("handleOperation", operation, this.rawData);
}, },
}, },
......
...@@ -23,33 +23,37 @@ ...@@ -23,33 +23,37 @@
:header-align="item.titleAlign" :header-align="item.titleAlign"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="item.prop=='faceImage'"> <template v-if="item.prop == 'faceImage'">
<slot name="faceImage" :scope="scope.row"></slot> <slot name="faceImage" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='images'"> <template v-else-if="item.prop == 'images'">
<slot name="images" :scope="scope.row"></slot> <slot name="images" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='audios'"> <template v-else-if="item.prop == 'audios'">
<slot name="audios" :scope="scope.row"></slot> <slot name="audios" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='videos'"> <template v-else-if="item.prop == 'videos'">
<slot name="videos" :scope="scope.row"></slot> <slot name="videos" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.isStatus"> <template v-else-if="item.isStatus">
<slot name="status" :scope="scope.row"></slot> <slot name="status" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='type'">
<slot name="type" :scope="scope.row"></slot> <template v-else-if="item.prop == 'years'">
</template>
<template v-else-if="item.prop=='years'">
<slot name="years" :scope="scope.row"></slot> <slot name="years" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='level'"> <template v-else-if="item.prop == 'level'">
<slot name="level" :scope="scope.row"></slot> <slot name="level" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.prop=='textureType'"> <template v-else-if="item.prop == 'textureType'">
<slot name="textureType" :scope="scope.row"></slot> <slot name="textureType" :scope="scope.row"></slot>
</template> </template>
<template v-else-if="item.isCulturalRelicType">
<slot name="type" :scope="scope.row"></slot>
</template>
<template v-else-if="item.isDisplayType">
<slot name="displayType" :scope="scope.row"></slot>
</template>
<span v-else>{{ scope.row[item.prop] }}</span> <span v-else>{{ scope.row[item.prop] }}</span>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -80,7 +80,6 @@ export default { ...@@ -80,7 +80,6 @@ export default {
watch: { watch: {
files: { files: {
handler: function (newVal, oldVal) { handler: function (newVal, oldVal) {
console.log("newVal", newVal);
this.fileList = newVal; this.fileList = newVal;
}, },
immediate: true, immediate: true,
......
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1656489573468" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11484" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M853.161077 892.549156 362.595248 892.549156l-209.432916-0.413416c-0.605797-0.001023-1.210571-0.031722-1.813299-0.092098-24.848944-2.484587-47.825238-14.060227-64.696488-32.594349-16.990976-18.665105-26.349111-42.85504-26.349111-68.112284L60.303434 264.62596c0-55.80805 45.403073-101.211123 101.211123-101.211123l691.645496 0c55.80805 0 101.2101 45.403073 101.2101 101.211123l0 225.51315c0 0.275269-0.00614 0.551562-0.01842 0.825808-0.021489 0.494257-1.971911 51.723012 15.481599 85.46244 4.716418 9.118682 1.14815 20.335141-7.970532 25.052582-9.116635 4.714372-20.335141 1.149173-25.052582-7.970532-21.300119-41.176818-19.844977-97.642854-19.618826-103.738689L917.191392 264.62596c0-35.307134-28.724205-64.031339-64.031339-64.031339L161.51558 200.594621c-35.307134 0-64.031339 28.724205-64.031339 64.031339l0 526.71105c0 32.755008 24.320918 59.957557 56.717769 63.61997l208.4311 0.412392 490.528989 0c35.307134 0 64.031339-28.725228 64.031339-64.032362l-0.382717-93.676519c-0.104377-1.749854-1.587148-19.548218-19.549242-42.499953-0.050142-0.063445-0.098237-0.125867-0.147356-0.190335L875.401614 626.481358 758.174726 471.362464c-0.415462-0.550539-38.995129-50.852178-86.271876-45.534056-38.335097 4.314259-75.954903 45.163619-108.789729 118.131491-17.615193 39.141462-34.650171 68.26885-52.082192 89.046059-17.607006 20.985964-35.679617 33.519418-55.251372 38.316677-43.422975 10.638291-81.049944-18.99461-120.886231-50.372248l-5.057179-3.980661c-46.555315-36.57808-68.750827-28.223808-158.330028 59.60247-7.330966 7.187703-19.101033 7.071046-26.288736-0.25992-7.187703-7.330966-7.071046-19.101033 0.25992-26.287713 46.658669-45.74588 77.544097-72.726372 107.085924-84.282568 33.357735-13.048177 64.274886-6.266727 100.242052 21.99392l5.092995 4.00829c33.9226 26.719548 63.219857 49.795103 89.028663 43.466977 25.618471-6.279007 53.30095-42.114167 82.279958-106.508779 39.139415-86.97591 85.837994-134.027529 138.79716-139.849118 68.454068-7.515161 117.823476 57.404408 119.891578 60.171428l117.122511 154.980747 21.599947 28.343535c26.276457 33.630958 27.333532 61.638849 27.367301 64.72514 0.001023 0.042979 0.001023 0.084934 0.001023 0.127913l0.38374 94.059236C954.371176 847.146083 908.969127 892.549156 853.161077 892.549156z" p-id="11485"></path><path d="M312.328401 446.967868c-42.324968 0-76.759221-34.434254-76.759221-76.759221s34.434254-76.759221 76.759221-76.759221 76.759221 34.434254 76.759221 76.759221S354.654392 446.967868 312.328401 446.967868zM312.328401 330.628186c-21.824051 0-39.579437 17.755386-39.579437 39.579437s17.755386 39.579437 39.579437 39.579437 39.579437-17.755386 39.579437-39.579437S334.153476 330.628186 312.328401 330.628186z" p-id="11486"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1656489577888" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11629" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M783.397177 815.037804 99.259678 815.037804c-32.612769 0-59.144028-26.53433-59.144028-59.149145 0-0.13917 0.001023-0.277316 0.004093-0.416486l0.533143-23.604604c0.227174-10.028401 8.42795-18.004049 18.407232-18.004049 0.141216 0 0.282433 0.001023 0.424672 0.005117 10.17064 0.230244 18.228153 8.661264 17.998933 18.830881l-0.529049 23.370267c0.097214 12.218276 10.06524 22.128997 22.305005 22.128997l684.137499 0c12.301164 0 22.309098-10.007935 22.309098-22.310122l0-77.920674c0-5.936199 2.860141-11.508102 7.684006-14.9679 4.822842-3.459798 11.021008-4.38282 16.641005-2.479471l124.534318 42.147936c11.083429-1.287319 19.715017-10.732435 19.715017-22.155603L974.280622 378.76758c0-11.423167-8.631588-20.868283-19.715017-22.155603l-124.534318 42.148959c-5.623068 1.902326-11.81714 0.980327-16.641005-2.479471-4.823865-3.459798-7.684006-9.031701-7.684006-14.966876L805.706275 268.925892c0-12.299117-10.007935-22.305005-22.309098-22.305005L99.793844 246.620887c-12.300141 0-22.306029 10.005888-22.306029 22.305005L77.487815 587.012438c0.071631 4.729721 0.096191 57.173141-32.541137 96.333022-6.513344 7.812943-18.127869 8.868995-25.942859 2.356674-7.814989-6.513344-8.868995-18.127869-2.356674-25.942859 24.326035-29.186739 24.015973-71.721485 24.006763-72.143087-0.004093-0.145309-0.005117-0.290619-0.005117-0.436952L40.648792 268.925892c0-32.612769 26.532283-59.144028 59.145052-59.144028l683.603333 0c32.613792 0 59.148122 26.532283 59.148122 59.144028l0 86.707804 103.523795-35.038004c1.901303-0.64366 3.897773-0.972141 5.9055-0.972141 32.612769 0 59.145052 26.532283 59.145052 59.144028l0 301.745369c0 32.612769-26.532283 59.145052-59.145052 59.145052-2.007727 0-4.003174-0.328481-5.9055-0.972141l-103.523795-35.038004 0 52.241828C842.544275 788.503475 816.010969 815.037804 783.397177 815.037804z" p-id="11630"></path><path d="M404.872121 647.215588c-2.798742 0-5.610788-0.63752-8.211009-1.933025-6.253424-3.115967-10.205433-9.500375-10.205433-16.486486L386.455679 404.165016c0-6.886851 3.842515-13.199627 9.960863-16.362666 6.118348-3.164063 13.489222-2.64934 19.10922 1.334391L569.047274 497.943866c4.79419 3.397377 7.67889 8.878205 7.766894 14.753005s-2.632967 11.43954-7.323802 14.978133L415.968853 643.499963C412.710646 645.956921 408.804686 647.215588 404.872121 647.215588zM423.294702 439.796538l0 152.029532 103.903441-78.389348L423.294702 439.796538z" p-id="11631"></path><path d="M65.636906 731.924875" p-id="11632"></path></svg>
\ No newline at end of file
...@@ -285,6 +285,7 @@ export default { ...@@ -285,6 +285,7 @@ export default {
{ {
name: "", name: "",
url: this.dialogForm.faceImageUrl, url: this.dialogForm.faceImageUrl,
fileId: this.dialogForm.faceImage,
}, },
]; ];
} else { } else {
...@@ -437,13 +438,6 @@ export default { ...@@ -437,13 +438,6 @@ export default {
}, 500); }, 500);
}, },
async loadLiterature() {
this.dicts.literatureList.map((item) => {
if (this.dialogForm.literature.indexOf(item.literatureId) != -1) {
this.literatureModelValue.push(item.literatureId);
}
});
},
handlePreview({ type, file }) { handlePreview({ type, file }) {
console.log(type, file); console.log(type, file);
}, },
...@@ -453,100 +447,43 @@ export default { ...@@ -453,100 +447,43 @@ export default {
// 取消编辑 // 取消编辑
cancelForm() { cancelForm() {
this.$emit("handleClose"); this.$emit("handleClose");
this.form = {}; this.dialogForm = {};
}, },
async handleSubmit() { async handleSubmit() {
const mediaArr = [ const mediaArr = [
"faceImage", "faceImage",
"images", "images",
"audios",
"videos", "videos",
"sayExplain", "sayExplain",
"audios",
]; ];
if (this.dialogForm.crId) { if (this.dialogForm.crId) {
let ps = []; //ps为涵盖5种媒体的promise集合 let ps = []; //ps为涵盖5种媒体的promise集合
mediaArr.forEach((media) => { mediaArr.forEach((media) => {
ps.push(this.handleEditUpload(media)); ps.push(this.handleEditUpload(media));
}); });
Promise.all(ps).then((allResult) => {
console.log("allResult", allResult);
});
// // 处理图片等媒体 // // 处理图片等媒体
// let imagesFiles = [...this.$refs["images"].getFiles()]; //imagesFiles中只存在(success)和新添加的(ready),不存在的已经在组件中被去除了
// if (imagesFiles.length > 0) {
// let formData = new FormData();
// let fileIds = [];
// imagesFiles.forEach((imageFile) => {
// switch (imageFile.status) {
// case "ready":
// formData.append(files, imageFile.raw);
// break;
// case "success":
// fileIds.push(imageFile.fileId);
// break;
// }
// });
// let imageUpRes = await upload(formData);
// if (imageUpRes.code == 0) {
// // 拿到已存在的和上传过后的结果进行拼接,并赋值给images,不用管imagesVo,后台自行处理
// const { data } = imageUpRes;
// data.map((item) => {
// fileIds.push(item.fileId);
// });
// this.dialogForm["images"] = fileIds.join(",");
// }
// } else {
// this.dialogForm["images"] = "";
// }
// mediaArr.map((media) => {
// let files = this.$refs[media].getFiles(); //获取每种媒体的文件
// let fileList = [...files]; //fileList中包含了有已经存在的(success)和新添加的(ready)
// if (fileList.length > 0) {
// let formData = new FormData();
// fileList.forEach((file) => {
// // 只会有Ready和success两种状态,success的不做处理,ready的上传后将
// if (file.status == "ready") {
// formData.append("files", file.raw);
// ps.push(upload(formData));
// } else {
// ps.push(file);
// }
// });
// } else {
// ps.push(null);
// }
// });
Promise.all(ps).then( Promise.all(ps).then(
async (allResult) => { async (allResult) => {
console.log("allResult", allResult); console.log("allResult", allResult);
// allResult.forEach((item, index) => { allResult.forEach((item, index) => {
// if (item) { this.dialogForm[mediaArr[index]] = item;
// let fileIds = []; });
// let files = item.data; const params = { ...this.dialogForm };
// files.forEach((file) => { params.literature = this.literatureModelValue.join(",");
// fileIds.push(file.fileId); params.status = this.dialogForm.status ? 1 : 0;
// }); console.log("params", params);
// this.dialogForm[mediaArr[index]] = fileIds.join(","); let res = await editCulturalRelic(params);
// } else { if (res.code == 0) {
// this.dialogForm[mediaArr[index]] = ""; this.$message.success("修改成功!");
// } this.loading = false;
// }); this.literatureModelValue = [];
// const { deptId, regionCode } = this.userInfo; this.$emit("handleClose");
// const params = { ...this.dialogForm, deptId, regionCode }; this.$emit("refresh");
// params.literature = this.literatureModelValue.join(","); this.dialogForm = {};
// params.status = this.dialogForm.status ? 1 : 0; }
// let res = await addCulturalRelic(params);
// if (res.code == 0) {
// this.$message.success("提交成功!");
// this.loading = false;
// this.literatureModelValue = [];
// this.$emit("handleClose");
// this.$emit("refresh");
// this.dialogForm = {};
// }
}, },
(reason) => { (reason) => {
console.log(reason); console.log(reason);
...@@ -607,12 +544,11 @@ export default { ...@@ -607,12 +544,11 @@ export default {
// 处理编辑时图片、视频、音频、讲解词媒体资源的上传问题 // 处理编辑时图片、视频、音频、讲解词媒体资源的上传问题
handleEditUpload(media) { handleEditUpload(media) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
debugger;
let fileIds = [];
let fileIdStr = "";
//files中只存在(success)和新添加的(ready),不存在的已经在组件中被去除了 //files中只存在(success)和新添加的(ready),不存在的已经在组件中被去除了
let files = [...this.$refs[media].getFiles()]; let files = [...this.$refs[media].getFiles()];
if (files.length > 0) { if (files.length > 0) {
let fileIds = [];
let fileIdStr = "";
let formData = new FormData(); let formData = new FormData();
files.forEach((file) => { files.forEach((file) => {
switch (file.status) { switch (file.status) {
...@@ -624,6 +560,7 @@ export default { ...@@ -624,6 +560,7 @@ export default {
break; break;
} }
}); });
if (formData.get("files")) { if (formData.get("files")) {
upload(formData) upload(formData)
.then((upRes) => { .then((upRes) => {
...@@ -633,16 +570,19 @@ export default { ...@@ -633,16 +570,19 @@ export default {
data.map((item) => { data.map((item) => {
fileIds.push(item.fileId); fileIds.push(item.fileId);
}); });
fileIdStr = fileIds.join(",");
resolve(fileIdStr);
} }
fileIdStr = fileIds.join(",");
resolve(fileIdStr);
}) })
.catch((err) => { .catch((err) => {
reject(err); reject(err);
}); });
} else { } else {
fileIdStr = ""; fileIdStr = fileIds.join(",");
resolve(fileIdStr);
} }
} else {
resolve("");
} }
}); });
}, },
......
...@@ -30,11 +30,11 @@ export const title = [{ ...@@ -30,11 +30,11 @@ export const title = [{
width: 100, width: 100,
columnAlign: 'center', columnAlign: 'center',
}, },
{ // {
prop: "level", // prop: "level",
label: "文物级别", // label: "文物级别",
columnAlign: 'center', // columnAlign: 'center',
}, // },
// { // {
// prop: "detailSize", // prop: "detailSize",
// label: "尺寸", // label: "尺寸",
...@@ -50,6 +50,7 @@ export const title = [{ ...@@ -50,6 +50,7 @@ export const title = [{
// label: "类别", // label: "类别",
// width: 100, // width: 100,
// columnAlign: 'center', // columnAlign: 'center',
// isCulturalRelicType:true
// }, // },
// { // {
// prop: "createId", // prop: "createId",
......
...@@ -24,9 +24,12 @@ ...@@ -24,9 +24,12 @@
<template v-slot:status="data"> <template v-slot:status="data">
<el-popconfirm <el-popconfirm
:title="getStatusTitle(data.scope.status)" :title="getStatusTitle(data.scope.status)"
@confirm="handleChangeStatus(data.scope.status)" @onConfirm="handleChangeStatus(data.scope)"
> >
<el-switch slot="reference" :value="data.scope.status"></el-switch> <el-switch
slot="reference"
:value="Boolean(Number(data.scope.status))"
></el-switch>
</el-popconfirm> </el-popconfirm>
</template> </template>
<template v-slot:years="data"> <template v-slot:years="data">
...@@ -73,7 +76,12 @@ ...@@ -73,7 +76,12 @@
import TablePage from "@/components/Table/TablePage.vue"; import TablePage from "@/components/Table/TablePage.vue";
import TableOperation from "@/components/Table/TableOperation.vue"; import TableOperation from "@/components/Table/TableOperation.vue";
import { title, operates, operations } from "./config"; import { title, operates, operations } from "./config";
import { getCulturalRelicList, getRCDetailById } from "@/api/culturalRelic"; import {
getCulturalRelicList,
getRCDetailById,
deleteCultralRelic,
editCulturalRelic,
} from "@/api/culturalRelic";
import InfoEditDialog from "./components/InfoEditDialog"; import InfoEditDialog from "./components/InfoEditDialog";
import SearchBar from "@/components/SearchBar"; import SearchBar from "@/components/SearchBar";
...@@ -108,24 +116,24 @@ export default { ...@@ -108,24 +116,24 @@ export default {
type: "input", type: "input",
label: "文物名称", label: "文物名称",
}, },
{ // {
prop: "name", // prop: "level",
type: "input", // type: "select",
label: "文物级别", // label: "文物级别",
selectOptions: [], // selectOptions: [],
}, // },
{ {
prop: "status", prop: "status",
type: "select", type: "select",
label: "状态", label: "状态",
selectOptions: [ selectOptions: [
{ {
label: "在线", label: "已上架",
value: "true", value: "1",
}, },
{ {
label: "离线", label: "已下架",
value: "false", value: "0",
}, },
], ],
}, },
...@@ -163,7 +171,19 @@ export default { ...@@ -163,7 +171,19 @@ export default {
dict(value) { dict(value) {
if (value) { if (value) {
this.dict = value; this.dict = value;
this.culturalLevel = []; // let culturalLevel = { ...this.dict.cultural_relic_level };
// let options = [];
// for (const key in culturalLevel) {
// let obj = {};
// obj["label"] = culturalLevel[key];
// obj["value"] = key;
// options.push(obj);
// }
// this.searchConfig.map((item) => {
// if (item.prop == "level") {
// item.selectOptions = options;
// }
// });
} }
}, },
}, },
...@@ -179,7 +199,7 @@ export default { ...@@ -179,7 +199,7 @@ export default {
}, },
getStatusTitle(status) { getStatusTitle(status) {
return (status) => { return (status) => {
if (status) { if (Number(status)) {
return "是否确定要下架?"; return "是否确定要下架?";
} else { } else {
return "是否确定要上架?"; return "是否确定要上架?";
...@@ -192,13 +212,18 @@ export default { ...@@ -192,13 +212,18 @@ export default {
}, },
methods: { methods: {
async search(form) { async search(form) {
console.log(form);
var params = { var params = {
page: this.list.current, page: this.list.current,
limit: this.list.size, limit: this.list.size,
...form, ...form,
}; };
if (!params.level) {
delete params.level;
}
if (params.status == "") {
delete params.status;
}
console.log("params", params);
let res = await getCulturalRelicList(params); let res = await getCulturalRelicList(params);
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
...@@ -207,6 +232,7 @@ export default { ...@@ -207,6 +232,7 @@ export default {
reset() { reset() {
console.log("reset"); console.log("reset");
this.loadData();
}, },
// 加载表格数据 // 加载表格数据
...@@ -230,22 +256,34 @@ export default { ...@@ -230,22 +256,34 @@ export default {
case "view": case "view":
break; break;
case "edit": case "edit":
// 查询接口,并复制给form let detailRes = await getRCDetailById({ crId: row.crId });
const { crId } = row; if (detailRes.code == 0) {
this.loading = true; this.form = detailRes.data;
let res = await getRCDetailById({ crId });
if (res.code == 0) {
this.loading = false;
this.form = res.data;
this.drawerVisible = true; this.drawerVisible = true;
} }
break; break;
// case "delete": case "delete":
// break; let deleteRes = await deleteCultralRelic([row.crId]);
if (deleteRes.code == 0) {
this.$message.success("删除成功!");
this.loadData();
}
break;
} }
}, },
handleChangeStatus(status) { async handleChangeStatus(row) {
console.log("status", status); console.log("status", row);
const { status } = row;
let newStatus = status === "0" ? "1" : "0";
const params = {
...row,
status: newStatus,
};
let res = await editCulturalRelic(params);
if (res.code == 0) {
this.loadData();
this.$message.success("修改成功!");
}
}, },
// 多选 // 多选
handleSelectionChange(val) { handleSelectionChange(val) {
......
<!-- -->
<template>
<div class="exhibiton-unit" ref="exhibitionUnit">
<el-tree
:data="treeData"
node-key="id"
default-expand-all
:expand-on-click-node="false"
>
<div class="exhibition-units-tree-node" slot-scope="{ node, data }">
<el-row :gutter="10">
<el-col :span="7">
<el-input
placeholder="展览单元(如:前言、第一单元)"
v-model="node.unit"
>
</el-input>
</el-col>
<el-col :span="7">
<el-input
placeholder="展览单元标题(如:单元的主题)"
v-model="node.title"
>
</el-input>
</el-col>
<el-col :span="7">
<el-input placeholder="展览单元介绍" v-model="node.intro">
</el-input>
</el-col>
<el-col :span="3" style="display: flex; align-items: center">
<div>
<i
class="el-icon-close delete"
@click="() => remove(node, data)"
></i>
<el-tooltip content="添加子节点" placement="top">
<i class="el-icon-plus plus" @click="() => append(data)"></i>
</el-tooltip>
</div>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="24" style="display: flex; flex-direction: column">
<div class="buttons">
<el-button
type="text"
@click.native="handleAddUnitImage(node, data)"
>
<div class="add-image">
<svg-icon icon-class="image" />
<span>添加单元图片</span>
</div>
</el-button>
<el-button
type="text"
@click.native="handleAddUnitVideo(node, data)"
>
<div class="add-image">
<svg-icon icon-class="video" />
<span>添加单元视频</span>
</div></el-button
>
</div>
</el-col>
<!-- <el-col :span="12">123</el-col> -->
</el-row>
<el-row :gutter="50">
<el-col :span="12">
<div>单元图片:</div>
<ManualUploader
:files="node.imagesVo"
:fileLimit="1"
:fileSize="50"
:fileType="['jpeg', 'jpg', 'png']"
listType="picture-card"
ref="images"
/>
</el-col>
<el-col :span="12">
<div>单元视频:</div>
<ManualUploader
:files="node.videosVo"
:fileLimit="1"
:fileSize="50"
:fileType="['mp4']"
listType="picture-card"
ref="videos"
/>
</el-col>
</el-row>
</div>
</el-tree>
</div>
</template>
<script>
import ManualUploader from "@/components/Uploader/ManualUploader.vue";
export default {
components: {
ManualUploader,
},
props: {
exhibitionUnits: {
type: Array,
default: () => [],
},
},
computed: {
treeData() {
let exhibitionUnits = [...this.exhibitionUnits];
exhibitionUnits.map((item) => {
if (item.imagesVo && item.imagesVo.length > 0) {
} else {
item.imagesVo = [];
}
if (item.VideosVo && item.VideosVo.length > 0) {
} else {
item.VideosVo = [];
}
});
return exhibitionUnits;
},
},
data() {
return {};
},
mounted() {},
methods: {
append(data) {
const newChild = {
unit: "",
title: "",
intro: "",
showImageUploader: false,
showVideoUploader: false,
children: [],
};
if (!data.children) {
this.$set(data, "children", []);
}
data.children.push(newChild);
},
remove(node, data) {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex((d) => d.id === data.id);
children.splice(index, 1);
},
handleAddUnitImage(node, data) {
console.log("node", node);
console.log("data", data);
},
handleAddUnitVideo(node, data) {},
},
};
</script>
<style lang="scss" scoped>
.exhibition-units-tree-node {
display: flex;
width: 100%;
flex-direction: column;
}
::v-deep .el-tree-node__content {
// padding: 10px;
// min-height: 140px;
height: auto;
padding: 10px;
display: flex;
align-items: center;
}
.plus {
font-size: 20px;
font-weight: bold;
color: #409eff;
transition: all ease 0.5s;
padding: 4px;
border-radius: 4px;
margin-left: 10px;
&:hover {
background-color: rgba($color: #000000, $alpha: 0.05);
//
}
}
.delete {
font-size: 20px;
font-weight: bold;
color: #f56c6c;
transition: all ease 0.5s;
padding: 4px;
border-radius: 4px;
margin-left: 10px;
&:hover {
background-color: rgba($color: #000000, $alpha: 0.05);
//
}
}
.add-image {
display: flex;
align-items: center;
.svg-icon {
width: 24px;
height: 24px;
color: #409eff;
margin-left: 10px;
padding: 4px;
border-radius: 4px;
box-sizing: border-box;
// &:hover {
// background-color: rgba($color: #000000, $alpha: 0.05);
// //
// }
}
}
</style>
...@@ -13,14 +13,20 @@ export const title = [{ ...@@ -13,14 +13,20 @@ export const title = [{
prop: "type", prop: "type",
label: "展览类型", label: "展览类型",
columnAlign: 'center', columnAlign: 'center',
isDisplayType:true
}, },
{ {
prop: "depName", prop: "depName",
label: "展览单位", label: "展览单位",
columnAlign: 'center', columnAlign: 'center',
isDept: true
}, },
{
prop: "regionName",
label: "所在地区",
columnAlign: 'center',
},
{ {
prop: "faceImage", prop: "faceImage",
label: "封面", label: "封面",
...@@ -29,11 +35,11 @@ export const title = [{ ...@@ -29,11 +35,11 @@ export const title = [{
width:130 width:130
}, },
{ // {
prop: "intro", // prop: "intro",
label: "展览介绍", // label: "展览介绍",
columnAlign: 'center', // columnAlign: 'center',
}, // },
// { // {
// prop: "literature", // prop: "literature",
...@@ -56,11 +62,6 @@ export const title = [{ ...@@ -56,11 +62,6 @@ export const title = [{
label: "浏览量", label: "浏览量",
columnAlign: 'center', columnAlign: 'center',
}, },
{
prop: "regionCode",
label: "所在地区",
columnAlign: 'center',
},
{ {
prop: "remark", prop: "remark",
...@@ -78,12 +79,12 @@ export const title = [{ ...@@ -78,12 +79,12 @@ export const title = [{
label: "模板主题", label: "模板主题",
columnAlign: 'center', columnAlign: 'center',
}, },
{ // {
prop: "images", // prop: "images",
label: "展览图片", // label: "展览图片",
columnAlign: 'center', // columnAlign: 'center',
isImages: true // isImages: true
}, // },
// { // {
// prop: "audios", // prop: "audios",
// label: "展览音频", // label: "展览音频",
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<div class="app-container"> <div class="app-container">
<div class="top-bar"> <div class="top-bar">
<SearchBar :config="searchConfig" @search="search" @reset="reset" /> <SearchBar :config="searchConfig" @search="search" @reset="reset" />
<el-button type="primary" @click.native="handleOperation({type:'add'})"> <el-button
type="primary"
@click.native="handleOperation({ type: 'add' })"
>
<i class="el-icon-s-promotion"></i> <i class="el-icon-s-promotion"></i>
发布</el-button 发布</el-button
> >
...@@ -17,11 +20,14 @@ ...@@ -17,11 +20,14 @@
:title="getStatusTitle(data.scope.status)" :title="getStatusTitle(data.scope.status)"
@confirm="handleChangeStatus(data.scope.status)" @confirm="handleChangeStatus(data.scope.status)"
> >
<el-switch slot="reference" :value="data.scope.status"></el-switch> <el-switch
slot="reference"
:value="Boolean(Number(data.scope.status))"
></el-switch>
</el-popconfirm> </el-popconfirm>
</template> </template>
<template v-slot:type="data"> <template v-slot:displayType="data">
{{ displayTypes[data.scope.type] }} {{ dict.display_type[data.scope.type] }}
</template> </template>
<template v-slot:faceImage="data"> <template v-slot:faceImage="data">
<img <img
...@@ -54,6 +60,7 @@ ...@@ -54,6 +60,7 @@
>查看音频</span >查看音频</span
> >
</template> </template>
<template v-slot:operates="scope"> <template v-slot:operates="scope">
<TableOperation <TableOperation
:operations="tableOperations" :operations="tableOperations"
...@@ -97,7 +104,7 @@ ...@@ -97,7 +104,7 @@
import TablePage from "@/components/Table/TablePage.vue"; import TablePage from "@/components/Table/TablePage.vue";
import TableOperation from "@/components/Table/TableOperation.vue"; import TableOperation from "@/components/Table/TableOperation.vue";
import { title, operates, operations } from "./config"; import { title, operates, operations } from "./config";
import { getList } from "@/api/display"; import { getList,deleteDisplay } from "@/api/display";
import InfoEditDialog from "./components/InfoEditDialog"; import InfoEditDialog from "./components/InfoEditDialog";
import PreviewDialog from "./components/PreviewDialog"; import PreviewDialog from "./components/PreviewDialog";
import SearchBar from "@/components/SearchBar"; import SearchBar from "@/components/SearchBar";
...@@ -125,7 +132,7 @@ export default { ...@@ -125,7 +132,7 @@ export default {
}, },
searchConfig: [ searchConfig: [
{ {
prop: "name", prop: "title",
type: "input", type: "input",
label: "展览名称", label: "展览名称",
}, },
...@@ -135,12 +142,12 @@ export default { ...@@ -135,12 +142,12 @@ export default {
label: "状态", label: "状态",
selectOptions: [ selectOptions: [
{ {
label: "线", label: "已上线",
value: "true", value: "1",
}, },
{ {
label: "线", label: "已下线",
value: "false", value: "0",
}, },
], ],
}, },
...@@ -171,16 +178,16 @@ export default { ...@@ -171,16 +178,16 @@ export default {
displayTypes: {}, displayTypes: {},
}; };
}, },
// watch: { watch: {
// dict(value) { dict(value) {
// if (value) { if (value) {
this.dict = value;
// // value.display_type.map((item) => { // value.display_type.map((item) => {
// // this.displayTypes[item.value] = item.label; // this.displayTypes[item.value] = item.label;
// // }); // });
// } }
// }, },
// }, },
computed: { computed: {
tableTitle() { tableTitle() {
return title; return title;
...@@ -193,7 +200,7 @@ export default { ...@@ -193,7 +200,7 @@ export default {
}, },
getStatusTitle(status) { getStatusTitle(status) {
return (status) => { return (status) => {
if (status) { if (Number(status)) {
return "是否确定要下架?"; return "是否确定要下架?";
} else { } else {
return "是否确定要上架?"; return "是否确定要上架?";
...@@ -216,12 +223,14 @@ export default { ...@@ -216,12 +223,14 @@ export default {
limit: this.list.size, limit: this.list.size,
...form, ...form,
}; };
if (params.status == "") {
delete params.status;
}
let res = await getList(params); let res = await getList(params);
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
} }
}, },
reset() { reset() {
this.loadData(); this.loadData();
console.log("reset"); console.log("reset");
...@@ -239,8 +248,8 @@ export default { ...@@ -239,8 +248,8 @@ export default {
this.list = res.data; this.list = res.data;
} }
}, },
handleOperation(value, row) { async handleOperation(value, row) {
console.log("handleOperation", value, row); // console.log("handleOperation", value, row);
switch (value.type) { switch (value.type) {
case "add": case "add":
this.editDialogVisible = true; this.editDialogVisible = true;
...@@ -251,8 +260,14 @@ export default { ...@@ -251,8 +260,14 @@ export default {
this.form = JSON.parse(JSON.stringify(row)); this.form = JSON.parse(JSON.stringify(row));
this.editDialogVisible = true; this.editDialogVisible = true;
break; break;
// case "delete": case "delete":
// break; // console.log(row.exhibitionId);
let deleteRes = await deleteDisplay([row.exhibitionId])
if (deleteRes.code===0) {
this.loadData()
this.$message.success('删除成功!')
}
break;
} }
}, },
handleChangeStatus(status) { handleChangeStatus(status) {
...@@ -264,10 +279,16 @@ export default { ...@@ -264,10 +279,16 @@ export default {
}, },
// 改变页容量 // 改变页容量
handleSizeChange() {}, handleSizeChange(value) {
this.list.size = value;
this.loadData();
},
// 改变当前显示页 // 改变当前显示页
handleCurrentChange() {}, handleCurrentChange(value) {
this.list.current = value;
this.loadData();
},
// 搜索 // 搜索
onSubmitSearch() { onSubmitSearch() {
...@@ -276,7 +297,7 @@ export default { ...@@ -276,7 +297,7 @@ export default {
// 关闭Dialog // 关闭Dialog
handleClose() { handleClose() {
this.editDialogVisible = false; this.editDialogVisible = false;
this.form={} this.form = {};
}, },
// 关闭预览图片 // 关闭预览图片
closeImgViewer() { closeImgViewer() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论