|
@@ -3,9 +3,9 @@
|
|
|
<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-main style="flex-basis: 100%; padding: 0px">
|
|
|
<el-tree
|
|
|
ref="treeRef"
|
|
|
class="menu-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,7 +314,7 @@ 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
|
|
|
}
|
|
|
|
|
@@ -357,8 +357,7 @@ const dictDel = (node, data) => {
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
|
|
|
const dicEdit = data => {
|
|
@@ -376,20 +375,6 @@ watch(groupFilterText, val => {
|
|
|
})
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
-.pageWrap {
|
|
|
- flex: 1;
|
|
|
- display: flex;
|
|
|
- height: 100%;
|
|
|
- min-height: 0;
|
|
|
- //background: #fff;
|
|
|
-}
|
|
|
-
|
|
|
-.content-warp {
|
|
|
- flex: 1;
|
|
|
- //width: calc(100% - 250px);
|
|
|
- width: calc(100% - 210px);
|
|
|
-}
|
|
|
-
|
|
|
// 角色的树结构样式
|
|
|
:deep(.menu-tree) {
|
|
|
.el-tree-node {
|
|
@@ -401,18 +386,6 @@ watch(groupFilterText, val => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .el-tree-node__content {
|
|
|
- height: 36px;
|
|
|
- }
|
|
|
-
|
|
|
- .el-tree-node__content .el-tree-node__label .icon {
|
|
|
- margin-right: 5px;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.nopadding {
|
|
|
- padding: 0px;
|
|
|
}
|
|
|
|
|
|
.custom-tree-node {
|