xiejun
2023-06-15 8e6c58eec222c4bbea613e02703d9af22da72bee
Source/UBCS-WEB/src/views/integration/systemInfo.vue
@@ -5,8 +5,8 @@
            @refresh-change="handleRefresh" @size-change="handleSizePage" @current-change="handleCurrentPage"
            @selection-change="selectionChange" @row-click="handleRowClick">
            <template slot="menuLeft">
                <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">查 询
                </el-button>
                <!-- <el-button icon="el-icon-search" size="small" type="primary" @click="handleStatus">查 询
                </el-button> -->
                <el-button icon="el-icon-delete" size="small" type="danger" @click="handleDeleteByIds">删 除
                </el-button>
            </template>
@@ -68,7 +68,8 @@
                            required: true,
                            message: '系统编号不能为空',
                            trigger: 'blur'
                        }]
                        }],
                        // maxlength: 30,    //字数限制
                    }, {
                        label: '系统名称',
                        prop: 'name',
@@ -77,7 +78,8 @@
                            required: true,
                            message: '系统名称不能为空',
                            trigger: 'blur'
                        }]
                        }],
                        // maxlength: 30,    //字数限制
                    },
                    {
                        label: '系统描述',
@@ -95,6 +97,9 @@
            console.log(this.search)
            const { pageSize, currentPage } = this.page
            let param = { size: pageSize, current: currentPage }
            this.search = Object.keys(this.search)
                .filter((key) => this.search[key] !== null && this.search[key] !== undefined && this.search[key] !== "")
                .reduce((acc, key) => ({ ...acc, [key]: this.search[key] }), {});
            const response = await getSysInfoList({ ...param, ...this.search })
            if (response.status === 200) {
                console.log(response)
@@ -106,31 +111,36 @@
        },
        // 新增
        async handleSave(row, done, loading) {
            const response = await sysInfoAdd(row)
            if (response.status === 200) {
            try {
                const response = await sysInfoAdd(row)
                if (response.status === 200) {
                    this.$message({
                        type: 'success',
                        message: '新增数据成功!'
                    })
                    done(row)
                    // this.$refs.crud.refreshTable()
                    // this.getDataList()
                }
            } catch {
                loading()
                this.$message({
                    type: 'success',
                    message: '新增数据成功!'
                })
                done()
                this.$refs.crud.refreshTable()
                this.getDataList()
            }
        },
        // 编辑
        async handleEdit(row, index, done, loading) {
            console.log(row)
            const { oid, id, name, description } = row
            const response = await sysInfoEdit({ oid, id, name, description })
            if (response.status === 200) {
            try {
                const { oid, id, name, description } = row
                const response = await sysInfoEdit({ oid, id, name, description })
                if (response.status === 200) {
                    loading()
                    this.$message({
                        type: 'success',
                        message: '修改数据成功!'
                    })
                    done(row)
                }
            } catch {
                loading()
                this.$message({
                    type: 'success',
                    message: '修改数据成功!'
                })
                done()
                this.getDataList()
            }
        },
        // 删除单条