From 537a785bd34db8876e2ee4201db5be3399efdfb2 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 19 九月 2023 10:42:56 +0800
Subject: [PATCH] 集成系统信息管理-查询更改
---
Source/UBCS-WEB/src/api/integration/sysInfo.js | 8
Source/UBCS-WEB/src/api/docking/data.js | 4
Source/UBCS-WEB/src/api/docking/task.js | 4
Source/UBCS-WEB/src/views/integration/systemInfo.vue | 470 +++++++++++++++++++++++++++------------------------
4 files changed, 257 insertions(+), 229 deletions(-)
diff --git a/Source/UBCS-WEB/src/api/docking/data.js b/Source/UBCS-WEB/src/api/docking/data.js
index 94da0af..1093124 100644
--- a/Source/UBCS-WEB/src/api/docking/data.js
+++ b/Source/UBCS-WEB/src/api/docking/data.js
@@ -1,13 +1,13 @@
import request from '@/router/axios';
-export const getDataList = (page, size, params) => {
+export const getDataList = (page, limit, params) => {
return request({
url: '/api/ubcs-code/dockingManagement/gridDockingData',
method: 'get',
params: {
...params,
page,
- size
+ limit
}
})
}
diff --git a/Source/UBCS-WEB/src/api/docking/task.js b/Source/UBCS-WEB/src/api/docking/task.js
index fcb0acc..c2dc99a 100644
--- a/Source/UBCS-WEB/src/api/docking/task.js
+++ b/Source/UBCS-WEB/src/api/docking/task.js
@@ -1,13 +1,13 @@
import request from '@/router/axios';
-export const getTaskList = (page, size, params) => {
+export const getTaskList = (page, limit, params) => {
return request({
url: '/api/ubcs-code/dockingManagement/gridDockingTask',
method: 'get',
params: {
...params,
page,
- size
+ limit
}
})
}
diff --git a/Source/UBCS-WEB/src/api/integration/sysInfo.js b/Source/UBCS-WEB/src/api/integration/sysInfo.js
index 871ccdb..6292caa 100644
--- a/Source/UBCS-WEB/src/api/integration/sysInfo.js
+++ b/Source/UBCS-WEB/src/api/integration/sysInfo.js
@@ -1,11 +1,15 @@
import request from '@/router/axios';
// 闆嗘垚绯荤粺淇℃伅绠$悊鍒楄〃
-export const getSysInfoList = (params) => {
+export const getSysInfoList = (size,current,params) => {
return request({
url: '/api/ubcs-code/dockingManagement/gridDockingSystem',
method: 'get',
- params: params
+ params: {
+ size,
+ current,
+ ...params
+ }
})
}
// 闆嗘垚绯荤粺淇℃伅绠$悊鏂板
diff --git a/Source/UBCS-WEB/src/views/integration/systemInfo.vue b/Source/UBCS-WEB/src/views/integration/systemInfo.vue
index c1cf5ae..392d645 100644
--- a/Source/UBCS-WEB/src/views/integration/systemInfo.vue
+++ b/Source/UBCS-WEB/src/views/integration/systemInfo.vue
@@ -1,235 +1,259 @@
<template>
- <basic-container>
- <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page" :search.sync="search"
- @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" @row-update="handleEdit"
- @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-delete" size="small" type="danger" @click="handleDeleteByIds">鍒� 闄�
- </el-button>
- </template>
- <template slot="search" slot-scope="{row,size}">
- <el-select v-model="selectValue" size="small" @change="handleSelect">
- <el-option v-for="item in selectOption" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- <el-input :placeholder="`璇疯緭鍏�${selectValue === 'id' ? '绯荤粺缂栧彿' : '绯荤粺鍚嶇О'}骞舵寜鍥炶溅鏌ヨ`" :size="size"
- style="width:300px;margin-left: 10px;" v-model="search[selectValue]" clearable
- @keyup.enter.native="handleEnter" @clear="handleClear"></el-input>
- </template>
- </avue-crud>
- </basic-container>
+ <basic-container>
+ <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :search.sync="search" :table-loading="loading"
+ @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete" @row-update="handleEdit"
+ @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-delete" size="small" type="danger" @click="handleDeleteByIds">鍒� 闄�
+ </el-button>
+ </template>
+ <template slot="search" slot-scope="{row,size}">
+ <el-select v-model="selectValue" size="small" @change="handleSelect">
+ <el-option v-for="item in selectOption" :key="item.value" :label="item.label" :value="item.value">
+ </el-option>
+ </el-select>
+ <el-input v-model="search[selectValue]" :placeholder="`璇疯緭鍏�${selectValue === 'id' ? '绯荤粺缂栧彿' : '绯荤粺鍚嶇О'}骞舵寜鍥炶溅鏌ヨ`"
+ :size="size" clearable style="width:300px;margin-left: 10px;"
+ @clear="handleClear" @keyup.enter.native="handleEnter"></el-input>
+ </template>
+ </avue-crud>
+ </basic-container>
</template>
<script>
-import { getSysInfoList, sysInfoAdd, sysInfoEdit, sysInfoDel } from '@/api/integration/sysInfo.js'
-export default {
- data() {
- return {
- loading: false,
- page: {
- currentPage: 1,
- pageSize: 10,
- total: 0
- },
- selectOption: [{
- value: 'id',
- label: '绯荤粺缂栧彿'
- }, {
- value: 'name',
- label: '绯荤粺鍚嶇О'
- }],
- selectValue: 'id',
- search: {},
- delIds: [],
- data: [],
- option: {
- height: "auto",
- tip:false,
- border: true,
- align: 'center',
- menuAlign: 'center',
- index: true,
- searchMenuSpan: 8,
- searchBtn: false,
- emptyBtn: false,
- columnBtn: false,
- defaultSort: {
- prop: 'id,name',
- order: 'descending'
- },
- selection: true,
- column: [
- {
- label: '绯荤粺缂栧彿',
- prop: 'id',
- sortable: true,
- rules: [{
- required: true,
- message: '绯荤粺缂栧彿涓嶈兘涓虹┖',
- trigger: 'blur'
- }],
- // maxlength: 30, //瀛楁暟闄愬埗
- }, {
- label: '绯荤粺鍚嶇О',
- prop: 'name',
- sortable: true,
- rules: [{
- required: true,
- message: '绯荤粺鍚嶇О涓嶈兘涓虹┖',
- trigger: 'blur'
- }],
- // maxlength: 30, //瀛楁暟闄愬埗
- },
- {
- label: '绯荤粺鎻忚堪',
- prop: 'description',
- type: 'textarea'
- }
- ]
- },
- }
- },
- methods: {
- // 鑾峰彇鍒楄〃
- async getDataList() {
- this.loading = true
- 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)
- this.loading = false
- const data = response.data.data
- this.data = data.records
- this.page.total = data.total
- } else this.loading = false
- },
- // 鏂板
- async handleSave(row, done, loading) {
- 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()
- }
- },
- // 缂栬緫
- async handleEdit(row, index, done, loading) {
- 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()
- }
- },
- // 鍒犻櫎鍗曟潯
- handleDelete(row) {
- const { oid } = row
- this.deleteSysInfo({ oids: oid })
- },
- // 澶氭潯鏁版嵁鍒犻櫎
- handleDeleteByIds() {
- const { oids } = this.delIds
- if (this.$utilFunc.isEmpty(oids)) {
- this.$message({
- type: "error",
- message: "璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�!"
- })
- } else {
- this.deleteSysInfo(this.delIds)
- }
- },
- // 鍒犻櫎鎺ュ彛
- deleteSysInfo(param) {
- this.$confirm('鏄惁纭畾鍒犻櫎閫夋嫨鐨勯泦鎴愮郴缁�?', '鎻愮ず', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning'
- }).then(async () => {
- const response = await sysInfoDel(param)
- if (response.status === 200) {
- console.log(response)
- this.$message({
- type: 'success',
- message: '鍒犻櫎鎴愬姛!'
- });
- this.getDataList()
- }
- })
- },
- // 閫夋嫨妗嗗唴瀹归�夋嫨鍚�
- handleSelect(event) {
- this.selectValue = event
- if (this.selectValue === 'id') {
- this.search['name'] = ''
- delete this.search['name']
- } else {
- this.search['id'] = ''
- delete this.search['id']
- }
- },
- // enter鎼滅储
- handleEnter() {
- if (this.search[this.selectValue] === '') return
- else this.getDataList()
+import {getSysInfoList, sysInfoAdd, sysInfoEdit, sysInfoDel} from '@/api/integration/sysInfo.js'
+export default {
+ data() {
+ return {
+ loading: false,
+ page: {
+ currentPage: 1,
+ pageSize: 10,
+ total: 0
+ },
+ selectOption: [{
+ value: 'id',
+ label: '绯荤粺缂栧彿'
+ }, {
+ value: 'name',
+ label: '绯荤粺鍚嶇О'
+ }],
+ selectValue: 'id',
+ search: {},
+ delIds: [],
+ data: [],
+ option: {
+ height: "auto",
+ tip: false,
+ border: true,
+ align: 'center',
+ menuAlign: 'center',
+ index: true,
+ searchMenuSpan: 8,
+ searchBtn: false,
+ emptyBtn: false,
+ columnBtn: false,
+ defaultSort: {
+ prop: 'id,name',
+ order: 'descending'
},
- // 杈撳叆妗嗘竻绌�
- handleClear() {
- this.search = {}
- this.getDataList()
- },
- // 鍒锋柊鎸夐挳
- handleRefresh() {
- this.getDataList()
- },
- handleSizePage(event) {
- this.page.pageSize = event
- },
- handleCurrentPage(event) {
- this.page.currentPage = event
- },
- // 鐐瑰嚮閫夋嫨
- handleRowClick(row) {
- this.$refs.crud.toggleRowSelection(row, true)
- },
- // 澶氶��
- selectionChange(list) {
- console.log(list)
- let newData = list.map(item => {
- const { oid } = item
- return oid
- })
- this.delIds = { oids: newData.toString() }
- console.log(this.delIds)
- },
+ selection: true,
+ column: [
+ {
+ label: '绯荤粺缂栧彿',
+ prop: 'id',
+ sortable: true,
+ rules: [{
+ required: true,
+ message: '绯荤粺缂栧彿涓嶈兘涓虹┖',
+ trigger: 'blur'
+ }],
+ // maxlength: 30, //瀛楁暟闄愬埗
+ }, {
+ label: '绯荤粺鍚嶇О',
+ prop: 'name',
+ sortable: true,
+ rules: [{
+ required: true,
+ message: '绯荤粺鍚嶇О涓嶈兘涓虹┖',
+ trigger: 'blur'
+ }],
+ // maxlength: 30, //瀛楁暟闄愬埗
+ },
+ {
+ label: '绯荤粺鎻忚堪',
+ prop: 'description',
+ type: 'textarea'
+ }
+ ]
+ },
}
+ },
+ methods: {
+ // 鑾峰彇鍒楄〃
+ // async getDataList() {
+ // this.loading = true
+ // 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(pageSize,currentPage,{...param})
+ // if (response.status === 200) {
+ // console.log(response)
+ // this.loading = false
+ // const data = response.data.data
+ // this.data = data.records
+ // this.page.total = data.total
+ // } else this.loading = false
+ // },
+ async getDataList() {
+ this.loading = true;
+ console.log(this.search);
+ const { pageSize, currentPage } = this.page;
+ const conditions = {};
+ if (Object.keys(this.search).length > 0) {
+ for (const key in this.search) {
+ if (this.search[key]) {
+ conditions[`conditionMap[${key}_like]`] = this.search[key];
+ }
+ }
+ }
+ const response = await getSysInfoList(pageSize, currentPage, conditions);
+ if (response.status === 200) {
+ console.log(response);
+ this.loading = false;
+ const data = response.data.data;
+ this.data = data.records;
+ this.page.total = data.total;
+ } else {
+ this.loading = false;
+ }
+ },
+ // 鏂板
+ async handleSave(row, done, loading) {
+ 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()
+ }
+ },
+ // 缂栬緫
+ async handleEdit(row, index, done, loading) {
+ 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()
+ }
+ },
+ // 鍒犻櫎鍗曟潯
+ handleDelete(row) {
+ const {oid} = row
+ this.deleteSysInfo({oids: oid})
+ },
+ // 澶氭潯鏁版嵁鍒犻櫎
+ handleDeleteByIds() {
+ const {oids} = this.delIds
+ if (this.$utilFunc.isEmpty(oids)) {
+ this.$message({
+ type: "error",
+ message: "璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�!"
+ })
+ } else {
+ this.deleteSysInfo(this.delIds)
+ }
+ },
+ // 鍒犻櫎鎺ュ彛
+ deleteSysInfo(param) {
+ this.$confirm('鏄惁纭畾鍒犻櫎閫夋嫨鐨勯泦鎴愮郴缁�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(async () => {
+ const response = await sysInfoDel(param)
+ if (response.status === 200) {
+ console.log(response)
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ this.getDataList()
+ }
+ })
+ },
+ // 閫夋嫨妗嗗唴瀹归�夋嫨鍚�
+ handleSelect(event) {
+ this.selectValue = event
+ if (this.selectValue === 'id') {
+ this.search['name'] = ''
+ delete this.search['name']
+ } else {
+ this.search['id'] = ''
+ delete this.search['id']
+ }
+ },
+ // enter鎼滅储
+ handleEnter() {
+ if (this.search[this.selectValue] === '') return
+ else this.getDataList()
+
+ },
+ // 杈撳叆妗嗘竻绌�
+ handleClear() {
+ this.search = {}
+ this.getDataList()
+ },
+ // 鍒锋柊鎸夐挳
+ handleRefresh() {
+ this.getDataList()
+ },
+ handleSizePage(event) {
+ this.page.pageSize = event
+ },
+ handleCurrentPage(event) {
+ this.page.currentPage = event
+ },
+ // 鐐瑰嚮閫夋嫨
+ handleRowClick(row) {
+ this.$refs.crud.toggleRowSelection(row, true)
+ },
+ // 澶氶��
+ selectionChange(list) {
+ console.log(list)
+ let newData = list.map(item => {
+ const {oid} = item
+ return oid
+ })
+ this.delIds = {oids: newData.toString()}
+ console.log(this.delIds)
+ },
+ }
}
</script>
<style lang="scss" scoped>
::v-deep(.avue-crud .el-select) {
- width: 100px !important;
+ width: 100px !important;
}
</style>
--
Gitblit v1.9.3