|
|
|
@ -123,11 +123,17 @@ |
|
|
|
|
width="140" |
|
|
|
|
align="center"> |
|
|
|
|
<template #default="{ row }"> |
|
|
|
|
<el-popconfirm v-if="row.checkpointId" |
|
|
|
|
:title="row.isEnable ? '禁用关卡后,已关联该关卡的判分点将被禁用,确定禁用吗?' : '启用关卡后,已关联该关卡的判分点将被启用,确定启用吗?'" |
|
|
|
|
@confirm.stop="enableSubmit(row)"> |
|
|
|
|
<template #reference> |
|
|
|
|
<el-switch v-if="row.checkpointId" |
|
|
|
|
v-model="row.isEnable" |
|
|
|
|
:active-value="1" |
|
|
|
|
:inactive-value="0" |
|
|
|
|
@change="hadChange = 1;" /> |
|
|
|
|
@change="enableChange(row)" /> |
|
|
|
|
</template> |
|
|
|
|
</el-popconfirm> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
@ -157,9 +163,9 @@ |
|
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
|
import { computed, onMounted, ref, reactive, watch, nextTick } from 'vue'; |
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'; |
|
|
|
|
import { Delete, Edit, Check, MoreFilled, Close } from '@element-plus/icons-vue'; |
|
|
|
|
import { listPass, savePass, updatePass, delPass } from '@/api/config'; |
|
|
|
|
import { listPass, savePass, updatePass, delPass, updateIsOpen } from '@/api/config'; |
|
|
|
|
import Search from '@/components/Search.vue'; |
|
|
|
|
import { useRouter, useRoute } from 'vue-router'; |
|
|
|
|
import Cookies from 'js-cookie'; |
|
|
|
@ -266,6 +272,14 @@ const toAdd = () => { |
|
|
|
|
hadChange.value = 1; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 禁启用回调 |
|
|
|
|
const enableChange = (row: Record<string, any>) => { |
|
|
|
|
row.isEnable = row.isEnable ? 0 : 1; |
|
|
|
|
}; |
|
|
|
|
const enableSubmit = async (row: Record<string, any>) => { |
|
|
|
|
row.isEnable = row.isEnable ? 0 : 1; |
|
|
|
|
await updateIsOpen(row.checkpointId, row.isEnable); |
|
|
|
|
}; |
|
|
|
|
// 编辑 |
|
|
|
|
const edit = async (row: Record<string, any>) => { |
|
|
|
|
if (!row.editing) { |
|
|
|
|