no message

This commit is contained in:
小陌 2023-07-30 22:24:21 +08:00
parent a2b0cf6d4f
commit 18541887dc
9 changed files with 277 additions and 283 deletions

View File

@ -13,8 +13,7 @@
</head>
<body>
<noscript>
<strong>We're sorry but <%= VUE_APP_TITLE %> doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong>
<strong>We're sorry but <%= VUE_APP_TITLE %> doesn't work properly without JavaScript enabled.</strong>
</noscript>
<script type="text/javascript">
var dark = window.localStorage.getItem('APP_DARK');
@ -26,7 +25,6 @@
<div class="app-loading">
<div class="app-loading__logo"> </div>
<div class="app-loading__loader"></div>
<!-- <div class="app-loading__title"><%= VUE_APP_TITLE %></div> -->
</div>
<style>
.app-loading {position: absolute;top:0px;left:0px;right:0px;bottom:0px;display: flex;justify-content: center;align-items: center;flex-direction: column;background: #fff;}
@ -34,10 +32,8 @@
.app-loading__logo img {width: 90px;vertical-align: bottom;}
.app-loading__loader {box-sizing: border-box;width: 35px;height: 35px;border: 5px solid transparent;border-top-color: #000;border-radius: 50%;animation: .5s loader linear infinite;position: relative;}
.app-loading__loader:before {box-sizing: border-box;content: '';display: block;width: inherit;height: inherit;position: absolute;top: -5px;left: -5px;border: 5px solid #ccc;border-radius: 50%;opacity: .5;}
.app-loading__title {font-size: 24px;color: #333;margin-top: 30px;}
.dark .app-loading {background: #222225;}
.dark .app-loading__loader {border-top-color: #fff;}
.dark .app-loading__title {color: #d0d0d0;}
@keyframes loader {
0% {
transform: rotate(0deg);
@ -48,7 +44,6 @@
}
</style>
</div>
<!-- built files will be auto injected -->
</body>
<div id="versionCheck" style="display: none;position: absolute;z-index: 99;top:0;left:0;right:0;bottom:0;padding:150px 20px;background:rgba(255,255,255,0.8);color: #333;">
<h2 style="line-height: 1;margin: 0;font-size: 24px;">当前浏览器内核版本过低</h2>

View File

@ -51,7 +51,7 @@
methods: {
async getData(){
this.loading = true
var res = await this.$api.system.tasks.list.get()
var res = await this.$http.get('tasks')
this.tasks = res.data
this.loading = false
},

View File

@ -6,10 +6,10 @@
<div class="screen panel-item hidden-sm-and-down" @click="screen">
<el-icon><el-icon-full-screen /></el-icon>
</div>
<!-- <div class="tasks panel-item" @click="tasks">
<div class="tasks panel-item" @click="tasks">
<el-icon><el-icon-sort /></el-icon>
</div>
<div class="msg panel-item" @click="showMsg">
<!-- <div class="msg panel-item" @click="showMsg">
<el-badge :hidden="msgList.length==0" :value="msgList.length" class="badge" type="danger">
<el-icon><el-icon-chat-dot-round /></el-icon>
</el-badge>
@ -53,7 +53,7 @@
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="uc">帐号信息</el-dropdown-item>
<el-dropdown-item command="userinfo">帐号信息</el-dropdown-item>
<el-dropdown-item command="clearCache">清除缓存</el-dropdown-item>
<el-dropdown-item divided command="outLogin">退出登录</el-dropdown-item>
</el-dropdown-menu>
@ -126,8 +126,8 @@
methods: {
//
handleUser(command) {
if(command == "uc"){
this.$router.push({path: '/usercenter'});
if(command == "userinfo"){
this.$router.push({path: '/user/index/info'});
}
if(command == "cmd"){
this.$router.push({path: '/cmd'});

View File

@ -0,0 +1,206 @@
<template>
<el-main>
<el-card shadow="never">
<x-select-filter :data="data" :selected-values="selectedValues" :label-width="80" @on-change="change"></x-select-filter>
</el-card>
<el-card class="userlose" shadow="never" style="margin-top: 10px;">
<el-container>
<el-header v-auths="['user.group']">
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<x-table :api="api" :hideDo="true" size="large" stripe ref="table" :params="filterData" :hidePagination="true">
<el-table-column prop="id" fixed sortable label="GroupID" align="center" width="120" />
<el-table-column prop="title" label="名称" width="180" />
<el-table-column prop="alias" label="别名" width="180" />
<el-table-column prop="status" label="状态" width="90">
<template #default="scope">
<x-status-indicator pulse type="success" v-if="scope.row.status==1" label="开启" />
<x-status-indicator pulse type="info" v-if="scope.row.status==0" label="关闭" />
</template>
</el-table-column>
<el-table-column prop="anicount" label="积分" width="100" v-if="filterData.type=='member'" />
<el-table-column prop="anicount" label="主图" width="100" v-if="filterData.type=='member'">
<template #default="scope">
<el-image :preview-src-list="[scope.row.image.url]" :preview-teleported="true" hide-on-click-modal="true" lazy="true" style="width: 30px; height: 30px" fit="cover" :src="scope.row.image.url">
<template #error>
<div class="image-slot">
无图
</div>
</template>
</el-image>
</template>
</el-table-column>
<el-table-column prop="aid" label="控制台模块" width="120" v-if="filterData.type=='system'">
<template #default="scope">
<el-badge :value="scope.row.authority.grid ? scope.row.authority.grid.length:0" type="warning"></el-badge>
</template>
</el-table-column>
<el-table-column prop="aid" label="菜单" width="80" v-if="filterData.type=='system'">
<template #default="scope">
<el-badge :value="scope.row.authority.menu ? scope.row.authority.menu.length:0" type="primary"></el-badge>
</template>
</el-table-column>
<el-table-column prop="message" label="备注">
<template #default="scope">
<input class="el-input__inner" type="text" readonly :value="scope.row.message">
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="160">
<template #default="scope">
<el-button-group>
<el-button text type="primary" size="small" @click="group_show(scope.row, scope.$index)">查看</el-button>
<el-button text type="primary" size="small" @click="group_edit(scope.row, scope.$index)" v-auths="['user.group']">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="group_del(scope.row, scope.$index)" >
<template #reference>
<el-button text type="primary" size="small" v-auths="['user.group']">删除</el-button>
</template>
</el-popconfirm>
</el-button-group>
</template>
</el-table-column>
</x-table>
</el-main>
</el-container>
</el-card>
</el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</template>
<style>
.userlose .el-card__body{
padding: 0px;
}
</style>
<script>
import xSelectFilter from '@/components/xSelectFilter'
import saveDialog from './save'
export default {
name: 'selectFilter',
components: {
xSelectFilter,
saveDialog,
},
data() {
return {
data: [
{
title: "用户组",
key: "type",
options: [
{
label: "系统组",
value: "system",
icon: "el-icon-flag"
},
{
label: "用户组",
value: "member",
icon: "el-icon-bottom-left"
},
{
label: "自定义会员组",
value: "default",
icon: "el-icon-circle-close"
}
]
}
],
selectedValues: {
type: ["system"]
},
filterData: {
type:'system'
},
search: {},
dialog: {
save: false,
permission: false
},
api:'user/group/lists'
}
},
computed: {
filteredItems() {
return this.items.filter(item => item.category === 'Category A');
}
},
mounted() {
},
methods: {
//
handleSaveSuccess(){
this.$refs.table.refresh()
},
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open().setData({type:this.filterData.type})
})
},
//
group_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
group_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async group_del(row){
var reqData = {id: row.id}
var res = await this.$http.post('user/group/delete',reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功");
return false;
}
this.$alert(res.message, "提示", {type: 'error'})
},
change(selected){
this.filterData = selected
this.$refs.table.reload(this.filterData)
},
//
changeSwitch(val, row){
row.status = row.status == '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
}
}
</script>
<style>
</style>

View File

@ -1,76 +1,76 @@
<template>
<x-dialog :title="titleMap[mode]" v-model="visible" :width="900" destroy-on-close @closed="$emit('closed')">
<el-main style="padding: 10px 20px;">
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px" label-position="left">
<el-form-item label="角色名称" prop="title">
<el-input v-model="form.title" clearable></el-input>
</el-form-item>
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px" label-position="left">
<el-form-item label="别名" prop="title">
<el-input v-model="form.alias" clearable></el-input>
<div class="el-form-item-msg">用于权限判断,可以留空; 不可重复</div>
</el-form-item>
<el-form-item label="角色名称" prop="title">
<el-input v-model="form.title" clearable></el-input>
</el-form-item>
<el-form-item label="升级点数" prop="anicount" v-if="form.type=='member'">
<el-input v-model="form.anicount" clearable></el-input>
</el-form-item>
<el-form-item label="别名" prop="title">
<el-input v-model="form.alias" clearable></el-input>
<div class="el-form-item-msg">用于权限判断,可以留空; 不可重复</div>
</el-form-item>
<el-form-item label="升级点数" prop="anicount" v-if="form.type=='member'">
<el-input v-model="form.anicount" clearable></el-input>
</el-form-item>
<el-form-item label="等级图片" prop="anicount" v-if="form.type=='member'">
<x-upload v-model="form.image" title="等级图片"></x-upload>
</el-form-item>
<el-form-item label="等级图片" prop="anicount" v-if="form.type=='member'">
<x-upload v-model="form.image" title="等级图片"></x-upload>
</el-form-item>
<el-form-item label="是否有效" prop="status">
<el-form-item label="是否有效" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1" size="large">开启</el-radio>
<el-radio label="0" size="large">关闭</el-radio>
</el-radio-group>
<el-radio-group v-model="form.status">
<el-radio label="1" size="large">开启</el-radio>
<el-radio label="0" size="large">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item label="备注" prop="message">
<el-input v-model="form.message" clearable type="textarea"></el-input>
</el-form-item>
<el-form-item label="备注" prop="message">
<el-input v-model="form.message" clearable type="textarea"></el-input>
</el-form-item>
<div class="rolepermission" v-if="form.type=='system'">
<el-tabs tab-position="top">
<el-tab-pane label="菜单权限">
<div class="treeMain">
<el-tree ref="menu" node-key="id" :data="menu.list" :props="menu.props" :default-checked-keys="menu.checked" show-checkbox></el-tree>
</div>
</el-tab-pane>
<el-tab-pane label="数据权限">
<el-form label-width="100px" label-position="left">
<el-form-item label="规则类型">
<el-select v-model="form.authority.dataType" placeholder="请选择">
<el-option label="全部可见" value="1"></el-option>
<el-option label="本人可见" value="2"></el-option>
<el-option label="所在部门可见" value="3"></el-option>
<el-option label="所在部门及子级可见" value="4"></el-option>
<el-option label="选择的部门可见" value="5"></el-option>
<el-option label="自定义" value="6"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择部门" v-show="form.dataType=='5'">
<div class="treeMain" style="width: 100%;">
<el-tree ref="dept" node-key="id" :data="dept.list" :props="dept.props" :default-checked-keys="dept.checked" show-checkbox></el-tree>
</div>
</el-form-item>
<el-form-item label="规则值" v-show="form.dataType=='6'">
<el-input v-model="form.authority.dataRule" clearable type="textarea" :rows="6" placeholder="请输入自定义规则代码"></el-input>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="控制台模块">
<div class="treeMain">
<el-tree ref="grid" node-key="key" :data="grid.list" :props="grid.props" :default-checked-keys="grid.checked" show-checkbox></el-tree>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-form>
<div class="rolepermission" v-if="form.type=='system'">
<el-tabs tab-position="top">
<el-tab-pane label="菜单权限">
<div class="treeMain">
<el-tree ref="menu" node-key="id" :data="menu.list" :props="menu.props" :default-checked-keys="menu.checked" show-checkbox></el-tree>
</div>
</el-tab-pane>
<el-tab-pane label="数据权限">
<el-form label-width="100px" label-position="left">
<el-form-item label="规则类型">
<el-select v-model="form.authority.dataType" placeholder="请选择">
<el-option label="全部可见" value="1"></el-option>
<el-option label="本人可见" value="2"></el-option>
<el-option label="所在部门可见" value="3"></el-option>
<el-option label="所在部门及子级可见" value="4"></el-option>
<el-option label="选择的部门可见" value="5"></el-option>
<el-option label="自定义" value="6"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择部门" v-show="form.dataType=='5'">
<div class="treeMain" style="width: 100%;">
<el-tree ref="dept" node-key="id" :data="dept.list" :props="dept.props" :default-checked-keys="dept.checked" show-checkbox></el-tree>
</div>
</el-form-item>
<el-form-item label="规则值" v-show="form.dataType=='6'">
<el-input v-model="form.authority.dataRule" clearable type="textarea" :rows="6" placeholder="请输入自定义规则代码"></el-input>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="控制台模块">
<div class="treeMain">
<el-tree ref="grid" node-key="key" :data="grid.list" :props="grid.props" :default-checked-keys="grid.checked" show-checkbox></el-tree>
</div>
</el-tab-pane>
</el-tabs>
</div>
</el-form>
</el-main>
<template #footer>
<el-button @click="visible=false" > </el-button>
<el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="submit()"> </el-button>
@ -195,7 +195,7 @@
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
var res = await this.$http.post('system/group/submit', this.form);
var res = await this.$http.post('user/group/submit', this.form);
this.isSaveing = false;
if(res.code == 200){
this.$emit('success', this.form, this.mode)
@ -217,7 +217,7 @@
this.dept.checked = this.form.authority.dept || [];
if (this.form.type=='system') {
this.$http.post('system/group/menuSystem',{}).then((res) => {
this.$http.post('user/group/menuSystem',{}).then((res) => {
if (res.code==200) {
// Object.assign(this.$data, res.data);
this.menu.list = res.data.menu || [];

View File

@ -1,207 +0,0 @@
<template>
<el-main>
<el-card shadow="never">
<x-select-filter :data="data" :selected-values="selectedValues" :label-width="80" @on-change="change"></x-select-filter>
</el-card>
<el-card class="userlose" shadow="never" style="margin-top: 10px;">
<el-container>
<el-header v-auths="['user.group']">
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<x-table :api="api" ref="table" :params="filterData" :hidePagination="true">
<el-table-column prop="id" fixed sortable label="GroupID" align="center" width="100" />
<el-table-column prop="title" label="名称" width="180" />
<el-table-column prop="alias" label="别名" width="180" />
<el-table-column prop="status" label="状态" width="90">
<template #default="scope">
<x-status-indicator pulse type="success" v-if="scope.row.status==1" label="开启" />
<x-status-indicator pulse type="info" v-if="scope.row.status==0" label="关闭" />
</template>
</el-table-column>
<el-table-column prop="anicount" label="积分" width="100" v-if="filterData.type=='member'" />
<el-table-column prop="anicount" label="主图" width="100" v-if="filterData.type=='member'">
<template #default="scope">
<el-image :preview-src-list="[scope.row.image.url]" :preview-teleported="true" hide-on-click-modal="true" lazy="true" style="width: 30px; height: 30px" fit="cover" :src="scope.row.image.url">
<template #error>
<div class="image-slot">
无图
</div>
</template>
</el-image>
</template>
</el-table-column>
<el-table-column prop="aid" label="控制台模块" width="100" v-if="filterData.type=='system'">
<template #default="scope">
<el-badge :value="scope.row.authority.grid ? scope.row.authority.grid.length:0" type="warning"></el-badge>
</template>
</el-table-column>
<el-table-column prop="aid" label="菜单" width="80" v-if="filterData.type=='system'">
<template #default="scope">
<el-badge :value="scope.row.authority.menu ? scope.row.authority.menu.length:0" type="primary"></el-badge>
</template>
</el-table-column>
<el-table-column prop="message" label="备注">
<template #default="scope">
<input class="el-input__inner" type="text" readonly :value="scope.row.message">
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="160">
<template #default="scope">
<el-button-group>
<el-button text type="primary" size="small" @click="group_show(scope.row, scope.$index)">查看</el-button>
<el-button text type="primary" size="small" @click="group_edit(scope.row, scope.$index)" v-auths="['user.group']">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="group_del(scope.row, scope.$index)" >
<template #reference>
<el-button text type="primary" size="small" v-auths="['user.group']">删除</el-button>
</template>
</el-popconfirm>
</el-button-group>
</template>
</el-table-column>
</x-table>
</el-main>
<!-- <pre>{{ filterData }}</pre> -->
</el-container>
</el-card>
</el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</template>
<style>
.userlose .el-card__body{
padding: 0px;
}
</style>
<script>
import xSelectFilter from '@/components/xSelectFilter'
import saveDialog from './role/save'
export default {
name: 'selectFilter',
components: {
xSelectFilter,
saveDialog,
},
data() {
return {
data: [
{
title: "用户组",
key: "type",
options: [
{
label: "系统组",
value: "system",
icon: "el-icon-flag"
},
{
label: "用户组",
value: "member",
icon: "el-icon-bottom-left"
},
{
label: "自定义会员组",
value: "default",
icon: "el-icon-circle-close"
}
]
}
],
selectedValues: {
type: ["system"]
},
filterData: {
type:'system'
},
search: {},
dialog: {
save: false,
permission: false
},
api:'system/group/lists'
}
},
computed: {
filteredItems() {
return this.items.filter(item => item.category === 'Category A');
}
},
mounted() {
},
methods: {
//
handleSaveSuccess(){
this.$refs.table.refresh()
},
//
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open().setData({type:this.filterData.type})
})
},
//
group_edit(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row)
})
},
//
group_show(row){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open('show').setData(row)
})
},
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async group_del(row){
var reqData = {id: row.id}
var res = await this.$http.post('system/group/delete',reqData);
if(res.code == 200){
this.$refs.table.refresh()
this.$message.success("删除成功");
return false;
}
this.$alert(res.message, "提示", {type: 'error'})
},
change(selected){
this.filterData = selected
this.$refs.table.reload(this.filterData)
},
//
changeSwitch(val, row){
row.status = row.status == '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
}
}
</script>
<style>
</style>