Browse Source

内容管理接口修改

master
lucky 4 years ago
parent
commit
73381e75d8
  1. 16083
      package-lock.json
  2. 136
      src/components/Activity/ActivityDate.vue
  3. 131
      src/components/Activity/ActivitySearch.vue
  4. 0
      src/components/User/UserDate.vue
  5. 0
      src/components/User/UserSearch.vue
  6. 14
      src/config/api.js
  7. 2
      src/plugins/ant-design-vue.js
  8. 53
      src/views/EventAnnouncement/EventAnnouncement.vue
  9. 51
      src/views/IndustryInfo/IndustryInfo.vue
  10. 12
      src/views/UserManage/UserManage.vue
  11. 17361
      yarn.lock

16083
package-lock.json

File diff suppressed because it is too large

136
src/components/Activity/ActivityDate.vue

@ -5,7 +5,10 @@
:columns="columns"
:data-source="lists"
:loading="loading"
:pagination="pagination"
@change="handleTableChange"
:row-key="record => record.id"
:scroll="{ y: height }"
bordered
class="white"
>
@ -13,17 +16,8 @@
<span>{{ index + 1 }}</span>
</template>
<template slot="type" slot-scope="text, record">
<a-tag color="blue">{{ record.type }}</a-tag>
</template>
<template slot="time" slot-scope="text, record">
<div v-if="record.realTime">{{ record.realTime }}</div>
<div v-else>{{ record.planTime }}</div>
</template>
<template slot="state" slot-scope="text, record">
<a-tag color="green">{{ record.state }}</a-tag>
<span v-if="record.releaseTime">{{ record.releaseTime}}</span><span v-if="record.releaseTime">-{{record.releaseTime}}</span>
</template>
<template slot="edit" slot-scope="text, record">
@ -31,16 +25,11 @@
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
<a-icon class="ml-4 pointer" theme="twoTone" two-tone-color="#ff0000" type="delete" />
</a-popconfirm>
<a-button @click="openSignUp" class="ml-4" size="small" type="primary">报名</a-button>
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div class="d-flex flex-nowrap justify-space-between mb-2">
<div>计划时间{{ record.planTime }}</div>
<div class="ml-8">实际时间{{ record.realTime }}</div>
<div class="ml-8">组织人{{ record.organizer }}</div>
</div>
<div>活动内容{{ record.content }}</div>
<div>详情
<span v-dompurify-html="record.content"></span></div>
</div>
</a-table>
</div>
@ -53,7 +42,7 @@
<script>
import ActivityEdit from "components/Activity/ActivityEdit.vue";
// import { delTeam } from 'config/api';
import { deleteIndustryInfo } from 'config/api';
const columns = [
{
@ -63,45 +52,30 @@ const columns = [
key: 'id',
scopedSlots: { customRender: 'id' },
},
{
title: '发布平台',
{
title: '标题',
align: 'center',
dataIndex: 'plat',
key: 'plat',
dataIndex: 'title',
key: 'title',
},
{
title: '类型',
title: '地点',
align: 'center',
dataIndex: 'type',
key: 'type',
scopedSlots: { customRender: 'type' },
dataIndex: 'address',
key: 'address',
},
{
title: '举办时间',
title: '活动时间',
align: 'center',
dataIndex: 'time',
key: 'time',
scopedSlots: { customRender: 'time' },
},
{
title: '地点',
align: 'center',
dataIndex: 'place',
key: 'place',
scopedSlots: { customRender: 'place' },
},
{
title: '主讲人',
align: 'center',
dataIndex: 'speaker',
key: 'speaker',
},
{
title: '发布状态',
title: '公告简介',
align: 'center',
dataIndex: 'state',
key: 'state',
scopedSlots: { customRender: 'state' },
dataIndex: 'intro',
key: 'intro',
},
{
title: '编辑',
@ -113,45 +87,18 @@ const columns = [
},
];
const lists = [
{
id:'001',
plat:'传控科技',
type: '路演',
planTime: '2020/11/17 08:00 - 2020/11/18 19:00',
realTime:'2020/11/17 08:00 - 2020/11/18 19:00',
place:'太原',
organizer: '张三',
speaker: '李四',
state: '发布',
content:'团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介'
},
{
id:'002',
plat:'中绿环保',
type: '路演',
planTime: '2020/11/17 08:00 - 2020/11/18 19:00',
realTime:'2020/11/17 08:00 - 2020/11/18 19:00',
place:'太原',
organizer: '张三',
speaker: '李四',
state: '不发布',
content:'团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介团队简介'
}
];
export default {
name: "ActivityDate",
components: {
ActivityEdit,
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = lists.map(item => ({ ...item }));
return {
columns,
lists,
loading: false,
editingKey: '',
height: '',
editVisible: false,
editItem: null, //
@ -159,7 +106,15 @@ export default {
},
mounted() {
this.height = document.getElementsByClassName('main')[0].offsetHeight - 150;
let th = 250;
let wh = window.innerHeight;
this.height = wh - th;
window.onresize = () => {
return (() => {
wh = window.innerHeight;
this.height = wh - th;
})();
};
},
methods: {
@ -169,24 +124,29 @@ export default {
this.editVisible = true;
},
closeModal(){
async closeModal(){
this.editVisible = false;
await this.$emit('getBackendSearch');
},
handleTableChange(pagination) {
const { current, pageSize } = pagination;
const condition = { current, pageSize };
this.$emit('getBackendSearch', condition);
},
//
async onDelete(teamId) {
async onDelete(id) {
try {
// const params = { param: { teamId } };
// const res = await delTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.$message.success('');
// const arr = [...this.lists];
// this.lists = arr.filter(item => item.id !== teamId);
// // TODO:
// } else {
// throw msg;
// }
const params = {param : {id}};
const res = await deleteIndustryInfo(params);
const {data,msg,code} = res.data;
if(code === 200){
this.$message.success('删除成功');
this.$emit('getBackendSearch');
}else{
throw msg;
}
} catch (error) {
this.$message.error(error || '删除失败');
}

131
src/components/Activity/ActivitySearch.vue

@ -1,54 +1,18 @@
<template>
<div class="d-flex flex-wrap pb-3">
<div>
<!-- 发布平台 -->
<a-select @change="getPlatform" placeholder="发布平台" style="width: 100px">
<a-select-option :key="index" :value="plat" v-for="(plat, index) in platforms">{{ plat }}</a-select-option>
</a-select>
<!-- 类型 -->
<a-select @change="getCategory" class="ml-3" placeholder="类型" style="width: 100px">
<a-select-option
:key="index"
:value="category.name"
v-for="(category, index) in categories"
>{{ category.name }}</a-select-option>
</a-select>
<!-- 举办时间 -->
<a-range-picker
@change="onChange"
class="ml-3"
format="YYYY/MM/DD HH:mm:ss"
show-time
style="width: 200px"
/>
<!-- 地点 -->
<a-input
@change="handleChange('place',$event)"
class="ml-3"
placeholder="地点"
style="width: 100px"
v-model="place"
/>
<!-- 组织人 -->
<!-- 活动标题 -->
<a-input
@change="handleChange('organizer',$event)"
class="ml-3"
placeholder="组织人"
style="width: 100px"
v-model="organizer"
placeholder="标题"
style="width: 150px"
v-model="titleKey"
/>
<!-- 主讲人 -->
<a-input
@change="handleChange('speaker',$event)"
class="ml-3"
placeholder="主讲人"
style="width: 100px"
v-model="speaker"
/>
<!-- 发布状态 -->
<a-select @change="getState" class="ml-3" placeholder="发布状态" style="width: 100px">
<a-select-option :key="index" :value="state" v-for="(state, index) in status">{{ state }}</a-select-option>
</a-select>
<!-- 活动类型 0路演 1讲座 2沙龙 不传参数则查询全部 -->
<span class="ml-8">活动类型</span>
<a-checkbox-group :options="items" @change="onChange"/>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div>
@ -73,25 +37,13 @@ export default {
data() {
return {
visible: false,
publishingPlatform: '',
categories: [
{id:1,name:'路演'},
{id:2,name:'沙龙'},
{id:3,name:'论坛'},
{id:4,name:'培训'},
{id:5,name:'讲座'},
{id:6,name:'创业活动'}
],
category: '',
place: '',
organizer: '',
speaker: '',
status: ['发布','不发布'],
state: '',
platforms: ['绿谷','维基'],
platform: ''
titleKey: '',
items: ['路演','讲座','沙龙'],
activityType: [],
checkedValues: []
}
},
methods: {
showModal(){
this.visible = true;
@ -101,48 +53,27 @@ export default {
this.visible = false;
},
handleChange(type, e) {
this.type = e.target.value;
},
//
getPlatform(value) {
console.log('value: ', value);
this.platform = value;
},
//
getCategory(value) {
console.log('value: ', value);
this.category = value;
},
//
getState(value) {
console.log('value: ', value);
this.state = value;
},
//
onChange(dates, dateStrings) {
console.log('From: ', dates[0], ', to: ', dates[1]);
console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
onChange(checkedValues) {
this.checkedValues = checkedValues
},
async handleTableChange() {
try {
// const params = { param: {publishingPlatform: this.publishingPlatform} };
// const res = await selLikeTeam(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// console.log('',data);
// // TODO:
// } else {
// throw msg;
// }
} catch (error) {
this.$message.error(error);
const { activityType,titleKey,checkedValues} = this;
for (let i = 0;i < checkedValues.length;i++) {
const item = checkedValues[i];
const currentIndex = this.items.indexOf(item)
const a = this.items.findIndex(a => a === item)
const index = this.activityType.findIndex(c=>c === a.label)
if(index === -1){
this.activityType.push(currentIndex)
}
}
//
const condition = {
activityType,titleKey
}
await this.$emit('getSelectTeam',condition)
this.activityType = [];
},
},
};

0
src/components/Enterprise/EnterpriseDate.vue → src/components/User/UserDate.vue

0
src/components/Enterprise/EnterpriseSearch.vue → src/components/User/UserSearch.vue

14
src/config/api.js

@ -9,6 +9,8 @@ let { proxyUrl, msgUrl } = require('@/config/setting');
const greenvalley = `${proxyUrl}/greenvalley`;
const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作
const page = `${greenvalley}/page`; // 页面管理相关操作
const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作
const activity = `${greenvalley}/activity`; // 活动公告相关操作
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -28,6 +30,18 @@ export const updatePage = params => axios.post(`${page}/update`, params);
// 页面详情查询
export const getPage = params => axios.post(`${page}/get`, params);
// 行业资讯列表查询
export const getBackendSearch = params => axios.post(`${industryInfo}/backendSearch`, params);
// 行业资讯列表删除
export const deleteIndustryInfo = params => axios.post(`${industryInfo}/delete`, params);
// 活动公告列表查询
export const getQueryBack = params => axios.post(`${activity}/query/back`, params);
// // 活动公告列表删除
// export const deleteIndustryInfo = params => axios.post(`${activity}/delete`, params);
// 查询所有的研发团队相关信息
export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);

2
src/plugins/ant-design-vue.js

@ -20,6 +20,7 @@ import {
Switch,
Radio,
Cascader,
Checkbox
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -41,6 +42,7 @@ Vue.use(DatePicker);
Vue.use(Switch);
Vue.use(Radio);
Vue.use(Cascader);
Vue.use(Checkbox);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

53
src/views/EventAnnouncement/EventAnnouncement.vue

@ -1,24 +1,31 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<policy-search />
<policy-date />
<activity-search @getSelectTeam='getSelectTeam'/>
<activity-date :lists="lists" :pagination="pagination" @getSelectTeam="getSelectTeam" />
</div>
</template>
<script>
import PolicySearch from "components/Policy/PolicySearch.vue";
import PolicyDate from "components/Policy/PolicyDate.vue";
// import { getSelectTeam } from 'config/api';
import ActivitySearch from "components/Activity/ActivitySearch.vue";
import ActivityDate from "components/Activity/ActivityDate.vue";
import { getQueryBack } from 'config/api';
export default {
name: "InnovationPolicy",
components: {
PolicySearch,
PolicyDate,
ActivitySearch,
ActivityDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
// this.getSelectTeam()
this.getSelectTeam()
},
methods: {
@ -26,12 +33,36 @@ export default {
* 根据团队id查看研发团队相关信息
* @param { String } competeTimeId 第几届信息的id
*/
async getSelectTeam() {
async getSelectTeam(condition) {
console.log(condition)
try {
const params = {param:{}}
const res = await getSelectTeam(params);
const params = {
param:{
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
}
if(condition){
if(condition.activityType){
params.param.activityType = condition.activityType
}
if(condition.titleKey){
params.param.titleKey = condition.titleKey
}
}
console.log(params.param)
const res = await getQueryBack(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data.list;
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}

51
src/views/IndustryInfo/IndustryInfo.vue

@ -1,14 +1,14 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<activity-search />
<activity-date />
<activity-search @getBackendSearch="getBackendSearch" />
<activity-date :pagination="pagination" :lists="lists" @getBackendSearch="getBackendSearch" />
</div>
</template>
<script>
import ActivitySearch from "components/Activity/ActivitySearch.vue";
import ActivityDate from "components/Activity/ActivityDate.vue";
// import { getSelectTeam } from 'config/api';
import { getBackendSearch } from 'config/api';
export default {
name: "ActivityBulletin",
@ -17,8 +17,15 @@ export default {
ActivityDate,
},
data() {
return {
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
created() {
// this.getSelectTeam()
this.getBackendSearch()
},
methods: {
@ -26,12 +33,42 @@ export default {
* 根据团队id查看研发团队相关信息
* @param { String } competeTimeId 第几届信息的id
*/
async getSelectTeam() {
async getBackendSearch(condition) {
try {
const params = {param:{}}
const res = await getSelectTeam(params);
const params = {
param: {
pageNum: (condition && condition.current) || 1,
pageSize: (condition && condition.pageSize) || 10,
},
};
if(condition){
if(condition.title){
params.param.title = condition.title
}
if(condition.spreadDepartment){
params.param.spreadDepartment = condition.spreadDepartment
}
if(condition.startTime){
params.param.startTime = condition.startTime
}
if(condition.endTime){
params.param.endTime = condition.endTime
}
if(condition.site){
params.param.site = condition.site
}
}
console.log('params',params)
const res = await getBackendSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log(data)
this.lists = data.list;
const paper = { ...this.pagination };
paper.current = data.pageNum;
paper.total = +data.total;
paper.pageSize = data.pageSize;
this.pagination = paper;
} else {
throw msg || '获取失败';
}

12
src/views/UserManage/UserManage.vue

@ -1,20 +1,20 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<enterprise-search />
<enterprise-date />
<user-search />
<user-date />
</div>
</template>
<script>
// @ is an alias to /src
import EnterpriseSearch from "components/Enterprise/EnterpriseSearch.vue";
import EnterpriseDate from "components/Enterprise/EnterpriseDate.vue";
import UserSearch from "components/User/UserSearch.vue";
import UserDate from "components/User/UserDate.vue";
export default {
name: "Home",
components: {
EnterpriseSearch,
EnterpriseDate
UserSearch,
UserDate
}
};
</script>

17361
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save