diff --git a/src/components/CustomTable/CustomTable.vue b/src/components/CustomTable/CustomTable.vue index 711fd12..906df42 100644 --- a/src/components/CustomTable/CustomTable.vue +++ b/src/components/CustomTable/CustomTable.vue @@ -18,11 +18,16 @@ </el-table-column> <!-- Actions Column --> - <el-table-column v-if="actions.length > 0" label="操作" align="center" class-name="small-padding fixed-width"> + <el-table-column v-if="actions.length > 0 && modalType !== 'score'" label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button v-for="(action, index) in filteredActions(scope.row.applyStatus)" :key="index" size="mini" type="text" :icon="action.icon" @click="action.handler(scope.row)">{{ action.text }}</el-button> </template> </el-table-column> + <el-table-column v-else label="操作" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button v-for="(action, index) in actions" :key="index" size="mini" type="text" :icon="action.icon" @click="action.handler(scope.row)">{{ action.text }}</el-button> + </template> + </el-table-column> </el-table> </div> @@ -63,6 +68,9 @@ export default { applyType:{ type:String, default:'', + }, + modalType:{ + type:String, } }, data(){ diff --git a/src/views/reward/score/index.vue b/src/views/reward/score/index.vue index ee324f0..0fdae03 100644 --- a/src/views/reward/score/index.vue +++ b/src/views/reward/score/index.vue @@ -30,6 +30,7 @@ :actions="tableActions" :query-params="queryParams" :apply-type="applyParam.applyType" + :modal-type="'score'" @handleQuery="handleQuery" @resetQuery="resetQuery" @handleView="handleView" @@ -292,11 +293,12 @@ export default { }, mounted() { this.$store.dispatch('GetInfo').then((res) => { + let filterData = this.tableActions if (res.user.userId === 1){ - let ratingIndex = this.tableActions.findIndex(action => action.text === '评分'); + let ratingIndex = filterData.findIndex(action => action.text === '评分'); if (ratingIndex !== -1) { // 使用 splice 方法将评分项从数组中删除 - this.tableActions.splice(ratingIndex, 1); + filterData.splice(ratingIndex, 1); } } })