|
@@ -4,21 +4,18 @@ import { FormConfigType } from '@/components/AForm/type'
|
|
import { ToolbarConfigType } from '@/components/AToolbar/type'
|
|
import { ToolbarConfigType } from '@/components/AToolbar/type'
|
|
import { ColumnConfigType } from '@/components/ATable/type'
|
|
import { ColumnConfigType } from '@/components/ATable/type'
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
-import { useHandleData } from '@/utils/useHandleData'
|
|
|
|
-import { getPageApi, getDetailApi, addApi, editApi, deleteApi } from '@/api/business/log/userOperation'
|
|
|
|
|
|
+import { getPageApi, getDetailApi, editApi } from '@/api/business/log/userOperation'
|
|
|
|
|
|
const queryRef = ref<InstanceType<typeof AForm>>()
|
|
const queryRef = ref<InstanceType<typeof AForm>>()
|
|
const formRef = ref<InstanceType<typeof AForm>>()
|
|
const formRef = ref<InstanceType<typeof AForm>>()
|
|
|
|
|
|
const showQuery = ref<boolean>(true)
|
|
const showQuery = ref<boolean>(true)
|
|
-const selectKeys = ref<string[]>([])
|
|
|
|
const pageTotal = ref<number>(0)
|
|
const pageTotal = ref<number>(0)
|
|
|
|
|
|
const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
|
|
const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
|
|
const tableData = ref<StrAnyObjArr>([])
|
|
const tableData = ref<StrAnyObjArr>([])
|
|
const formData = ref<StrAnyObj>({})
|
|
const formData = ref<StrAnyObj>({})
|
|
|
|
|
|
-const dialogTitle = ref<string>('')
|
|
|
|
const dialogVisible = ref<boolean>(false)
|
|
const dialogVisible = ref<boolean>(false)
|
|
|
|
|
|
const queryConfig: FormConfigType[] = [
|
|
const queryConfig: FormConfigType[] = [
|
|
@@ -86,33 +83,19 @@ const toolbarConfig: ToolbarConfigType[] = [
|
|
queryRef.value?.resetFields()
|
|
queryRef.value?.resetFields()
|
|
getPage()
|
|
getPage()
|
|
}
|
|
}
|
|
- },
|
|
|
|
- {
|
|
|
|
- common: 'add',
|
|
|
|
- click() {
|
|
|
|
- dialogVisible.value = true
|
|
|
|
- dialogTitle.value = '新增'
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
- // {
|
|
|
|
- // common: 'delete',
|
|
|
|
- // disabled() {
|
|
|
|
- // return selectKeys.value.length == 0
|
|
|
|
- // },
|
|
|
|
- // click() {
|
|
|
|
- // handleRemove(selectKeys.value)
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
]
|
|
]
|
|
|
|
|
|
const columnConfig: ColumnConfigType[] = [
|
|
const columnConfig: ColumnConfigType[] = [
|
|
{
|
|
{
|
|
prop: 'moduleName',
|
|
prop: 'moduleName',
|
|
- label: '模块标题'
|
|
|
|
|
|
+ label: '模块标题',
|
|
|
|
+ width: 160
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'operatorName',
|
|
prop: 'operatorName',
|
|
- label: '操作人姓名'
|
|
|
|
|
|
+ label: '操作人姓名',
|
|
|
|
+ width: 160
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'operationType',
|
|
prop: 'operationType',
|
|
@@ -127,11 +110,13 @@ const columnConfig: ColumnConfigType[] = [
|
|
return '删除'
|
|
return '删除'
|
|
}
|
|
}
|
|
return ''
|
|
return ''
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ width: 120
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'createTime',
|
|
prop: 'createTime',
|
|
- label: '操作时间'
|
|
|
|
|
|
+ label: '操作时间',
|
|
|
|
+ width: 160
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'description',
|
|
prop: 'description',
|
|
@@ -150,43 +135,35 @@ const columnConfig: ColumnConfigType[] = [
|
|
return '拒绝'
|
|
return '拒绝'
|
|
}
|
|
}
|
|
return ''
|
|
return ''
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ width: 120
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'auditTime',
|
|
prop: 'auditTime',
|
|
- label: '审核时间'
|
|
|
|
|
|
+ label: '审核时间',
|
|
|
|
+ width: 160
|
|
},
|
|
},
|
|
{
|
|
{
|
|
prop: 'remark',
|
|
prop: 'remark',
|
|
label: '审核注释'
|
|
label: '审核注释'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: 250,
|
|
|
|
|
|
+ width: 120,
|
|
handleConfig: [
|
|
handleConfig: [
|
|
{
|
|
{
|
|
|
|
+ if: (row) => row.auditStatus == 0,
|
|
text: '审核',
|
|
text: '审核',
|
|
click(row) {
|
|
click(row) {
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
- dialogTitle.value = '审核'
|
|
|
|
getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
|
|
getDetailApi({ id: row.id }).then((resp: StrAnyObj) => {
|
|
formData.value = resp
|
|
formData.value = resp
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // {
|
|
|
|
- // common: 'delete',
|
|
|
|
- // click(row) {
|
|
|
|
- // handleRemove([row.id])
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
]
|
|
]
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
|
|
-const formConfig: FormConfigType[] = [
|
|
|
|
-
|
|
|
|
-]
|
|
|
|
-
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getPage()
|
|
getPage()
|
|
})
|
|
})
|
|
@@ -198,32 +175,15 @@ function getPage() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
-function tableSelectionChange(item: StrAnyObjArr) {
|
|
|
|
- selectKeys.value = item.map((item) => item.id)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function formSubmit() {
|
|
|
|
|
|
+function formSubmit(status: boolean) {
|
|
formRef.value?.validate(() => {
|
|
formRef.value?.validate(() => {
|
|
- editApi(formData.value).then(() => {
|
|
|
|
|
|
+ editApi({ ...formData.value, auditStatus: status ? 1 : 2 }).then(() => {
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
ElMessage.success('操作成功')
|
|
ElMessage.success('操作成功')
|
|
getPage()
|
|
getPage()
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
-function formClosed() {
|
|
|
|
- formRef.value?.resetFields()
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function handleRemove(idList: string[]) {
|
|
|
|
- useHandleData('是否确认删除?', () => {
|
|
|
|
- deleteApi({ idList }).then(() => {
|
|
|
|
- ElMessage.success('删除成功')
|
|
|
|
- getPage()
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -233,7 +193,6 @@ function handleRemove(idList: string[]) {
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
<a-table
|
|
<a-table
|
|
- selection
|
|
|
|
:data="tableData"
|
|
:data="tableData"
|
|
:page-total="pageTotal"
|
|
:page-total="pageTotal"
|
|
:toolbar-config="toolbarConfig"
|
|
:toolbar-config="toolbarConfig"
|
|
@@ -243,12 +202,18 @@ function handleRemove(idList: string[]) {
|
|
v-model:page-size="queryData.pageSize"
|
|
v-model:page-size="queryData.pageSize"
|
|
@page-num-change="getPage"
|
|
@page-num-change="getPage"
|
|
@page-size-change="getPage"
|
|
@page-size-change="getPage"
|
|
- @selection-change="tableSelectionChange"
|
|
|
|
>
|
|
>
|
|
</a-table>
|
|
</a-table>
|
|
|
|
|
|
- <a-dialog v-model="dialogVisible" :title="dialogTitle" @submit="formSubmit" @closed="formClosed">
|
|
|
|
- <a-form ref="formRef" v-model="formData" :config="formConfig" :span="24"> </a-form>
|
|
|
|
|
|
+ <a-dialog v-model="dialogVisible" title="审核" :footer="false">
|
|
|
|
+ <el-input style="padding: 20px 0" type="textarea" v-model="formData.remark" placeholder="请输入审核备注" />
|
|
|
|
+ <div style="text-align: center">
|
|
|
|
+ <div>
|
|
|
|
+ <el-button plain type="info" @click="dialogVisible = false">关 闭</el-button>
|
|
|
|
+ <el-button plain type="success" @click="formSubmit(true)">通 过</el-button>
|
|
|
|
+ <el-button plain type="warning" @click="formSubmit(false)">拒 绝</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</a-dialog>
|
|
</a-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|