全部栏目
-
-
-
- {{ node.label }}
+
+
+
+ {{ node.label }}
-
+
-
-
-
+
+
+
{{(page - 1) * pageSize + scope.$index + 1}}
-
-
-
-
+
+
+
+
{{ types.find(e => e.id === scope.row.typeId).name }}
-
-
-
-
-
-
+
+
+
+
+
+
{{ scope.row.isRelease ? '已发布' : '草稿' }}
-
+
-
+
-
+
- 预览
- 编辑
- 删除
-
+ 预览
+ 编辑
+ 删除
+
@@ -99,325 +197,325 @@ import util from '@/libs/util'
import { mapMutations } from 'vuex'
import ColumnConst from '@/const/column'
export default {
- data() {
- return {
- last: this.$route.query.last, // 是否直接跳到最后一页的文章(编辑文章的时候改了所属栏目,返回到列表后则需要跳到最后一页文章)
- types: ColumnConst.types,
- siteName: this.$store.state.content.site.siteName,
- columns: [],
- defaultProps: {
- value: 'id',
- label: 'columnName'
+ data () {
+ return {
+ last: this.$route.query.last, // 是否直接跳到最后一页的文章(编辑文章的时候改了所属栏目,返回到列表后则需要跳到最后一页文章)
+ types: ColumnConst.types,
+ siteName: this.$store.state.content.site.siteName,
+ columns: [],
+ defaultProps: {
+ value: 'id',
+ label: 'columnName'
+ },
+ field: 'title',
+ keywords: [
+ {
+ id: 'title',
+ name: '标题'
},
- field: 'title',
- keywords: [
- {
- id: 'title',
- name: '标题'
- },
- {
- id: 'founder',
- name: '录入人'
- },
- {
- id: 'column',
- name: '栏目'
- },
- {
- id: 'editor',
- name: '修改人'
- }
- ],
- keyword: '',
- list: [],
- page: 1,
- pageSize: 10,
- total: 0,
- modifiedTimeSort: '',
- publicationTimeSort: '',
- topSort: '',
- multipleSelection: [],
- originSettings: [],
- settings: [
- {
- name: '选择框',
- show: true
- },
- {
- name: '标题',
- show: true
- },
- {
- name: '栏目',
- show: true
- },
- {
- name: '所属分类',
- show: false
- },
- {
- name: '栏目类型',
- show: true
- },
- {
- name: '录入人',
- show: true
- },
- {
- name: '修改人',
- show: true
- },
- {
- name: '修改日期',
- show: true
- },
- {
- name: '发布日期',
- show: true
- },
- {
- name: '总浏览',
- show: true
- },
- {
- name: '状态',
- show: true
- },
- {
- name: '操作',
- show: true
- }
- ],
- originList: []
- };
- },
- watch: {
- keyword: function(val) {
- clearTimeout(this.searchTimer)
- this.searchTimer = setTimeout(() => {
- this.initData()
- }, 500)
- }
- },
- mounted() {
- this.$store.commit('user/setCrumbs', [
{
- name: '站点管理',
- route: '/site'
+ id: 'founder',
+ name: '录入人'
},
{
- name: '内容管理'
+ id: 'column',
+ name: '栏目'
},
{
- name: '文章管理'
+ id: 'editor',
+ name: '修改人'
}
- ])
- this.originSettings = JSON.parse(JSON.stringify(this.settings))
- this.getColumn()
- },
- methods: {
- ...mapMutations('content', [
- 'setColumn'
- ]),
- // 栏目树形
- getColumn() {
- this.$post(this.api.listWithTree, {
- siteId: this.$store.state.content.site.id,
- columnName: '',
- templateId: '',
- typeId : '',
- isSort: 1
- }).then(({ data }) => {
- this.columns = data
- this.$nextTick(() => {
- this.$refs.column.setCurrentKey(this.$route.query.columnId || data[0].id)
- this.getData()
- })
- }).catch(e => {})
- },
- // 文章列表
- getData() {
- const id = this.$refs.column.getCurrentKey()
- this.$router.push(`/article?columnId=${id}`).catch(e => {})
- const { keyword } = this
- const data = {
- siteId: this.$store.state.content.site.id,
- columnIds: [id],
- pageNum: this.page,
- pageSize: this.pageSize,
- topSort: this.topSort,
- title: this.field === 'title' ? keyword : '',
- founder: this.field === 'founder' ? keyword : '',
- column: this.field === 'column' ? keyword : '',
- editor: this.field === 'editor' ? keyword : ''
+ ],
+ keyword: '',
+ list: [],
+ page: 1,
+ pageSize: 10,
+ total: 0,
+ modifiedTimeSort: '',
+ publicationTimeSort: '',
+ topSort: '',
+ multipleSelection: [],
+ originSettings: [],
+ settings: [
+ {
+ name: '选择框',
+ show: true
+ },
+ {
+ name: '标题',
+ show: true
+ },
+ {
+ name: '栏目',
+ show: true
+ },
+ {
+ name: '所属分类',
+ show: false
+ },
+ {
+ name: '栏目类型',
+ show: true
+ },
+ {
+ name: '录入人',
+ show: true
+ },
+ {
+ name: '修改人',
+ show: true
+ },
+ {
+ name: '修改日期',
+ show: true
+ },
+ {
+ name: '发布日期',
+ show: true
+ },
+ {
+ name: '总浏览',
+ show: true
+ },
+ {
+ name: '状态',
+ show: true
+ },
+ {
+ name: '操作',
+ show: true
}
- if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort
- if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort
- this.$post(this.api.queryArticle, data).then(({ data }) => {
- data.records.map(e => {
- e.editing = false
- e.releaseTime = e.releaseTime.split(' ')[0]
- })
- this.originList = JSON.parse(JSON.stringify(data.records))
- this.list = data.records
- const total = +data.total
- this.total = total
- if (this.last) {
- let page = parseInt(total / 10)
- total % 10 && page++
- this.page = page
- this.last = ''
- this.getData()
- }
- }).catch(err => {})
- },
- // 重置栏位筛选
- resetColumns() {
- this.settings = JSON.parse(JSON.stringify(this.originSettings))
- },
- currentChange(val) {
- this.page = val
- this.getData()
- },
- handleSelectionChange(val) {
- this.multipleSelection = val
- },
- initData() {
- this.$refs.table.clearSelection()
- this.page = 1
- this.getData()
+ ],
+ originList: []
+ };
+ },
+ watch: {
+ keyword: function (val) {
+ clearTimeout(this.searchTimer)
+ this.searchTimer = setTimeout(() => {
+ this.initData()
+ }, 500)
+ }
+ },
+ mounted () {
+ this.$store.commit('user/setCrumbs', [
+ {
+ name: '站点管理',
+ route: '/site'
},
- // 排序提交
- submitSequence(row) {
- const { sequence } = row
- if (!sequence) return util.errorMsg('请输入排序')
- if (isNaN(sequence)) return util.errorMsg('请输入数字')
- this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${sequence > this.total ? this.total : sequence}`).then(res => {
- this.initData()
- }).catch(res => {})
+ {
+ name: '内容管理'
},
- // 编辑排序
- editSequence(row) {
- this.list.forEach(e => {
+ {
+ name: '文章管理'
+ }
+ ])
+ this.originSettings = JSON.parse(JSON.stringify(this.settings))
+ this.getColumn()
+ },
+ methods: {
+ ...mapMutations('content', [
+ 'setColumn'
+ ]),
+ // 栏目树形
+ getColumn () {
+ this.$post(this.api.listWithTree, {
+ siteId: this.$store.state.content.site.id,
+ columnName: '',
+ templateId: '',
+ typeId: '',
+ isSort: 1
+ }).then(({ data }) => {
+ this.columns = data
+ this.$nextTick(() => {
+ this.$refs.column.setCurrentKey(this.$route.query.columnId || data[0].id)
+ this.getData()
+ })
+ }).catch(e => { })
+ },
+ // 文章列表
+ getData () {
+ const id = this.$refs.column.getCurrentKey()
+ this.$router.push(`/article?columnId=${id}`).catch(e => { })
+ const { keyword } = this
+ const data = {
+ siteId: this.$store.state.content.site.id,
+ columnIds: [id],
+ pageNum: this.page,
+ pageSize: this.pageSize,
+ topSort: this.topSort,
+ title: this.field === 'title' ? keyword : '',
+ founder: this.field === 'founder' ? keyword : '',
+ column: this.field === 'column' ? keyword : '',
+ editor: this.field === 'editor' ? keyword : ''
+ }
+ if (this.modifiedTimeSort !== '') data.modifiedTimeSort = this.modifiedTimeSort
+ if (this.publicationTimeSort !== '') data.publicationTimeSort = this.publicationTimeSort
+ this.$post(this.api.queryArticle, data).then(({ data }) => {
+ data.records.map(e => {
e.editing = false
+ e.releaseTime = e.releaseTime.split(' ')[0]
})
- row.editing = true
- },
- // 批量删除
- batchDel() {
- const list = this.multipleSelection
- if (list.length) {
- this.$confirm('确定要删除吗?', '提示', {
- type: 'warning'
- }).then(() => {
- const data = []
- list.map(e => {
- data.push('ids=' + e.id)
- })
- this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => {
- this.$refs.table.clearSelection()
- util.successMsg("删除成功")
- this.getData()
- }).catch(res => {})
- }).catch(() => {})
- } else {
- util.errorMsg('请先选择数据 !')
+ this.originList = JSON.parse(JSON.stringify(data.records))
+ this.list = data.records
+ const total = +data.total
+ this.total = total
+ if (this.last) {
+ let page = parseInt(total / 10)
+ total % 10 && page++
+ this.page = page
+ this.last = ''
+ this.getData()
}
- },
- // 删除
- handleDelete(row) {
+ }).catch(err => { })
+ },
+ // 重置栏位筛选
+ resetColumns () {
+ this.settings = JSON.parse(JSON.stringify(this.originSettings))
+ },
+ currentChange (val) {
+ this.page = val
+ this.getData()
+ },
+ handleSelectionChange (val) {
+ this.multipleSelection = val
+ },
+ initData () {
+ this.$refs.table.clearSelection()
+ this.page = 1
+ this.getData()
+ },
+ // 排序提交
+ submitSequence (row) {
+ const { sequence } = row
+ if (!sequence) return util.errorMsg('请输入排序')
+ if (isNaN(sequence)) return util.errorMsg('请输入数字')
+ this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${sequence > this.total ? this.total : sequence}`).then(res => {
+ this.initData()
+ }).catch(res => { })
+ },
+ // 编辑排序
+ editSequence (row) {
+ this.list.forEach(e => {
+ e.editing = false
+ })
+ row.editing = true
+ },
+ // 批量删除
+ batchDel () {
+ const list = this.multipleSelection
+ if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
- this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => {
- util.successMsg('删除成功')
+ const data = []
+ list.map(e => {
+ data.push('ids=' + e.id)
+ })
+ this.$post(`${this.api.deleteArticle}?${data.join('&')}`).then(res => {
+ this.$refs.table.clearSelection()
+ util.successMsg("删除成功")
this.getData()
- }).catch(res => {})
- }).catch(() => {})
- },
- // 禁用启用
- switchOff(val, row) {
- this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
- },
- // 新增
- add() {
- if (!this.columns.length) return util.errorMsg('请添加栏目')
- this.setColumn(this.$refs.column.getCurrentNode())
- this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
- },
- // 排序回调
- sortChange(column) {
- const { order } = column
- // 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个
- // 两个时间0默认倒序 1升序
- if (column.prop === 'updateTime') {
- this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
- if (order) {
- this.publicationTimeSort = ''
- this.topSort = ''
- }
+ }).catch(res => { })
+ }).catch(() => { })
+ } else {
+ util.errorMsg('请先选择数据 !')
+ }
+ },
+ // 删除
+ handleDelete (row) {
+ this.$confirm('确定要删除吗?', '提示', {
+ type: 'warning'
+ }).then(() => {
+ this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => {
+ util.successMsg('删除成功')
+ this.getData()
+ }).catch(res => { })
+ }).catch(() => { })
+ },
+ // 禁用启用
+ switchOff (val, row) {
+ this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
+ },
+ // 新增
+ add () {
+ if (!this.columns.length) return util.errorMsg('请添加栏目')
+ this.setColumn(this.$refs.column.getCurrentNode())
+ this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
+ },
+ // 排序回调
+ sortChange (column) {
+ const { order } = column
+ // 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个
+ // 两个时间0默认倒序 1升序
+ if (column.prop === 'updateTime') {
+ this.modifiedTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
+ if (order) {
+ this.publicationTimeSort = ''
+ this.topSort = ''
}
- if (column.prop === 'releaseTime') {
- this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
- if (order) {
- this.modifiedTimeSort = ''
- this.topSort = ''
- }
+ }
+ if (column.prop === 'releaseTime') {
+ this.publicationTimeSort = order ? order === 'ascending' ? 1 : 0 : ''
+ if (order) {
+ this.modifiedTimeSort = ''
+ this.topSort = ''
}
- // 序号排序 0默认升序 1倒序
- if (column.prop === 'sequence') {
- this.topSort = order ? order === 'ascending' ? 0 : 1 : ''
- if (order) {
- this.publicationTimeSort = ''
- this.modifiedTimeSort = ''
- }
+ }
+ // 序号排序 0默认升序 1倒序
+ if (column.prop === 'sequence') {
+ this.topSort = order ? order === 'ascending' ? 0 : 1 : ''
+ if (order) {
+ this.publicationTimeSort = ''
+ this.modifiedTimeSort = ''
}
- this.getData()
- },
- // 置顶
- sticky(row) {
- this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
- this.initData()
- }).catch(res => {})
- },
- // 预览
- preview(row) {
- window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`)
- },
- // 编辑
- edit(row) {
- this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
- },
- }
+ }
+ this.getData()
+ },
+ // 置顶
+ sticky (row) {
+ this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
+ this.initData()
+ }).catch(res => { })
+ },
+ // 预览
+ preview (row) {
+ window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`)
+ },
+ // 编辑
+ edit (row) {
+ this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`)
+ },
+ }
};
\ No newline at end of file
diff --git a/src/pages/column/page/deviceIntroBeam.vue b/src/pages/column/page/deviceIntroBeam.vue
index 75c754b..386942a 100644
--- a/src/pages/column/page/deviceIntroBeam.vue
+++ b/src/pages/column/page/deviceIntroBeam.vue
@@ -69,7 +69,8 @@