|
@@ -26,7 +26,7 @@
|
|
@click="cutLeft(item.id,item.type)"
|
|
@click="cutLeft(item.id,item.type)"
|
|
>
|
|
>
|
|
<span :title="item.name">{{ item.name }}</span>
|
|
<span :title="item.name">{{ item.name }}</span>
|
|
- <div class="inco" v-if="item.id !== 1 && item.id !== 2 && item.id !== 3">
|
|
|
|
|
|
+ <div class="inco" v-if="item.id !== 4 && item.id !== 5">
|
|
<i
|
|
<i
|
|
@click="moduleEdit(item.id)"
|
|
@click="moduleEdit(item.id)"
|
|
title="编辑"
|
|
title="编辑"
|
|
@@ -91,19 +91,17 @@
|
|
<span class="table_name" :title="row.name">{{ row.name }}</span>
|
|
<span class="table_name" :title="row.name">{{ row.name }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="封面图片" width="120">
|
|
|
|
|
|
+ <el-table-column label="内容简介" width="250">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
- <img
|
|
|
|
- class="table_img"
|
|
|
|
- :src="baseURL + row.thumb"
|
|
|
|
- alt=""
|
|
|
|
- :onerror="defaultImg"
|
|
|
|
- />
|
|
|
|
|
|
+ <span class="table_name" :title="row.description">{{ row.description }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="visit" label="阅读" width="100">
|
|
<el-table-column prop="visit" label="阅读" width="100">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="creatorName" label="发布人">
|
|
|
|
|
|
+ <el-table-column label="发布人">
|
|
|
|
+ <template>
|
|
|
|
+ <span>超级管理员</span>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="createTime" label="发布时间" width="200">
|
|
<el-table-column prop="createTime" label="发布时间" width="200">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -180,9 +178,8 @@
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="row">
|
|
<span>展示类型:</span>
|
|
<span>展示类型:</span>
|
|
- <el-radio :disabled='!!dialogData.id' v-model="dialogData.type" label="model">实物模型</el-radio>
|
|
|
|
- <el-radio :disabled='!!dialogData.id' v-model="dialogData.type" label="img">专题图库</el-radio>
|
|
|
|
- <el-radio :disabled='!!dialogData.id' v-model="dialogData.type" label="video">视频档案</el-radio>
|
|
|
|
|
|
+ <el-radio :disabled='!!dialogData.id' v-model="dialogData.type" label="share">链接</el-radio>
|
|
|
|
+ <el-radio :disabled='!!dialogData.id' v-model="dialogData.type" label="info">图文</el-radio>
|
|
</div>
|
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button @click="btnX">取 消</el-button>
|
|
<el-button @click="btnX">取 消</el-button>
|
|
@@ -195,15 +192,12 @@
|
|
<script>
|
|
<script>
|
|
import axios from '@/utils/request'
|
|
import axios from '@/utils/request'
|
|
import {
|
|
import {
|
|
- goodsList,
|
|
|
|
- goodsRemove,
|
|
|
|
- goodsDisplay,
|
|
|
|
- goodsSort,
|
|
|
|
moduleList,
|
|
moduleList,
|
|
moduleSave,
|
|
moduleSave,
|
|
moduleRemove,
|
|
moduleRemove,
|
|
moduleDetail
|
|
moduleDetail
|
|
} from '@/apis/tab1'
|
|
} from '@/apis/tab1'
|
|
|
|
+import { newsList, newsRemove, newsDisplay, newsSort } from '@/apis/tab3'
|
|
export default {
|
|
export default {
|
|
name: 'tab3',
|
|
name: 'tab3',
|
|
components: {},
|
|
components: {},
|
|
@@ -214,16 +208,15 @@ export default {
|
|
dialogData: {
|
|
dialogData: {
|
|
module: 'news',
|
|
module: 'news',
|
|
name: '',
|
|
name: '',
|
|
- type: 'model'
|
|
|
|
|
|
+ type: 'share'
|
|
},
|
|
},
|
|
// 关于新增模块的数据↑
|
|
// 关于新增模块的数据↑
|
|
baseURL: '',
|
|
baseURL: '',
|
|
total: 0,
|
|
total: 0,
|
|
time: '',
|
|
time: '',
|
|
conLeftArr: [
|
|
conLeftArr: [
|
|
- { id: 1, name: '...' },
|
|
|
|
- { id: 2, name: '...' },
|
|
|
|
- { id: 3, name: '...' }
|
|
|
|
|
|
+ { id: 4, name: '...' },
|
|
|
|
+ { id: 5, name: '...' }
|
|
],
|
|
],
|
|
formData: {
|
|
formData: {
|
|
startTime: '',
|
|
startTime: '',
|
|
@@ -232,10 +225,10 @@ export default {
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
searchKey: '',
|
|
searchKey: '',
|
|
sortType: 0,
|
|
sortType: 0,
|
|
- moduleId: 1
|
|
|
|
|
|
+ moduleId: 4
|
|
},
|
|
},
|
|
// 当前选中的模块类型
|
|
// 当前选中的模块类型
|
|
- activeType: 'model',
|
|
|
|
|
|
+ activeType: 'share',
|
|
tableData: []
|
|
tableData: []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -264,7 +257,7 @@ export default {
|
|
const res = await moduleRemove(id)
|
|
const res = await moduleRemove(id)
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('删除成功')
|
|
this.$message.success('删除成功')
|
|
- const res2 = await moduleList('goods')
|
|
|
|
|
|
+ const res2 = await moduleList('news')
|
|
this.conLeftArr = res2.data
|
|
this.conLeftArr = res2.data
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
})
|
|
})
|
|
@@ -275,9 +268,9 @@ export default {
|
|
btnX () {
|
|
btnX () {
|
|
this.dialogShow = false
|
|
this.dialogShow = false
|
|
this.dialogData = {
|
|
this.dialogData = {
|
|
- module: 'goods',
|
|
|
|
|
|
+ module: 'news',
|
|
name: '',
|
|
name: '',
|
|
- type: 'model'
|
|
|
|
|
|
+ type: 'share'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async btnOk () {
|
|
async btnOk () {
|
|
@@ -288,7 +281,7 @@ export default {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('操作成功')
|
|
this.$message.success('操作成功')
|
|
this.btnX()
|
|
this.btnX()
|
|
- const res2 = await moduleList('goods')
|
|
|
|
|
|
+ const res2 = await moduleList('news')
|
|
this.conLeftArr = res2.data
|
|
this.conLeftArr = res2.data
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
},
|
|
},
|
|
@@ -300,42 +293,42 @@ export default {
|
|
this.time = ''
|
|
this.time = ''
|
|
this.formData.pageNum = 1
|
|
this.formData.pageNum = 1
|
|
this.formData.startTime = this.formData.endTime = ''
|
|
this.formData.startTime = this.formData.endTime = ''
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
},
|
|
},
|
|
// 点击查询
|
|
// 点击查询
|
|
searchBtn () {
|
|
searchBtn () {
|
|
this.formData.pageNum = 1
|
|
this.formData.pageNum = 1
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
},
|
|
},
|
|
// 排序
|
|
// 排序
|
|
async changeSort (val, id) {
|
|
async changeSort (val, id) {
|
|
// console.log(998, val, id)
|
|
// console.log(998, val, id)
|
|
if (Number(val) < 1) return this.$message.warning('不能小于1')
|
|
if (Number(val) < 1) return this.$message.warning('不能小于1')
|
|
- const res = await goodsSort(id, Number(val))
|
|
|
|
|
|
+ const res = await newsSort(id, Number(val))
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('操作成功')
|
|
this.$message.success('操作成功')
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
},
|
|
},
|
|
// 点击开关
|
|
// 点击开关
|
|
async changeSwit (val, id) {
|
|
async changeSwit (val, id) {
|
|
- const res = await goodsDisplay(id, val)
|
|
|
|
|
|
+ const res = await newsDisplay(id, val)
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('操作成功')
|
|
this.$message.success('操作成功')
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
},
|
|
},
|
|
// 分页器方法
|
|
// 分页器方法
|
|
currentChange (val) {
|
|
currentChange (val) {
|
|
// console.log('当前页改变了', val)
|
|
// console.log('当前页改变了', val)
|
|
this.formData.pageNum = val
|
|
this.formData.pageNum = val
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
},
|
|
},
|
|
sizeChange (val) {
|
|
sizeChange (val) {
|
|
// console.log('条数改变了', val)
|
|
// console.log('条数改变了', val)
|
|
this.formData.pageNum = 1
|
|
this.formData.pageNum = 1
|
|
this.formData.pageSize = val
|
|
this.formData.pageSize = val
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
},
|
|
},
|
|
// 点击删除
|
|
// 点击删除
|
|
delGoods (id) {
|
|
delGoods (id) {
|
|
@@ -345,10 +338,10 @@ export default {
|
|
type: 'warning'
|
|
type: 'warning'
|
|
})
|
|
})
|
|
.then(async () => {
|
|
.then(async () => {
|
|
- const res = await goodsRemove(id)
|
|
|
|
|
|
+ const res = await newsRemove(id)
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
this.$message.success('删除成功')
|
|
this.$message.success('删除成功')
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
} else this.$message.warning(res.msg)
|
|
} else this.$message.warning(res.msg)
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|
|
@@ -358,14 +351,14 @@ export default {
|
|
// 点击查看
|
|
// 点击查看
|
|
lookGood (id) {
|
|
lookGood (id) {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
- path: '/layout/tab1Look',
|
|
|
|
|
|
+ path: '/layout/tab3Look',
|
|
query: { Sid: id, id: this.formData.moduleId }
|
|
query: { Sid: id, id: this.formData.moduleId }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 点击编辑文物
|
|
// 点击编辑文物
|
|
editGood (id) {
|
|
editGood (id) {
|
|
- let temp = '/layout/tab1Add'
|
|
|
|
- if (this.activeType === 'img') temp = '/layout/tab1Add2'
|
|
|
|
|
|
+ let temp = '/layout/tab3Add'
|
|
|
|
+ if (this.activeType === 'info') temp = '/layout/tab3Add2'
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: temp,
|
|
path: temp,
|
|
query: { Sid: id, id: this.formData.moduleId }
|
|
query: { Sid: id, id: this.formData.moduleId }
|
|
@@ -373,8 +366,8 @@ export default {
|
|
},
|
|
},
|
|
// 点击新增文物
|
|
// 点击新增文物
|
|
addGood () {
|
|
addGood () {
|
|
- let temp = '/layout/tab1Add'
|
|
|
|
- if (this.activeType === 'img') temp = '/layout/tab1Add2'
|
|
|
|
|
|
+ let temp = '/layout/tab3Add'
|
|
|
|
+ if (this.activeType === 'info') temp = '/layout/tab3Add2'
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: temp,
|
|
path: temp,
|
|
query: { id: this.formData.moduleId, k: this.activeType }
|
|
query: { id: this.formData.moduleId, k: this.activeType }
|
|
@@ -384,7 +377,7 @@ export default {
|
|
cutLeft (id, type) {
|
|
cutLeft (id, type) {
|
|
if (id === this.formData.moduleId) return
|
|
if (id === this.formData.moduleId) return
|
|
this.formData.moduleId = id
|
|
this.formData.moduleId = id
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
// 把当前选中的模块类型保存
|
|
// 把当前选中的模块类型保存
|
|
this.activeType = type
|
|
this.activeType = type
|
|
},
|
|
},
|
|
@@ -422,8 +415,8 @@ export default {
|
|
return i
|
|
return i
|
|
},
|
|
},
|
|
// 封装获取列表的函数
|
|
// 封装获取列表的函数
|
|
- async goodsList (data) {
|
|
|
|
- const res = await goodsList(data)
|
|
|
|
|
|
+ async newsList (data) {
|
|
|
|
+ const res = await newsList(data)
|
|
this.total = res.data.total
|
|
this.total = res.data.total
|
|
this.tableData = res.data.records
|
|
this.tableData = res.data.records
|
|
// console.log(998, res)
|
|
// console.log(998, res)
|
|
@@ -432,7 +425,7 @@ export default {
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
async created () {
|
|
async created () {
|
|
// 获取模块列表
|
|
// 获取模块列表
|
|
- const res = await moduleList('goods')
|
|
|
|
|
|
+ const res = await moduleList('news')
|
|
this.conLeftArr = res.data
|
|
this.conLeftArr = res.data
|
|
|
|
|
|
// 获取服务器前缀地址
|
|
// 获取服务器前缀地址
|
|
@@ -446,7 +439,7 @@ export default {
|
|
if (v.id === temp) this.activeType = v.type
|
|
if (v.id === temp) this.activeType = v.type
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- this.goodsList(this.formData)
|
|
|
|
|
|
+ this.newsList(this.formData)
|
|
},
|
|
},
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
mounted () {},
|
|
mounted () {},
|