|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
// 引入依赖
|
|
|
|
|
import api from '@/api/lbt'
|
|
|
|
|
// import { toSQLLine } from '@/utils/stringFun'
|
|
|
|
|
import WarningBar from '@/components/warningBar/warningBar.vue'
|
|
|
|
|
// import WarningBar from '@/components/warningBar/warningBar.vue'
|
|
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
|
@ -12,6 +12,7 @@ const dialogFormVisible = ref(false)
|
|
|
|
|
import { useUserStore } from '@/pinia/modules/user'
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
import { parseTime } from '@/utils'
|
|
|
|
|
import { fa } from 'element-plus/es/locale'
|
|
|
|
|
// 变量
|
|
|
|
|
const path = ref(import.meta.env.VITE_BASE_API)
|
|
|
|
|
const queryParams = ref({
|
|
|
|
@ -150,7 +151,7 @@ function delLbtFunc(item) {
|
|
|
|
|
.then(async() => {
|
|
|
|
|
const res = await api.delLbt({
|
|
|
|
|
// ids: [item.ID]
|
|
|
|
|
id: item.ID
|
|
|
|
|
id: item.ID
|
|
|
|
|
})
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
ElMessage({
|
|
|
|
@ -173,6 +174,22 @@ function handleSizeChange(val) {
|
|
|
|
|
queryParams.value.pageSize = val
|
|
|
|
|
getLbtList()
|
|
|
|
|
}
|
|
|
|
|
const state_loading = ref(false)
|
|
|
|
|
async function changeStateFunc(row) { // 改变状态
|
|
|
|
|
state_loading.value = true
|
|
|
|
|
const res = await api.editLbtState({ status: row.status })
|
|
|
|
|
state_loading.value = false
|
|
|
|
|
// eslint-disable-next-line no-empty
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: '修改成功!'
|
|
|
|
|
})
|
|
|
|
|
return true
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
@ -205,7 +222,8 @@ function handleSizeChange(val) {
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="left" label="是否启用" min-width="150" prop="status">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
{{ scope.row.status == '1'?'启用':'禁用' }}
|
|
|
|
|
<el-switch v-model="scope.row.status" :active-value="1" :loadiing="state_loading" :inactive-value="2" active-text="启用" inactive-text="禁用" :before-change="changeStateFunc(scope.row)" />
|
|
|
|
|
<!-- {{ scope.row.status == '1'?'启用':'禁用' }} -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column align="left" label="说明" min-width="150" prop="lbtIntroduction" /> -->
|
|
|
|
@ -273,9 +291,9 @@ function handleSizeChange(val) {
|
|
|
|
|
<el-form-item label="链接地址" prop="link">
|
|
|
|
|
<el-input v-model="form.link" placeholder="链接地址" autocomplete="off" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="启用状态" prop="status">
|
|
|
|
|
<el-form-item label="启用状态" prop="status">
|
|
|
|
|
<el-switch v-model="form.status" :active-value="1" :inactive-value="2" active-text="启用" inactive-text="禁用" />
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="展示位置" prop="lbtType">
|
|
|
|
|
<el-select v-model="form.lbtType" class="m-2" placeholder="请选择">
|
|
|
|
|
<el-option
|
|
|
|
|