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

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

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