| | |
| | | @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> |
| | |
| | | required: true, |
| | | message: '系统编号不能为空', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //字数限制 |
| | | }, { |
| | | label: '系统名称', |
| | | prop: 'name', |
| | |
| | | required: true, |
| | | message: '系统名称不能为空', |
| | | trigger: 'blur' |
| | | }] |
| | | }], |
| | | // maxlength: 30, //字数限制 |
| | | }, |
| | | { |
| | | label: '系统描述', |
| | |
| | | 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) |
| | |
| | | }, |
| | | // 新增 |
| | | 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() |
| | | } |
| | | }, |
| | | // 删除单条 |