From 3807d6c050026a9a5ee7b8d3da3cd09e3c31ce15 Mon Sep 17 00:00:00 2001
From: zhangxp <zhangxp@chicecm.com>
Date: 星期四, 08 六月 2023 18:01:01 +0800
Subject: [PATCH] 新增集成系统信息管理,差删除接口未调试

---
 Source/UBCS-WEB/src/api/integration/sysInfo.js            |   34 +++++
 Source/UBCS-WEB/src/views/integration/applicationForm.vue |   42 +++++-
 Source/UBCS-WEB/src/views/integration/systemInfo.vue      |  224 +++++++++++++++++++++++++++++++++++++
 Source/UBCS-WEB/src/api/integration/application.js        |   10 +
 Source/UBCS-WEB/vue.config.js                             |    7 -
 5 files changed, 301 insertions(+), 16 deletions(-)

diff --git a/Source/UBCS-WEB/src/api/integration/application.js b/Source/UBCS-WEB/src/api/integration/application.js
index d95b8a2..796aab9 100644
--- a/Source/UBCS-WEB/src/api/integration/application.js
+++ b/Source/UBCS-WEB/src/api/integration/application.js
@@ -7,4 +7,12 @@
       method: 'get',
       params: params
     })
-  }
\ No newline at end of file
+  }
+  // 鐢抽鍗曠姸鎬�
+export const queryApplyStat = (params) => {
+  return request({
+    url: '/api/ubcs-applyjtcodeservice/DockingPreApplyCode/queryApplyState',
+    method: 'get',
+    params: params
+  })
+}
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/api/integration/sysInfo.js b/Source/UBCS-WEB/src/api/integration/sysInfo.js
new file mode 100644
index 0000000..83449bc
--- /dev/null
+++ b/Source/UBCS-WEB/src/api/integration/sysInfo.js
@@ -0,0 +1,34 @@
+import request from '@/router/axios';
+
+// 闆嗘垚绯荤粺淇℃伅绠$悊鍒楄〃
+export const getSysInfoList = (params) => {
+    return request({
+      url: '/api/ubcs-code/dockingManagement/gridSysIntBase',
+      method: 'get',
+      params: params
+    })
+  }
+  // 闆嗘垚绯荤粺淇℃伅绠$悊鏂板
+export const sysInfoAdd = (params) => {
+  return request({
+    url: '/api/ubcs-code/dockingManagement/addSave',
+    method: 'post',
+    data: params
+  })
+}
+ // 闆嗘垚绯荤粺淇℃伅绠$悊鏂板
+ export const sysInfoEdit = (params) => {
+    return request({
+      url: '/api/ubcs-code/dockingManagement/editSave',
+      method: 'put',
+      data: params
+    })
+  }
+   // 闆嗘垚绯荤粺淇℃伅绠$悊鏂板
+export const sysInfoDel = (params) => {
+    return request({
+      url: '/api/ubcs-code/dockingManagement/deleteDataById',
+      method: 'delete',
+      params: params
+    })
+  }
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/views/integration/applicationForm.vue b/Source/UBCS-WEB/src/views/integration/applicationForm.vue
index 7a3c48b..db577fa 100644
--- a/Source/UBCS-WEB/src/views/integration/applicationForm.vue
+++ b/Source/UBCS-WEB/src/views/integration/applicationForm.vue
@@ -2,7 +2,8 @@
     <basic-container>
         <avue-crud :table-loading="loading" :data="data" :option="option" :search.sync="searchParam" :page.sync="page"
             ref="crud" @refresh-change="getDataList" @search-change="handleSearch" @search-reset="handleReset"
-            @size-change="handleSizePage" @current-change="handleCurrentPage" @on-load="getDataList">
+            @size-change="handleSizePage" @current-change="handleCurrentPage" @on-load="getDataList"
+            @selection-change="selectionChange" @row-click="handleRowClick">
             <template slot="menuLeft">
                 <el-button icon="el-icon-document" size="small" type="primary" @click="handleStatus">闆嗗洟鐢宠鐘舵��
                 </el-button>
@@ -12,7 +13,7 @@
 </template>
 
 <script>
