This commit is contained in:
王创世 2024-06-06 18:00:47 +08:00
parent 641f2c095e
commit ffb4e76dce
15 changed files with 305 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -174,6 +174,7 @@ export default Vue.extend({
this.$store.commit('user/removeAssociation');
this.$store.commit('user/removeToken');
this.$router.push(`/login?id=`+this.association.id);
this.$store.commit('user/setUserInfo',[]);
//this.$router.push(`/login?redirect=${this.$router.history.current.fullPath}`);
},
changeCollapsed() {

View File

@ -231,6 +231,7 @@
: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"
@ -420,6 +421,10 @@ export default {
uploadImage: {
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
@ -443,6 +448,7 @@ export default {
JuanTotal:0,
JuanId:0,
getType:3,
association:{}
}
},
beforeDestroy() {
@ -451,6 +457,12 @@ export default {
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;
this.getList();
},
methods: {

View File

@ -56,8 +56,8 @@
v-model="addForm.news_image_show"
tips="请选择单张图片/视频文件上传"
accept="image/*,video/*"
:data="{association_id:this.association.association_id}"
:showImageFileName="true"
:imageViewerProps="true"
:format-response="formatResponse"
></t-upload>
</t-form-item>
@ -91,10 +91,16 @@ export default {
{colKey: 'url', title: '跳转链接', align: 'center'},
{colKey: 'select', title: '操作', width: 200, align: 'center'},
],
association:{}
}
},
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.getList();
},
methods: {

View File

@ -141,6 +141,9 @@ export default {
uploadImage: {
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
@ -160,6 +163,12 @@ export default {
},
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.association_id;
this.getList();
},
methods: {

View File

@ -0,0 +1,201 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-button @click="add">新增</t-button>
<t-table
rowKey="index"
:data="list"
:columns="columns"
:stripe="false"
:bordered="false"
:hover="true"
size="large"
table-layout="auto"
cellEmptyContent="-"
>
<template #group="{ row }">
<t-tag theme="primary" v-if="row.group==1">超级管理员</t-tag>
<t-tag theme="success" v-if="row.group==2">办事员</t-tag>
</template>
<template #select="{ row }">
<t-space size="24px" v-if="row.group!=1">
<t-button theme="warning" @click="edit(row)">编辑</t-button>
<t-popconfirm content="确认删除吗?" @confirm="del(row)">
<t-button theme="danger" >删除</t-button>
</t-popconfirm>
</t-space>
</template>
</t-table>
</div>
<t-dialog :header="isEdit?'编辑管理员':'新增管理员'" :visible="addMode" :onClose="onCloseMy" @confirm="onSubmit">
<t-form>
<t-form-item label="管理员帐号" name="name">
<t-input placeholder="请输入管理员帐号" v-model="modData.zhanghu"/>
</t-form-item>
<t-form-item label="管理员密码" name="password">
<t-input placeholder="请输入管理员密码" v-model="modData.password"/>
</t-form-item>
<t-form-item label="绑定会员" name="password">
<t-select
v-model="modData.member_id"
:filterable="true"
placeholder="搜索会员"
style="width: 400px; display: inline-block"
>
<t-option v-for="(item,index) in options" :value="item.value" :key="index" :label="item.label"></t-option>
</t-select>
</t-form-item>
<t-form-item label="权限类型" name="type">
<t-select v-model="modData.group">
<t-option value="2" key="2" label="业务员"></t-option>
</t-select>
</t-form-item>
</t-form>
</t-dialog>
</t-card>
</template>
<script lang="ts">
export default {
data() {
return {
modData:{
zhanghu:'',
password:'',
group:'2',
member_id:null,
pid:0
},
options: [],
addMode: false,
isEdit: false,
editID:0,
list: [],
columns: [
{colKey: 'zhanghu', title: '管理员帐号'},
{colKey: 'nikename', title: '绑定会员'},
{colKey: 'group', title: '权限类型'},
{colKey: 'select', title: '操作', width: 200},
],
association:{},
}
},
mounted() {
//this.member_id=this.$route.query.id;
if(typeof (this.$store.state.user.association)=='object'){
this.association=this.$store.state.user.association;
}else{
this.association=JSON.parse(this.$store.state.user.association);
}
this.getList();
this.getUserList();
},
methods: {
getList() {
this.$request
.post("/association")
.then( (res) => {
console.log(res);
this.list=res.data;
})
.catch((e) => {
console.log(e);
});
},
getUserList() {
this.$request
.post("/member",{if_xianshi:1,size:1000,page:1})
.then( (res) => {
console.log(res);
var key=res.data.ret;
var transformedSelectList = key.map(item => ({
value: item.member_id,
label: item.nikename
}));
this.options=transformedSelectList;
})
.catch((e) => {
console.log(e);
});
},
del(d){
console.log(d);
this.$request
.post('/association/delAdmin',{id:d.id})
.then((res) => {
if(res.code==1){
this.$message.success(res.msg);
this.getList();
}else {
this.$message.error(res.msg);
}
console.log(res);
})
.catch((e) => {
console.log(e);
});
},
add(){
delete this.modData.id;
this.modData.zhanghu='';
this.modData.password= '';
this.modData.member_id=null;
this.addMode=true;
this.isEdit=false;
},
edit(d){
this.editID=d.id;
this.modData.zhanghu=d.zhanghu;
this.modData.password=d.password;
this.modData.member_id=d.member_id;
this.modData.group=String(d.group);
this.addMode=true;
this.isEdit=true;
},
onSubmit() {
if (this.modData.zhanghu == '') {
this.$message.error('账户不能为空');
return;
}
if (this.modData.password == '') {
this.$message.error('密码不能为空');
return;
}
if (this.modData.member_id == 0 || this.modData.member_id == null) {
this.$message.error('绑定会员不能为空');
return;
}
if (this.modData.group == '') {
this.$message.error('请选择权限类型');
return;
}
var url='/association/addAdmin';
if(this.isEdit){
url='/association/updateAdmin';
this.modData.id=this.editID;
}
this.modData.pid=this.association.id;
this.$request
.post(url,this.modData)
.then((res) => {
if(res.code==1){
this.$message.success(res.msg);
this.addMode=false;
}else {
this.$message.error(res.msg);
}
this.getList();
})
.catch((e) => {
console.log(e);
});
},
onCloseMy() {
this.addMode = false;
}
}
}
</script>
<style scoped lang="less">
</style>

View File

@ -48,20 +48,14 @@
</div>
</template>
<script setup lang="ts">
import {ChevronRightIcon} from 'tdesign-icons-vue';
import store from "@/store";
import * as echarts from "echarts/core";
import {GridComponent, LegendComponent, TooltipComponent} from "echarts/components";
import {GridComponent} from "echarts/components";
import {LineChart, PieChart} from "echarts/charts";
import {CanvasRenderer} from "echarts/renderers";
import dayjs from "dayjs";
import {getRandomArray} from "@/utils/charts";
echarts.use([TooltipComponent, LegendComponent, PieChart, GridComponent, LineChart, CanvasRenderer]);
echarts.use([PieChart, GridComponent, LineChart, CanvasRenderer]);
export default {
components: {
ChevronRightIcon,
},
data() {
return {
resizeTime: 1,

View File

@ -153,6 +153,9 @@ export default {
uploadImage: {
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
@ -183,6 +186,12 @@ export default {
},
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.getList();
this.getGory();
},

View File

@ -124,6 +124,7 @@
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="formData.cardz_image_show"
theme="image"
:data="{association_id:this.association.association_id}"
tips="请选择身份证正面照"
accept="image/*"
:format-response="(response) => formatResponse(response, 1)"
@ -133,6 +134,7 @@
<t-upload
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="formData.cardf_image_show"
:data="{association_id:this.association.association_id}"
theme="image"
tips="请选择身份证反面照"
accept="image/*"
@ -150,6 +152,7 @@
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="formData.business_license_image_show"
theme="image"
:data="{association_id:this.association.association_id}"
tips="请选择营业执照"
accept="image/*"
:format-response="(response) => formatResponse(response, 3)"
@ -160,6 +163,7 @@
:action="$store.state.user.apiUrl+'/api/common/upload'"
v-model="formData.company_image_show"
theme="image"
:data="{association_id:this.association.association_id}"
tips="请选择营业执照"
accept="image/*"
:format-response="(response) => formatResponse(response, 5)"
@ -321,6 +325,7 @@ export default {
caiMode: false,
previews: {},
caiImg: '',
association:{},
formData: {
phone: '',
password: '',
@ -390,6 +395,12 @@ export default {
};
},
mounted() {
if(typeof (store.state.user.association)=='object'){
this.association=store.state.user.association;
}else{
this.association=JSON.parse(store.state.user.association);
}
console.log( this.association);
this.id = this.$route.query.id;
this.getInfo();
this.getPlan();
@ -404,6 +415,7 @@ export default {
console.log(this.caiImg);
let formData = new FormData();
formData.append('file', data, 'image.jpg');
formData.append('association_id', this.association.association_id);
console.log(formData);
axios.post(store.state.user.apiUrl + '/api/common/upload', formData, {
headers: {
@ -508,7 +520,7 @@ getRegion() {
console.log(res);
if (res.code == 1) {
this.industry_list = res.data;
this.industry_list.push({id: 0, industry_name: '其他行业'});
this.industry_list.push({id: -1, industry_name: '其他行业'});
}
})
.catch((e) => {

View File

@ -1,6 +1,11 @@
<template>
<t-card :bordered="false">
<div class="form-step-container">
<t-tabs v-model="tabIndex" @change="tabIndexChange">
<t-tab-panel :value="0" 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-table
rowKey="index"
:data="list"
@ -68,7 +73,7 @@
<div style="height: 200px" v-if="typeof (updateInfo.member_log.introduction) !='undefined'">个人经历</div>
<div style="height: 100px;text-align: center;line-height: 100px" v-if="typeof (updateInfo.member_log.company_image) !='undefined'">公司图标</div>
<div v-if="typeof (updateInfo.member_log.enterprise_name) !='undefined'">公司名称</div>
<div v-if="typeof (updateInfo.member_log.industry_name) !='undefined'">公司行业</div>
<div v-if="typeof (updateInfo.member_log.industry_id) !='undefined'">公司行业</div>
<div v-if="typeof (updateInfo.member_log.enterprise_location) !='undefined'">公司地址</div>
<div style="height: 200px" v-if="typeof (updateInfo.member_log.enterprise_Introduction) !='undefined'">公司介绍</div>
</t-space>
@ -102,7 +107,7 @@
</div>
</div>
<div v-if="typeof (updateInfo.member.enterprise_name) !='undefined'">{{ updateInfo.member.enterprise_name }}</div>
<div v-if="typeof (updateInfo.member.industry_name) !='undefined'">{{ updateInfo.member.industry_name }}</div>
<div v-if="typeof (updateInfo.member.industry_id) !='undefined'">{{updateInfo.member.industry_id==-1?'其他行业':updateInfo.member.industry_name }}</div>
<div v-if="typeof (updateInfo.member.enterprise_location) !='undefined'">{{ updateInfo.member.enterprise_location==''?'':updateInfo.member.enterprise_location }}</div>
<div style="height: 200px;overflow: scroll;" v-if="typeof (updateInfo.member.enterprise_Introduction) !='undefined'">{{ updateInfo.member.enterprise_Introduction }}</div>
</t-space>
@ -135,7 +140,7 @@
</div>
</div>
<div v-if="typeof (updateInfo.member_log.enterprise_name) !='undefined'">{{ updateInfo.member_log.enterprise_name }}</div>
<div v-if="typeof (updateInfo.member_log.industry_name) !='undefined'">{{ updateInfo.member_log.industry_name }}</div>
<div v-if="typeof (updateInfo.member_log.industry_id) !='undefined'">{{updateInfo.member_log.industry_id==-1?'其他行业':updateInfo.member_log.industry_name }}</div>
<div v-if="typeof (updateInfo.member_log.enterprise_location) !='undefined'">{{ updateInfo.member_log.enterprise_location }}</div>
<div style="height: 200px;overflow: scroll;" v-if="typeof (updateInfo.member_log.enterprise_Introduction) !='undefined'">{{ updateInfo.member_log.enterprise_Introduction }}</div>
</t-space>
@ -173,7 +178,7 @@ export default {
association: {},
ShenMode: false,
list: [],
tabIndex: 1,
tabIndex: 0,
columns: [
{colKey: 'nikename', title: '会员姓名'},
{colKey: 'createtime', title: '申请时间'},
@ -197,6 +202,12 @@ export default {
this.getList();
},
methods: {
tabIndexChange(d){
console.log(d);
this.list = [];
this.total = 0;
this.getList();
},
shenDo(dis) {
if (dis == 2 && this.content == '') {
this.$message.error('请填写拒绝理由!');
@ -247,7 +258,7 @@ export default {
},
getList() {
this.$request
.post("/member_log/index", {page: this.page, size: this.size})
.post("/member_log/index", {page: this.page, size: this.size,if_xianshi:this.tabIndex})
.then((res) => {
console.log(res);
this.list = res.data.ret;

View File

@ -15,7 +15,7 @@
</t-descriptions-item>
<t-descriptions-item label="会员姓名" :content="info.nikename"></t-descriptions-item>
<t-descriptions-item label="职位" :content="info.position_name"></t-descriptions-item>
<t-descriptions-item label="行业" :content="info.industry_id==0?'其他行业':info.industry_name"></t-descriptions-item>
<t-descriptions-item label="行业" :content="info.industry_id==-1?'其他行业':info.industry_name"></t-descriptions-item>
<t-descriptions-item label="区域" :content="info.region_name"></t-descriptions-item>
<t-descriptions-item label="手机号" :content="info.phone"></t-descriptions-item>
<t-descriptions-item label="性别">

View File

@ -94,7 +94,7 @@ export default {
.then((res) => {
console.log(res);
this.list = res.data;
this.list.push({id:0,industry_name:'其他行业'});
this.list.push({id:-1,industry_name:'其他行业'});
})
.catch((e) => {
console.log(e);

View File

@ -90,6 +90,12 @@ export default [
redirect: '/association/index',
meta: { title: '协会管理', icon: HomeIcon },
children: [
{
path: 'person ',
name: 'associationPerson',
component: () => import('@/pages/association/person.vue'),
meta: { title: '管理员' },
},
{
path: 'carousel ',
name: 'associationCarousel',

View File

@ -6,9 +6,9 @@ const InitUserInfo = {
const state = {
token: localStorage.getItem('associationToken') || '', // 默认token不走权限
userInfo: InitUserInfo,
association:localStorage.getItem('associationInfo') || '',
association: localStorage.getItem('associationInfo') || '',
//apiUrl:'http://192.168.3.130',
apiUrl:'https://ysx.0rui.cn'
apiUrl: 'https://ysx.0rui.cn'
};
const mutations = {
@ -24,7 +24,7 @@ const mutations = {
state.userInfo = userInfo;
},
setAssociation(state, Association) {
localStorage.setItem('associationInfo', JSON.stringify(Association) );
localStorage.setItem('associationInfo', JSON.stringify(Association));
state.association = Association;
},
removeAssociation(state) {
@ -39,49 +39,59 @@ const getters = {
};
const actions = {
async login({ commit }, userInfo) {
async login({commit}, userInfo) {
const mockLogin = async (userInfo) => {
// 登录请求流程
console.log(userInfo);
commit('setAssociation',userInfo);
return{
commit('setAssociation', userInfo);
return {
code: 200,
}
};
const res = await mockLogin(userInfo);
if (res.code === 200) {
console.log('token',userInfo.token);
commit('setToken',userInfo.token);
console.log('token', userInfo.token);
commit('setToken', userInfo.token);
} else {
return res;
}
},
async getUserInfo({ commit, state }) {
async getUserInfo({commit, state}) {
const mockRemoteUserInfo = async (token) => {
if (typeof (token) == 'object') {
var key = token;
} else {
var key = JSON.parse(token);
}
if (key.group == 1) {
return {
name: 'td_main',
roles: ['ALL_ROUTERS'],
};
} else {
return {
name: 'td_dev',
roles: ['newsIndex', 'login', 'activityIndex', 'userEditShen', 'userIndex', 'userInfo', 'userEdit'],
};
}
// if (token === 'main_token') {
// return {
// name: 'td_main',
// roles: ['ALL_ROUTERS'],
// };
// }
// return {
// name: 'td_dev',
// roles: ['UserIndex', 'DashboardBase', 'login'],
// };
};
const res = await mockRemoteUserInfo(state.token);
const res = await mockRemoteUserInfo(state.association);
commit('setUserInfo', res);
},
async logout({ commit }) {
async logout({commit}) {
commit('removeToken');
commit('setUserInfo', InitUserInfo);
commit('setUserInfo', []);
},
};

View File

@ -33,7 +33,7 @@ instance.interceptors.request.use((config) => {
// 添加token请求头
config.headers.token = token;
}
config.data = { ...config.data, association_id: association.id};
config.data = { ...config.data, association_id: association.association_id};
}
console.log(config.data);