This commit is contained in:
Air 2024-11-18 17:59:17 +08:00
parent 4538ad4132
commit 4d9ceb6de8
17 changed files with 2250 additions and 591 deletions

View File

@ -1,5 +1,5 @@
<template>
<router-view :class="[mode]" />
<router-view :key="$route.fullPath" :class="[mode]" />
</template>
<script>

View File

@ -1,5 +1,5 @@
<template>
<div>
<div class="key">
<template v-for="item in list">
<template v-if="!item.children || !item.children.length || item.meta?.single">
<t-menu-item
@ -15,6 +15,7 @@
</template>
{{ item.title }}
</t-menu-item>
<t-menu-item
v-else
:key="`${item.path}`"
@ -30,10 +31,12 @@
</t-menu-item>
</template>
<t-submenu v-else :name="item.path" :value="item.path" :title="item.title" :key="item.path">
<template #icon>
<t-icon v-if="typeof item.icon === 'string' && item.icon" :name="item.icon" />
<renderFnIcon :item="item" />
</template>
<menu-content v-if="item.children" :nav-data="item.children" />
</t-submenu>
</template>
@ -107,3 +110,8 @@ export default Vue.extend({
},
});
</script>
<style>
.key .key .key{
padding-left: 20px;
}
</style>

View File

@ -0,0 +1,334 @@
<template>
<t-card :bordered="false">
<div style="color: #2E2E2E;font-size: 20px;height: 50px">
<span>新增</span>
<span v-if="addForm.activity_type==1">协会活动</span>
<span v-if="addForm.activity_type==2">调查问卷</span>
<span v-if="addForm.activity_type==3">公益捐赠</span>
<span v-if="addForm.activity_type==4">学习培训</span>
</div>
<div>
<t-form layout="inline">
<t-form-item label="活动标题" name="activity_name">
<t-input size="large" placeholder="请输入活动标题" v-model="addForm.activity_name"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动简介" name="activity_desc">
<t-input size="large" placeholder="请输入活动简介" v-model="addForm.activity_desc"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动地址" name="activity_location">
<t-input size="large" placeholder="请输入活动地址" v-model="addForm.activity_location"
:style="{ width: '480px' }"/>
</t-form-item>
<!-- <t-form-item label="活动类别" name="activity_type">-->
<!-- <t-select size="large" v-model="addForm.activity_type" :style="{ width: '480px' }">-->
<!-- <t-option key="1" label="协会活动" value="1"/>-->
<!-- <t-option key="2" label="调查问卷" value="2"/>-->
<!-- <t-option key="3" label="公益捐赠" value="3"/>-->
<!-- <t-option key="4" label="学习培训" value="4"/>-->
<!-- </t-select>-->
<!-- </t-form-item>-->
<t-form-item label="显示报名人" name="if_display_registrants">
<t-select size="large" v-model="addForm.if_display_registrants" :style="{ width: '480px' }">
<t-option key="1" label="显示" value="1"/>
<t-option key="2" label="不显示" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名范围" name="range">
<t-select size="large" v-model="addForm.range" :style="{ width: '480px' }">
<t-option key="1" label="会员" value="1"/>
<!-- <t-option key="2" label="非会员" value="2"/>-->
<t-option key="3" label="不限制" value="3"/>
</t-select>
</t-form-item>
<t-form-item label="报名审核" name="if_auditing">
<t-select size="large" v-model="addForm.if_auditing" :style="{ width: '480px' }">
<t-option key="1" label="否" value="1"/>
<t-option key="2" label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名人数" name="number">
<t-input size="large" placeholder="请输入报名人数0为不限制" v-model="addForm.number"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="签到" name="if_sign">
<t-select size="large" v-model="addForm.if_sign" :style="{ width: '480px' }">
<t-option label="否" value="1"/>
<t-option label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item v-if="addForm.if_sign==2" label="签到积分" name="custom_points">
<t-input size="large" placeholder="请输入签到积分" v-model="addForm.custom_points"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item v-if="addForm.activity_type==4" label="付费金额" name="money">
<t-input size="large" placeholder="请输入付费金额0为免费" v-model="addForm.money"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动主图" :style="{ width: '100%' }">
<t-upload
ref="uploadRef2"
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.activity_image_show"
theme="image"
:data="{association_id:this.association.association_id}"
tips="请选择单张图片文件上传"
accept="image/*"
:allowUploadDuplicateFile="true"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item label="视频" v-if="addForm.activity_type==4" :style="{ width: '100%' }">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="activity_video_show"
tips="请选择单个视频文件上传"
accept="video/*"
:showImageFileName="true"
:imageViewerProps="true"
:format-response="formatResponseVideo"
></t-upload>
</t-form-item>
<t-form-item label="活动简介" name="activity_desc">
<div style="border: 1px solid #ccc;width: 100%;">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 400px;"
v-model="addForm.activity_content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
</t-form>
<!-- <t-form-item label="活动排序" name="weigh">-->
<!-- <t-input placeholder="请输入排序" v-model="addForm.weigh" :style="{ width: '480px' }"/>-->
<!-- </t-form-item>-->
<t-form layout="inline" style="margin-top: 20px;">
<t-form-item label="报名开始时间" name="signup_start_time">
<t-date-picker size="large" :clearable="true" placeholder="报名开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="报名结束时间" name="signup_end_time">
<t-date-picker size="large" :clearable="true" placeholder="报名结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_end_time"></t-date-picker>
</t-form-item>
</t-form>
<t-form layout="inline" style="margin-top: 20px;">
<t-form-item label="活动开始时间" name="activity_start_time">
<t-date-picker size="large" :clearable="true" placeholder="活动开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="活动结束时间" name="activity_end_time">
<t-date-picker size="large" :clearable="true" placeholder="活动结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_end_time"></t-date-picker>
</t-form-item>
</t-form>
<div style="text-align: center;width: 30%;margin: 0px auto;padding-top: 50px;">
<t-button @click="onSubmit" theme="primary" block size="large">
提交
</t-button>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
import {CloudDownloadIcon} from "tdesign-icons-vue";
import axios from "axios";
import {toInteger} from "lodash";
export default {
components: {Editor, Toolbar, CloudDownloadIcon},
data() {
return {
addForm: {
// weigh:0,
money: '0',
activity_name: '',
activity_desc: '',
activity_image_show: [],
activity_image: '',
activity_start_time: '',
activity_end_time: '',
activity_content: '',
activity_location: '',
activity_type: null,
if_display_registrants: null,
signup_start_time: '',
signup_end_time: '',
if_auditing: '1',
range: '3',
number: '',
if_sign: '1',
custom_points: ''
},
activity_video: '',
activity_video_show: [],
addMode: false,
editor: null,
toolbarConfig: {
showLinkImg: false,
uploadImgShowBase64: true,
excludeKeys: [
'insertVideo', //
'uploadVideo',
'group-video',
'insertImage',//
'insertLink',//
'insertTable',//
'codeBlock',//
]
},
editorConfig: {
placeholder: '',
readOnly: false, //
autoFocus: true,
MENU_CONF: {
uploadImage: {
maxFileSize: 50 * 1024 * 1024,
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
metaWithUrl: false,
meta: {
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
onError: (file, err, res) => {
if (err.message.indexOf('exceeds maximum allowed size') !== -1) {
this.$message.error('限制为50M请调整好再上传', 2000);
}
},
}
}
},
association: {},
typeName:0,
}
},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() //
},
mounted() {
if (typeof (store.state.user.association) == 'object') {
this.association = store.state.user.association;
} else {
this.association = JSON.parse(store.state.user.association);
}
this.editorConfig.MENU_CONF.uploadImage.meta.association_id = this.association.association_id;
var tab=this.$route.name.slice(-1);
this.addForm.activity_type = toInteger(tab);
},
methods: {
onCreated(editor) {
this.editor = Object.seal(editor);
},
formatResponseVideo(res) {
console.log(res);
this.activity_video = res.data.url;
return {url: res.data.fullurl};
},
formatResponse(res) {
console.log(res);
this.addForm.activity_image = res.data.url;
return {url: res.data.fullurl};
},
onSubmit() {
console.log(this.addForm);
if (this.addForm.activity_name == '') {
this.$message.error('活动标题不能为空');
return;
}
if (this.addForm.activity_desc == '') {
this.$message.error('活动简介不能为空');
return;
}
if (this.addForm.activity_type == null) {
this.$message.error('活动类别不能为空');
return;
}
if (this.addForm.activity_image == '') {
this.$message.error('活动图片不能为空');
return;
}
if (this.addForm.activity_content == '') {
this.$message.error('活动详情不能为空');
return;
}
if (this.addForm.activity_start_time == '') {
this.$message.error('活动开始时间不能为空');
return;
}
if (this.addForm.activity_end_time == '') {
this.$message.error('活动结束时间不能为空');
return;
}
if (this.addForm.activity_type == 1 || this.addForm.activity_type == 4) {
if (this.addForm.signup_start_time == '') {
this.$message.error('报名开始时间不能为空');
return;
}
if (this.addForm.signup_end_time == '') {
this.$message.error('报名结束时间不能为空');
return;
}
}
if (this.addForm.activity_location == '') {
this.$message.error('活动地址不能为空');
return;
}
if (this.addForm.activity_type == 2 || this.addForm.activity_type == 3) {
this.addForm.signup_start_time = this.addForm.activity_start_time;
this.addForm.signup_end_time = this.addForm.activity_end_time;
}
console.log(this.addForm);
var url = '/activity/add';
this.addForm.video = this.activity_video;
this.$request
.post(url, this.addForm)
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success('添加活动成功!');
this.$router.push({
path: '/activity'+this.addForm.activity_type+'/activity_index'+this.addForm.activity_type,
},500);
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
console.log(e);
});
},
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