-import { getList } from '@/api/integration/application.js'
+import { getList, queryApplyStat } from '@/api/integration/application.js'
 import { dateFormat } from '@/util/date.js'
 export default {
     data() {
@@ -25,6 +26,7 @@
                 total: 0
             },
             searchParam: {},
+            stateParam: {},
             option: {
                 height: "auto",
                 index: true,
@@ -33,7 +35,8 @@
                 columnBtn: false,
                 searchMenuSpan: 8,
                 highlightCurrentRow: true,
-                menu:false,
+                menu: false,
+                selection: true,
                 column: [
                     {
                         label: '鐢宠鍗曞彿',
@@ -77,9 +80,6 @@
                         prop: 'lastModifyTime',
                         type: 'datetime',
                         search: true,
-                        formatter: () => {
-
-                        }
                     }, {
                         label: '杩斿洖鏍囪瘑',
                         width: 100,
@@ -100,8 +100,20 @@
         }
     },
     methods: {
-        handleStatus() {
-
+        async handleStatus() {
+            const { oids } = this.stateParam
+            if (this.$utilFunc.isEmpty(oids)) {
+                this.$message({
+                    type: "error",
+                    message: "璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�!"
+                })
+            } else {
+                console.log(this.stateParam)
+                const response = await queryApplyStat(this.stateParam)
+                if (response.status === 200) {
+                    console.log(response)
+                }
+            }
         },
         async getDataList() {
             this.loading = true
@@ -140,7 +152,19 @@
             this.page.currentPage = 1
             this.getDataList()
             done()
-        }
+        },
+        selectionChange(list) {
+            console.log(list)
+            let newData = list.map(item => {
+                const { dataOid } = item
+                return dataOid
+            })
+            this.stateParam = { oids: newData.toString() }
+            console.log(newData)
+        },
+        handleRowClick(row) {
+            this.$refs.crud.toggleRowSelection(row, true)
+        },
     }
 }
 </script>
\ No newline at end of file
diff --git a/Source/UBCS-WEB/src/views/integration/systemInfo.vue b/Source/UBCS-WEB/src/views/integration/systemInfo.vue
new file mode 100644
index 0000000..f1f2b78
--- /dev/null
+++ b/Source/UBCS-WEB/src/views/integration/systemInfo.vue
@@ -0,0 +1,224 @@
+<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>
+</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",
+                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'
+                        }]
+                    }, {
+                        label: '绯荤粺鍚嶇О',
+                        prop: 'name',
+                        sortable: true,
+                        rules: [{
+                            required: true,
+                            message: '绯荤粺鍚嶇О涓嶈兘涓虹┖',
+                            trigger: 'blur'
+                        }]
+                    },
+                    {
+                        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 }
+            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) {
+            const response = await sysInfoAdd(row)
+            if (response.status === 200) {
+                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) {
+                loading()
+                this.$message({
+                    type: 'success',
+                    message: '淇敼鏁版嵁鎴愬姛锛�'
+                })
+                done()
+                this.getDataList()
+            }
+        },
+        // 鍒犻櫎鍗曟潯
+        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;
+}
+</style>
\ No newline at end of file
diff --git a/Source/UBCS-WEB/vue.config.js b/Source/UBCS-WEB/vue.config.js
index 98c3012..18858ab 100644
--- a/Source/UBCS-WEB/vue.config.js
+++ b/Source/UBCS-WEB/vue.config.js
@@ -26,16 +26,11 @@
     proxy: {
       '/api': {
         //鏈湴鏈嶅姟鎺ュ彛鍦板潃
-         target: 'http://localhost:37000',
         //  target: 'http://localhost:37000',
         //target: 'http://192.168.1.51:37000',
-        //target: 'http://192.168.3.7:37000',
-        // target: 'http://dev.vci-tech.com:37000',
-        // target: 'http://192.168.1.51:37000/',
-        //   target: 'http://localhost:37000',
         // target: 'http://192.168.1.63:37000',
         //target: 'http://192.168.3.7:37000',
-        // target: 'http://dev.vci-tech.com:37000',
+        target: 'http://dev.vci-tech.com:37000',
         //target: 'http://192.168.1.51:37000/',
         //杩滅▼婕旂ず鏈嶅姟鍦板潃,鍙敤浜庣洿鎺ュ惎鍔ㄩ」鐩�
         // target: 'https://saber.bladex.vip/api',

--
Gitblit v1.9.3