no message

This commit is contained in:
小陌 2023-12-30 23:12:27 +08:00
parent f26c7ff6de
commit fe65db5524
4 changed files with 384 additions and 170 deletions

View File

@ -1,25 +1,19 @@
<template>
<el-main class="nopadding">
<xTable name="weixin"></xTable>
</el-main>
<xTable name="weixin"></xTable>
</template>
<script>
import xTable from '@/views/system/table'
export default {
components: {
xTable,
},
data() {
return {
data: [
import xTable from '@/views/table/1'
export default {
components: {
xTable,
},
data() {
return {
data: [
]
}
]
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,169 @@
<template>
<el-container class="page-user">
<el-aside style="width: 176px;">
<el-container>
<el-header style="height: auto;display: block;">
<div class="user-info-top">
<x-upload
v-if="avatarupload"
v-model="user.avatar"
:data={token:token}
ref="uploader"
:api="avatarupload"
width="120"
height="120"
icon="el-icon-UploadFilled"
:onRemove="onRemove"
class="xuavatar"
round
:cropper="true"
title="上传头像"
:replaceupload="true"
:aspectRatio="1/1" />
<el-avatar :size="120" v-else :src="user.avatar"></el-avatar>
<h2 class="nickname">{{ user.nickname || user.username }}</h2>
<!-- <p><el-tag effect="dark" round size="large" disable-transitions>{{ user.role }}</el-tag></p> -->
<p>
<el-button-group>
<el-button @click="xupdate('message', '发送消息', 'drawer')" type="info" size="small">
系统消息
</el-button>
<el-button @click="xupdate('user', '编辑信息', 'fdsafdafafa')" type="info" color="#607d8b" size="small">
编辑资料
</el-button>
</el-button-group>
</p>
<div style="text-align: left; padding-top: 2px;">
<p v-if="user.uid"><el-button link size="small" v-copy="user.uid">UID{{ user.uid }} </el-button> </p>
<p v-if="user.uin"><el-button link size="small" v-copy="user.uin">UIN{{ user.uin }}</el-button> </p>
<p v-if="user.mobile"><el-button size="small" link v-copy="user.mobile">Mobile{{ user.mobile }} </el-button> </p>
<p v-if="user.email"><el-button size="small" link v-copy="user.email">Email{{ user.email }} </el-button> </p>
<!-- <p v-if="user.regdate"><el-button link v-copy="user.regdate">regdate: {{ user.regdate }} </el-button> </p> -->
</div>
</div>
</el-header>
<el-main class="nopadding">
<el-menu class="menu" :default-active="selectpage">
<el-menu-item-group v-for="(group,g) in menu" :key="g" :index="g" :title="group.title">
<el-menu-item v-for="(item,i) in group.list" :key="g+'-'+i" :index="g+'-'+i" @click="openPage(item)">
<el-icon v-if="item.icon"><component :is="item.icon"/></el-icon>
<template #title>
<span>{{item.title}}</span>
<el-badge :value="item.tag" :max="99" class="item"> </el-badge>
</template>
</el-menu-item>
</el-menu-item-group>
</el-menu>
</el-main>
</el-container>
</el-aside>
<el-main style="padding: 0px;">
<Suspense>
<template #default>
<component :data="user" :is="page"/>
</template>
<template #fallback>
<el-skeleton :rows="3" />
</template>
</Suspense>
</el-main>
</el-container>
<x-update v-if="updateKey" :name="updateKey" ref="xupdate" @success="handleSuccess" @closed="updateKey=''"></x-update>
</template>
<style>
.xuavatar {
margin: auto;
border-radius: 10px !important;
}
.page-user .user-info-top .nickname {
font-size: 14px;
margin-top: 8px;
}
.xuavatar .el-upload--picture-card {
--el-upload-picture-card-size:80px;
border-radius: 10px !important;
}
</style>
<style scoped>
.el-badge {
position: absolute; height: 18px; line-height: 18px; font-size: 12px; color: #fff; right: 8px; border-radius: 18px;
}
</style>
<script>
import { defineAsyncComponent } from 'vue'
export default {
name: 'userCenter',
components: {
account: defineAsyncComponent(() => import('./components/account')),
seting: defineAsyncComponent(() => import('./components/seting')),
pushSettings: defineAsyncComponent(() => import('./components/pushSettings')),
password: defineAsyncComponent(() => import('./components/password')),
space: defineAsyncComponent(() => import('./components/space')),
xtable: defineAsyncComponent(() => import('./components/table')),
},
props: {
modelValue: { type: Object, default: () => {} },
type: { type: String, default: "" }
},
data() {
return {
menu: [],
user: {},
userData: this.modelValue,
token: '',
avatarupload: '',
updateKey: '',
page: "account",
selectpage: "0-0"
}
},
created() {
this.loaddata();
},
methods: {
xupdate(key, name, type){
this.updateKey = key;
this.$nextTick(() => {
this.$refs.xupdate.open().getComponentType(type).setConfig({
name:name,
remoteurl:'table/getUpdate?name='+key+'&token='+this.token
});
})
},
loaddata(){
this.$http.post('user/index/get',{uid: this.userData.uid, type:this.type}).then((res) => {
if (res.code==200) {
Object.assign(this.$data, res.data);
if (res.data.menu) {
this.page = res.data.menu[0]['list'][0]['component']
}
return false;
}
this.$alert(res.message, "提示", {type: 'error'});
});
},
onRemove(){
this.$http.post('avatar/admin/delete',{token: this.token}).then((res) => {
if (res.code==200) {
this.userData.avatar = '';
this.$refs.uploader.clearFiles();
this.$message.success(res.message || "操作成功")
return false;
}
this.$alert(res.message, "提示", {type: 'error'});
});
return false;
},
openPage(item){
this.page = item.component
}
}
}
</script>

View File

@ -1,17 +1,18 @@
<template>
<el-container class="page-user">
<el-aside style="width: 176px;">
<el-container>
<el-header style="height: auto;display: block;">
<div class="user-info-top">
<el-header style="padding: 0; height: 150px;">
<div style="width: 100%;">
<div class="acea-row user-row">
<div class="avatar mr15">
<!-- <img :src="user.avatar"> -->
<x-upload
v-if="avatarupload"
v-model="user.avatar"
:data={token:token}
ref="uploader"
:api="avatarupload"
width="120"
height="120"
width="60"
height="60"
icon="el-icon-UploadFilled"
:onRemove="onRemove"
class="xuavatar"
@ -20,150 +21,200 @@
title="上传头像"
:replaceupload="true"
:aspectRatio="1/1" />
<el-avatar :size="120" v-else :src="user.avatar"></el-avatar>
<h2 class="nickname">{{ user.nickname || user.username }}</h2>
<!-- <p><el-tag effect="dark" round size="large" disable-transitions>{{ user.role }}</el-tag></p> -->
<p>
<el-button-group>
<el-button @click="xupdate('message', '发送消息', 'drawer')" type="info" size="small">
系统消息
</el-button>
<el-button @click="xupdate('user', '编辑信息', 'fdsafdafafa')" type="info" color="#607d8b" size="small">
编辑资料
</el-button>
</el-button-group>
</p>
<div style="text-align: left; padding-top: 2px;">
<p v-if="user.uid"><el-button link size="small" v-copy="user.uid">UID{{ user.uid }} </el-button> </p>
<p v-if="user.uin"><el-button link size="small" v-copy="user.uin">UIN{{ user.uin }}</el-button> </p>
<p v-if="user.mobile"><el-button size="small" link v-copy="user.mobile">Mobile{{ user.mobile }} </el-button> </p>
<p v-if="user.email"><el-button size="small" link v-copy="user.email">Email{{ user.email }} </el-button> </p>
<!-- <p v-if="user.regdate"><el-button link v-copy="user.regdate">regdate: {{ user.regdate }} </el-button> </p> -->
</div>
<el-avatar :size="60" v-else :src="user.avatar"></el-avatar>
</div>
</el-header>
<el-main class="nopadding">
<el-menu class="menu" :default-active="selectpage">
<el-menu-item-group v-for="(group,g) in menu" :key="g" :index="g" :title="group.title">
<el-menu-item v-for="(item,i) in group.list" :key="g+'-'+i" :index="g+'-'+i" @click="openPage(item)">
<el-icon v-if="item.icon"><component :is="item.icon"/></el-icon>
<template #title>
<span>{{item.title}}</span>
<el-badge :value="item.tag" :max="99" class="item"> </el-badge>
</template>
</el-menu-item>
</el-menu-item-group>
</el-menu>
</el-main>
</el-container>
</el-aside>
<el-main style="padding: 0px;">
<Suspense>
<template #default>
<component :data="user" :is="page"/>
</template>
<template #fallback>
<el-skeleton :rows="3" />
</template>
</Suspense>
<div class="user-row-text">
<div><span class="nickname">{{ user.nickname }}</span><i class="iconfont iconxiaochengxu"></i></div>
<div class="level">11111</div>
</div>
<div class="user-row-action">
<el-button type="primary">编辑</el-button>
<el-button type="success">积分余额</el-button>
</div>
</div>
<el-row style="padding: 10px 25px;">
<el-col :span="4">
<el-statistic title="Daily active users" :value="268500" />
</el-col>
<el-col :span="4">
<el-statistic :value="138">
<template #title>
<div style="display: inline-flex; align-items: center">
Ratio of men to women
<el-icon style="margin-left: 4px" :size="12">
<Male />
</el-icon>
</div>
</template>
<template #suffix>/100</template>
</el-statistic>
</el-col>
<el-col :span="4">
<el-statistic title="Total Transactions" :value="172000" />
</el-col>
<el-col :span="4">
<el-statistic title="Feedback number" :value="562">
<template #suffix>
<el-icon style="vertical-align: -0.125em">
<ChatLineRound />
</el-icon>
</template>
</el-statistic>
</el-col>
</el-row>
</div>
</el-header>
<el-main>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="User" name="first">User</el-tab-pane>
<el-tab-pane label="Config" name="second">Config</el-tab-pane>
<el-tab-pane label="Role" name="third">Role</el-tab-pane>
<el-tab-pane label="Task" name="fourth">Task</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
<x-update v-if="updateKey" :name="updateKey" ref="xupdate" @success="handleSuccess" @closed="updateKey=''"></x-update>
<x-update v-if="updateKey" :name="updateKey" ref="xupdate" @success="handleSuccess" @closed="updateKey = ''"></x-update>
</template>
<style>
.xuavatar {
margin: auto;
border-radius: 10px !important;
}
.page-user .user-info-top .nickname {
font-size: 14px;
margin-top: 8px;
}
.xuavatar .el-upload--picture-card {
--el-upload-picture-card-size:80px;
border-radius: 10px !important;
}
</style>
<style scoped>
.el-badge {
position: absolute; height: 18px; line-height: 18px; font-size: 12px; color: #fff; right: 8px; border-radius: 18px;
}
.mr15 {
margin-right: 15px !important;
}
.user-row-action {
flex: 1;
align-self: center;
text-align: right;
}
.user-row {
padding: 10px 20px 0;
width: 100%;
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-o-box-lines: multiple;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.user-row .nickname {
font-weight: 500;
font-size: 16px;
line-height: 16px;
color: rgba(0, 0, 0, .85);
}
.avatar {
width: 60px;
height: 60px;
border-radius: 50%;
overflow: hidden;
}
.avatar img {
width: 100%;
height: 100%;
}
.user-row-text {
flex: 1;
align-self: center;
}
.user-row .level {
margin-top: 5px;
}
.el-badge {
position: absolute;
height: 18px;
line-height: 18px;
font-size: 12px;
color: #fff;
right: 8px;
border-radius: 18px;
}
</style>
<script>
import { defineAsyncComponent } from 'vue'
import { defineAsyncComponent } from 'vue'
export default {
name: 'userCenter',
components: {
account: defineAsyncComponent(() => import('./components/account')),
seting: defineAsyncComponent(() => import('./components/seting')),
pushSettings: defineAsyncComponent(() => import('./components/pushSettings')),
password: defineAsyncComponent(() => import('./components/password')),
space: defineAsyncComponent(() => import('./components/space')),
xtable: defineAsyncComponent(() => import('./components/table')),
},
props: {
modelValue: { type: Object, default: () => {} },
type: { type: String, default: "" }
},
data() {
return {
menu: [],
user: {},
userData: this.modelValue,
token: '',
avatarupload: '',
updateKey: '',
page: "account",
selectpage: "0-0"
}
},
created() {
this.loaddata();
},
methods: {
xupdate(key, name, type){
this.updateKey = key;
this.$nextTick(() => {
this.$refs.xupdate.open().getComponentType(type).setConfig({
name:name,
remoteurl:'table/getUpdate?name='+key+'&token='+this.token
});
})
},
loaddata(){
this.$http.post('user/index/get',{uid: this.userData.uid, type:this.type}).then((res) => {
if (res.code==200) {
Object.assign(this.$data, res.data);
if (res.data.menu) {
this.page = res.data.menu[0]['list'][0]['component']
}
return false;
}
this.$alert(res.message, "提示", {type: 'error'});
export default {
name: 'userCenter',
components: {
account: defineAsyncComponent(() => import('./components/account')),
seting: defineAsyncComponent(() => import('./components/seting')),
pushSettings: defineAsyncComponent(() => import('./components/pushSettings')),
password: defineAsyncComponent(() => import('./components/password')),
space: defineAsyncComponent(() => import('./components/space')),
xtable: defineAsyncComponent(() => import('./components/table')),
},
props: {
modelValue: { type: Object, default: () => { } },
type: { type: String, default: "" }
},
data() {
return {
menu: [],
user: {},
userData: this.modelValue,
token: '',
activeName: '',
avatarupload: '',
updateKey: '',
page: "account",
selectpage: "0-0"
}
},
created() {
this.loaddata();
},
methods: {
xupdate(key, name, type) {
this.updateKey = key;
this.$nextTick(() => {
this.$refs.xupdate.open().getComponentType(type).setConfig({
name: name,
remoteurl: 'table/getUpdate?name=' + key + '&token=' + this.token
});
},
onRemove(){
this.$http.post('avatar/admin/delete',{token: this.token}).then((res) => {
if (res.code==200) {
this.userData.avatar = '';
this.$refs.uploader.clearFiles();
this.$message.success(res.message || "操作成功")
return false;
})
},
loaddata() {
this.$http.post('user/index/get', { uid: this.userData.uid, type: this.type }).then((res) => {
if (res.code == 200) {
Object.assign(this.$data, res.data);
if (res.data.menu) {
this.page = res.data.menu[0]['list'][0]['component']
}
this.$alert(res.message, "提示", {type: 'error'});
});
return false;
},
openPage(item){
this.page = item.component
}
return false;
}
this.$alert(res.message, "提示", { type: 'error' });
});
},
onRemove() {
this.$http.post('avatar/admin/delete', { token: this.token }).then((res) => {
if (res.code == 200) {
this.userData.avatar = '';
this.$refs.uploader.clearFiles();
this.$message.success(res.message || "操作成功")
return false;
}
this.$alert(res.message, "提示", { type: 'error' });
});
return false;
},
openPage(item) {
this.page = item.component
}
}
}
</script>

View File

@ -156,7 +156,7 @@ export default {
methods: {
deleteGroup() {
this.$confirm('确认删除' + this.form.title + '用户组吗?', '提示', {
this.$confirm('相关绑定的用户会更换到默认默认用户组', '确认删除<' + this.form.title + '>用户组吗?', {
type: 'warning',
confirmButtonText: '确定删除',
confirmButtonClass: 'el-button--danger'