Browse Source

图片新闻

master
song 3 years ago
parent
commit
f9587ea0bb
  1. 12
      src/components/News/addOrEdit.vue
  2. 8
      src/components/News/index.vue

12
src/components/News/addOrEdit.vue

@ -178,11 +178,13 @@
if(!this.formLabelAlign.publishTime){ if(!this.formLabelAlign.publishTime){
this.formLabelAlign.publishTime = new Date() this.formLabelAlign.publishTime = new Date()
} }
if(!code) return if(this.showAdd){
this.formLabelAlign.showPage.splice(0, 1, code.slice(0, 2)) if(!code) return
this.formLabelAlign.showPage.splice(1, 1, code) this.formLabelAlign.showPage.splice(0, 1, code.slice(0, 2))
if(code === '0204'){ this.formLabelAlign.showPage.splice(1, 1, code)
this.formLabelAlign.showPage = ['02', '0203'] if(code === '0204'){
this.formLabelAlign.showPage = ['02', '0203']
}
} }
}, },

8
src/components/News/index.vue

@ -147,7 +147,8 @@
showAdd: true, showAdd: true,
detailContent: null, detailContent: null,
keys: [], keys: [],
loading: true loading: true,
options: {}
} }
}, },
@ -160,6 +161,7 @@
* 获取详情列表 * 获取详情列表
*/ */
getList(options) { getList(options) {
this.options = options;
const { pageNum, pageSize, showPage } = this; const { pageNum, pageSize, showPage } = this;
const params = { const params = {
pageNum, pageNum,
@ -291,7 +293,7 @@
this.showModal = false this.showModal = false
if(type){ if(type){
this.keys = [] this.keys = []
this.getList() this.getList(this.options)
} }
}, },
@ -310,7 +312,7 @@
DELETE_DETAIL(params).then((res) => { DELETE_DETAIL(params).then((res) => {
if(res.code === 200){ if(res.code === 200){
Alert.success('删除成功'); Alert.success('删除成功');
this.getList() this.getList(this.options)
}else{ }else{
Alert.fail(res.msg || '删除失败'); Alert.fail(res.msg || '删除失败');
} }

Loading…
Cancel
Save