diff --git a/src/components/Banner/addOrEdit.vue b/src/components/Banner/addOrEdit.vue index 5ef8536..4782a0d 100644 --- a/src/components/Banner/addOrEdit.vue +++ b/src/components/Banner/addOrEdit.vue @@ -30,7 +30,7 @@ - 确定 + 确定 取消 @@ -64,6 +64,7 @@ label: 'title', children: 'children' }, + loading: false, rules: { url: [ { required: true, message: '请上传图片', trigger: 'change' } @@ -146,41 +147,55 @@ * 添加轮播图 */ async addCarousel(formName){ - const { url, showPage, recStatus } = formName; - const params = { - url, - showPage: showPage[1], - recStatus - }; - await ADD_CAROUSEL(params).then((res) => { - if(res.code === 200){ - Alert.success('添加成功'); - this.$emit('close', true) - }else{ - Alert.fail(res.msg || '添加失败'); - } - }) + try { + this.loading = true; + const { url, showPage, recStatus } = formName; + const params = { + url, + showPage: showPage[1], + recStatus + }; + await ADD_CAROUSEL(params).then((res) => { + this.loading = false; + if(res.code === 200){ + Alert.success('添加成功'); + this.$emit('close', true) + }else{ + Alert.fail(res.msg || '添加失败'); + } + }) + } catch (error) { + this.loading = false; + console.error('error: ', error); + } }, /** * 修改轮播图 */ async updateCarousel(formName){ - const { id, url, showPage, recStatus } = formName; - const params = { - id, - url, - showPage: showPage[1], - recStatus - }; - await UPDATE_CAROUSEL(params).then((res) => { - if(res.code === 200){ - Alert.success('修改成功'); - this.$emit('close', true) - }else{ - Alert.fail(res.msg || '修改失败'); - } - }) + try { + this.loading = true; + const { id, url, showPage, recStatus } = formName; + const params = { + id, + url, + showPage: showPage[1], + recStatus + }; + await UPDATE_CAROUSEL(params).then((res) => { + this.loading = false; + if(res.code === 200){ + Alert.success('修改成功'); + this.$emit('close', true) + }else{ + Alert.fail(res.msg || '修改失败'); + } + }) + } catch (error) { + this.loading = false; + console.error('error: ', error); + } } } } diff --git a/src/components/Banner/index.vue b/src/components/Banner/index.vue index f3132b2..328a3ed 100644 --- a/src/components/Banner/index.vue +++ b/src/components/Banner/index.vue @@ -82,6 +82,7 @@ diff --git a/src/components/Detail/index.vue b/src/components/Detail/index.vue index bb94fef..44d93bc 100644 --- a/src/components/Detail/index.vue +++ b/src/components/Detail/index.vue @@ -97,6 +97,7 @@ diff --git a/src/components/News/addOrEdit.vue b/src/components/News/addOrEdit.vue index 43e2369..50cd87d 100644 --- a/src/components/News/addOrEdit.vue +++ b/src/components/News/addOrEdit.vue @@ -61,6 +61,24 @@
+ + + + + + 保存 @@ -115,10 +133,11 @@ source: '', publishTime: '', content: '', - showPage: '', + showPage: ['02','0203'], relationContentIds: [] }, fileList: [], + code: '', BASE_API, tabList, props: { @@ -142,11 +161,15 @@ if(this.currList && this.currList && !this.showAdd){ await this.getDetail() for(let key in this.currList){ + if(key !== 'showPage') this.formLabelAlign[key] = this.currList[key] } + const { showPage } = this.currList + this.formLabelAlign.showPage.splice(0, 1, showPage.slice(0, 2)) + this.formLabelAlign.showPage.splice(1, 1, showPage) } const code = localStorage.getItem('code') - this.formLabelAlign.showPage = code + this.code = code if(code === '0204'){ this.formLabelAlign.showType = 1 } @@ -156,6 +179,12 @@ if(!this.formLabelAlign.publishTime){ this.formLabelAlign.publishTime = new Date() } + if(!code) return + this.formLabelAlign.showPage.splice(0, 1, code.slice(0, 2)) + this.formLabelAlign.showPage.splice(1, 1, code) + if(code === '0204'){ + this.formLabelAlign.showPage = ['02', '0203'] + } }, methods: { @@ -188,6 +217,12 @@ } }, + // 位置选择 + handleChange(value) { + console.log('value: ', value); + this.formLabelAlign.showPage = value + }, + // 修改标题路径显示类型 changeShowType(value){ this.formLabelAlign.showType = value; @@ -224,10 +259,10 @@ * 添加详情 */ async addCarousel(formName){ - console.log('addddd'); try { this.loading = true; const params = formName; + params.showPage = formName.showPage[1], await ADD_DETAIL(params).then((res) => { this.loading = false; if(res.code === 200){ @@ -250,6 +285,7 @@ try { this.loading = true; const params = formName; + params.showPage = formName.showPage[1], await UPDATE_DETAIL(params).then((res) => { this.loading = false; if(res.code === 200){ diff --git a/src/components/News/contentRelation.vue b/src/components/News/contentRelation.vue index 14308fc..c6bc272 100644 --- a/src/components/News/contentRelation.vue +++ b/src/components/News/contentRelation.vue @@ -22,10 +22,9 @@ @@ -37,7 +36,7 @@ import { DELETE_RELATION } from '@/api/contentIntro'; import Alert from "@/utils/alert"; export default { - props: ['relations'], + props: ['relations','introId'], data() { return { @@ -74,9 +73,9 @@ export default { confirmButtonText: '确定', callback: res => { if(res === 'confirm') { - const { introId, relationContentId } = item + const { introId } = this.introId const relationContentIds = [] - relationContentIds.push(relationContentId) + relationContentIds.push(item.introId) const params = { introId, relationContentIds @@ -84,6 +83,7 @@ export default { DELETE_RELATION(params).then((data) => { if(data.code === 200) { Alert.success('删除成功'); + this.$emit('getDetail') } else { Alert.fail(data.msg); } diff --git a/src/components/News/detailContent.vue b/src/components/News/detailContent.vue index fd0086f..7312bcb 100644 --- a/src/components/News/detailContent.vue +++ b/src/components/News/detailContent.vue @@ -20,19 +20,20 @@ 相关新闻: 添加相关新闻
- +
- + 取 消 - 确 定 + 确 定 @@ -54,7 +55,8 @@ import Alert from "@/utils/alert"; data() { return { showModal: false, - relationContentIds: [] + relationContentIds: [], + loading: false, } }, methods: { @@ -81,23 +83,30 @@ import Alert from "@/utils/alert"; */ async submit(){ try { + this.loading = true; const params = { introId: this.list.introId, relationContentIds: this.relationContentIds } ADD_RELATION(params).then((data) => { + this.loading = false; if(data.code === 200) { Alert.success('添加成功'); this.showModal = false; - this.$emit('getDetail', this.list) + this.getDetail() } else { Alert.fail(data.msg); } }); } catch (error) { + this.loading = false; console.error('error: ', error); } }, + + getDetail(){ + this.$emit('getDetail', this.list) + } } } diff --git a/src/components/News/index.vue b/src/components/News/index.vue index 2f4aa64..7505de0 100644 --- a/src/components/News/index.vue +++ b/src/components/News/index.vue @@ -111,6 +111,7 @@ @@ -169,6 +170,13 @@ pageSize, showPage }; + if(showPage === '0201' || showPage === '0202' || showPage === '0203'){ + params.pageType = 0 + } + if(showPage === '0204'){ + params.showPage = '0203' + params.pageType = 1 + } POST_QUERY_DETAIL(params).then(res => { if(res.code === 200){ if(res.data.list && res.data.list.length){ diff --git a/src/filters/code.js b/src/filters/code.js index eb6e905..e5a931f 100644 --- a/src/filters/code.js +++ b/src/filters/code.js @@ -2,6 +2,7 @@ export const tabList = [ { title: '首页', code: '00', + disabled: true, children: [ { title: '首页', @@ -13,6 +14,7 @@ export const tabList = [ { title: '公司概况', code: '01', + disabled: true, children: [ { title: '公司简介', @@ -44,42 +46,52 @@ export const tabList = [ { title: '集团新闻', code: '0201', + disabled: false, }, { title: '省公司新闻', code: '0202', + disabled: false, }, { title: '公司新闻', code: '0203', + disabled: false, }, { title: '图片新闻', code: '0204', + disabled: true, }, { title: '热点专题', code: '0205', + disabled: true, }, { title: '媒体关注', code: '0206', + disabled: true, }, { title: '视频新闻', code: '0207', + disabled: true, }, { title: '专题片', code: '0208', + disabled: true, }, { title: '企业画册', code: '0209', + disabled: true, }, { title: '现场风采', code: '0210', + disabled: true, }, ] }, @@ -87,6 +99,7 @@ export const tabList = [ { title: '党的建设', code: '03', + disabled: true, children: [ { title: '中心组学习', @@ -118,6 +131,7 @@ export const tabList = [ { title: '安全生产', code: '04', + disabled: true, children: [ { title: '安全会议', @@ -145,6 +159,7 @@ export const tabList = [ { title: '通知公告', code: '05', + disabled: true, children: [ { title: '通知', @@ -172,6 +187,7 @@ export const tabList = [ { title: '信息公开', code: '06', + disabled: true, children: [ { title: '基本信息', @@ -234,6 +250,7 @@ export const tabList = [ { title: '制度资料', code: '08', + disabled: true, children: [ { title: '集团公司制度', @@ -273,6 +290,7 @@ export const tabList = [ { title: '部门首页', code: '09', + disabled: true, children: [ { title: '总经理工作部', @@ -344,6 +362,7 @@ export const tabList = [ { title: '其他', code: '99', + disabled: true, children: [ { title: '光荣榜', diff --git a/src/views/privilegeManagement/account/index.vue b/src/views/privilegeManagement/account/index.vue index 4a75bad..79fa90b 100644 --- a/src/views/privilegeManagement/account/index.vue +++ b/src/views/privilegeManagement/account/index.vue @@ -78,6 +78,7 @@