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

131
src/components/Activity/ActivitySearch.vue

@ -1,54 +1,18 @@
<template> <template>
<div class="d-flex flex-wrap pb-3"> <div class="d-flex flex-wrap pb-3">
<div> <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 <a-input
@change="handleChange('organizer',$event)"
class="ml-3" class="ml-3"
placeholder="组织人" placeholder="标题"
style="width: 100px" style="width: 150px"
v-model="organizer" v-model="titleKey"
/> />
<!-- 主讲人 -->
<a-input <!-- 活动类型 0路演 1讲座 2沙龙 不传参数则查询全部 -->
@change="handleChange('speaker',$event)" <span class="ml-8">活动类型</span>
class="ml-3" <a-checkbox-group :options="items" @change="onChange"/>
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>
<a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button> <a-button @click="handleTableChange" class="mx-2" type="primary">搜索</a-button>
</div> </div>
@ -73,25 +37,13 @@ export default {
data() { data() {
return { return {
visible: false, visible: false,
publishingPlatform: '', titleKey: '',
categories: [ items: ['路演','讲座','沙龙'],
{id:1,name:'路演'}, activityType: [],
{id:2,name:'沙龙'}, checkedValues: []
{id:3,name:'论坛'},
{id:4,name:'培训'},
{id:5,name:'讲座'},
{id:6,name:'创业活动'}
],
category: '',
place: '',
organizer: '',
speaker: '',
status: ['发布','不发布'],
state: '',
platforms: ['绿谷','维基'],
platform: ''
} }
}, },
methods: { methods: {
showModal(){ showModal(){
this.visible = true; this.visible = true;
@ -101,48 +53,27 @@ export default {
this.visible = false; this.visible = false;
}, },
handleChange(type, e) { onChange(checkedValues) {
this.type = e.target.value; this.checkedValues = checkedValues
},
//
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]);
}, },
async handleTableChange() { async handleTableChange() {
try { const { activityType,titleKey,checkedValues} = this;
// const params = { param: {publishingPlatform: this.publishingPlatform} }; for (let i = 0;i < checkedValues.length;i++) {
// const res = await selLikeTeam(params); const item = checkedValues[i];
// const { data, msg, code } = res.data; const currentIndex = this.items.indexOf(item)
// if (code === 200) { const a = this.items.findIndex(a => a === item)
// console.log('',data); const index = this.activityType.findIndex(c=>c === a.label)
// // TODO: if(index === -1){
// } else { this.activityType.push(currentIndex)
// throw msg; }
// } }
} catch (error) { //
this.$message.error(error); 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 greenvalley = `${proxyUrl}/greenvalley`;
const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作 const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作
const page = `${greenvalley}/page`; // 页面管理相关操作 const page = `${greenvalley}/page`; // 页面管理相关操作
const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作
const activity = `${greenvalley}/activity`; // 活动公告相关操作
// websocket基础地址 // websocket基础地址
export const WS_BASE_URL = msgUrl; 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 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`); export const getAllTeam = () => axios.post(`${researchTeam}/selectAllTeam`);

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

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

53
src/views/EventAnnouncement/EventAnnouncement.vue

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

51
src/views/IndustryInfo/IndustryInfo.vue

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

12
src/views/UserManage/UserManage.vue

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

17361
yarn.lock

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