提交 f1bda61e authored 作者: 龙菲's avatar 龙菲

展览编辑增加左右切换按钮和回到顶部

上级 401ffcc5
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
return { return {
highImg: this.$getFullUrl(item.url), highImg: this.$getFullUrl(item.url),
lowImg: this.$getFullUrl(item.pressUrl), lowImg: this.$getFullUrl(item.pressUrl),
url: this.$getFullUrl(item.pressUrl), url: this.$getFullUrl(item.pressUrl),
// pressUrl:item.pressUrl, // pressUrl:item.pressUrl,
name: item.name, name: item.name,
fileId: item.fileId, fileId: item.fileId,
...@@ -105,9 +105,6 @@ export default { ...@@ -105,9 +105,6 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
}, },
advice(value) {
console.log(value);
},
}, },
computed: { computed: {
// 是否显示提示 // 是否显示提示
...@@ -262,4 +259,12 @@ export default { ...@@ -262,4 +259,12 @@ export default {
.disabled .el-upload--picture-card { .disabled .el-upload--picture-card {
display: none !important; display: none !important;
} }
// 上传抖动修复
.el-upload-list__item.is-ready {
display: none;
}
// 隐藏回显动画
.el-upload-list__item {
transition: none !important;
}
</style> </style>
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
:options="editorOption" :options="editorOption"
@change="onEditorChange($event)" @change="onEditorChange($event)"
class=".editor" class=".editor"
@click.native="handleEditAblequestion"
/> />
</template> </template>
...@@ -76,14 +77,25 @@ export default { ...@@ -76,14 +77,25 @@ export default {
theme: "snow", theme: "snow",
placeholder: "", placeholder: "",
}, },
qillInit: true,
}; };
}, },
mounted() {
this.$refs.myQuillEditor.quill.enable(false);
},
methods: { methods: {
onEditorChange() { onEditorChange() {
//内容改变事件 //内容改变事件
this.$emit("input", this.content); this.$emit("input", this.content);
}, },
handleEditAblequestion() {
if (this.qillInit) {
this.$refs.text.quill.enable(true);
console.log(111);
this.$refs.text.quill.focus();
this.qillInit = false;
}
},
}, },
}; };
</script> </script>
......
...@@ -13,7 +13,7 @@ const service = axios.create({ ...@@ -13,7 +13,7 @@ const service = axios.create({
// baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests // withCredentials: true, // send cookies when cross-domain requests
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
timeout: 5000, timeout: 10*1000,
}) })
// request interceptor // request interceptor
service.interceptors.request.use( service.interceptors.request.use(
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="exhibiton-unit" ref="exhibitionUnit"> <div class="exhibiton-unit" ref="exhibitionUnit">
<el-row class="tree-container" v-if="treeData.length > 0"> <el-row class="tree-container" v-if="treeData.length > 0">
<el-col :span="9"> <el-col :span="9">
<el-tree :data="treeData" node-key="euId" > <el-tree :data="treeData" node-key="euId">
<div class="exhibition-units-tree-node" slot-scope="{ node, data }"> <div class="exhibition-units-tree-node" slot-scope="{ node, data }">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<div class="title" @click="handleClickNode(node, data)"> <div class="title" @click="handleClickNode(node, data)">
...@@ -54,7 +54,12 @@ ...@@ -54,7 +54,12 @@
<el-input placeholder="请输入标题" v-model="currentData.title"> <el-input placeholder="请输入标题" v-model="currentData.title">
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="24" class="mg-bt20">
<VueQuillEditor
v-model="currentData.intro"
placeholder="请输入单元介绍"
/>
</el-col>
<el-col :span="24" class="mg-bt20"> <el-col :span="24" class="mg-bt20">
<el-select <el-select
v-model="currentData.crIds" v-model="currentData.crIds"
...@@ -66,9 +71,10 @@ ...@@ -66,9 +71,10 @@
:remote-method="searchCR" :remote-method="searchCR"
:loading="loading" :loading="loading"
style="width: 100%" style="width: 100%"
ref="remoteSelect"
> >
<el-option <el-option
v-for="item in CRList" v-for="item in crList"
:key="item.crId" :key="item.crId"
:label="item.name" :label="item.name"
:value="item.crId" :value="item.crId"
...@@ -76,46 +82,24 @@ ...@@ -76,46 +82,24 @@
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<!-- <el-input <div>单元图片:</div>
placeholder="请输入介绍" <ManualUploader
v-model="currentData.intro" v-model="currentData.imagesVo"
type="textarea" :files="currentData.imagesVo"
rows="4" :fileLimit="7"
maxlength="800" :fileSize="50"
show-word-limit :fileType="['jpeg', 'jpg', 'png']"
> listType="picture-card"
</el-input> --> :ref="'unit-images-' + currentData.euId"
<!-- <quill-editor />
ref="myQuillEditor"
v-model="currentData.intro"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)"
class=".editor"
/> -->
<VueQuillEditor v-model="currentData.intro" placeholder="请输入单元介绍"/>
</el-col> </el-col>
</el-row> </el-row>
<el-collapse-transition> <!-- <el-collapse-transition>
<el-row :gutter="50"> <el-row :gutter="50">
<el-col :span="24">
<div>单元图片:</div>
<ManualUploader
v-model="currentData.imagesVo"
:files="currentData.imagesVo"
:fileLimit="7"
:fileSize="50"
:fileType="['jpeg', 'jpg', 'png']"
listType="picture-card"
:ref="'unit-images-' + currentData.euId"
/>
</el-col>
</el-row> </el-row>
</el-collapse-transition> </el-collapse-transition> -->
<div class="next-prev"> <div class="next-prev">
<el-button <el-button
size="mini" size="mini"
...@@ -193,16 +177,28 @@ export default { ...@@ -193,16 +177,28 @@ export default {
if (arr.length > 0) { if (arr.length > 0) {
arr.forEach((item) => { arr.forEach((item) => {
if (item.culturalRelics && item.culturalRelics.length > 0) { if (item.culturalRelics && item.culturalRelics.length > 0) {
that.$set(that, "CRList", item.culturalRelics); that.$set(that, "crList", item.culturalRelics);
item.crIds = []; item.crIds = [];
item.culturalRelics.map((cr) => { item.culturalRelics.map((cr) => {
item.crIds.push(cr.crId); // item.crIds.push(cr.crId);
that.$nextTick(() => {
// console.log("remoteSelect", that.$refs["remoteSelect"]);
that.$refs["remoteSelect"].cachedOptions.push({
currentLabel: cr.name, // 当前绑定的数据的label
currentValue: cr.crId, // 当前绑定数据的value
label: cr.name, // 当前绑定的数据的label
value: cr.crId, // 当前绑定数据的value
});
}); });
item.imagesVo = item.imagesVo ? item.imagesVo : []; });
item.videosVo = item.videosVo ? item.videosVo : [];
} else { } else {
that.$set(that, "CRList", []); that.$set(that, "crList", []);
} }
item.imagesVo = item.imagesVo || [];
item.videosVo = item.videosVo || [];
if (item.children) { if (item.children) {
loopData(item.children); loopData(item.children);
} }
...@@ -217,11 +213,9 @@ export default { ...@@ -217,11 +213,9 @@ export default {
}, },
}, },
data() { data() {
return { return {
treeData: [], treeData: [],
CRList: [], //文物列表,关联文物使用 crList: [], //文物列表,关联文物使用
loading: false, loading: false,
imagesVo: [], imagesVo: [],
videosVo: [], videosVo: [],
...@@ -231,13 +225,12 @@ export default { ...@@ -231,13 +225,12 @@ export default {
}, },
methods: { methods: {
getUnitData() { getUnitData() {
return this.treeData; return this.treeData;
}, },
// 关联文献查询 // 关联文献查询
searchCR(queryString) { searchCR(queryString) {
if (!queryString.trim()) { if (!queryString.trim()) {
this.CRList = []; this.crList = [];
return; return;
} }
this.loading = true; this.loading = true;
...@@ -250,9 +243,9 @@ export default { ...@@ -250,9 +243,9 @@ export default {
this.loading = false; this.loading = false;
const res = await getCulturalRelicListPer(params); const res = await getCulturalRelicListPer(params);
if (res.code == 0) { if (res.code == 0) {
this.CRList = res.data.records; this.crList = res.data.records;
} else { } else {
this.CRList = []; this.crList = [];
this.$message.error(res.msg); this.$message.error(res.msg);
} }
}, 500); }, 500);
...@@ -433,7 +426,7 @@ export default { ...@@ -433,7 +426,7 @@ export default {
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
.title { .title {
width:200px; width: 200px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
...@@ -70,8 +70,11 @@ ...@@ -70,8 +70,11 @@
<InfoEditDialog <InfoEditDialog
:visible="editDialogVisible" :visible="editDialogVisible"
:form="form" :form="form"
:currentPageIds="currentPageIds"
@handleClose="handleClose" @handleClose="handleClose"
@refresh="loadData" @refresh="loadData"
@changeDisplay="reloadDisplay"
ref="InfoEditDialog"
/> />
<PreviewDialog <PreviewDialog
v-if="Object.keys(curPreviewObj).length > 0" v-if="Object.keys(curPreviewObj).length > 0"
...@@ -121,6 +124,7 @@ export default { ...@@ -121,6 +124,7 @@ export default {
import("element-ui/packages/image/src/image-viewer"), import("element-ui/packages/image/src/image-viewer"),
}, },
data() { data() {
let that = this;
return { return {
list: { list: {
record: [], record: [],
...@@ -181,6 +185,7 @@ export default { ...@@ -181,6 +185,7 @@ export default {
previewVideos: [], previewVideos: [],
displayTypes: {}, displayTypes: {},
curPreviewObj: {}, //当前预览的对象 curPreviewObj: {}, //当前预览的对象
currentPageIds: [], //当前的id数组,用于给详情页切换用
}; };
}, },
computed: { computed: {
...@@ -222,11 +227,13 @@ export default { ...@@ -222,11 +227,13 @@ export default {
let res = await getListPer(params); let res = await getListPer(params);
if (res.code == 0) { if (res.code == 0) {
this.list = res.data; this.list = res.data;
this.currentPageIds = this.list.records.map((item) => {
return item.exhibitionId;
});
} }
}, },
reset() { reset() {
this.loadData(); this.loadData();
console.log("reset");
}, },
// 加载表格数据 // 加载表格数据
...@@ -237,13 +244,14 @@ export default { ...@@ -237,13 +244,14 @@ export default {
}; };
let res = await getListPer(params); let res = await getListPer(params);
if (res.code == 0) { if (res.code == 0) {
console.log(res.data);
this.list = res.data; this.list = res.data;
this.currentPageIds = this.list.records.map((item) => {
return item.exhibitionId;
});
} }
}, },
async handleOperation(value, row) { async handleOperation(value, row) {
console.log(value, row);
switch (value.type) { switch (value.type) {
case "add": case "add":
this.editDialogVisible = true; this.editDialogVisible = true;
...@@ -270,6 +278,16 @@ export default { ...@@ -270,6 +278,16 @@ export default {
break; break;
} }
}, },
async reloadDisplay(exhibitionId) {
this.$refs.InfoEditDialog.submitLoading = true;
this.$refs.InfoEditDialog.loadingText = "加载中...";
let editRes = await getDisplayById({
exhibitionId,
});
this.form = editRes.data;
this.$refs.InfoEditDialog.submitLoading = false;
},
async handleChangeStatus(row) { async handleChangeStatus(row) {
const { status } = row; const { status } = row;
let newStatus = status === "0" ? "1" : "0"; let newStatus = status === "0" ? "1" : "0";
......
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
}, },
searchConfig: [ searchConfig: [
{ {
prop: "name", prop: "title",
type: "input", type: "input",
label: "文创名称", label: "文创名称",
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论