|
@@ -14,16 +14,8 @@
|
|
|
:columns="activeColumns"
|
|
|
>
|
|
|
<template #toolLeft>
|
|
|
- <el-button type="primary" @click="addHandler">
|
|
|
- <el-icon class="btn-icon">
|
|
|
- <Plus />
|
|
|
- </el-icon>
|
|
|
- </el-button>
|
|
|
- <el-button type="danger" :disabled="curSelectionRows.length === 0" @click="batch_del">
|
|
|
- <el-icon class="btn-icon">
|
|
|
- <Delete />
|
|
|
- </el-icon>
|
|
|
- </el-button>
|
|
|
+ <el-button plain :icon="Plus" @click="addHandler" type="primary">新增</el-button>
|
|
|
+ <el-button plain :icon="Delete" :disabled="curSelectionRows.length === 0" @click="batch_del" type="danger">删除</el-button>
|
|
|
</template>
|
|
|
|
|
|
<template #statusSlot="scope">
|
|
@@ -85,9 +77,9 @@ const formsDialog = ref([
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
- label: '编码',
|
|
|
+ label: '部门编码',
|
|
|
itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入编码', trigger: 'blur' }]
|
|
|
+ rules: [{ required: true, message: '请输入部门编码', trigger: 'blur' }]
|
|
|
},
|
|
|
{
|
|
|
prop: 'sort',
|
|
@@ -97,7 +89,7 @@ const formsDialog = ref([
|
|
|
},
|
|
|
{
|
|
|
prop: 'status',
|
|
|
- label: '状态',
|
|
|
+ label: '部门状态',
|
|
|
itemType: 'switch',
|
|
|
activeText: '正常',
|
|
|
inactiveText: '禁用'
|
|
@@ -148,7 +140,7 @@ const queryList = async () => {
|
|
|
const { options, searchParams } = tableOpts
|
|
|
options.loading = true
|
|
|
try {
|
|
|
- const list = await department.departmentPageApi(searchParams)
|
|
|
+ const list = await department.departmentPageApi(searchParams.data || {})
|
|
|
// tableOpts.total = total
|
|
|
tableOpts.list = list
|
|
|
formsDialog.value[0].options = list
|
|
@@ -173,16 +165,16 @@ const selectionChange = e => {
|
|
|
// 表格搜索条件
|
|
|
const forms = ref([
|
|
|
{
|
|
|
- prop: 'keyword',
|
|
|
+ prop: 'name',
|
|
|
label: '部门名称:',
|
|
|
itemType: 'input',
|
|
|
placeholder: '请输入部门名称'
|
|
|
},
|
|
|
{
|
|
|
prop: 'status',
|
|
|
- label: '状态:',
|
|
|
+ label: '部门状态:',
|
|
|
itemType: 'select',
|
|
|
- placeholder: '请选择状态',
|
|
|
+ placeholder: '请选择部门状态',
|
|
|
options: [
|
|
|
{
|
|
|
label: '禁用',
|
|
@@ -205,12 +197,11 @@ const columns = [
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
- label: '编码',
|
|
|
- minWidth: 100
|
|
|
+ label: '部门编码'
|
|
|
},
|
|
|
{
|
|
|
prop: 'status',
|
|
|
- label: '状态',
|
|
|
+ label: '部门状态',
|
|
|
minWidth: 80,
|
|
|
slots: {
|
|
|
default: 'statusSlot'
|
|
@@ -226,21 +217,21 @@ const columns = [
|
|
|
label: '排序',
|
|
|
minWidth: 80
|
|
|
},
|
|
|
- {
|
|
|
- prop: 'updateBy',
|
|
|
- label: '修改人',
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'updateTime',
|
|
|
- label: '修改时间',
|
|
|
- minWidth: 150
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createBy',
|
|
|
- label: '创建人',
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'updateBy',
|
|
|
+ // label: '修改人',
|
|
|
+ // minWidth: 100
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'updateTime',
|
|
|
+ // label: '修改时间',
|
|
|
+ // minWidth: 150
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // prop: 'createBy',
|
|
|
+ // label: '创建人',
|
|
|
+ // minWidth: 100
|
|
|
+ // },
|
|
|
{
|
|
|
prop: 'createTime',
|
|
|
label: '创建时间',
|
|
@@ -263,7 +254,8 @@ const { searchData, tableOpts, checkedColumns, activeColumns, updateParams } = u
|
|
|
options: {
|
|
|
showIndex: false,
|
|
|
defaultExpandAll: false,
|
|
|
- onSelectionChange: selectionChange
|
|
|
+ onSelectionChange: selectionChange,
|
|
|
+ showPagination: false
|
|
|
},
|
|
|
// 需要展示的列
|
|
|
columns,
|
|
@@ -360,7 +352,7 @@ const addHandler = () => {
|
|
|
}
|
|
|
|
|
|
const handleStatusChange = (row: any) => {
|
|
|
- // 状态 0、禁用 1、正常
|
|
|
+ // 部门状态 0、禁用 1、正常
|
|
|
const status = row.status
|
|
|
let text = Number(row.status) === 0 ? '禁用' : '启用'
|
|
|
ElMessageBox.confirm('请确认是否' + text + '当前数据?', '提示', { type: 'warning' })
|