View File

@ -0,0 +1,370 @@
<template>
<t-card :bordered="false">
<div style="color: #2E2E2E;font-size: 20px;height: 50px">修改协会活动</div>
<div>
<t-form layout="inline">
<t-form-item label="活动标题" name="activity_name">
<t-input size="large" placeholder="请输入活动标题" v-model="addForm.activity_name"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动简介" name="activity_desc">
<t-input size="large" placeholder="请输入活动简介" v-model="addForm.activity_desc"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动地址" name="activity_location">
<t-input size="large" placeholder="请输入活动地址" v-model="addForm.activity_location"
:style="{ width: '480px' }"/>
</t-form-item>
<!-- <t-form-item label="活动类别" name="activity_type">-->
<!-- <t-select size="large" v-model="addForm.activity_type" :style="{ width: '480px' }">-->
<!-- <t-option key="1" label="协会活动" value="1"/>-->
<!-- <t-option key="2" label="调查问卷" value="2"/>-->
<!-- <t-option key="3" label="公益捐赠" value="3"/>-->
<!-- <t-option key="4" label="学习培训" value="4"/>-->
<!-- </t-select>-->
<!-- </t-form-item>-->
<t-form-item label="显示报名人" name="if_display_registrants">
<t-select size="large" v-model="addForm.if_display_registrants" :style="{ width: '480px' }">
<t-option key="1" label="显示" value="1"/>
<t-option key="2" label="不显示" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名范围" name="range">
<t-select size="large" v-model="addForm.range" :style="{ width: '480px' }">
<t-option key="1" label="会员" value="1"/>
<!-- <t-option key="2" label="非会员" value="2"/>-->
<t-option key="3" label="不限制" value="3"/>
</t-select>
</t-form-item>
<t-form-item label="报名审核" name="if_auditing">
<t-select size="large" v-model="addForm.if_auditing" :style="{ width: '480px' }">
<t-option key="1" label="否" value="1"/>
<t-option key="2" label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item label="报名人数" name="number">
<t-input size="large" placeholder="请输入报名人数0为不限制" v-model="addForm.number"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="签到" name="if_sign">
<t-select size="large" v-model="addForm.if_sign" :style="{ width: '480px' }">
<t-option label="否" value="1"/>
<t-option label="是" value="2"/>
</t-select>
</t-form-item>
<t-form-item v-if="addForm.if_sign==2" label="签到积分" name="custom_points">
<t-input size="large" placeholder="请输入签到积分" v-model="addForm.custom_points"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item v-if="addForm.activity_type==4" label="付费金额" name="money">
<t-input size="large" placeholder="请输入付费金额0为免费" v-model="addForm.money"
:style="{ width: '480px' }"/>
</t-form-item>
<t-form-item label="活动主图" :style="{ width: '100%' }">
<t-upload
ref="uploadRef2"
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.activity_image_show"
theme="image"
:data="{association_id:this.association.association_id}"
tips="请选择单张图片文件上传"
accept="image/*"
:allowUploadDuplicateFile="true"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item label="视频" v-if="addForm.activity_type==4" :style="{ width: '100%' }">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="activity_video_show"
tips="请选择单个视频文件上传"
accept="video/*"
:showImageFileName="true"
:imageViewerProps="true"
:format-response="formatResponseVideo"
></t-upload>
</t-form-item>
<t-form-item label="活动简介" name="activity_desc">
<div style="border: 1px solid #ccc;width: 100%;">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 400px;"
v-model="addForm.activity_content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
</t-form>
<!-- <t-form-item label="活动排序" name="weigh">-->
<!-- <t-input placeholder="请输入排序" v-model="addForm.weigh" :style="{ width: '480px' }"/>-->
<!-- </t-form-item>-->
<t-form layout="inline" style="margin-top: 20px;">
<t-form-item label="报名开始时间" name="signup_start_time">
<t-date-picker size="large" :clearable="true" placeholder="报名开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="报名结束时间" name="signup_end_time">
<t-date-picker size="large" :clearable="true" placeholder="报名结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.signup_end_time"></t-date-picker>
</t-form-item>
</t-form>
<t-form layout="inline" style="margin-top: 20px;">
<t-form-item label="活动开始时间" name="activity_start_time">
<t-date-picker size="large" :clearable="true" placeholder="活动开始时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_start_time"></t-date-picker>
</t-form-item>
<t-form-item label="活动结束时间" name="activity_end_time">
<t-date-picker size="large" :clearable="true" placeholder="活动结束时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.activity_end_time"></t-date-picker>
</t-form-item>
</t-form>
<div style="text-align: center;width: 30%;margin: 0px auto;padding-top: 50px;">
<t-button @click="onSubmit" theme="primary" block size="large">
提交
</t-button>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
import {CloudDownloadIcon} from "tdesign-icons-vue";
import axios from "axios";
export default {
components: {Editor, Toolbar, CloudDownloadIcon},
data() {
return {
addForm: {
// weigh:0,
money: '0',
activity_name: '',
activity_desc: '',
activity_image_show: [],
activity_image: '',
activity_start_time: '',
activity_end_time: '',
activity_content: '',
activity_location: '',
activity_type: 1,
if_display_registrants: null,
signup_start_time: '',
signup_end_time: '',
if_auditing: '1',
range: '3',
number: '',
if_sign: '1',
custom_points: ''
},
addMode: false,
editID: 0,
editor: null,
toolbarConfig: {
showLinkImg: false,
uploadImgShowBase64: true,
excludeKeys: [
'insertVideo', //
'uploadVideo',
'group-video',
'insertImage',//
'insertLink',//
'insertTable',//
'codeBlock',//
]
},
activity_video: '',
activity_video_show: [],
editorConfig: {
placeholder: '',
readOnly: false, //
autoFocus: true,
MENU_CONF: {
uploadImage: {
maxFileSize: 50 * 1024 * 1024,
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
metaWithUrl: false,
meta: {
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
onError: (file, err, res) => {
if (err.message.indexOf('exceeds maximum allowed size') !== -1) {
this.$message.error('限制为50M请调整好再上传', 2000);
}
},
}
}
},
association: {},
}
},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() //
},
mounted() {
if (typeof (store.state.user.association) == 'object') {
this.association = store.state.user.association;
} else {
this.association = JSON.parse(store.state.user.association);
}
this.editorConfig.MENU_CONF.uploadImage.meta.association_id = this.association.association_id;
if (typeof (this.$route.query.id) !== 'undefined') {
console.log(this.$route.query);
this.editID = this.$route.query.id;
this.getActInfo();
}
},
methods: {
onCreated(editor) {
this.editor = Object.seal(editor);
},
formatResponseVideo(res) {
console.log(res);
this.activity_video = res.data.url;
return {url: res.data.fullurl};
},
formatResponse(res) {
console.log(res);
this.addForm.activity_image = res.data.url;
return {url: res.data.fullurl};
},
getActInfo() {
this.$request
.post('/activity/find', {id: this.editID})
.then((res) => {
this.edit(res.data);
})
.catch((e) => {
console.log(e);
});
},
edit(d) {
this.addForm.id = d.id;
this.activity_video = d.video;
if (d.video == '') {
this.activity_video_show = [];
} else {
this.activity_video_show = [{url: store.state.user.apiUrl + d.video, name: d.video}];
}
// this.addForm.weigh = d.weigh;
this.addForm.activity_name = d.activity_name;
this.addForm.activity_desc = d.activity_desc;
this.addForm.activity_image_show = [{url: store.state.user.apiUrl + d.activity_image}];
this.addForm.activity_image = d.activity_image;
this.addForm.activity_start_time = d.activity_start_time;
this.addForm.activity_end_time = d.activity_end_time;
this.addForm.activity_location = d.activity_location;
this.addForm.activity_content = d.activity_content;
this.addForm.activity_type = d.activity_type;
this.addForm.if_display_registrants = d.if_display_registrants;
this.addForm.money = d.money;
this.addForm.signup_start_time = d.signup_start_time;
this.addForm.signup_end_time = d.signup_end_time;
this.addForm.if_auditing = String(d.if_auditing);
this.addForm.range = String(d.range);
this.addForm.number = String(d.number);
this.addForm.if_sign = String(d.if_sign);
this.addForm.custom_points = String(d.custom_points);
},
onSubmit() {
console.log(this.addForm);
if (this.addForm.activity_name == '') {
this.$message.error('活动标题不能为空');
return;
}
if (this.addForm.activity_desc == '') {
this.$message.error('活动简介不能为空');
return;
}
if (this.addForm.activity_type == null) {
this.$message.error('活动类别不能为空');
return;
}
if (this.addForm.activity_image == '') {
this.$message.error('活动图片不能为空');
return;
}
if (this.addForm.activity_content == '') {
this.$message.error('活动详情不能为空');
return;
}
if (this.addForm.activity_start_time == '') {
this.$message.error('活动开始时间不能为空');
return;
}
if (this.addForm.activity_end_time == '') {
this.$message.error('活动结束时间不能为空');
return;
}
if (this.addForm.activity_type == 1 || this.addForm.activity_type == 4) {
if (this.addForm.signup_start_time == '') {
this.$message.error('报名开始时间不能为空');
return;
}
if (this.addForm.signup_end_time == '') {
this.$message.error('报名结束时间不能为空');
return;
}
}
if (this.addForm.activity_location == '') {
this.$message.error('活动地址不能为空');
return;
}
if (this.addForm.activity_type == 2 || this.addForm.activity_type == 3) {
this.addForm.signup_start_time = this.addForm.activity_start_time;
this.addForm.signup_end_time = this.addForm.activity_end_time;
}
console.log(this.addForm);
var url = '/activity/update';
this.addForm.video = this.activity_video;
this.$request
.post(url, this.addForm)
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success('修改活动成功!');
this.$router.push({
path: '/activity'+this.addForm.activity_type+'/activity_index'+this.addForm.activity_type,
},500);
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
console.log(e);
});
},
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +1,82 @@
<template>
<div>
<!-- <t-back-top-->
<!-- container=".tdesign-starter-layout"-->
<!-- :visible-height="0"-->
<!-- style="position: absolute"-->
<!-- :offset="['24px', '80px']"-->
<!-- >-->
<!-- <t-icon name="backtop" size="20px" />-->
<!-- </t-back-top>-->
<!-- <t-back-top-->
<!-- container=".tdesign-starter-layout"-->
<!-- :visible-height="0"-->
<!-- style="position: absolute"-->
<!-- :offset="['24px', '80px']"-->
<!-- >-->
<!-- <t-icon name="backtop" size="20px" />-->
<!-- </t-back-top>-->
<!-- 顶部 card -->
<top-panel class="row-container" />
<!-- 中部图表 -->
<middle-chart class="row-container" />
<!-- 列表排名 -->
<rank-list class="row-container" />
<!-- 出入库概览 -->
<output-overview class="row-container" />
<!-- <top-panel class="row-container" />-->
<!-- &lt;!&ndash; 中部图表 &ndash;&gt;-->
<!-- <middle-chart class="row-container" />-->
<!-- &lt;!&ndash; 列表排名 &ndash;&gt;-->
<!-- <rank-list class="row-container" />-->
<!-- &lt;!&ndash; 出入库概览 &ndash;&gt;-->
<!-- <output-overview class="row-container" />-->
<div class="dashboard-detail">
<t-card title="待办事项" class="dashboard-detail-card" :bordered="false">
<t-row :gutter="[16, 16]">
<t-col v-for="(item, index) in list" :key="index" :xs="6" :xl="3">
<t-card :title="item.name" style="cursor: pointer;">
<div style="display: flex;justify-content: space-between;align-items: center">
<div style="font-size: 30px;color:#0052D9">{{ item.value }}</div>
<div>
<icon name="chevron-right-s" style=""/>
</div>
</div>
</t-card>
</t-col>
</t-row>
</t-card>
</div>
<div class="dashboard-detail" style="margin-top: 10px;">
<t-card title="账户信息" class="dashboard-detail-card" :bordered="false">
<t-row :gutter="[16, 16]">
<t-col v-for="(item, index) in user_list" :key="index" :xs="6" :xl="3">
<t-card :title="item.name" style="cursor: pointer;">
<div style="display: flex;justify-content: space-between;align-items: center">
<div style="font-size: 30px;color:#0052D9">{{ item.value }}</div>
<div>
<icon name="chevron-right-s" style=""/>
</div>
</div>
</t-card>
</t-col>
</t-row>
</t-card>
</div>
</div>
</template>
<script>
import TopPanel from './components/TopPanel.vue';
import MiddleChart from './components/MiddleChart.vue';
import RankList from './components/RankList.vue';
import OutputOverview from './components/OutputOverview.vue';
import {Icon} from 'tdesign-icons-vue';
export default {
name: 'DashboardBase',
components: {
TopPanel,
MiddleChart,
RankList,
OutputOverview,
Icon,
},
data() {
return {
list: [
{name: '入会审核', value: '11'},
{name: '青企圈审核', value: '5'},
{name: '青企圈评论审核', value: '7'},
{name: '会员发票', value: '1'},
{name: '编辑信息审核', value: '5'},
{name: '报名审核', value: '19'},
{name: '生日提醒', value: '3'},
{name: '会费逾期', value: '275'},
],
user_list: [
{name: '访问日志', value: '126'},
{name: '操作日志', value: '595'},
{name: '短信余量', value: '402'},
{name: '存储空间', value: '500G'},
{name: '剩余空间', value: '450G'},
]
}
},
mounted() {
// var reload=localStorage.getItem('reload');
@ -47,6 +93,7 @@ export default {
.row-container {
margin-bottom: 16px;
}
/deep/ .t-card__body {
padding-top: 0;
}

274
src/pages/news/news_add.vue Normal file
View File

@ -0,0 +1,274 @@
<script setup lang="ts">
</script>
<template>
<t-card :bordered="false">
<div class="form-step-container">
<!-- <t-dialog :header="isEdit?'编辑新闻':'新增新闻'" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit"-->
<!-- width="45%" top="20px">-->
<t-form >
<t-form-item label="文章标题" name="news_title">
<t-input size="large" placeholder="请输入文章标题" v-model="addForm.news_title"/>
</t-form-item>
<t-form-item label="简短标题" name="news_titleshort">
<t-input size="large" placeholder="请输入简短标题" v-model="addForm.news_titleshort"/>
</t-form-item>
<t-form-item label="所属类目" name="activity_location">
<t-select size="large" v-model="addForm.gory_id">
<t-option v-for="(item,index) in gory_list" :key="index" :label="item.name" :value="item.id" />
</t-select>
</t-form-item>
<t-form-item label="作者" name="news_auto">
<t-input size="large" placeholder="请输入作者" v-model="addForm.news_auto"/>
</t-form-item>
<t-form-item label="来源" name="news_source">
<t-input size="large" placeholder="请输入来源" v-model="addForm.news_source"/>
</t-form-item>
<t-form-item label="点击量" name="news_source">
<t-input size="large" placeholder="请输入自定义点击量" v-model="addForm.news_hits"/>
</t-form-item>
<t-form-item label="微信文章链接" name="wx_url">
<t-input size="large" placeholder="请输入微信文章链接" v-model="addForm.wx_url"/>
</t-form-item>
<t-form-item label="新闻内容" name="news_content">
<div style="border: 1px solid #ccc;z-index: 99">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 400px;"
v-model="addForm.news_content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
<t-form-item label="新闻主图">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.news_image_show"
theme="image"
tips="请选择单张图片文件上传"
accept="image/*"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item
label="展示时间"
name="days">
<t-date-picker size="large" :style="{ width: '200px' }" :clearable="true" placeholder="展示时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.showtime"></t-date-picker>
</t-form-item>
</t-form>
<div style="padding: 50px 0px;text-align: center">
<t-button size="large" @click="onSubmit">提交</t-button>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
export default {
components: {Editor, Toolbar},
data() {
return {
visible: false,
infoMode: false,
ser:{
news_title:'',
gory_id:'',
},
addForm: {
news_title: '',
news_titleshort: '',
gory_id: null,
news_auto: '',
news_source: '',
news_content: '',
news_image: '',
news_image_show:[],
showtime:'',
news_hits:0,
wx_url:'',
},
addMode: false,
isEdit: false,
editID: 0,
gory_list:[],
editor: null,
toolbarConfig: {
showLinkImg: false,
uploadImgShowBase64: true,
excludeKeys: [
'insertVideo', //
'insertImage',//
'insertLink',//
'insertTable',//
'codeBlock',//
]
},
editorConfig: {
placeholder: '',
readOnly: false, //
autoFocus: true,
MENU_CONF: {
uploadImage: {
maxFileSize: 50 * 1024 * 1024,
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
meta:{
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
},
uploadVideo: {
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
}
}
},
}
},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() //
},
mounted() {
//this.member_id=this.$route.query.id;
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
}
this.editorConfig.MENU_CONF.uploadImage.meta.association_id=this.association.id;
this.getGory();
},
methods: {
formatResponse(res) {
console.log(res);
this.addForm.news_image = res.data.url;
return {url: res.data.fullurl};
},
onCreated(editor) {
this.editor = Object.seal(editor);
},
edit(d) {
console.log(d);
this.addForm.news_id = d.news_id;
this.addForm.news_title = d.news_title;
this.addForm.news_titleshort = d.news_titleshort;
this.addForm.news_image_show = [{url: store.state.user.apiUrl + d.news_image}];
this.addForm.news_image = d.news_image;
this.addForm.gory_id = d.gory_id;
this.addForm.news_auto = d.news_auto;
this.addForm.news_source = d.news_source;
this.addForm.news_content = d.news_content;
this.addForm.showtime = d.showtime
this.addForm.news_hits = d.news_hits;
this.addForm.wx_url=d.wx_url;
this.addMode = true;
this.isEdit = true;
},
getGory(){
this.$request
.post("/gory/index")
.then((res) => {
console.log(res);
if (res.code == 1) {
this.gory_list=res.data;
}
})
.catch((e) => {
console.log(e);
});
},
onSubmit() {
console.log(this.addForm);
if (this.addForm.news_title == '') {
this.$message.error('新闻标题不能为空');
return;
}
if (this.addForm.news_titleshort == '') {
this.$message.error('简短标题不能为空');
return;
}
if (this.addForm.gory_id == null) {
this.$message.error('请选择新闻分类');
return;
}
if (this.addForm.news_auto == '') {
this.$message.error('作者不能为空');
return;
}
if (this.addForm.news_source == '') {
this.$message.error('来源不能为空');
return;
}
// if (this.addForm.news_content == '') {
// this.$message.error('');
// return;
// }
if (this.addForm.news_image=='') {
this.$message.error('新闻主图不能为空');
return;
}
if (this.addForm.showtime=='') {
this.$message.error('展示时间不能为空');
return;
}
var url = '/news/add';
this.$request
.post(url, this.addForm)
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success(res.msg);
setTimeout(()=>{
this.$router.push({
path: '/news/news_index',
},500);
})
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
console.log(e);
});
},
onCloseMy() {
this.addMode = false;
this.infoMode = false;
}
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

View File

@ -1,7 +1,36 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-button @click="add">新增</t-button>
<t-form
ref="form"
:data="ser"
:label-width="80"
@submit="onSubmit"
>
<t-row>
<!-- <t-form-item name="nikename">-->
<!-- <t-button @click="add">添加新闻</t-button>-->
<!-- </t-form-item>-->
<t-form-item label="标题">
<t-input
v-model="ser.news_title"
class="form-item-content"
type="search"
placeholder="请输入标题"
style="width: 150px"
/>
</t-form-item>
<t-form-item label="所属类目" style="margin-left: 20px;">
<t-select v-model="ser.gory_id">
<t-option :key="0" label="全部" value=""></t-option>
<t-option v-for="(item,index) in gory_list" :key="index" :label="item.name" :value="item.id" />
</t-select>
</t-form-item>
<t-form-item name="nikename">
<t-button theme="warning" @click="serDo" style="margin-left: 20px">搜索</t-button>
</t-form-item>
</t-row>
</t-form>
<t-table
rowKey="index"
:data="list"
@ -36,71 +65,7 @@
></t-pagination>
</div>
</div>
<t-dialog :header="isEdit?'编辑新闻':'新增新闻'" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit"
width="45%" top="20px">
<t-form>
<t-form-item label="文章标题" name="news_title">
<t-input placeholder="请输入文章标题" v-model="addForm.news_title"/>
</t-form-item>
<t-form-item label="简短标题" name="news_titleshort">
<t-input placeholder="请输入简短标题" v-model="addForm.news_titleshort"/>
</t-form-item>
<t-form-item label="所属类目" name="activity_location">
<t-select v-model="addForm.gory_id">
<t-option v-for="(item,index) in gory_list" :key="index" :label="item.name" :value="item.id" />
</t-select>
</t-form-item>
<t-form-item label="作者" name="news_auto">
<t-input placeholder="请输入作者" v-model="addForm.news_auto"/>
</t-form-item>
<t-form-item label="来源" name="news_source">
<t-input placeholder="请输入来源" v-model="addForm.news_source"/>
</t-form-item>
<t-form-item label="点击量" name="news_source">
<t-input placeholder="请输入自定义点击量" v-model="addForm.news_hits"/>
</t-form-item>
<t-form-item label="微信文章链接" name="wx_url">
<t-input placeholder="请输入微信文章链接" v-model="addForm.wx_url"/>
</t-form-item>
<t-form-item label="新闻内容" name="news_content">
<div style="border: 1px solid #ccc;z-index: 99">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 200px"
v-model="addForm.news_content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
<t-form-item label="新闻主图">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.news_image_show"
theme="image"
tips="请选择单张图片文件上传"
accept="image/*"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item
label="展示时间"
name="days">
<t-date-picker :style="{ width: '200px' }" :clearable="true" placeholder="展示时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.showtime"></t-date-picker>
</t-form-item>
</t-form>
</t-dialog>
</t-card>
</template>
@ -114,6 +79,10 @@ export default {
return {
visible: false,
infoMode: false,
ser:{
news_title:'',
gory_id:'',
},
addForm: {
news_title: '',
news_titleshort: '',
@ -211,6 +180,10 @@ export default {
this.getGory();
},
methods: {
serDo(){
this.pagination.page = 1;
this.getList();
},
onCurrentChange(d) {
this.pagination.page = d;
this.getList();
@ -310,7 +283,7 @@ export default {
},
getList() {
this.$request
.post("/news", {page: this.pagination.page, size: this.pagination.size})
.post("/news", {page: this.pagination.page, size: this.pagination.size,gory_id:this.ser.gory_id,news_title:this.ser.news_title})
.then((res) => {
console.log(res);
if (res.code == 1) {

View File

@ -285,19 +285,9 @@ export default {
};
},
edit(d) {
console.log(d);
this.addForm.id = d.id;
this.addForm.title = d.title;
this.addForm.image_show = [{url: store.state.user.apiUrl + d.image}];
this.addForm.image = d.image;
this.addForm.category_id = d.category_id;
this.addForm.article_source = d.article_source;
this.addForm.content = d.content;
this.addForm.number_of_views = d.number_of_views;
this.addForm.display_time=d.display_time;
this.addForm.wx_url=d.wx_url;
this.addMode = true;
this.isEdit = true;
this.$router.push({
path: '/pc/pc_news_edit?id=' + d.id,
});
},
serDo(){
this.pagination.page=1;

View File

@ -0,0 +1,242 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-form>
<t-form-item label="文章标题" name="news_title">
<t-input size="large" placeholder="请输入文章标题" v-model="addForm.title"/>
</t-form-item>
<t-form-item label="所属类目" name="activity_location">
<t-select size="large" v-model="addForm.category_id">
<t-option v-for="(item,index) in gory_list" :key="index" :label="item.category_name" :value="item.id" />
</t-select>
</t-form-item>
<t-form-item label="来源" name="news_source">
<t-input size="large" placeholder="请输入来源" v-model="addForm.article_source"/>
</t-form-item>
<t-form-item label="点击量" name="news_source">
<t-input size="large" placeholder="请输入自定义点击量" v-model="addForm.number_of_views"/>
</t-form-item>
<t-form-item label="微信文章链接" name="wx_url">
<t-input size="large" placeholder="请输入微信文章链接" v-model="addForm.wx_url"/>
</t-form-item>
<t-form-item label="新闻内容" name="news_content">
<div style="border: 1px solid #ccc;z-index: 99">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 400px"
v-model="addForm.content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
<t-form-item label="新闻主图">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.image_show"
theme="image"
tips="请选择单张图片文件上传"
accept="image/*"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item
label="展示时间"
name="days">
<t-date-picker size="large" :style="{ width: '200px' }" :clearable="true" placeholder="展示时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.display_time"></t-date-picker>
</t-form-item>
</t-form>
<div style="padding: 50px 0px;text-align: center">
<t-button size="large" @click="onSubmit">提交</t-button>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
export default {
components: {Editor, Toolbar},
data() {
return {
addForm: {
title: '',
category_id: null,
article_source: '',
content: '',
image: '',
image_show:[],
number_of_views:0,
display_time:'',
wx_url:'',
},
addMode: false,
isEdit: false,
editID: 0,
gory_list:[],
editor: null,
toolbarConfig: {
showLinkImg: false,
uploadImgShowBase64: true,
excludeKeys: [
'insertVideo', //
'insertImage',//
'insertLink',//
'insertTable',//
'codeBlock',//
]
},
editorConfig: {
placeholder: '',
readOnly: false, //
autoFocus: true,
MENU_CONF: {
uploadImage: {
maxFileSize: 50 * 1024 * 1024,
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
meta:{
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
onError:(file, err, res)=>{
if(err.message.indexOf('exceeds maximum allowed size') !== -1){
this.$message.error('限制为50M请调整好再上传',2000);
}
},
},
uploadVideo: {
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
}
}
},
}
},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() //
},
mounted() {
//this.member_id=this.$route.query.id;
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
}
this.editorConfig.MENU_CONF.uploadImage.meta.association_id=this.association.id;
this.getGory();
},
methods: {
formatResponse(res) {
console.log(res);
this.addForm.image = res.data.url;
return {url: res.data.fullurl};
},
onCreated(editor) {
this.editor = Object.seal(editor);
},
edit(d) {
console.log(d);
this.addForm.id = d.id;
this.addForm.title = d.title;
this.addForm.image_show = [{url: store.state.user.apiUrl + d.image}];
this.addForm.image = d.image;
this.addForm.category_id = d.category_id;
this.addForm.article_source = d.article_source;
this.addForm.content = d.content;
this.addForm.number_of_views = d.number_of_views;
this.addForm.display_time=d.display_time;
this.addForm.wx_url=d.wx_url;
this.addMode = true;
this.isEdit = true;
},
getGory(){
this.$request
.post("/pc/pc_news/gory")
.then((res) => {
console.log(res);
if (res.code == 1) {
this.gory_list=res.data;
}
})
.catch((e) => {
console.log(e);
});
},
onSubmit() {
console.log(this.addForm);
if (this.addForm.title == '') {
this.$message.error('新闻标题不能为空');
return;
}
if (this.addForm.category_id == null) {
this.$message.error('请选择新闻分类');
return;
}
if (this.addForm.article_source == '') {
this.$message.error('来源不能为空');
return;
}
// if (this.addForm.content == '') {
// this.$message.error('');
// return;
// }
if (this.addForm.image=='') {
this.$message.error('新闻主图不能为空');
return;
}
var url = '/pc_news/articleadd';
if (this.isEdit) {
url = '/pc_news/articleupdate';
}
this.$request
.post(url, this.addForm)
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success(res.msg);
this.addMode = false;
this.getList();
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
console.log(e);
});
},
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

View File

@ -0,0 +1,290 @@
<script setup lang="ts">
</script>
<template>
<t-card :bordered="false">
<div class="form-step-container">
<!-- <t-dialog :header="isEdit?'编辑新闻':'新增新闻'" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit"-->
<!-- width="45%" top="20px">-->
<t-form >
<t-form-item label="文章标题" name="news_title">
<t-input size="large" placeholder="请输入文章标题" v-model="addForm.news_title"/>
</t-form-item>
<t-form-item label="简短标题" name="news_titleshort">
<t-input size="large" placeholder="请输入简短标题" v-model="addForm.news_titleshort"/>
</t-form-item>
<t-form-item label="所属类目" name="activity_location">
<t-select size="large" v-model="addForm.gory_id">
<t-option v-for="(item,index) in gory_list" :key="index" :label="item.name" :value="item.id" />
</t-select>
</t-form-item>
<t-form-item label="作者" name="news_auto">
<t-input size="large" placeholder="请输入作者" v-model="addForm.news_auto"/>
</t-form-item>
<t-form-item label="来源" name="news_source">
<t-input size="large" placeholder="请输入来源" v-model="addForm.news_source"/>
</t-form-item>
<t-form-item label="点击量" name="news_source">
<t-input size="large" placeholder="请输入自定义点击量" v-model="addForm.news_hits"/>
</t-form-item>
<t-form-item label="微信文章链接" name="wx_url">
<t-input size="large" placeholder="请输入微信文章链接" v-model="addForm.wx_url"/>
</t-form-item>
<t-form-item label="新闻内容" name="news_content">
<div style="border: 1px solid #ccc;z-index: 99">
<!-- 工具栏 -->
<Toolbar
style="border-bottom: 1px solid #ccc"
mode="default"
:editor="editor"
:defaultConfig="toolbarConfig"
/>
<Editor
style="height: 400px;"
v-model="addForm.news_content"
:defaultConfig="editorConfig"
mode="default"
@onCreated="(e) => onCreated(e)"
/>
</div>
</t-form-item>
<t-form-item label="新闻主图">
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="addForm.news_image_show"
theme="image"
tips="请选择单张图片文件上传"
accept="image/*"
:format-response="formatResponse"
></t-upload>
</t-form-item>
<t-form-item
label="展示时间"
name="days">
<t-date-picker size="large" :style="{ width: '200px' }" :clearable="true" placeholder="展示时间"
:enableTimePicker="true" :allow-input="false"
v-model="addForm.showtime"></t-date-picker>
</t-form-item>
</t-form>
<div style="padding: 50px 0px;text-align: center">
<t-button size="large" @click="onSubmit">提交</t-button>
</div>
</div>
</t-card>
</template>
<script lang="ts">
import store from "@/store";
import {Editor, Toolbar} from '@wangeditor/editor-for-vue';
export default {
components: {Editor, Toolbar},
data() {
return {
visible: false,
infoMode: false,
ser:{
news_title:'',
gory_id:'',
},
addForm: {
news_title: '',
news_titleshort: '',
gory_id: null,
news_auto: '',
news_source: '',
news_content: '',
news_image: '',
news_image_show:[],
showtime:'',
news_hits:0,
wx_url:'',
},
addMode: false,
isEdit: false,
editID: 0,
gory_list:[],
editor: null,
toolbarConfig: {
showLinkImg: false,
uploadImgShowBase64: true,
excludeKeys: [
'insertVideo', //
'insertImage',//
'insertLink',//
'insertTable',//
'codeBlock',//
]
},
editorConfig: {
placeholder: '',
readOnly: false, //
autoFocus: true,
MENU_CONF: {
uploadImage: {
maxFileSize: 50 * 1024 * 1024,
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
meta:{
association_id: 0,
},
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
},
uploadVideo: {
server: store.state.user.apiUrl + '/api/common/upload',
fieldName: 'file',
customInsert(res: any, insertFn: InsertFnType) { // TS
// customInsert(res, insertFn) { // JS
// res
console.log(res);
// res url alt href
insertFn(res.data.fullurl, '', '')
},
}
}
},
}
},
beforeDestroy() {
const editor = this.editor
if (editor == null) return
editor.destroy() //
},
mounted() {
//this.member_id=this.$route.query.id;
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
}
this.editorConfig.MENU_CONF.uploadImage.meta.association_id=this.association.id;
if (typeof (this.$route.query.id) !== 'undefined') {
console.log(this.$route.query);
this.editID = this.$route.query.id;
this.getActInfo();
}
this.getGory();
},
methods: {
getActInfo(){
this.$request
.post('/news/find', {id: this.editID})
.then((res) => {
//this.edit(res.data);
})
.catch((e) => {
console.log(e);
});
},
formatResponse(res) {
console.log(res);
this.addForm.news_image = res.data.url;
return {url: res.data.fullurl};
},
onCreated(editor) {
this.editor = Object.seal(editor);
},
edit(d) {
console.log(d);
this.addForm.news_id = d.news_id;
this.addForm.news_title = d.news_title;
this.addForm.news_titleshort = d.news_titleshort;
this.addForm.news_image_show = [{url: store.state.user.apiUrl + d.news_image}];
this.addForm.news_image = d.news_image;
this.addForm.gory_id = d.gory_id;
this.addForm.news_auto = d.news_auto;
this.addForm.news_source = d.news_source;
this.addForm.news_content = d.news_content;
this.addForm.showtime = d.showtime
this.addForm.news_hits = d.news_hits;
this.addForm.wx_url=d.wx_url;
this.addMode = true;
this.isEdit = true;
},
getGory(){
this.$request
.post("/gory/index")
.then((res) => {
console.log(res);
if (res.code == 1) {
this.gory_list=res.data;
}
})
.catch((e) => {
console.log(e);
});
},
onSubmit() {
console.log(this.addForm);
if (this.addForm.news_title == '') {
this.$message.error('新闻标题不能为空');
return;
}
if (this.addForm.news_titleshort == '') {
this.$message.error('简短标题不能为空');
return;
}
if (this.addForm.gory_id == null) {
this.$message.error('请选择新闻分类');
return;
}
if (this.addForm.news_auto == '') {
this.$message.error('作者不能为空');
return;
}
if (this.addForm.news_source == '') {
this.$message.error('来源不能为空');
return;
}
// if (this.addForm.news_content == '') {
// this.$message.error('');
// return;
// }
if (this.addForm.news_image=='') {
this.$message.error('新闻主图不能为空');
return;
}
if (this.addForm.showtime=='') {
this.$message.error('展示时间不能为空');
return;
}
var url = '/news/update';
this.addForm.id=this.editID
this.$request
.post(url, this.addForm)
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success(res.msg);
setTimeout(()=>{
this.$router.push({
path: '/news/news_index',
},500);
})
} else {
this.$message.error(res.msg);
}
})
.catch((e) => {
console.log(e);
});
},
onCloseMy() {
this.addMode = false;
this.infoMode = false;
}
}
}
</script>
<style src="@wangeditor/editor/dist/css/style.css"></style>

View File

@ -1,11 +1,11 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-tabs v-model="state" @change="tabIndexChange">
<t-tab-panel :value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
<!-- <t-tabs v-model="state" @change="tabIndexChange">-->
<!-- <t-tab-panel :value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>-->
<!-- </t-tabs>-->
<t-table
rowKey="index"
:data="list"
@ -64,6 +64,7 @@
</template>
<script lang="ts">
import store from "@/store";
import {toInteger} from "lodash";
export default {
data() {
@ -94,8 +95,9 @@ export default {
}else{
this.association=JSON.parse(store.state.user.association);
}
var tab=this.$route.name.slice(-1);
this.state = toInteger(tab);
this.getList();
//this.getGory();
},
methods: {
tabIndexChange(index){

View File

@ -1,11 +1,11 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-tabs v-model="state" @change="tabIndexChange">
<t-tab-panel :value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
<!-- <t-tabs v-model="state" @change="tabIndexChange">-->
<!-- <t-tab-panel :value="1" label="待审核" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="2" label="已通过" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="3" label="已拒绝" :destroyOnHide="false"></t-tab-panel>-->
<!-- </t-tabs>-->
<t-table
rowKey="index"
:data="list"
@ -63,6 +63,7 @@
</template>
<script lang="ts">
import store from "@/store";
import {toInteger} from "lodash";
export default {
data() {
@ -92,6 +93,8 @@ export default {
}else{
this.association=JSON.parse(store.state.user.association);
}
var tab=this.$route.name.slice(-1);
this.state=tab;
this.getList();
//this.getGory();
},

View File

@ -50,12 +50,12 @@
</div>
</t-row>
</t-form>
<t-tabs v-model="tabIndex" @change="tabIndexChange">
<t-tab-panel :value="1" label="正式会员" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="0" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="3" label="待缴纳会费" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="2" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
<!-- <t-tabs v-model="tabIndex" @change="tabIndexChange">-->
<!-- <t-tab-panel :value="1" label="正式会员" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="0" label="待审核" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="3" label="待缴纳会费" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="2" label="已拒绝" :destroyOnHide="false"></t-tab-panel>-->
<!-- </t-tabs>-->
<t-table
row-key="member_id"
:data="list"
@ -113,6 +113,7 @@
import store from "@/store";
import {toInteger} from "lodash";
import {CloudDownloadIcon} from 'tdesign-icons-vue';
import router from "@/router";
export default {
components: {
@ -155,6 +156,7 @@ export default {
}
},
mounted() {
if (typeof (this.$store.state.user.association) == 'object') {
this.association = this.$store.state.user.association;
} else {
@ -164,10 +166,13 @@ export default {
if (page) {
this.page = toInteger(page);
}
const Tab = sessionStorage.getItem('sUserTab');
if (Tab) {
this.tabIndex = toInteger(Tab);
}
var tab=this.$route.name.slice(-1);
this.tabIndex = toInteger(tab);
console.log(tab);
// const Tab = sessionStorage.getItem('sUserTab');
// if (Tab) {
// this.tabIndex = toInteger(Tab);
// }
this.getList();
this.getPositionList();
this.getRegion();

View File

@ -1,10 +1,10 @@
<template>
<t-card :bordered="false">
<t-tabs v-model="tabIndex" @change="tabIndexChange">
<t-tab-panel :value="3" label="待审核" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="1" label="已通过" :destroyOnHide="false"></t-tab-panel>
<t-tab-panel :value="2" label="已拒绝" :destroyOnHide="false"></t-tab-panel>
</t-tabs>
<!-- <t-tabs v-model="tabIndex" @change="tabIndexChange">-->
<!-- <t-tab-panel :value="3" label="待审核" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="1" label="已通过" :destroyOnHide="false"></t-tab-panel>-->
<!-- <t-tab-panel :value="2" label="已拒绝" :destroyOnHide="false"></t-tab-panel>-->
<!-- </t-tabs>-->
<div class="form-step-container">
<t-table
rowKey="index"
@ -104,6 +104,7 @@
</template>
<script lang="ts">
import store from "@/store";
import {toInteger} from "lodash";
export default {
data() {
@ -137,7 +138,8 @@ export default {
} else {
this.association = JSON.parse(store.state.user.association);
}
console.log(this.association);
var tab=this.$route.name.slice(-1);
this.tabIndex = toInteger(tab);
this.getList();
},
methods: {

View File

@ -1,4 +1,3 @@
import { DashboardIcon } from 'tdesign-icons-vue';
import Layout from '@/layouts/index.vue';
export default [
@ -8,15 +7,16 @@ export default [
redirect: '/dashboard/base',
name: 'dashboard',
meta: {
title: '首页',
icon: DashboardIcon,
title: '待办事项',
icon: 'chat-bubble-history',
single:true,
},
children: [
{
path: 'base',
name: 'DashboardBase',
component: () => import('@/pages/dashboard/base/index.vue'),
meta: { title: '数据大屏' },
meta: { title: '待办事项' },
}
],
},

View File

@ -1,5 +1,3 @@
import {ViewModuleIcon, UsergroupIcon, ViewListIcon, ChartBubbleIcon, HomeIcon, HelpIcon,UserAvatarIcon} from 'tdesign-icons-vue';
import Layout from '@/layouts/index.vue';
export default [
@ -8,32 +6,46 @@ export default [
name: 'user',
component: Layout,
redirect: '/user/user_index',
meta: {title: '会员管理', icon: UsergroupIcon},
meta: {title: '会员管理', icon: 'user'},
children: [
{
path: 'user_index',
name: 'userIndex',
path: 'user_add',
name: 'userAdd',
component: () => import('@/pages/user/user_add.vue'),
meta: {title: '新增会员'},
},
{
path: 'user_index_1',
name: 'userIndex1',
component: () => import('@/pages/user/user_index.vue'),
meta: {title: '会员列表'},
meta: {title: '正式会员'},
},
{
path: 'plan',
name: 'userPlan',
component: () => import('@/pages/user/user_plan.vue'),
meta: {title: '职位管理'},
path: 'user_index_0',
name: 'userIndex0',
component: () => import('@/pages/user/user_index.vue'),
meta: {title: '待审核'},
},
{
path: 'line',
name: 'userLine',
component: () => import('@/pages/user/user_line.vue'),
meta: {title: '行业管理'},
path: 'user_index_3',
name: 'userIndex3',
component: () => import('@/pages/user/user_index.vue'),
meta: {title: '待缴纳会费'},
},
{
path: 'region',
name: 'userRegion',
component: () => import('@/pages/user/user_region.vue'),
meta: {title: '区域管理'},
path: 'user_index_2',
name: 'userIndex2',
component: () => import('@/pages/user/user_index.vue'),
meta: {title: '已拒绝'},
},
// {
// path: 'region',
// name: 'userRegion',
// component: () => import('@/pages/user/user_region.vue'),
// meta: {title: '区域管理'},
// },
{
path: 'user_info',
name: 'userInfo',
@ -46,18 +58,7 @@ export default [
component: () => import('@/pages/user/user_edit.vue'),
meta: {title: '会员编辑', hidden: true},
},
{
path: 'user_add',
name: 'userAdd',
component: () => import('@/pages/user/user_add.vue'),
meta: {title: '新增会员', hidden: true},
},
{
path: 'user_invoice',
name: 'userInvoice',
component: () => import('@/pages/user/user_invoice.vue'),
meta: {title: '会员发票管理'},
},
// {
// path: 'user_edit_shen',
// name: 'userEditShen',
@ -66,44 +67,229 @@ export default [
// },
],
},
{
path: '/user_invoice',
name: 'userInvoice',
component: Layout,
redirect: '/user/user_invoice',
meta: {title: '发票管理', icon: 'pantone'},
children: [
{
path: 'user_invoice3',
name: 'userInvoice3',
component: () => import('@/pages/user/user_invoice.vue'),
meta: {title: '待开具'},
},
{
path: 'user_invoice1',
name: 'userInvoice1',
component: () => import('@/pages/user/user_invoice.vue'),
meta: {title: '已开具'},
},
{
path: 'user_invoice2',
name: 'userInvoice2',
component: () => import('@/pages/user/user_invoice.vue'),
meta: {title: '已拒绝'},
},
],
},
{
path: '/plan',
name: 'userPlan',
component: Layout,
redirect: '/user/user_plan',
meta: {title: '职位管理', icon: 'tree-round-dot'},
children: [
{
path: 'plan',
name: 'userPlan',
component: () => import('@/pages/user/user_plan.vue'),
meta: {title: '职位管理'},
},
],
},
{
path: '/line',
name: 'userLine',
component: Layout,
redirect: '/user/user_line',
meta: {title: '行业管理', icon: 'education'},
children: [
{
path: 'line',
name: 'userLine',
component: () => import('@/pages/user/user_line.vue'),
meta: {title: '行业管理'},
},
],
},
{
path: '/activity',
name: 'activity',
component: Layout,
redirect: '/activity/index',
meta: {title: '活动管理', icon: ChartBubbleIcon},
meta: {title: '协会活动', icon: 'flag-4'},
children: [
{
path: 'activity_index',
name: 'activityIndex',
path: 'activity_add1',
name: 'activityAdd1',
component: () => import('@/pages/activity/activity_add.vue'),
meta: {title: '新增活动'},
},
{
path: 'activity_edit',
name: 'activityEdit',
component: () => import('@/pages/activity/activity_edit.vue'),
meta: {title: '活动编辑',hidden:true},
},
{
path: 'activity_index1',
name: 'activityIndex1',
component: () => import('@/pages/activity/activity_index.vue'),
meta: {title: '活动列表'},
},
// {
// path: 'activity_top',
// name: 'activityTop',
// component: () => import('@/pages/activity/activity_top.vue'),
// meta: {title: '活动首页置顶'},
// }
],
},
{
path: '/activity2',
name: 'activity2',
component: Layout,
redirect: '/activity/activity_index',
meta: {title: '调查问卷', icon: 'markup'},
children: [
{
path: 'activity_top',
name: 'activityTop',
component: () => import('@/pages/activity/activity_top.vue'),
meta: {title: '活动首页置顶'},
}
path: 'activity_add2',
name: 'activityAdd2',
component: () => import('@/pages/activity/activity_add.vue'),
meta: {title: '新增问卷'},
},
{
path: 'activity_index2',
name: 'activityIndex2',
component: () => import('@/pages/activity/activity_index.vue'),
meta: {title: '问卷列表'},
},
// {
// path: 'activity_top',
// name: 'activityTop',
// component: () => import('@/pages/activity/activity_top.vue'),
// meta: {title: '活动首页置顶'},
// }
],
},
{
path: '/activity3',
name: 'activity3',
component: Layout,
redirect: '/activity/activity_index',
meta: {title: '公益捐赠', icon: 'undertake-hold-up'},
children: [
{
path: 'activity_add3',
name: 'activityAdd3',
component: () => import('@/pages/activity/activity_add.vue'),
meta: {title: '新增公益捐赠'},
},
{
path: 'activity_index3',
name: 'activityIndex3',
component: () => import('@/pages/activity/activity_index.vue'),
meta: {title: '公益捐赠列表'},
},
],
},
{
path: '/activity4',
name: 'activity4',
component: Layout,
redirect: '/activity/activity_index',
meta: {title: '学习培训', icon: 'git-repository'},
children: [
{
path: 'activity_add4',
name: 'activityAdd4',
component: () => import('@/pages/activity/activity_add.vue'),
meta: {title: '新增学习培训'},
},
{
path: 'activity_index4',
name: 'activityIndex4',
component: () => import('@/pages/activity/activity_index.vue'),
meta: {title: '学习培训列表'},
},
],
},
{
path: '/tweets',
name: 'tweets',
component: Layout,
redirect: '/tweets/index',
meta: {title: '青企圈', icon: UserAvatarIcon},
meta: {title: '青企圈', icon: 'chat-heart'},
children: [
{
path: 'index',
path: 'tweets_index',
name: 'tweetsIndex',
component: () => import('@/pages/tweets/index.vue'),
meta: {title: '内容列表'},
component: () => import('@/layouts/blank.vue'),
children: [
{
path: 'tweets_index2',
name: 'tweetsIndex2',
component: () => import('@/pages/tweets/index.vue'),
meta: {title: '通过列表'},
}, {
path: 'tweets_index1',
name: 'tweetsIndex1',
component: () => import('@/pages/tweets/index.vue'),
meta: {title: '待审核列表'},
}, {
path: 'tweets_index3',
name: 'tweetsIndex3',
component: () => import('@/pages/tweets/index.vue'),
meta: {title: '已拒绝列表'},
}
// , {
// path: 'pl_index',
// name: 'tweetsPlIndex',
// component: () => import('@/pages/tweets/pl_index.vue'),
// meta: {title: '评论列表'},
// },
],
}, {
path: 'pl_index',
name: 'tweetsPlIndex',
component: () => import('@/pages/tweets/pl_index.vue'),
component: () => import('@/layouts/blank.vue'),
meta: {title: '评论列表'},
children: [
{
path: 'pl_index2',
name: 'tweetsPlIndex2',
component: () => import('@/pages/tweets/pl_index.vue'),
meta: {title: '通过列表'},
}, {
path: 'pl_index1',
name: 'tweetsPlIndex1',
component: () => import('@/pages/tweets/pl_index.vue'),
meta: {title: '待审核列表'},
}, {
path: 'pl_index3',
name: 'tweetsPlIndex3',
component: () => import('@/pages/tweets/pl_index.vue'),
meta: {title: '已拒绝列表'},
}
// , {
// path: 'pl_index',
// name: 'tweetsPlIndex',
// component: () => import('@/pages/tweets/pl_index.vue'),
// meta: {title: '评论列表'},
// },
],
},
],
},
@ -112,7 +298,7 @@ export default [
name: 'news',
component: Layout,
redirect: '/news/news_index',
meta: {title: '新闻文章', icon: ViewListIcon},
meta: {title: '新闻管理', icon: 'system-log'},
children: [
// {
// path: 'wechat_index',
@ -120,11 +306,17 @@ export default [
// component: () => import('@/pages/news/wechat_index.vue'),
// meta: {title: '公众号内容管理'},
// },
{
path: 'news_index_add',
name: 'newsIndexAdd',
component: () => import('@/pages/news/news_add.vue'),
meta: {title: '添加新闻'},
},
{
path: 'news_index',
name: 'newsIndex',
component: () => import('@/pages/news/news_index.vue'),
meta: {title: '新闻内容管理'},
meta: {title: '新闻内容列表'},
},
{
path: 'news_type',
@ -138,7 +330,7 @@ export default [
name: 'association',
component: Layout,
redirect: '/association/index',
meta: {title: '协会管理', icon: HomeIcon},
meta: {title: '协会管理', icon: 'city-3'},
children: [
{
path: 'person ',
@ -176,25 +368,37 @@ export default [
path: '/pc',
name: 'pc',
component: Layout,
meta: {title: '官网内容管理', icon: ViewModuleIcon},
meta: {title: '官网内容管理', icon: 'tv-2'},
children: [
{
path: 'pc_news_type',
name: 'pcNewsType',
component: () => import('@/pages/pc/pc_news_type.vue'),
meta: {title: '新闻分类'},
path: 'pc_news_add',
name: 'pcNewsAdd',
component: () => import('@/pages/pc/pc_news_add.vue'),
meta: {title: '添加新闻'},
},
{
path: 'pc_news_edit',
name: 'pcNewsEdit',
component: () => import('@/pages/pc/pc_news_edit.vue'),
meta: {title: '编辑新闻'},
},
{
path: 'pc_news',
name: 'pcNews',
component: () => import('@/pages/pc/pc_news.vue'),
meta: {title: '新闻列表'},
meta: {title: '新闻内容列表'},
},
{
path: 'pc_news_type',
name: 'pcNewsType',
component: () => import('@/pages/pc/pc_news_type.vue'),
meta: {title: '新闻类目管理'},
},
{
path: 'pc_message',
name: 'pcSwiper',
component: () => import('@/pages/pc/pc_message.vue'),
meta: {title: '留言管理'},
meta: {title: '官网留言管理'},
},
],
}