|
|
@@ -3,7 +3,6 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import OcComponent from '../components/Oc.vue'
|
|
|
import OcAdminComponent from '../components/OcAdmin.vue'
|
|
|
import { deleteOcById, getOcByList, resetAdminPwd, updateLicStatus, updateStatus } from '@/api/system/ocApi'
|
|
|
-import { ocTypeFilter } from '@/utils/tool'
|
|
|
|
|
|
const state = reactive({
|
|
|
loading: false,
|
|
|
@@ -21,7 +20,7 @@ const state = reactive({
|
|
|
|
|
|
const ocRef = ref()
|
|
|
|
|
|
-const getDataList = async () => {
|
|
|
+const getData = async () => {
|
|
|
state.loading = true
|
|
|
const { data } = await getOcByList(state.search)
|
|
|
state.dataList = data
|
|
|
@@ -29,16 +28,15 @@ const getDataList = async () => {
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getDataList()
|
|
|
+ getData()
|
|
|
})
|
|
|
|
|
|
function onSearch() {
|
|
|
- getDataList()
|
|
|
+ getData()
|
|
|
}
|
|
|
|
|
|
function onOcAdd() {
|
|
|
- const ocTypeId = state.search.ocTypeId
|
|
|
- ocRef.value.showAddModel(ocTypeId)
|
|
|
+ ocRef.value.showAddModel()
|
|
|
}
|
|
|
|
|
|
function onOcEdit(row: any) {
|
|
|
@@ -49,11 +47,8 @@ function onOcEdit(row: any) {
|
|
|
function onOcDel(row: any) {
|
|
|
ElMessageBox.confirm(`确认删除「${row.ocName}」吗?`, '确认信息').then(async () => {
|
|
|
await deleteOcById(row.ocId)
|
|
|
- await getDataList()
|
|
|
- ElMessage.success({
|
|
|
- message: '删除成功',
|
|
|
- center: true,
|
|
|
- })
|
|
|
+ await getData()
|
|
|
+ ElMessage.success('删除成功')
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
|
|
|
@@ -128,21 +123,9 @@ function onPasswordReset(row: { ocId: number; adminId: number; adminName: string
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="ocTypeId" label="类型" header-align="center" align="center" width="120">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ ocTypeFilter(scope.row.ocTypeId) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="ocCatId" label="分类" header-align="center" align="center" width="120">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ scope.row.ocCatTitle }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="ocRemark" label="备注" header-align="center" align="left">
|
|
|
+ <el-table-column prop="ocCatId" label="分类" header-align="center" align="center" width="250">
|
|
|
<template #default="scope">
|
|
|
- <span>{{ scope.row.ocRemark }}</span>
|
|
|
+ <span>{{ scope.row.ocTypeTitle }}</span> - <span>{{ scope.row.ocCatTitle }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -193,7 +176,13 @@ function onPasswordReset(row: { ocId: number; adminId: number; adminName: string
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column label="操作" header-align="center" align="center" width="220">
|
|
|
+ <el-table-column prop="ocRemark" label="备注" header-align="center" align="left">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.ocRemark }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="操作" header-align="center" align="center" width="160">
|
|
|
<template #default="scope">
|
|
|
<div>
|
|
|
<el-button type="primary" size="small" plain @click="onOcEdit(scope.row)">
|
|
|
@@ -210,8 +199,8 @@ function onPasswordReset(row: { ocId: number; adminId: number; adminName: string
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</page-main>
|
|
|
- <OcComponent ref="ocRef" @success="getDataList" />
|
|
|
- <OcAdminComponent ref="ocAdminRef" @success="getDataList" />
|
|
|
+ <OcComponent ref="ocRef" :oc-type-id="state.search.ocTypeId" @success="getData" />
|
|
|
+ <OcAdminComponent ref="ocAdminRef" @success="getData" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|