|
@@ -3,7 +3,7 @@
|
|
|
<el-aside style="background: #fff; margin-right: 10px" width="200px">
|
|
|
<el-container style="height: 100%">
|
|
|
<el-header>
|
|
|
- <el-input v-model="groupFilterText" placeholder="输入关键字进行过滤" clearable style="margin-top: 10px" />
|
|
|
+ <el-input v-model="groupFilterText" placeholder="输入关键字进行过滤" clearable style="margin-top: 10px"/>
|
|
|
</el-header>
|
|
|
<el-main class="nopadding" style="flex-basis: 100%">
|
|
|
<el-tree
|
|
@@ -24,8 +24,8 @@
|
|
|
<span class="label">{{ node.label }}</span>
|
|
|
<span class="code">{{ data.code }}</span>
|
|
|
<span class="do">
|
|
|
- <el-icon @click.stop="dicEdit(data)"><Edit /></el-icon>
|
|
|
- <el-icon @click.stop="dictDel(node, data)"><Delete /></el-icon>
|
|
|
+ <el-icon @click.stop="dicEdit(data)"><Edit/></el-icon>
|
|
|
+ <el-icon @click.stop="dictDel(node, data)"><Delete/></el-icon>
|
|
|
</span>
|
|
|
</span>
|
|
|
</template>
|
|
@@ -49,12 +49,12 @@
|
|
|
<template #toolLeft>
|
|
|
<el-button type="primary" @click="addHandler('table')">
|
|
|
<el-icon class="btn-icon">
|
|
|
- <Plus />
|
|
|
+ <Plus/>
|
|
|
</el-icon>
|
|
|
</el-button>
|
|
|
<el-button type="danger" :disabled="curSelectionRows.length === 0" @click="batch_del">
|
|
|
<el-icon class="btn-icon">
|
|
|
- <Delete />
|
|
|
+ <Delete/>
|
|
|
</el-icon>
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -71,14 +71,14 @@
|
|
|
<template #actionSlot="scope">
|
|
|
<el-tooltip content="编辑" placement="bottom" effect="light">
|
|
|
<el-icon class="ibt0" @click="table_edit(scope.row)">
|
|
|
- <Edit />
|
|
|
+ <Edit/>
|
|
|
</el-icon>
|
|
|
</el-tooltip>
|
|
|
<el-divider direction="vertical"></el-divider>
|
|
|
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row)">
|
|
|
<template #reference>
|
|
|
<el-icon class="ibt0">
|
|
|
- <Delete />
|
|
|
+ <Delete/>
|
|
|
</el-icon>
|
|
|
</template>
|
|
|
</el-popconfirm>
|
|
@@ -100,10 +100,10 @@
|
|
|
</template>
|
|
|
<script lang="tsx" setup>
|
|
|
import dict from '@/api/system/dict'
|
|
|
-import { computed, nextTick, ref, watch } from 'vue'
|
|
|
-import { ElMessage, ElTree, ElMessageBox } from 'element-plus'
|
|
|
-import { useTablePage } from '@/hooks/useTablePage'
|
|
|
-import { Plus, Delete, Edit } from '@element-plus/icons-vue'
|
|
|
+import {computed, nextTick, ref, watch} from 'vue'
|
|
|
+import {ElMessage, ElTree, ElMessageBox} from 'element-plus'
|
|
|
+import {useTablePage} from '@/hooks/useTablePage'
|
|
|
+import {Plus, Delete, Edit} from '@element-plus/icons-vue'
|
|
|
import StatusIndicator from '@/components/StatusIndicator'
|
|
|
import tree from '@/config/rule/tree.ts'
|
|
|
|
|
@@ -118,19 +118,19 @@ const formsDialog = [
|
|
|
itemType: 'select',
|
|
|
filterable: true,
|
|
|
options: [],
|
|
|
- rules: [{ required: true, message: '请选择所属字典', trigger: 'blur' }]
|
|
|
+ rules: [{required: true, message: '请选择所属字典', trigger: 'blur'}]
|
|
|
},
|
|
|
{
|
|
|
prop: 'name',
|
|
|
label: '项名称',
|
|
|
itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入项名称', trigger: 'blur' }]
|
|
|
+ rules: [{required: true, message: '请输入项名称', trigger: 'blur'}]
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
label: '编码',
|
|
|
itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入编码', trigger: 'blur' }]
|
|
|
+ rules: [{required: true, message: '请输入编码', trigger: 'blur'}]
|
|
|
},
|
|
|
{
|
|
|
prop: 'status',
|
|
@@ -143,7 +143,7 @@ const formsDialog = [
|
|
|
prop: 'sort',
|
|
|
label: '排序',
|
|
|
itemType: 'inputNumber',
|
|
|
- rules: [{ required: true, message: '请输入排序', trigger: 'blur' }]
|
|
|
+ rules: [{required: true, message: '请输入排序', trigger: 'blur'}]
|
|
|
},
|
|
|
{
|
|
|
prop: 'remark',
|
|
@@ -192,24 +192,24 @@ const getGroup = async () => {
|
|
|
showGroupLoading.value = true
|
|
|
let data = await dict.dictListParentApi()
|
|
|
formOptions.value.forms[0].options = data.map(item => {
|
|
|
- return { value: item.id, label: item.name }
|
|
|
+ return {value: item.id, label: item.name}
|
|
|
})
|
|
|
showGroupLoading.value = false
|
|
|
- data.unshift({ id: '', name: '所有' })
|
|
|
+ data.unshift({id: '', name: '所有'})
|
|
|
treeData.value = data
|
|
|
}
|
|
|
|
|
|
// 左侧菜单点击
|
|
|
const leftTreeClick = data => {
|
|
|
- searchData.value = { ...searchData.value, data: { pid: data.id ? data.id : null } }
|
|
|
+ searchData.value = {...searchData.value, data: {pid: data.id ? data.id : null}}
|
|
|
}
|
|
|
|
|
|
// table列表数据请求
|
|
|
const queryList = async () => {
|
|
|
- const { options, searchParams } = tableOpts
|
|
|
+ const {options, searchParams} = tableOpts
|
|
|
options.loading = true
|
|
|
try {
|
|
|
- const { records: list, total } = await dict.dictPageApi(searchParams)
|
|
|
+ const {records: list, total} = await dict.dictPageApi(searchParams)
|
|
|
tableOpts.total = total
|
|
|
tableOpts.list = list
|
|
|
} catch {
|
|
@@ -266,7 +266,7 @@ const columns = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows, updateParams } = useTablePage(
|
|
|
+const {searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows, updateParams} = useTablePage(
|
|
|
{
|
|
|
options: {
|
|
|
showIndex: false
|
|
@@ -314,14 +314,14 @@ const batch_del = () => {
|
|
|
|
|
|
const table_edit = async row => {
|
|
|
isCreate.value = false
|
|
|
- activeData.value = { ...row, status: row.status ? true : false }
|
|
|
+ activeData.value = {...row, status: row.status ? true : false}
|
|
|
visible.value = true
|
|
|
}
|
|
|
|
|
|
// 弹窗事件
|
|
|
const submitHandler = async params => {
|
|
|
- let flg = true
|
|
|
try {
|
|
|
+ formOptions.value.formConfig.submitLoading = true
|
|
|
params.status = params.status ? 1 : 0
|
|
|
params.id = activeData.value.id ? activeData.value.id : null
|
|
|
await dict.dictAddOrEditSaveApi(params)
|
|
@@ -331,11 +331,9 @@ const submitHandler = async params => {
|
|
|
getGroup()
|
|
|
}
|
|
|
updateParams()
|
|
|
- } catch (e) {
|
|
|
- flg = false
|
|
|
- console.log(e)
|
|
|
+ } finally {
|
|
|
+ formOptions.value.formConfig.submitLoading = false
|
|
|
}
|
|
|
- formOptions.value.formConfig.submitLoading = flg
|
|
|
}
|
|
|
|
|
|
const addHandler = mode => {
|
|
@@ -359,7 +357,8 @@ const dictDel = (node, data) => {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => {})
|
|
|
+ .catch(() => {
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
const dicEdit = data => {
|