no message
This commit is contained in:
parent
a1df7a276d
commit
8d364f93c5
@ -1,354 +1,252 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container>
|
|
||||||
<el-aside width="180px" v-loading="showGrouploading" class="hidden-sm-and-down">
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<el-input placeholder="输入关键字进行过滤" v-model="groupFilterText" clearable></el-input>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<x-menu-item v-for="(item, index) in leftSides" :key="index" :label="item.name" :num="item.num"
|
|
||||||
:icon-class="item.iconClass" :icon-color="item.color" :select="leftType == item.infoType"
|
|
||||||
@click="sideClick(item)" />
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</el-aside>
|
|
||||||
<el-container>
|
|
||||||
<el-header>
|
|
||||||
<div class="left-panel">
|
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
|
|
||||||
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length == 0"
|
|
||||||
@click="batch_del"></el-button>
|
|
||||||
<el-button type="primary" plain :disabled="selection.length == 0">分配角色</el-button>
|
|
||||||
<el-button type="primary" plain :disabled="selection.length == 0">密码重置</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="right-panel">
|
|
||||||
<div class="right-panel-search">
|
|
||||||
<el-input v-model="search.name" placeholder="登录账号 / 姓名" clearable></el-input>
|
|
||||||
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-header>
|
|
||||||
<el-main class="nopadding">
|
|
||||||
<xTable ref="table" @selection-change="selectionChange" :api="userlistApi" stripe remoteSort remoteFilter>
|
|
||||||
<el-table-column type="selection" width="50"></el-table-column>
|
|
||||||
<el-table-column label="UID" prop="uid" width="80" sortable='custom'></el-table-column>
|
|
||||||
<el-table-column label="头像" width="200" column-key="filterAvatar"
|
|
||||||
:filters="[{ text: '已上传', value: '1' }, { text: '未上传', value: '0' }]">
|
|
||||||
<template #default="scope">
|
|
||||||
<div class="xavatar" @click="getUser(scope.row)">
|
|
||||||
<el-avatar :src="scope.row.avatar" size="small">空</el-avatar>
|
|
||||||
<label class="input-mask">
|
|
||||||
<input class="el-input__inner" type="text" readonly
|
|
||||||
:value="scope.row.nickname || scope.row.username">
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</el-table-column>
|
<div style="padding: 10px;">
|
||||||
<el-table-column label="所属角色" prop="groupName" width="200" sortable='custom'></el-table-column>
|
|
||||||
<el-table-column label="加入时间" prop="date" width="170" sortable='regdate'></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="table_show(scope.row, scope.$index)">查看</el-button>
|
|
||||||
<el-button text type="primary" size="small"
|
|
||||||
@click="table_edit(scope.row, scope.$index)">编辑</el-button>
|
|
||||||
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
|
||||||
<template #reference>
|
|
||||||
<el-button text type="primary" size="small">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-popconfirm>
|
|
||||||
</el-button-group>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</xTable>
|
|
||||||
</el-main>
|
|
||||||
</el-container>
|
|
||||||
</el-container>
|
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save = false"></save-dialog>
|
|
||||||
|
|
||||||
<el-drawer :with-header="false" append-to-body="true" v-if="visible" v-model="visible" :size="1000" :show-close="false"
|
|
||||||
style="overflow: initial;" destroy-on-close @closed="visible = false; $emit('closed')">
|
|
||||||
<el-button type="danger" @click="visible = false" class="userdrawerclose" icon="el-icon-close"> </el-button>
|
|
||||||
<x-user v-model="copiedData"></x-user>
|
|
||||||
</el-drawer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<el-table :data="tableData" stripe border style="width: 100%">
|
||||||
import saveDialog from './save'
|
<el-table-column prop="date" label="Date" width="180" />
|
||||||
import xMenuItem from '@/components/xMenu/item'
|
<el-table-column fixed="right" prop="name" label="Name" width="180" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
<el-table-column prop="address" label="Address" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
export default {
|
<script setup>
|
||||||
name: 'user',
|
const tableData = [
|
||||||
components: {
|
{
|
||||||
xMenuItem,
|
date: '2016-05-03',
|
||||||
saveDialog
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
},
|
||||||
data() {
|
{
|
||||||
return {
|
date: '2016-05-02',
|
||||||
dialog: {
|
name: 'Tom',
|
||||||
save: false
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
|
||||||
showGrouploading: false,
|
|
||||||
visible: false,
|
|
||||||
groupFilterText: '',
|
|
||||||
userlistApi: 'user/index/lists',
|
|
||||||
group: [],
|
|
||||||
copiedData: {},
|
|
||||||
selection: [],
|
|
||||||
leftSides: [
|
|
||||||
{
|
|
||||||
name: '今日需联系线索',
|
|
||||||
color: '#2362FB',
|
|
||||||
iconClass: 'wk wk-leads',
|
|
||||||
infoType: 'todayLeads',
|
|
||||||
num: 10,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '今日需联系客户',
|
|
||||||
color: '#2362FB',
|
|
||||||
iconClass: 'wk wk-customer',
|
|
||||||
infoType: 'todayCustomer',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '今日需联系商机',
|
|
||||||
color: '#2362FB',
|
|
||||||
iconClass: 'wk wk-business',
|
|
||||||
infoType: 'todayBusiness',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '分配给我的线索',
|
|
||||||
color: '#704AFD',
|
|
||||||
iconClass: 'wk wk-leads',
|
|
||||||
infoType: 'followLeads',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '分配给我的客户',
|
|
||||||
color: '#19B5F6',
|
|
||||||
iconClass: 'wk wk-s-seas',
|
|
||||||
infoType: 'followCustomer',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待进入公海的客户',
|
|
||||||
color: '#26D4DA',
|
|
||||||
iconClass: 'wk wk-seas',
|
|
||||||
infoType: 'putInPoolRemind',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待审核合同',
|
|
||||||
color: '#FD5B4A',
|
|
||||||
iconClass: 'wk wk-contract',
|
|
||||||
infoType: 'checkContract',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待审核回款',
|
|
||||||
color: '#FFB940',
|
|
||||||
iconClass: 'wk wk-receivables',
|
|
||||||
infoType: 'checkReceivables',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待回款提醒',
|
|
||||||
color: '#27BA4A',
|
|
||||||
iconClass: 'wk wk-bell',
|
|
||||||
infoType: 'remindReceivablesPlan',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '即将到期的合同',
|
|
||||||
color: '#FF7A38',
|
|
||||||
iconClass: 'wk wk-contract',
|
|
||||||
infoType: 'endContract',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待回访合同',
|
|
||||||
color: '#ff9232',
|
|
||||||
iconClass: 'wk wk-house',
|
|
||||||
infoType: 'returnVisitRemind',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '待审核发票',
|
|
||||||
color: '#ff9232',
|
|
||||||
iconClass: 'wk wk-invoice',
|
|
||||||
infoType: 'checkInvoice',
|
|
||||||
num: 0,
|
|
||||||
hidden: false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
search: {
|
|
||||||
name: null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
{
|
||||||
groupFilterText(val) {
|
date: '2016-05-04',
|
||||||
this.$refs.group.filter(val);
|
name: 'Tom',
|
||||||
}
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
},
|
||||||
mounted() {
|
{
|
||||||
this.getGroup()
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
},
|
||||||
methods: {
|
{
|
||||||
getUser(o) {
|
date: '2016-05-03',
|
||||||
this.visible = true
|
name: 'Tom',
|
||||||
this.copiedData = o;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
},
|
||||||
//添加
|
{
|
||||||
add() {
|
date: '2016-05-02',
|
||||||
this.dialog.save = true
|
name: 'Tom',
|
||||||
this.$nextTick(() => {
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
this.$refs.saveDialog.open()
|
},
|
||||||
})
|
{
|
||||||
},
|
date: '2016-05-04',
|
||||||
//编辑
|
name: 'Tom',
|
||||||
table_edit(row) {
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
this.dialog.save = true
|
},
|
||||||
this.$nextTick(() => {
|
{
|
||||||
this.$refs.saveDialog.open('edit').setData(row)
|
date: '2016-05-01',
|
||||||
})
|
name: 'Tom',
|
||||||
},
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
//查看
|
},
|
||||||
table_show(row) {
|
{
|
||||||
this.dialog.save = true
|
date: '2016-05-03',
|
||||||
this.$nextTick(() => {
|
name: 'Tom',
|
||||||
this.$refs.saveDialog.open('show').setData(row)
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
})
|
},
|
||||||
},
|
{
|
||||||
//删除
|
date: '2016-05-02',
|
||||||
async table_del(row, index) {
|
name: 'Tom',
|
||||||
var reqData = { id: row.id }
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
var res = await this.$api.demo.post.post(reqData);
|
},
|
||||||
if (res.code == 200) {
|
{
|
||||||
//这里选择刷新整个表格 OR 插入/编辑现有表格数据
|
date: '2016-05-04',
|
||||||
this.$refs.table.tableData.splice(index, 1);
|
name: 'Tom',
|
||||||
this.$message.success("删除成功")
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
} else {
|
},
|
||||||
this.$alert(res.message, "提示", { type: 'error' })
|
{
|
||||||
}
|
date: '2016-05-01',
|
||||||
},
|
name: 'Tom',
|
||||||
//批量删除
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
async batch_del() {
|
},
|
||||||
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
|
{
|
||||||
type: 'warning'
|
date: '2016-05-03',
|
||||||
}).then(() => {
|
name: 'Tom',
|
||||||
const loading = this.$loading();
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
this.selection.forEach(item => {
|
},
|
||||||
this.$refs.table.tableData.forEach((itemI, indexI) => {
|
{
|
||||||
if (item.id === itemI.id) {
|
date: '2016-05-02',
|
||||||
this.$refs.table.tableData.splice(indexI, 1)
|
name: 'Tom',
|
||||||
}
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
})
|
},
|
||||||
})
|
{
|
||||||
loading.close();
|
date: '2016-05-04',
|
||||||
this.$message.success("操作成功")
|
name: 'Tom',
|
||||||
}).catch(() => {
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
})
|
{
|
||||||
},
|
date: '2016-05-01',
|
||||||
//表格选择后回调事件
|
name: 'Tom',
|
||||||
selectionChange(selection) {
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
this.selection = selection;
|
},
|
||||||
},
|
{
|
||||||
//加载树数据
|
date: '2016-05-03',
|
||||||
async getGroup() {
|
name: 'Tom',
|
||||||
this.showGrouploading = true;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
var res = await this.$http.get('user/index/typeList');
|
},
|
||||||
this.showGrouploading = false;
|
{
|
||||||
this.group = res.data;
|
date: '2016-05-02',
|
||||||
},
|
name: 'Tom',
|
||||||
//树过滤
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
groupFilterNode(value, data) {
|
},
|
||||||
if (!value) return true;
|
{
|
||||||
return data.label.indexOf(value) !== -1;
|
date: '2016-05-04',
|
||||||
},
|
name: 'Tom',
|
||||||
//树点击事件
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
groupClick(data) {
|
},
|
||||||
var params = {
|
{
|
||||||
groupId: data.id
|
date: '2016-05-01',
|
||||||
}
|
name: 'Tom',
|
||||||
this.$refs.table.reload(params)
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
},
|
},
|
||||||
//搜索
|
{
|
||||||
upsearch() {
|
date: '2016-05-03',
|
||||||
this.$refs.table.upData(this.search)
|
name: 'Tom',
|
||||||
},
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
//本地更新数据
|
},
|
||||||
handleSuccess(data, mode) {
|
{
|
||||||
if (mode == 'add') {
|
date: '2016-05-02',
|
||||||
data.id = new Date().getTime()
|
name: 'Tom',
|
||||||
this.$refs.table.tableData.unshift(data)
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
} else if (mode == 'edit') {
|
},
|
||||||
this.$refs.table.tableData.filter(item => item.id === data.id).forEach(item => {
|
{
|
||||||
Object.assign(item, data)
|
date: '2016-05-04',
|
||||||
})
|
name: 'Tom',
|
||||||
}
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
}
|
date: '2016-05-01',
|
||||||
</script>
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
<style scoped>
|
},
|
||||||
.xavatar {
|
{
|
||||||
display: flex;
|
date: '2016-05-03',
|
||||||
align-items: center;
|
name: 'Tom',
|
||||||
cursor: pointer;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
}
|
},
|
||||||
|
{
|
||||||
.userdrawerclose {
|
date: '2016-05-02',
|
||||||
cursor: pointer;
|
name: 'Tom',
|
||||||
width: 25px;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
height: 25px;
|
},
|
||||||
border-radius: 50%;
|
{
|
||||||
font-size: 12px;
|
date: '2016-05-04',
|
||||||
left: -10px;
|
name: 'Tom',
|
||||||
top: 100px;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
background-color: #9facc3;
|
},
|
||||||
background-repeat: no-repeat;
|
{
|
||||||
background-position: 50%;
|
date: '2016-05-01',
|
||||||
display: flex;
|
name: 'Tom',
|
||||||
align-items: center;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
justify-content: center;
|
},
|
||||||
position: absolute;
|
{
|
||||||
border-color: #fff;
|
date: '2016-05-03',
|
||||||
padding: 6px;
|
name: 'Tom',
|
||||||
font-weight: bolder;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
}
|
},
|
||||||
|
{
|
||||||
.xavatar .input-mask {
|
date: '2016-05-02',
|
||||||
margin-left: 28px;
|
name: 'Tom',
|
||||||
z-indexz: 1;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
position: absolute;
|
},
|
||||||
}
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
.xavatar .input-mask::before {
|
name: 'Tom',
|
||||||
content: "";
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
position: absolute;
|
},
|
||||||
top: 0;
|
{
|
||||||
right: 0;
|
date: '2016-05-01',
|
||||||
bottom: 0;
|
name: 'Tom',
|
||||||
left: 0;
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
pointer-events: auto;
|
},
|
||||||
cursor: pointer;
|
{
|
||||||
}
|
date: '2016-05-03',
|
||||||
</style>
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user