Browse Source

活动公告

master
ma 4 years ago
parent
commit
9e784f03de
  1. 19
      package-lock.json
  2. 81
      src/components/Activity/ActivityDate.vue
  3. 131
      src/components/Activity/ActivitySearch.vue
  4. 1
      src/components/Page/PageDate.vue
  5. 0
      src/components/User/UserDate.vue
  6. 0
      src/components/User/UserSearch.vue
  7. 10
      src/config/api.js
  8. 2
      src/plugins/ant-design-vue.js
  9. 53
      src/views/EventAnnouncement/EventAnnouncement.vue
  10. 44
      src/views/IndustryInfo/IndustryInfo.vue
  11. 12
      src/views/UserManage/UserManage.vue
  12. 14
      yarn.lock

19
package-lock.json

@ -15,6 +15,7 @@
"register-service-worker": "^1.7.1",
"stylus": "^0.54.8",
"vue": "^2.6.11",
"vue-dompurify-html": "^2.3.0",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
@ -5807,6 +5808,11 @@
"domelementtype": "1"
}
},
"node_modules/dompurify": {
"version": "2.2.6",
"resolved": "https://registry.npm.taobao.org/dompurify/download/dompurify-2.2.6.tgz?cache=0&sync_timestamp=1608303432721&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdompurify%2Fdownload%2Fdompurify-2.2.6.tgz",
"integrity": "sha1-VJRdxcC0XOWuIocFd36OWdey7cQ="
},
"node_modules/domready": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/domready/download/domready-1.0.8.tgz",
@ -14621,6 +14627,17 @@
"integrity": "sha1-KdTrSCdcf+FbkuH9XZX74qlmQ28=",
"dev": true
},
"node_modules/vue-dompurify-html": {
"version": "2.3.0",
"resolved": "https://registry.npm.taobao.org/vue-dompurify-html/download/vue-dompurify-html-2.3.0.tgz",
"integrity": "sha1-sXXt2lc2LPewPShkRo+mROBaKtA=",
"dependencies": {
"dompurify": "^2.0.0"
},
"peerDependencies": {
"vue": "^2.0.0"
}
},
"node_modules/vue-eslint-parser": {
"version": "7.1.1",
"resolved": "https://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-7.1.1.tgz?cache=0&sync_timestamp=1602498980660&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-eslint-parser%2Fdownload%2Fvue-eslint-parser-7.1.1.tgz",
@ -21159,7 +21176,7 @@
},
"dompurify": {
"version": "2.2.6",
"resolved": "https://registry.npm.taobao.org/dompurify/download/dompurify-2.2.6.tgz",
"resolved": "https://registry.npm.taobao.org/dompurify/download/dompurify-2.2.6.tgz?cache=0&sync_timestamp=1608303432721&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdompurify%2Fdownload%2Fdompurify-2.2.6.tgz",
"integrity": "sha1-VJRdxcC0XOWuIocFd36OWdey7cQ="
},
"domready": {

81
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,6 +16,10 @@
<span>{{ index + 1 }}</span>
</template>
<template slot="time" slot-scope="text, record">
<span v-if="record.releaseTime">{{ record.releaseTime}}</span><span v-if="record.releaseTime">-{{record.releaseTime}}</span>
</template>
<template slot="edit" slot-scope="text, record">
<a-icon @click="showEditModal(record)" class="pointer" theme="twoTone" type="edit" />
<a-popconfirm @confirm="() => onDelete(record.id)" title="确定要删除这一条?" v-if="lists.length">
@ -21,7 +28,8 @@
</template>
<div slot="expandedRowRender" slot-scope="record" style="margin: 0">
<div>详情{{ record.content }}</div>
<div>详情
<span v-dompurify-html="record.content"></span></div>
</div>
</a-table>
</div>
@ -34,7 +42,7 @@
<script>
import ActivityEdit from "components/Activity/ActivityEdit.vue";
// import { delTeam } from 'config/api';
import { deleteIndustryInfo } from 'config/api';
const columns = [
{
@ -44,35 +52,30 @@ const columns = [
key: 'id',
scopedSlots: { customRender: 'id' },
},
{
{
title: '标题',
align: 'center',
dataIndex: 'title',
key: 'title',
},
{
title: '简介',
align: 'center',
dataIndex: 'description',
key: 'description',
},
{
title: '地点',
align: 'center',
dataIndex: 'site',
key: 'site',
dataIndex: 'address',
key: 'address',
},
{
title: '发布部门',
title: '活动时间',
align: 'center',
dataIndex: 'spreadDepartment',
key: 'spreadDepartment',
dataIndex: 'time',
key: 'time',
scopedSlots: { customRender: 'time' },
},
{
title: '时间',
title: '公告简介',
align: 'center',
dataIndex: 'time',
key: 'time',
dataIndex: 'intro',
key: 'intro',
},
{
title: '编辑',
@ -90,10 +93,9 @@ export default {
ActivityEdit,
},
props: { lists: { type: Array, default: () => [] } },
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = this.lists.map(item => ({ ...item }));
return {
columns,
loading: false,
@ -104,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: {
@ -114,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 = [];
},
},
};

1
src/components/Page/PageDate.vue

@ -78,7 +78,6 @@ export default {
},
props: { lists: { type: Array, default: () => [] }, pagination: { type: Object, default: () => {} } },
data() {
this.cacheData = this.lists.map(item => ({ ...item }));
return {
columns,
loading: false,

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

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

10
src/config/api.js

@ -10,6 +10,7 @@ const greenvalley = `${proxyUrl}/greenvalley`;
const researchTeam = `${greenvalley}/researchTeam`; // 创新平台相关操作
const page = `${greenvalley}/page`; // 页面管理相关操作
const industryInfo = `${greenvalley}/industryInfo`; // 行业资讯相关操作
const activity = `${greenvalley}/activity`; // 活动公告相关操作
// websocket基础地址
@ -30,6 +31,15 @@ export const updatePage = params => axios.post(`${page}/update`, 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 || '获取失败';
}

44
src/views/IndustryInfo/IndustryInfo.vue

@ -1,7 +1,7 @@
<template>
<div class="pa-3 white fill-height d-flex flex-column">
<activity-search />
<activity-date :lists="lists" />
<activity-search @getBackendSearch="getBackendSearch" />
<activity-date :pagination="pagination" :lists="lists" @getBackendSearch="getBackendSearch" />
</div>
</template>
@ -19,7 +19,8 @@ export default {
data() {
return {
lists: []
lists: [],
pagination: { current: 1, pageSize: 10 },
};
},
@ -32,17 +33,42 @@ export default {
* 根据团队id查看研发团队相关信息
* @param { String } competeTimeId 第几届信息的id
*/
async getBackendSearch() {
async getBackendSearch(condition) {
try {
const params = {param:{
pageNum: 1,
pageSize: 10
}}
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
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>

14
yarn.lock

@ -3592,6 +3592,11 @@
dependencies:
"domelementtype" "1"
"dompurify@^2.0.0":
"integrity" "sha1-VJRdxcC0XOWuIocFd36OWdey7cQ="
"resolved" "https://registry.npm.taobao.org/dompurify/download/dompurify-2.2.6.tgz?cache=0&sync_timestamp=1608303432721&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdompurify%2Fdownload%2Fdompurify-2.2.6.tgz"
"version" "2.2.6"
"domready@1.0.8":
"integrity" "sha1-kfJS5Ze2Wvd+dFriTdAYXV4m1Yw="
"resolved" "https://registry.npm.taobao.org/domready/download/domready-1.0.8.tgz"
@ -9391,6 +9396,13 @@
"resolved" "https://registry.npm.taobao.org/vue-cli-plugin-axios/download/vue-cli-plugin-axios-0.0.4.tgz"
"version" "0.0.4"
"vue-dompurify-html@^2.3.0":
"integrity" "sha1-sXXt2lc2LPewPShkRo+mROBaKtA="
"resolved" "https://registry.npm.taobao.org/vue-dompurify-html/download/vue-dompurify-html-2.3.0.tgz"
"version" "2.3.0"
dependencies:
"dompurify" "^2.0.0"
"vue-eslint-parser@^7.0.0":
"integrity" "sha1-xDwccV/1B3i5p+mk4WkhGF80JdM="
"resolved" "https://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-7.1.1.tgz?cache=0&sync_timestamp=1602498980660&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-eslint-parser%2Fdownload%2Fvue-eslint-parser-7.1.1.tgz"
@ -9467,7 +9479,7 @@
"resolved" "https://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz"
"version" "1.9.1"
"vue@^2.6.11":
"vue@^2.0.0", "vue@^2.6.11":
"integrity" "sha1-9evU+mvShpQD4pqJau1JBEVskSM="
"resolved" "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz"
"version" "2.6.12"

Loading…
Cancel
Save