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