|
@@ -1,11 +1,11 @@
|
|
<template>
|
|
<template>
|
|
- <div class="main " v-loading="loading">
|
|
|
|
|
|
+ <div class="main" v-loading="loading">
|
|
<el-col :span="24" class="one">
|
|
<el-col :span="24" class="one">
|
|
<el-button type="primary" @click="toBack()">返回</el-button>
|
|
<el-button type="primary" @click="toBack()">返回</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset"> </custom-search-bar>
|
|
<custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset"> </custom-search-bar>
|
|
- <custom-button-bar :fields="buttonFields" @add="toAdd" @select="toMoreDelect"></custom-button-bar>
|
|
|
|
- <custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @exam="toExam" @edit="toEdit" @delete="toDelete" @toSelect="toSelect" :select="true">
|
|
|
|
|
|
+ <custom-button-bar :fields="buttonFields" @add="toAdd"></custom-button-bar>
|
|
|
|
+ <custom-table :data="data" :fields="fields" @query="search" :total="total" :opera="opera" @exam="toExam" @edit="toEdit" @delete="toDelete">
|
|
<template #is_use="{ row }">
|
|
<template #is_use="{ row }">
|
|
<el-tag v-if="row.is_use == '0'" type="success" @click="toUse(row, '1')">启用</el-tag>
|
|
<el-tag v-if="row.is_use == '0'" type="success" @click="toUse(row, '1')">启用</el-tag>
|
|
<el-tag v-else type="info" @click="toUse(row, '0')">禁用</el-tag>
|
|
<el-tag v-else type="info" @click="toUse(row, '0')">禁用</el-tag>
|
|
@@ -59,10 +59,7 @@ const opera = [
|
|
{ label: t('common.exam'), method: 'exam', type: 'warning', display: (i) => i.status === '0' },
|
|
{ label: t('common.exam'), method: 'exam', type: 'warning', display: (i) => i.status === '0' },
|
|
{ label: t('common.delete'), method: 'delete', confirm: true, type: 'danger', display: (i) => i.is_use === '1' }
|
|
{ label: t('common.delete'), method: 'delete', confirm: true, type: 'danger', display: (i) => i.is_use === '1' }
|
|
]
|
|
]
|
|
-const buttonFields = [
|
|
|
|
- { label: t('common.create'), method: 'add' },
|
|
|
|
- { label: t('common.select'), method: 'select', type: 'danger' }
|
|
|
|
-]
|
|
|
|
|
|
+const buttonFields = [{ label: t('common.create'), method: 'add' }]
|
|
let skip = 0
|
|
let skip = 0
|
|
let limit = inject('limit')
|
|
let limit = inject('limit')
|
|
const total = ref(0)
|
|
const total = ref(0)
|
|
@@ -71,8 +68,6 @@ const route = useRoute()
|
|
// 字典表
|
|
// 字典表
|
|
const isUseList = ref([])
|
|
const isUseList = ref([])
|
|
const statusList = ref([])
|
|
const statusList = ref([])
|
|
-// 多选列表
|
|
|
|
-const selectList = ref([])
|
|
|
|
// 加载中
|
|
// 加载中
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
const formFields = ref([
|
|
const formFields = ref([
|
|
@@ -125,25 +120,6 @@ const getDict = (data, model) => {
|
|
return get(res, 'label')
|
|
return get(res, 'label')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// 多选
|
|
|
|
-const toSelect = (val) => {
|
|
|
|
- selectList.value = val
|
|
|
|
-}
|
|
|
|
-// 批量删除
|
|
|
|
-const toMoreDelect = () => {
|
|
|
|
- if (selectList.value.length > 0) {
|
|
|
|
- ElMessageBox.confirm(`确定批量删除数据?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' })
|
|
|
|
- .then(async () => {
|
|
|
|
- console.log(selectList.value)
|
|
|
|
- })
|
|
|
|
- .catch(() => {})
|
|
|
|
- } else {
|
|
|
|
- ElMessage({
|
|
|
|
- message: '未选择要处理的数据!',
|
|
|
|
- type: 'warning'
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
// 添加
|
|
// 添加
|
|
const toAdd = () => {
|
|
const toAdd = () => {
|
|
form.value = { journal: route.query.id }
|
|
form.value = { journal: route.query.id }
|