Browse Source

Merge branch 'master' of ssh://101.201.226.163:50022/binbin0314/datang-admin

master
aBin 3 years ago
parent
commit
1b5eabe56e
  1. 17
      src/components/Banner/addOrEdit.vue
  2. 1
      src/components/Banner/index.vue
  3. 1
      src/components/Detail/index.vue
  4. 7
      src/components/News/addContentRelation.vue
  5. 41
      src/components/News/addOrEdit.vue
  6. 10
      src/components/News/contentRelation.vue
  7. 19
      src/components/News/detailContent.vue
  8. 31
      src/components/News/index.vue
  9. 114
      src/components/News/search.vue
  10. 19
      src/filters/code.js
  11. 1
      src/views/privilegeManagement/account/index.vue

17
src/components/Banner/addOrEdit.vue

@ -30,7 +30,7 @@
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit(formLabelAlign)">确定</el-button>
<el-button type="primary" :loading="loading" @click="submit(formLabelAlign)">确定</el-button>
<el-button @click="$emit('close')">取消</el-button>
</el-form-item>
</el-form>
@ -64,6 +64,7 @@
label: 'title',
children: 'children'
},
loading: false,
rules: {
url: [
{ required: true, message: '请上传图片', trigger: 'change' }
@ -146,6 +147,8 @@
* 添加轮播图
*/
async addCarousel(formName){
try {
this.loading = true;
const { url, showPage, recStatus } = formName;
const params = {
url,
@ -153,6 +156,7 @@
recStatus
};
await ADD_CAROUSEL(params).then((res) => {
this.loading = false;
if(res.code === 200){
Alert.success('添加成功');
this.$emit('close', true)
@ -160,12 +164,18 @@
Alert.fail(res.msg || '添加失败');
}
})
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
},
/**
* 修改轮播图
*/
async updateCarousel(formName){
try {
this.loading = true;
const { id, url, showPage, recStatus } = formName;
const params = {
id,
@ -174,6 +184,7 @@
recStatus
};
await UPDATE_CAROUSEL(params).then((res) => {
this.loading = false;
if(res.code === 200){
Alert.success('修改成功');
this.$emit('close', true)
@ -181,6 +192,10 @@
Alert.fail(res.msg || '修改失败');
}
})
} catch (error) {
this.loading = false;
console.error('error: ', error);
}
}
}
}

1
src/components/Banner/index.vue

@ -82,6 +82,7 @@
<el-dialog
width="800px"
:show-close="false"
:close-on-click-modal="false"
:visible.sync="showModal">
<add-or-edit ref="distribution" :show-add="showAdd" :currList="currList" v-if="showModal" @close="close"></add-or-edit>
</el-dialog>

1
src/components/Detail/index.vue

@ -97,6 +97,7 @@
<el-dialog
width="1200px"
:show-close="false"
:close-on-click-modal="false"
:visible.sync="showModal">
<add-or-edit ref="distribution" :show-add="showAdd" :currList="currList" v-if="showModal" @close="close"></add-or-edit>
<!-- <el-button type="primary" @click="dialogVisible = false"> </el-button> -->

7
src/components/News/addContentRelation.vue

@ -96,6 +96,13 @@ export default {
showPage,
title
};
if(showPage === '0201' || showPage === '0202' || showPage === '0203'){
params.showType = 0
}
if(showPage === '0204'){
params.showPage = '0203'
params.showType = 1
}
POST_QUERY_DETAIL(params).then(res => {
if(res.code === 200){
this.lists = res.data.list

41
src/components/News/addOrEdit.vue

@ -61,6 +61,24 @@
</el-form-item>
</div>
<div class="flex justify-between">
<el-form-item label="页面显示位置:" prop="showPage">
<el-cascader
v-if="code !== '0204'"
v-model="formLabelAlign.showPage"
:props="props"
:disabled="true"
class="w-230"
:options="tabList">
</el-cascader>
<el-cascader
v-else
v-model="formLabelAlign.showPage"
class="w-230"
:options="tabList"
:props="props"
@change="handleChange">
</el-cascader>
</el-form-item>
<el-form-item label="提交状态:" prop="submitStatus">
<el-radio-group v-model="formLabelAlign.submitStatus" @change="changeSubmitStatus">
<el-radio :label="0">保存</el-radio>
@ -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,11 @@
}
},
//
handleChange(value) {
this.formLabelAlign.showPage = value
},
//
changeShowType(value){
this.formLabelAlign.showType = value;
@ -224,10 +258,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 +284,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){

10
src/components/News/contentRelation.vue

@ -22,10 +22,9 @@
<el-table-column
fixed="right"
label="操作"
align="center"
>
<template slot-scope="relations">
<el-button type="danger" plain size="mini" @click="deleteItem">删除</el-button>
<el-button type="danger" plain size="mini" @click="deleteItem(relations.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -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);
}

19
src/components/News/detailContent.vue

@ -20,19 +20,20 @@
<span class="font-bold">相关新闻 </span>
<el-button type="primary" plain size="mini" class="mt-2 ml-4" @click="addRelationNews">添加相关新闻</el-button>
<div v-if="detailContent && detailContent.relations && detailContent.relations.length" class="flex flex-column px-10">
<content-relation class="px-10" :relations="detailContent.relations" />
<content-relation class="px-10" :introId="list.introId" :relations="detailContent.relations" />
</div>
</div>
<el-dialog
width="800px"
title="添加相关新闻"
:close-on-click-modal="false"
:show-close="false"
:visible.sync="showModal">
<add-content-relation ref="distribution" :introId="list.introId" v-if="showModal" @close="close" @setRelationValue="setRelationValue"></add-content-relation>
<add-content-relation ref="distribution" :introId="list.introId" v-if="showModal" @getDetail="getDetail" @close="close" @setRelationValue="setRelationValue"></add-content-relation>
<span slot="footer" class="dialog-footer">
<el-button @click="showModal = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button type="primary" :loading="loading" @click="submit"> </el-button>
</span>
</el-dialog>
</div>
@ -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)
}
}
}
</script>

