提交 876db43f authored 作者: 龙菲's avatar 龙菲

展览增加关联虚拟展厅字段

上级 6b90e618
...@@ -6,7 +6,6 @@ import { ...@@ -6,7 +6,6 @@ import {
getCulturalRelicList getCulturalRelicList
} from '@/api/culturalRelic' } from '@/api/culturalRelic'
import { import {
getLiteratureList,
getLtListPer getLtListPer
} from '@/api/literature' } from '@/api/literature'
...@@ -200,17 +199,14 @@ const actions = { ...@@ -200,17 +199,14 @@ const actions = {
/** /**
* 获取文献列表 * 获取文献列表
* @param {Boolean} hasPer 是否含有权限
* @param {params} params 分页或一些查询参数 * @param {params} params 分页或一些查询参数
* @returns {Promise} * @returns {Promise}
*/ */
getLtList({ getLtList({
commit commit
}, { },
hasPer,
params params
}) { ) {
if (hasPer) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getLtListPer(params).then(response => { getLtListPer(params).then(response => {
const { const {
...@@ -222,20 +218,6 @@ const actions = { ...@@ -222,20 +218,6 @@ const actions = {
reject(error) reject(error)
}) })
}) })
} else {
return new Promise((resolve, reject) => {
getLiteratureList(params).then(response => {
const {
data
} = response
commit('SET_CR_LIST', data.records)
resolve(response)
}).catch(error => {
reject(error)
})
})
}
}, },
} }
......
...@@ -35,6 +35,21 @@ ...@@ -35,6 +35,21 @@
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item
label="展览单位"
:label-width="formLabelWidth"
prop="deptId"
>
<el-cascader
style="width: 100%"
v-model="dialogForm.deptId"
:options="orgTreeData"
:props="optionProps"
placeholder="请选择展览单位"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="展览类型" :label-width="formLabelWidth"> <el-form-item label="展览类型" :label-width="formLabelWidth">
<el-select <el-select
v-model="dialogForm.type" v-model="dialogForm.type"
...@@ -51,21 +66,7 @@ ...@@ -51,21 +66,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item
label="展览单位"
:label-width="formLabelWidth"
prop="deptId"
>
<el-cascader
style="width: 100%"
v-model="dialogForm.deptId"
:options="orgTreeData"
:props="optionProps"
placeholder="请选择展览单位"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item <el-form-item
label="展览性质" label="展览性质"
:label-width="formLabelWidth" :label-width="formLabelWidth"
...@@ -172,6 +173,29 @@ ...@@ -172,6 +173,29 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关联虚拟展厅" :label-width="formLabelWidth">
<el-select
v-model="vrIds"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词搜索虚拟展厅"
:remote-method="searchVirtual"
:loading="loading"
style="width: 100%"
ref="virtualSelect"
clearable
>
<el-option
v-for="item in vrList"
:key="item.bvId"
:label="item.name"
:value="item.bvId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="是否上架" :label-width="formLabelWidth"> <el-form-item label="是否上架" :label-width="formLabelWidth">
<el-switch v-model="dialogForm.status"> </el-switch> <el-switch v-model="dialogForm.status"> </el-switch>
</el-form-item> </el-form-item>
...@@ -259,12 +283,11 @@ import { addDisplay, editDisplay } from "@/api/display"; ...@@ -259,12 +283,11 @@ import { addDisplay, editDisplay } from "@/api/display";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import ManualUploader from "@/components/Uploader/ManualUploader.vue"; import ManualUploader from "@/components/Uploader/ManualUploader.vue";
import ExhibitionUnit from "./ExhibitionUnit.vue"; import ExhibitionUnit from "./ExhibitionUnit.vue";
// import PageSelect from "@/components/PageSelect"; import { uploadV1 } from "@/utils/file";
import { upload, uploadV1 } from "@/utils/file";
import { themeTypeOptions } from "../contants"; import { themeTypeOptions } from "../contants";
import { deleteFiles } from "@/api/file"; import { deleteFiles } from "@/api/file";
import VueQuillEditor from "@/components/VueQuillEditor"; import VueQuillEditor from "@/components/VueQuillEditor";
import { getVirtualListPer } from "@/api/vitual";
export default { export default {
name: "InfoEditDialog", name: "InfoEditDialog",
components: { components: {
...@@ -285,12 +308,6 @@ export default { ...@@ -285,12 +308,6 @@ export default {
}, },
computed: { computed: {
...mapGetters(["userInfo", "dicts"]), ...mapGetters(["userInfo", "dicts"]),
dialogVisible: {
get: function () {
return this.visible;
},
set: function () {},
},
title() { title() {
if (this.dialogForm.exhibitionId) { if (this.dialogForm.exhibitionId) {
return "修改信息"; return "修改信息";
...@@ -303,6 +320,13 @@ export default { ...@@ -303,6 +320,13 @@ export default {
}, },
}, },
watch: { watch: {
visible: {
handler: function (value) {
this.dialogVisible = value;
},
deep: true,
immediate: true,
},
form: { form: {
handler: function (value) { handler: function (value) {
if (value) { if (value) {
...@@ -379,7 +403,19 @@ export default { ...@@ -379,7 +403,19 @@ export default {
} }
}); });
} }
// 回填文物
this.vrIds = [];
if (
this.dialogForm.virtualVo &&
this.dialogForm.virtualVo.length > 0
) {
this.vrList = this.dialogForm.virtualVo;
this.dialogForm.virtualVo.forEach((vr) => {
if (this.vrIds) {
this.vrIds.push(vr.bvId);
}
});
}
// 回填展览单位 // 回填展览单位
if (this.dialogForm.deptId) { if (this.dialogForm.deptId) {
this.dialogForm.deptId = [this.dialogForm.deptId]; this.dialogForm.deptId = [this.dialogForm.deptId];
...@@ -434,6 +470,8 @@ export default { ...@@ -434,6 +470,8 @@ export default {
literatureValues: [], //选中的文献列表 literatureValues: [], //选中的文献列表
crList: [], //文物列表 crList: [], //文物列表
crIds: [], //选中的文物列表 crIds: [], //选中的文物列表
vrList: [], //虚拟展厅列表
vrIds: [],
// showUnit: false, // showUnit: false,
faceImage: [], faceImage: [],
images: [], images: [],
...@@ -458,6 +496,7 @@ export default { ...@@ -458,6 +496,7 @@ export default {
intro: [{ required: true, message: "请填写展览介绍", trigger: "blur" }], intro: [{ required: true, message: "请填写展览介绍", trigger: "blur" }],
}, },
imagesAdvice: "", imagesAdvice: "",
dialogVisible: false,
}; };
}, },
async created() { async created() {
...@@ -467,7 +506,7 @@ export default { ...@@ -467,7 +506,7 @@ export default {
]); ]);
this.$store.dispatch("org/getMuseumTreeData", false).then((res) => { this.$store.dispatch("org/getMuseumTreeData", false).then((res) => {
// this.orgTreeData = res[0].children; //去掉根节点的文旅厅 // this.orgTreeData = res[0].children; //去掉根节点的文旅厅
this.orgTreeData =res this.orgTreeData = res;
}); });
}, },
...@@ -486,10 +525,7 @@ export default { ...@@ -486,10 +525,7 @@ export default {
}; };
setTimeout(async () => { setTimeout(async () => {
this.loading = false; this.loading = false;
const res = await this.$store.dispatch("dict/getLtList", { const res = await this.$store.dispatch("dict/getLtList", params);
hasPer: false,
params,
});
if (res.code == 0) { if (res.code == 0) {
this.literatureList = res.data.records; this.literatureList = res.data.records;
} else { } else {
...@@ -498,6 +534,33 @@ export default { ...@@ -498,6 +534,33 @@ export default {
} }
}, 500); }, 500);
}, },
// 关联虚拟展厅查询
searchVirtual(queryString) {
let that = this;
if (!queryString.trim()) {
that.vrList = [];
return;
}
that.loading = true;
const params = {
name: queryString,
page: "1",
limit: "100",
};
setTimeout(async () => {
// debugger
that.loading = false;
let res = await getVirtualListPer(params);
if (res.code == 0) {
that.vrList = res.data.records;
} else {
that.vrList = [];
that.$message.error(res.msg);
}
}, 500);
},
// 关联文物查询 // 关联文物查询
searchCR(queryString) { searchCR(queryString) {
let that = this; let that = this;
...@@ -769,7 +832,7 @@ export default { ...@@ -769,7 +832,7 @@ export default {
} }
let crIdArr = unit.crIds; let crIdArr = unit.crIds;
unit.crIds = crIdArr ? crIdArr.join(",") : ""; unit.crIds = crIdArr ? crIdArr.join(",") : "";
var deleteArr = ["euId", "isEditing"]; var deleteArr = ["euId"];
deleteArr.forEach((i) => { deleteArr.forEach((i) => {
if (unit[i]) { if (unit[i]) {
delete unit[i]; delete unit[i];
...@@ -795,6 +858,7 @@ export default { ...@@ -795,6 +858,7 @@ export default {
params.literature = this.literatureValues.join(","); params.literature = this.literatureValues.join(",");
params.status = this.dialogForm.status ? 1 : 0; params.status = this.dialogForm.status ? 1 : 0;
params.crIds = this.crIds.join(","); params.crIds = this.crIds.join(",");
params.bvIds = this.vrIds.join(",");
params.displayCharacter = 1; //传布展 params.displayCharacter = 1; //传布展
addDisplay(params) addDisplay(params)
.then((res) => { .then((res) => {
...@@ -834,6 +898,7 @@ export default { ...@@ -834,6 +898,7 @@ export default {
let literature = this.literatureValues.join(","); let literature = this.literatureValues.join(",");
let crIds = this.crIds.join(","); let crIds = this.crIds.join(",");
let bvIds = this.vrIds.join(",");
let status = this.dialogForm.status ? 1 : 0; let status = this.dialogForm.status ? 1 : 0;
// return; // return;
...@@ -855,6 +920,7 @@ export default { ...@@ -855,6 +920,7 @@ export default {
status, status,
literature, literature,
crIds, crIds,
bvIds,
displayCharacter, displayCharacter,
exhibitionUnits: unitData, exhibitionUnits: unitData,
}; };
...@@ -879,7 +945,7 @@ export default { ...@@ -879,7 +945,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.loadingText = "上传完毕"; this.loadingText = "上传完毕";
this.submitLoading = false; this.submitLoading = false;
this.$message.success("修改展览成功!"); this.$message.success("修改成功!");
}, 1000); }, 1000);
} }
}) })
......
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
</el-carousel> </el-carousel>
</div> </div>
</div> </div>
<!--展览单元 --> <!--展览单元 -->
<div <div
class="content-item display-detail_units" class="content-item display-detail_units"
......
...@@ -125,10 +125,7 @@ ...@@ -125,10 +125,7 @@
if (params.status == "") { if (params.status == "") {
delete params.status; delete params.status;
} }
const res = await this.$store.dispatch("dict/getLtList", { const res = await this.$store.dispatch("dict/getLtList", params);
hasPer: true,
params,
});
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
} }
...@@ -144,10 +141,7 @@ ...@@ -144,10 +141,7 @@
page: this.list.current, page: this.list.current,
limit: this.list.size, limit: this.list.size,
}; };
const res = await this.$store.dispatch("dict/getLtList", { const res = await this.$store.dispatch("dict/getLtList", params);
hasPer: true,
params,
});
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
} }
......
<template> <template>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="60%" width="50%"
style="height: 98%" style="height: 98%"
:before-close="handleClose" :before-close="handleClose"
top="5vh" top="5vh"
...@@ -154,16 +154,23 @@ export default { ...@@ -154,16 +154,23 @@ export default {
if (that.dialogForm.id) { if (that.dialogForm.id) {
that.status = Boolean(Number(that.dialogForm.status)); that.status = Boolean(Number(that.dialogForm.status));
// 回填封面 // 回填封面
if (this.dialogForm.faceImage) { if (
that.faceImage = [ this.dialogForm.faceImageUrl ||
this.dialogForm.faceImagePressUrl
) {
this.faceImage = [
{ {
name: this.dialogForm.name + "封面.png", name: "",
url: url: this.dialogForm.faceImageUrl || "",
pressUrl:
this.dialogForm.faceImagePressUrl || this.dialogForm.faceImagePressUrl ||
this.dialogForm.faceImageUrl, this.dialogForm.faceImageUrl ||
fileId: this.dialogForm.faceImage, "",
fileId: this.dialogForm.faceImage || "",
}, },
]; ];
} else {
this.faceImage = [];
} }
// 编辑状态下禁用当前所属地之下的节点 // 编辑状态下禁用当前所属地之下的节点
} }
......
...@@ -144,14 +144,23 @@ export default { ...@@ -144,14 +144,23 @@ export default {
console.log("that.dialogForm.", that.dialogForm); console.log("that.dialogForm.", that.dialogForm);
that.status = Boolean(Number(that.dialogForm.status)); that.status = Boolean(Number(that.dialogForm.status));
// 回填封面 // 回填封面
if (this.dialogForm.faceImage) { if (
that.faceImage = [ this.dialogForm.faceImageUrl ||
this.dialogForm.faceImagePressUrl
) {
this.faceImage = [
{ {
name: this.dialogForm.name + "封面.png", name: "",
url: this.dialogForm.faceImageUrl, url: this.dialogForm.faceImageUrl || "",
fileId: this.dialogForm.faceImage, pressUrl:
this.dialogForm.faceImagePressUrl ||
this.dialogForm.faceImageUrl ||
"",
fileId: this.dialogForm.faceImage || "",
}, },
]; ];
} else {
this.faceImage = [];
} }
} }
}, },
......
...@@ -172,7 +172,6 @@ export default { ...@@ -172,7 +172,6 @@ export default {
if (params.status == "") { if (params.status == "") {
delete params.status; delete params.status;
} }
console.log("params", params);
let res = await getVirtualListPer(params); let res = await getVirtualListPer(params);
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
...@@ -196,18 +195,15 @@ export default { ...@@ -196,18 +195,15 @@ export default {
}, },
loadOrgTree() { loadOrgTree() {
this.$store.dispatch("org/getMuseumTreeData", true).then((res) => { this.$store.dispatch("org/getMuseumTreeData", true).then((res) => {
this.orgTreeData = res[0].children; //去掉文旅厅根节点 // this.orgTreeData = res[0].children; //去掉文旅厅根节点
this.orgTreeData = res; //去掉文旅厅根节点
}); });
}, },
async handleOperation(value, row) { async handleOperation(value, row) {
console.log("handleOperation", value, row);
switch (value.type) { switch (value.type) {
case "add": case "add":
this.drawerVisible = true; this.drawerVisible = true;
break; break;
case "view":
// TODO:
break;
case "edit": case "edit":
this.form = row; this.form = row;
this.drawerVisible = true; this.drawerVisible = true;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论