From d38a5c6d9260252cc875d365d34fecb8480d5528 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 10 四月 2024 21:15:14 +0800
Subject: [PATCH] 看板接口页面

---
 src/views/console/system/interfaceConfig.vue |  203 +++++++++++++++++++++++++++++++++++++++++++++++++-
 src/api/model/setting.js                     |   10 ++
 副本智能制造系统功能定义.xls                             |    0 
 3 files changed, 204 insertions(+), 9 deletions(-)

diff --git a/src/api/model/setting.js b/src/api/model/setting.js
index 9d78f36..ca850fb 100644
--- a/src/api/model/setting.js
+++ b/src/api/model/setting.js
@@ -1,7 +1,7 @@
 /*
  * @Date: 2024-04-07 21:49:32
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-10 19:45:58
+ * @LastEditTime: 2024-04-10 21:04:50
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/api/model/setting.js
  */
 import config from "@/config"
@@ -36,5 +36,11 @@
 			return await http.delete(this.url,data,conf);
 		}
     },
-    
+    getConList: {
+        url: `${config.API_URL}/blade-system/interface-config/page`,
+		name: "鐪嬫澘鎺ュ彛鍒楄〃",
+		get: async function(data){
+			return await http.get(this.url,data,{params: data});
+		}
+    },
 }
\ No newline at end of file
diff --git a/src/views/console/system/interfaceConfig.vue b/src/views/console/system/interfaceConfig.vue
index ae4e30c..e74c70b 100644
--- a/src/views/console/system/interfaceConfig.vue
+++ b/src/views/console/system/interfaceConfig.vue
@@ -1,21 +1,210 @@
 <!--
  * @Date: 2024-04-09 22:18:47
  * @LastEditors: Sneed
- * @LastEditTime: 2024-04-09 22:20:03
+ * @LastEditTime: 2024-04-10 21:11:42
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/console/system/interfaceConfig.vue
+ * 鐪嬫澘鎺ュ彛
 -->
 <template>
