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

修改首页和布展单元

上级 7a64f999
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"dependencies": { "dependencies": {
"axios": "0.18.1", "axios": "0.18.1",
"core-js": "3.6.5", "core-js": "3.6.5",
"echarts": "^5.3.3",
"element-ui": "2.13.2", "element-ui": "2.13.2",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
......
...@@ -37,6 +37,8 @@ export default { ...@@ -37,6 +37,8 @@ export default {
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}, },
isDashboard(route) { isDashboard(route) {
const name = route && route.name const name = route && route.name
......
<template>
<div :id="id" :class="className" :style="{ height: height, width: width }" />
</template>
<script>
// import tdTheme from './theme.json' // 引入默认主题
import resizeMixins from "@/utils/resizeMixin";
// import '../map/fujian.js'
export default {
name: 'echart',
mixins: [resizeMixins],
props: {
className: {
type: String,
default: 'chart'
},
id: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '2.5rem'
},
options: {
type: Object,
default: ()=>({})
}
},
data () {
return {
chart: null
}
},
watch: {
options: {
handler (options) {
// 设置true清空echart缓存
this.chart.setOption(options, true)
},
deep: true
}
},
mounted () {
// this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
this.initChart();
},
methods: {
initChart () {
// 初始化echart
this.chart = this.$echarts.init(this.$el)
this.$emit('myCharts', this.chart) // 把实例丢出来
this.chart.setOption(this.options, true)
}
}
}
</script>
<style>
</style>
\ No newline at end of file
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
// 大小限制(MB) // 大小限制(MB)
fileSize: { fileSize: {
type: Number, type: Number,
default: 5, default: 50,
}, },
// 文件类型, 例如["doc", "xls", "ppt", "txt", "pdf"] // 文件类型, 例如["doc", "xls", "ppt", "txt", "pdf"]
fileType: { fileType: {
......
...@@ -18,7 +18,11 @@ import { ...@@ -18,7 +18,11 @@ import {
getFullUrl getFullUrl
} from '@/utils/index' } from '@/utils/index'
import * as echarts from 'echarts';
Vue.prototype.$getFullUrl = getFullUrl Vue.prototype.$getFullUrl = getFullUrl
Vue.prototype.$echarts = echarts
Vue.use(ElementUI) Vue.use(ElementUI)
......
// 混入代码 resize-mixins.js
import { Debounce } from '@/utils';
const resizeChartMethod = '$__resizeChartMethod';
export default {
data() {
// 在组件内部将图表 init 的引用映射到 chart 属性上
return {
chart: null,
};
},
created() {
window.addEventListener('resize', this[resizeChartMethod], false);
},
activated() {
// 防止 keep-alive 之后图表变形
if (this.chart) {
this.chart.resize()
}
},
beforeDestroy() {
window.removeEventListener('reisze', this[resizeChartMethod]);
},
methods: {
// 防抖函数来控制 resize 的频率
[resizeChartMethod]: Debounce(function() {
if (this.chart) {
this.chart.resize();
}
}, 300),
},
};
...@@ -120,14 +120,14 @@ ...@@ -120,14 +120,14 @@
v-if="!treeData.length > 0" v-if="!treeData.length > 0"
type="primary" type="primary"
icon="el-icon-circle-plus-outline" icon="el-icon-circle-plus-outline"
@click="handleAddUnit" @click="handleAddUnit('manual')"
size="small" size="small"
>手动添加展览单元</el-button >手动添加展览单元</el-button
> >
<el-button <el-button
v-if="!treeData.length > 0" v-if="!treeData.length > 0"
type="success" type="success"
@click="handleAddUnit" @click="handleAddUnit('word')"
size="small" size="small"
> >
<svg-icon icon-class="word"></svg-icon> <svg-icon icon-class="word"></svg-icon>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
<el-button <el-button
v-if="!treeData.length > 0" v-if="!treeData.length > 0"
type="success" type="success"
@click="handleAddUnit" @click="handleAddUnit('excel')"
size="small" size="small"
> >
<svg-icon icon-class="excel"></svg-icon> <svg-icon icon-class="excel"></svg-icon>
...@@ -338,19 +338,26 @@ export default { ...@@ -338,19 +338,26 @@ export default {
children.splice(index, 1); children.splice(index, 1);
}, },
handleAddUnit() { handleAddUnit(type) {
let obj = { switch (type) {
euId: 1, //后期去掉 case "manual":
unit: "", //单元名称,如前言、第一单元,暂时忽略 let obj = {
title: "单元标题", //单元标题,类似主题名称 euId: 1, //后期去掉
intro: "", //单元介绍 unit: "", //单元名称,如前言、第一单元,暂时忽略
images: "", //图片id集合 title: "单元标题", //单元标题,类似主题名称
videos: "", //视频id集合 intro: "", //单元介绍
crIds: [], //关联文物集合 images: "", //图片id集合
// showMediaUploader: false, videos: "", //视频id集合
}; crIds: [], //关联文物集合
this.$set(this.treeData, 0, obj); // showMediaUploader: false,
this.currentData = this.treeData[0]; };
this.$set(this.treeData, 0, obj);
this.currentData = this.treeData[0];
break;
default:
this.$message.info('该功能仍在开发中,敬请期待')
break;
}
}, },
//失去焦点事件 //失去焦点事件
...@@ -483,7 +490,7 @@ export default { ...@@ -483,7 +490,7 @@ export default {
.ql-snow .ql-tooltip[data-mode="video"]::before { .ql-snow .ql-tooltip[data-mode="video"]::before {
content: "请输入视频地址:"; content: "请输入视频地址:";
} }
.ql-snow .ql-picker{ .ql-snow .ql-picker {
height: 40px; height: 40px;
} }
.ql-snow .ql-picker.ql-size .ql-picker-label::before, .ql-snow .ql-picker.ql-size .ql-picker-label::before,
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="展览介绍" :label-width="formLabelWidth"> <el-form-item label="展览介绍" :label-width="formLabelWidth">
<el-input <!-- <el-input
type="textarea" type="textarea"
placeholder="请输入展览介绍" placeholder="请输入展览介绍"
v-model="dialogForm.intro" v-model="dialogForm.intro"
...@@ -90,7 +90,13 @@ ...@@ -90,7 +90,13 @@
show-word-limit show-word-limit
rows="6" rows="6"
> >
</el-input> </el-input> -->
<quill-editor
ref="myQuillEditor"
v-model="dialogForm.intro"
:options="editorOption"
class=".editor"
/>
</el-form-item> </el-form-item>
<el-form-item label="展览封面" :label-width="formLabelWidth"> <el-form-item label="展览封面" :label-width="formLabelWidth">
<ManualUploader <ManualUploader
...@@ -229,11 +235,13 @@ import ExhibitionUnit from "./ExhibitionUnit.vue"; ...@@ -229,11 +235,13 @@ import ExhibitionUnit from "./ExhibitionUnit.vue";
import { upload, 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 { quillEditor } from "vue-quill-editor";
export default { export default {
name: "InfoEditDialog", name: "InfoEditDialog",
components: { components: {
ManualUploader, ManualUploader,
ExhibitionUnit, ExhibitionUnit,
quillEditor
// PageSelect, // PageSelect,
}, },
props: { props: {
...@@ -339,13 +347,25 @@ export default { ...@@ -339,13 +347,25 @@ export default {
immediate: true, immediate: true,
}, },
}, },
async created() {
await this.$store.dispatch("dict/getDictList", [
"display_type",
"display_character",
]);
},
data() { data() {
// 工具栏配置
const toolbarOptions = [
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 -----['bold', 'italic', 'underline', 'strike']
["blockquote", "code-block"], // 引用 代码块-----['blockquote', 'code-block']
[{ header: 1 }, { header: 2 }], // 1、2 级标题-----[{ header: 1 }, { header: 2 }]
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表-----[{ list: 'ordered' }, { list: 'bullet' }]
[{ script: "sub" }, { script: "super" }], // 上标/下标-----[{ script: 'sub' }, { script: 'super' }]
[{ indent: "-1" }, { indent: "+1" }], // 缩进-----[{ indent: '-1' }, { indent: '+1' }]
[{ direction: "rtl" }], // 文本方向-----[{'direction': 'rtl'}]
[{ size: ["small", false, "large", "huge"] }], // 字体大小-----[{ size: ['small', false, 'large', 'huge'] }]
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题-----[{ header: [1, 2, 3, 4, 5, 6, false] }]
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色-----[{ color: [] }, { background: [] }]
[{ font: [] }], // 字体种类-----[{ font: [] }]
[{ align: [] }], // 对齐方式-----[{ align: [] }]
["clean"], // 清除文本格式-----['clean']
["image", "video"], // 链接、图片、视频-----['link', 'image', 'video']
];
return { return {
dialogForm: { dialogForm: {
...this.form, ...this.form,
...@@ -366,8 +386,26 @@ export default { ...@@ -366,8 +386,26 @@ export default {
videos: [], videos: [],
audios: [], audios: [],
pageSelectUrl: "/api/bizCulturalRelic/listByPage", pageSelectUrl: "/api/bizCulturalRelic/listByPage",
//富文本编辑器配置
editorOption: {
// 富文本编辑器配置
modules: {
//工具栏定义的
toolbar: toolbarOptions,
},
//主题
theme: "snow",
placeholder: "请输入单元介绍",
},
}; };
}, },
async created() {
await this.$store.dispatch("dict/getDictList", [
"display_type",
"display_character",
]);
},
methods: { methods: {
// 关联文献查询 // 关联文献查询
searchLiterature(queryString) { searchLiterature(queryString) {
...@@ -653,14 +691,18 @@ export default { ...@@ -653,14 +691,18 @@ export default {
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.displayCharacter = 1; //传布展 params.displayCharacter = 1; //传布展
let res = await addDisplay(params); addDisplay(params)
.then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success("提交成功!"); this.$message.success("提交成功!");
this.loading = false; this.loading = false;
this.$emit("refresh"); this.$emit("refresh");
this.reload(); this.reload();
} }
})
.catch((err) => {
this.loading = false;
});
} else { } else {
const { const {
exhibitionId, exhibitionId,
...@@ -707,14 +749,25 @@ export default { ...@@ -707,14 +749,25 @@ export default {
}; };
// return; // return;
let res = await editDisplay(params); editDisplay(params)
let deleteRes = await deleteFiles(deleteFileArr); .then(async (res) => {
if (res.code == 0 && deleteRes.code == 0) { let deleteRes;
this.$message.success("提交成功!"); console.log(res);
this.loading = false; // return
this.$emit("refresh"); if (deleteFileArr.length > 0) {
this.reload(); await deleteFiles(deleteFileArr);
} }
if (res.code == 0) {
this.$message.success("提交成功!");
this.$emit("refresh");
this.reload();
this.loading = false;
}
})
.catch((err) => {
console.log("err222222", err);
this.loading = false;
});
} }
// } // }
......
export const title = [{
prop: "name",
label: "名称",
columnAlign: 'center',
width:120
},
{
prop: "unit",
label: "馆藏单位/展览单位",
columnAlign: 'center',
},
{
prop: "regionName",
label: "所在地区",
columnAlign: 'center',
},
{
prop: "dj",
label: "点击量",
columnAlign: 'center',
},
{
prop: "dz",
label: "点赞量",
columnAlign: 'center',
},
{
prop: "sc",
label: "收藏量",
columnAlign: 'center',
},
]
差异被折叠。
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<script> <script>
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 } from "./config"; import { title } from "./config";
import { getLogList } from "@/api/log"; import { getLogList } from "@/api/log";
import SearchBar from "@/components/SearchBar"; import SearchBar from "@/components/SearchBar";
......
...@@ -31,7 +31,8 @@ module.exports = { ...@@ -31,7 +31,8 @@ module.exports = {
lintOnSave: false, lintOnSave: false,
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
host: '172.24.100.18', // host: '172.24.100.18',
host:'127.0.0.1',
port: port, port: port,
open: true, open: true,
overlay: { overlay: {
...@@ -40,15 +41,16 @@ module.exports = { ...@@ -40,15 +41,16 @@ module.exports = {
}, },
proxy: { proxy: {
'/api': { '/api': {
target: 'http://192.168.1.230:9566/api', // target: 'http://192.168.1.230:9566/api',
// target:'http://222.85.214.245:9066/api', target:'http://222.85.214.245:9566/api',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '' '^/api': ''
} }
}, },
'/files': { '/files': {
target: 'http://192.168.1.230:9563/files', // target: 'http://192.168.1.230:9563/files',
target: 'http://222.85.214.245:9563/files',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/files': '' '^/files': ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论