|
@@ -125,9 +125,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="'action' === field.prop">
|
|
<template v-else-if="'action' === field.prop">
|
|
|
<el-button v-auth="'station.whitelist.modify'" size="small" plain type="warning" @click="onRowClick('edit', row)">编辑</el-button>
|
|
<el-button v-auth="'station.whitelist.modify'" size="small" plain type="warning" @click="onRowClick('edit', row)">编辑</el-button>
|
|
|
- <el-button v-auth="'station.whitelist.modify'" size="small" plain :type="row.status === 1 ? 'info' : 'success'" @click="onToggleStatus(row)">
|
|
|
|
|
- {{ row.status === 1 ? '禁用' : '启用' }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
<el-button v-auth="'station.whitelist.delete'" size="small" plain type="danger" @click="onRowDel(row)">移除</el-button>
|
|
<el-button v-auth="'station.whitelist.delete'" size="small" plain type="danger" @click="onRowDel(row)">移除</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
@@ -146,7 +143,7 @@
|
|
|
|
|
|
|
|
<script setup lang="ts" name="StationWhitelistList">
|
|
<script setup lang="ts" name="StationWhitelistList">
|
|
|
import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, nextTick, onBeforeUnmount} from 'vue';
|
|
import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, nextTick, onBeforeUnmount} from 'vue';
|
|
|
-import {$body, $get, $delete, $put} from "/@/utils/request";
|
|
|
|
|
|
|
+import {$body, $get, $delete} from "/@/utils/request";
|
|
|
import {Msg} from "/@/utils/message";
|
|
import {Msg} from "/@/utils/message";
|
|
|
import ExtPage from '/@/components/form/ExtPage.vue'
|
|
import ExtPage from '/@/components/form/ExtPage.vue'
|
|
|
import mittBus from '/@/utils/mitt';
|
|
import mittBus from '/@/utils/mitt';
|
|
@@ -185,7 +182,7 @@ const state = reactive({
|
|
|
{label: '备注', prop: 'remark', minWidth: 200, resizable: true},
|
|
{label: '备注', prop: 'remark', minWidth: 200, resizable: true},
|
|
|
{label: '创建时间', prop: 'createTime', width: 180, resizable: true},
|
|
{label: '创建时间', prop: 'createTime', width: 180, resizable: true},
|
|
|
{
|
|
{
|
|
|
- label: '操作', prop: 'action', width: 260, align: 'center', fixed: 'right',
|
|
|
|
|
|
|
+ label: '操作', prop: 'action', width: 160, align: 'center', fixed: 'right',
|
|
|
}
|
|
}
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
@@ -267,19 +264,6 @@ const onRowDel = (row: any) => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const onToggleStatus = (row: any) => {
|
|
|
|
|
- const newStatus = row.status === 1 ? 0 : 1;
|
|
|
|
|
- const statusText = newStatus === 1 ? '启用' : '禁用';
|
|
|
|
|
- Msg.confirm(`确定要${statusText}用户『${row.userNickname || row.userPhone}』吗?`).then(() => {
|
|
|
|
|
- $put(`/station-whitelist/status/${row.id}?status=${newStatus}`).then(() => {
|
|
|
|
|
- Msg.message(`${statusText}成功`, 'success');
|
|
|
|
|
- loadData(true);
|
|
|
|
|
- }).catch(() => {
|
|
|
|
|
- Msg.message(`${statusText}失败`, 'error');
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const handleTableSelectionChange = (selection: any) => {
|
|
const handleTableSelectionChange = (selection: any) => {
|
|
|
state.selectedIds = selection.map((item: any) => item.id);
|
|
state.selectedIds = selection.map((item: any) => item.id);
|
|
|
}
|
|
}
|