-    <div>
-        鐪嬫澘鎺ュ彛
-    </div>
+    <el-container>
+        <el-header style="justify-content: flex-start;">
+            <el-button type="primary" plain @click="add">鏂板</el-button>
+            <el-button @click="del" plain type="danger" :disabled="selection.length == 0">鍒犻櫎</el-button>
+        </el-header>
+        <el-main>
+            <scTable ref="table" @selection-change="handleSelectionChange" row-key="id" border :params="params" :apiObj="apiObj" stripe>
+                <el-table-column type="selection" width="55" />
+                <el-table-column prop="url" label="鎺ュ彛鍦板潃" />
+                <el-table-column prop="urlName" label="鎺ュ彛涓枃鍚�" />
+                <el-table-column prop="urlType" label="鎺ュ彛绫诲瀷">
+                    <template #default="scope">
+                        <span>{{ ['POST',"PUT","GET"][scope.row.urlType] }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="owningChart" label="鍥捐〃绫诲瀷">
+                    <template #default="scope">
+                        <span>{{ ['鏌辩姸鎶樼嚎鍥�',"楗煎浘","鐢樼壒鍥�","琛ㄦ牸","浠〃鐩�"][scope.row.owningChart -1] }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="鎿嶄綔" fixed="right" align="left" width="160">
+                    <template #default="scope">
+                        <el-button-group>
+                            <el-button text type="primary" size="small"
+                                @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
+                            <el-popconfirm title="纭畾鍒犻櫎鍚楋紵" @confirm="table_del(scope.row, scope.$index, '0')">
+                                <template #reference>
+                                    <el-button text type="primary" size="small">鍒犻櫎</el-button>
+                                </template>
+                            </el-popconfirm>
+                        </el-button-group>
+                    </template>
+                </el-table-column>
+            </scTable>
+        </el-main>
+        <el-dialog v-model="dialogVisible" :title="dialogTitle" width="750" :before-close="handleClose">
+            <el-form :model="row" :rules="rules" ref="dialogForm" label-width="120px" label-position="center">
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="鍒嗙被鍚嶇О" prop="name">
+                            <el-input style="width: 240px" v-model="row.name" placeholder="璇疯緭鍏ュ垎绫诲悕绉�"
+                                clearable></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="涓婄骇鍒嗙被" prop="parentId">
+                            <el-select v-model="row.parentId" filterable placeholder="璇烽�夋嫨涓婄骇鍒嗙被" style="width: 240px">
+                                <el-option v-for="item in options" :key="item.value" :label="item.label"
+                                    :value="item.value" />
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="鍒嗙被鍥炬爣" prop="icon">
+                            <el-input @click="showIconDialog = true" style="width: 240px" v-model="row.icon"
+                                placeholder="璇烽�夋嫨鍒嗙被鍥炬爣" clearable></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="鍒嗙被缂栧彿" prop="type">
+                            <el-input style="width: 240px" v-model="row.type" placeholder="璇疯緭鍏ュ垎绫荤紪鍙�"
+                                clearable></el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="鎺掑垪椤哄簭" prop="orderNum">
+                            <el-input-number style="width: 240px" default v-model="row.orderNum" :min="0"
+                                placeholder="璇疯緭鍏ユ帓鍒楅『搴�" />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="鐘舵��" prop="status">
+                            <el-radio-group style="width: 240px" v-model="row.status">
+                                <el-radio v-for="item in statusList" :label="item.value" :key="item.value">{{ item.label
+                                    }}</el-radio>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+            <template #footer>
+                <div class="dialog-footer">
+                    <el-button @click="dialogVisible = false">鍙栨秷</el-button>
+                    <el-button type="primary" @click="save">
+                        淇濆瓨
+                    </el-button>
+                </div>
+            </template>
+        </el-dialog>
+        <el-dialog v-model="showIconDialog" title="鍒嗙被鍥炬爣" width="750">
+            <div class="icons">
+                <component @click="setIcon(item)" class="icon" v-for="item in icons" :is='item' :key="item"></component>
+            </div>
+
+        </el-dialog>
+    </el-container>
 </template>
 
 <script>
-    export default {
-        
-    }
+export default {
+    data() {
+        return {
+            apiObj: this.$API.setting.getConList,
+            selection: [],
+            dialogVisible: false,
+            row: {
+                id: '',
+                name: '',
+                parentId: '',
+                icon: '',
+                type: '',
+                orderNum: 0,
+                status: 1,
+            },
+            rules: {
+                name: [
+                    { required: true, message: '璇疯緭鍏ュ垎绫诲悕绉�' }
+                ],
+                type: [
+                    { required: true, message: '璇疯緭鍏ュ垎绫荤紪鍙�' }
+                ]
+            },
+        }
+    },
+    created() {
+        this.queryList()
+    },
+    methods: {
+        add() {
+            this?.$refs?.dialogForm?.resetFields()
+            Object.keys(this.row).forEach(v => {
+                this.row[v] = ''
+            })
+            this.row.orderNum = 0
+            this.dialogTitle = '鏂板'
+            this.dialogVisible = true
+        },
+        save() {
+            this.$refs.dialogForm.validate(async (valid) => {
+                if (valid) {
+                    let request = this.$API.setting.insert
+                    if (this?.row?.id) {
+                        request = this.$API.setting.update
+                    }
+                    request.post(this.row).then(res => {
+                        this.dialogVisible = false
+                        this.queryList()
+                    })
+                }
+            })
+        },
+        del() {
+            this.$API.setting.del.delete({}, { data: this.selection.map(v => v.id) }).then(res => {
+                this.queryList()
+            })
+        },
+        queryList() {
+            this.$API.setting.getList.get().then(res => {
+                this.tableData = res.data;
+                this.options = res.data.map(item => ({
+                    value: item.id,
+                    label: item.name
+                }))
+            })
+        },
+        table_edit(row) {
+            this.row = { ...row }
+            console.log(this.row)
+            this.dialogTitle = '鏂板'
+            this.dialogVisible = true
+        },
+        table_del(row) {
+            this.$API.setting.del.delete({}, { data: [row.id] }).then(res => {
+                this.queryList()
+            })
+        },
+        handleSelectionChange(selection) {
+            console.log('>>>>>>')
+            this.selection = selection;
+        },
+        setIcon(icon) {
+            console.log('>>>>>>', icon)
+            this.row.icon = icon
+            this.showIconDialog = false
+        }
+    },
+}
 </script>
 
 <style lang="scss" scoped>
+.icons {
+    display: flex;
+    flex-wrap: wrap;
+}
 
+.icon {
+    margin: 10px;
+    width: 20px;
+    height: 20px;
+    cursor: pointer;
+}
 </style>
\ No newline at end of file
diff --git "a/\345\211\257\346\234\254\346\231\272\350\203\275\345\210\266\351\200\240\347\263\273\347\273\237\345\212\237\350\203\275\345\256\232\344\271\211.xls" "b/\345\211\257\346\234\254\346\231\272\350\203\275\345\210\266\351\200\240\347\263\273\347\273\237\345\212\237\350\203\275\345\256\232\344\271\211.xls"
index 939ab16..c7b8382 100644
--- "a/\345\211\257\346\234\254\346\231\272\350\203\275\345\210\266\351\200\240\347\263\273\347\273\237\345\212\237\350\203\275\345\256\232\344\271\211.xls"
+++ "b/\345\211\257\346\234\254\346\231\272\350\203\275\345\210\266\351\200\240\347\263\273\347\273\237\345\212\237\350\203\275\345\256\232\344\271\211.xls"
Binary files differ

--
Gitblit v1.9.3