|
@@ -3,7 +3,9 @@
|
|
|
<div class="filters-container">
|
|
<div class="filters-container">
|
|
|
<el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
|
|
<el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
|
|
|
<el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
|
|
<el-button @click="getData" type="primary" icon="el-icon-search" class="filter-item">搜索 </el-button>
|
|
|
- <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item">添加 </el-button>
|
|
|
|
|
|
|
+ <el-button @click="addRow" type="primary" icon="el-icon-plus" class="filter-item" v-if="display"
|
|
|
|
|
+ >添加
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
@click="download"
|
|
@click="download"
|
|
|
type="primary"
|
|
type="primary"
|
|
@@ -30,7 +32,7 @@
|
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="150">
|
|
<el-table-column label="操作" align="center" fixed="right" min-width="150">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
<el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
|
|
<el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
- <el-button size="mini" @click="recharge(row)" type="warning" plain v-if="userInfo">充值</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" @click="recharge(row)" type="warning" plain v-if="display">充值</el-button>
|
|
|
<el-button size="mini" @click="handleCommand(row.userId)">推广</el-button>
|
|
<el-button size="mini" @click="handleCommand(row.userId)">推广</el-button>
|
|
|
<el-button size="mini" @click="handleCommand1(row.id)">员工</el-button>
|
|
<el-button size="mini" @click="handleCommand1(row.id)">员工</el-button>
|
|
|
<el-button size="mini" @click="handleCommand2(row.id)">收益</el-button>
|
|
<el-button size="mini" @click="handleCommand2(row.id)">收益</el-button>
|
|
@@ -105,7 +107,8 @@ export default {
|
|
|
saving: false,
|
|
saving: false,
|
|
|
rules: {
|
|
rules: {
|
|
|
packageId: [{ required: true, message: '请选择套餐', trigger: 'blur' }]
|
|
packageId: [{ required: true, message: '请选择套餐', trigger: 'blur' }]
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ display: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -117,6 +120,7 @@ export default {
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
});
|
|
});
|
|
|
|
|
+ this.getAdmin();
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapState(['userInfo']),
|
|
...mapState(['userInfo']),
|
|
@@ -251,6 +255,15 @@ export default {
|
|
|
this.saving = false;
|
|
this.saving = false;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ getAdmin() {
|
|
|
|
|
+ let data = this.userInfo.authorities;
|
|
|
|
|
+ for (let item in data) {
|
|
|
|
|
+ if (data[item].name === 'ROLE_ADMIN') {
|
|
|
|
|
+ this.display = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|