31
src/components/News/index.vue

@ -1,13 +1,7 @@
<template>
<div>
<el-button
type="primary"
icon="el-icon-plus"
style="margin-bottom: 15px;"
@click="addModal"
>
添加
</el-button>
<search @addModal="addModal" @getList="getList" />
<div class="table">
<el-table
:data="lists"
@ -111,6 +105,7 @@
<el-dialog
width="1200px"
:show-close="false"
:close-on-click-modal="false"
:visible.sync="showModal">
<add-or-edit ref="distribution" :show-add="showAdd" :currList="currList" v-if="showModal" @close="close"></add-or-edit>
</el-dialog>
@ -120,6 +115,7 @@
<script>
const AddOrEdit = () => import('./addOrEdit.vue');
const DetailContent = () => import('./detailContent.vue');
const Search = () => import('./search.vue');
import {
POST_QUERY_DETAIL,
QUERY_DETAIL,
@ -155,25 +151,36 @@
},
components: {
AddOrEdit,DetailContent
AddOrEdit,DetailContent,Search
},
methods: {
/**
* 获取详情列表
*/
getList() {
getList(options) {
const { pageNum, pageSize, showPage } = this;
const params = {
pageNum,
pageSize,
showPage
};
if(showPage === '0201' || showPage === '0202' || showPage === '0203'){
params.showType = 0
}
if(showPage === '0204'){
params.showPage = '0203'
params.showType = 1
}
if(options){
params.title = options.title
params.editor = options.editor
params.publishTimeStart = options.publishTimeStart
params.publishTimeEnd = options.publishTimeEnd
}
POST_QUERY_DETAIL(params).then(res => {
if(res.code === 200){
if(res.data.list && res.data.list.length){
this.lists = res.data.list
}
this.pageNum = +res.data.pageNum
this.pageSize = +res.data.pageSize
this.count = +res.data.total

114
src/components/News/search.vue

@ -0,0 +1,114 @@
<template>
<div class="flex flex-wrap mb-4">
<div class="flex flex-row mr-5 mb-4 align-center">
标题
<el-input
placeholder="请输入标题"
class="flex-1"
v-model="title"
@change="changeTitle($event, 'title')">
</el-input>
</div>
<div class="flex flex-row mr-5 mb-4 align-center">
责编
<el-input
placeholder="请输入责编"
class="flex-1"
v-model="editor"
@change="changeTitle($event, 'editor')">
</el-input>
</div>
<div class="flex flex-row mr-5 mb-4 align-center">
发表时间
<el-date-picker
v-model="publishTime"
@change="changeTime"
class="flex-1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
<div class="flex flex-row mr-5 mb-4 align-center" v-show="show">
页面显示位置
<el-cascader
v-model="showPage"
class="w-230"
:options="tabList"
:props="props"
@change="handleChange">
</el-cascader>
</div>
<el-button
type="primary"
icon="el-icon-search"
class="mr-5 mb-4"
@click="$emit('getList', options)">
搜索
</el-button>
<el-button
type="primary"
icon="el-icon-plus"
class="mb-4"
@click="$emit('addModal')"
>
添加
</el-button>
</div>
</template>
<script>
import {tabList} from '../../filters/code';
export default{
data() {
return {
tabList,
props: {
value: 'code',
label: 'title',
children: 'children'
},
show: false,
title: '',
editor: '',
publishTime: '',
showPage: ['02','0203'],
options: {
title: '',
editor: '',
publishTimeStart: '',
publishTimeEnd: '',
showPage: '0203'
}
}
},
mounted(){
const code = localStorage.getItem('code')
if(code === '0204'){
this.show = true
}
},
methods: {
changeTitle(e, type){
this[type] = e
this.options[type] = e
},
changeTime(e){
this.options.publishTimeStart = this.$moment(e[0]).valueOf()
this.options.publishTimeEnd = this.$moment(e[1]).valueOf()
},
//
handleChange(value) {
this.options.showPage = value[1]
},
}
}
</script>

19
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: '光荣榜',

1
src/views/privilegeManagement/account/index.vue

@ -78,6 +78,7 @@
<el-dialog
title="修改账户信息"
width="800px"
:close-on-click-modal="false"
:visible.sync="showEidtDialog">
<el-form :model="editRow" ref="editRow" label-width="100px">
<el-form-item label="登录名" prop="userName" :rules="[{required: true, message: '不能为空', trigger: 'blur'}]">

Loading…
Cancel
Save