From fee38f39e36bcda9924f5b26dca609dda6b331e0 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期日, 22 六月 2025 16:53:27 +0800
Subject: [PATCH] no message
---
zy-asrs-openapi/src/main/webapp/views/reportApiManage.html | 503 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 358 insertions(+), 145 deletions(-)
diff --git a/zy-asrs-openapi/src/main/webapp/views/reportApiManage.html b/zy-asrs-openapi/src/main/webapp/views/reportApiManage.html
index b92c9a4..eaf4957 100644
--- a/zy-asrs-openapi/src/main/webapp/views/reportApiManage.html
+++ b/zy-asrs-openapi/src/main/webapp/views/reportApiManage.html
@@ -1,146 +1,359 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <title>API寮�鏀惧钩鍙� - 涓婃姤鎺ュ彛绠$悊</title>
- <link rel="stylesheet" href="../static/css/element.css">
- <link rel="stylesheet" href="../static/css/common.css">
- <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
- <script type="text/javascript" src="../static/js/vue.min.js"></script>
- <script type="text/javascript" src="../static/js/showdown.min.js"></script>
- <script type="text/javascript" src="../static/js/common.js"></script>
- <script type="text/javascript" src="../static/js/element.js"></script>
-</head>
-<body>
- <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
- <div style="width: 80%;">
- <el-card class="box-card">
- <el-form :inline="true" :model="tableSearchParam" class="demo-form-inline">
- <el-form-item label="">
- <el-input v-model="tableSearchParam.task_no" placeholder="浠诲姟鍙�"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="getTableData">鏌ヨ</el-button>
- <el-button type="primary" @click="resetParam">閲嶇疆</el-button>
- </el-form-item>
- </el-form>
- <el-table ref="singleTable" :data="tableData" style="width: 100%;">
- <el-table-column property="id" label="#ID">
- </el-table-column>
- <el-table-column property="wrkNo" label="宸ヤ綔鍙�">
- </el-table-column>
- <el-table-column property="taskNo" label="浠诲姟鍙�">
- </el-table-column>
- <el-table-column property="commandStatus$" label="鎸囦护鐘舵��">
- </el-table-column>
- <el-table-column show-overflow-tooltip property="durationTime" label="鎸佺画鏃堕暱">
- </el-table-column>
- <el-table-column property="commandType" label="鎸囦护绫诲瀷">
- </el-table-column>
- <el-table-column property="device" label="璁惧">
- </el-table-column>
- <el-table-column property="deviceLog" label="璁惧鎵ц淇℃伅">
- </el-table-column>
- <el-table-column property="commandDesc" label="鍛戒护鎻忚堪">
- </el-table-column>
- <el-table-column show-overflow-tooltip property="startTime$" label="寮�濮嬫椂闂�">
- </el-table-column>
- <el-table-column show-overflow-tooltip property="executeTime$" label="鎵ц鏃堕棿">
- </el-table-column>
- <el-table-column show-overflow-tooltip property="completeTime$" label="瀹屾垚鏃堕棿">
- </el-table-column>
- <el-table-column show-overflow-tooltip property="command" label="鍛戒护鎶ユ枃" width="250">
- </el-table-column>
- </el-table>
-
- <div style="margin-top: 10px;">
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
- </el-pagination>
- </div>
- </el-card>
- </div>
-
- <div style="position: fixed;top: 20px;right: 20px;width: 150px;border-left: 3px solid #f0f0f0;padding-left: 15px;">
- <div><el-button type="text" @click="switchPage('index.html')">瑙勮寖璇存槑</el-button></div>
- <div><el-button type="text" @click="switchPage('reportCompleted.html')">浠诲姟瀹屾垚涓婃姤</el-button></div>
- <div><el-button type="text" @click="switchPage('reportCompleted.html')">浠诲姟鍙栨秷涓婃姤</el-button></div>
- <div><el-button type="text" @click="switchPage('reportCompleted.html')">搴撳瓨涓婃姤</el-button></div>
- <div><el-button type="text" @click="switchPage('reportApiManage.html')">涓婃姤API绠$悊</el-button></div>
- </div>
- </div>
-
- <script>
- var app = new Vue({
- el: '#app',
- data: {
- tableData: [],
- currentPage: 1,
- pageSizes: [16, 30, 50, 100, 150, 200],
- pageSize: 16,
- pageTotal: 0,
- tableSearchParam: {
- task_no: null,
- },
- },
- created() {
- this.init()
- },
- methods: {
- init() {
- this.getTableData()
- },
- getTableData() {
- let that = this;
- let data = this.tableSearchParam
- data.curr = this.currentPage
- data.limit = this.pageSize
- $.ajax({
- url: baseUrl + "/commandInfoLog/list/auth",
- headers: {
- 'token': localStorage.getItem('token')
- },
- data: data,
- dataType: 'json',
- contentType: 'application/json;charset=UTF-8',
- method: 'GET',
- success: function(res) {
- if (res.code == 200) {
- that.tableData = res.data.records
- that.pageTotal = res.data.total
- } else {
- that.$message({
- message: res.msg,
- type: 'error'
- });
- }
- }
- });
- },
- handleSizeChange(val) {
- console.log(`姣忛〉 ${val} 鏉);
- this.pageSize = val
- this.getTableData()
- },
- handleCurrentChange(val) {
- console.log(`褰撳墠椤�: ${val}`);
- this.currentPage = val
- this.getTableData()
- },
- resetParam() {
- this.tableSearchParam = {
- task_no: null,
- status: null,
- wrk_no: null
- }
- this.getTableData()
- },
- switchPage(url) {
- location.href = url
- }
- }
- })
- </script>
-</body>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>API寮�鏀惧钩鍙� - 涓婃姤鎺ュ彛绠$悊</title>
+ <link rel="stylesheet" href="../static/css/element.css">
+ <link rel="stylesheet" href="../static/css/common.css">
+ <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script>
+ <script type="text/javascript" src="../static/js/vue.min.js"></script>
+ <script type="text/javascript" src="../static/js/showdown.min.js"></script>
+ <script type="text/javascript" src="../static/js/common.js"></script>
+ <script type="text/javascript" src="../static/js/element.js"></script>
+</head>
+<body>
+ <div id="app" style="display: flex;justify-content: center;flex-wrap: wrap;">
+ <div style="width: 80%;">
+ <el-card class="box-card">
+ <el-form :inline="true" :model="tableSearchParam" class="demo-form-inline">
+ <el-form-item label="">
+ <el-input v-model="tableSearchParam.url" placeholder="URL"></el-input>
+ </el-form-item>
+ <el-form-item label="">
+ <el-select v-model="tableSearchParam.type" placeholder="璇烽�夋嫨涓婃姤绫诲瀷">
+ <el-option label="璁㈠崟瀹屾垚" value="order_complete"></el-option>
+ <el-option label="璁㈠崟鍙栨秷" value="order_cancel"></el-option>
+ <el-option label="搴撳瓨涓婃姤" value="report_stock"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-select v-model="tableSearchParam.status" placeholder="璇烽�夋嫨鏄惁寮�鍚�">
+ <el-option label="寮�鍚�" value="1"></el-option>
+ <el-option label="鍏抽棴" value="0"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="">
+ <el-select v-model="tableSearchParam.hostId" placeholder="璇烽�夋嫨閫夋嫨浠撳簱">
+ <el-option v-for="item in hostList" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="getTableData">鏌ヨ</el-button>
+ <el-button type="primary" @click="resetParam">閲嶇疆</el-button>
+ <el-button type="success" @click="showAddApi()">娣诲姞鎺ュ彛</el-button>
+ </el-form-item>
+ </el-form>
+ <el-table ref="singleTable" :data="tableData" style="width: 100%;">
+ <el-table-column property="url" label="URL">
+ </el-table-column>
+ <el-table-column property="type$" label="涓婃姤绫诲瀷">
+ </el-table-column>
+ <el-table-column property="status$" label="鏄惁寮�鍚�">
+ </el-table-column>
+ <el-table-column property="hostId$" label="浠撳簱">
+ </el-table-column>
+ <el-table-column
+ fixed="right"
+ label="鎿嶄綔"
+ width="100">
+ <template slot-scope="scope">
+ <el-button @click="showAddApi(scope.row)" type="text" size="small">缂栬緫</el-button>
+ <el-button @click="deleteApi(scope.row)" type="text" size="small">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+
+ <div style="margin-top: 10px;">
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+ :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize"
+ layout="total, sizes, prev, pager, next, jumper" :total="pageTotal">
+ </el-pagination>
+ </div>
+ </el-card>
+ </div>
+
+ <div class="slider">
+ <div><el-button type="text" @click="switchPage('index.html')">绠�浠�</el-button></div>
+ <div><el-button type="text" @click="switchPage('default.html')">瑙勮寖璇存槑</el-button></div>
+ <el-divider></el-divider>
+ <div><el-button type="text" @click="switchPage('reportCompleted.html')">璁㈠崟瀹屾垚涓婃姤</el-button></div>
+ <div><el-button type="text" @click="switchPage('reportCancel.html')">璁㈠崟鍙栨秷涓婃姤</el-button></div>
+ <div><el-button type="text" @click="switchPage('reportStock.html')">搴撳瓨涓婃姤</el-button></div>
+ <div><el-button type="text" @click="switchPage('reportApiManage.html')">涓婃姤API绠$悊</el-button></div>
+ <el-divider></el-divider>
+ <div><el-button type="text" @click="switchPage('getOrderType.html')">鑾峰彇璁㈠崟绫诲瀷</el-button></div>
+ <div><el-button type="text" @click="switchPage('getOrderStatus.html')">鑾峰彇璁㈠崟鐘舵�佸垪琛�</el-button></div>
+ <div><el-button type="text" @click="switchPage('getOrderList.html')">鑾峰彇璁㈠崟鍒楄〃</el-button></div>
+ <div><el-button type="text" @click="switchPage('generateOrderPakIn.html')">鐢熸垚鍏ュ簱璁㈠崟</el-button></div>
+ <div><el-button type="text" @click="switchPage('generateOrderPakOut.html')">鐢熸垚鍑哄簱璁㈠崟</el-button></div>
+ <div><el-button type="text" @click="switchPage('createMat.html')">娣诲姞鐗╂枡淇℃伅</el-button></div>
+<!-- <el-divider></el-divider>-->
+<!-- <div><el-button type="text" @click="keyList()">瀵嗛挜绠$悊</el-button></div>-->
+ </div>
+
+ <el-dialog title="鎺ュ彛绠$悊" :visible.sync="formVisible">
+ <el-form ref="form" :model="formData" label-width="80px">
+ <el-form-item label="URL">
+ <el-input v-model="formData.url" placeholder="璇疯緭鍏ヤ笂鎶RL"></el-input>
+ </el-form-item>
+ <el-form-item label="涓婃姤绫诲瀷">
+ <el-select v-model="formData.type" placeholder="璇烽�夋嫨涓婃姤绫诲瀷">
+ <el-option label="璁㈠崟瀹屾垚" value="order_complete"></el-option>
+ <el-option label="璁㈠崟鍙栨秷" value="order_cancel"></el-option>
+ <el-option label="搴撳瓨涓婃姤" value="report_stock"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="鏄惁寮�鍚�">
+ <el-select v-model="formData.status" placeholder="璇烽�夋嫨鏄惁寮�鍚�">
+ <el-option label="寮�鍚�" value="1"></el-option>
+ <el-option label="鍏抽棴" value="0"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="閫夋嫨浠撳簱">
+ <el-select v-model="formData.hostId" placeholder="璇烽�夋嫨閫夋嫨浠撳簱">
+ <el-option v-for="item in hostList" :label="item.name" :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button v-if="formData.id == null" type="success" @click="addApi()">娣诲姞</el-button>
+ <el-button v-else type="primary" @click="updateApi()">鏇存柊</el-button>
+ </el-form-item>
+ </el-form>
+ </el-dialog>
+ </div>
+
+ <script>
+ var app = new Vue({
+ el: '#app',
+ data: {
+ tableData: [],
+ currentPage: 1,
+ pageSizes: [16, 30, 50, 100, 150, 200],
+ pageSize: 16,
+ pageTotal: 0,
+ tableSearchParam: {
+ url: "",
+ type: "",
+ status: "",
+ hostId: ""
+ },
+ tableData: [],
+ formVisible: false,
+ formData: {
+ id: null,
+ url: "",
+ type: "",
+ status: "",
+ hostId: ""
+ },
+ hostList: []
+ },
+ created() {
+ this.init()
+ },
+ methods: {
+ init() {
+ this.getTableData()
+ this.getHostList()
+ },
+ getTableData() {
+ let that = this;
+ let data = this.tableSearchParam
+ data.curr = this.currentPage
+ data.limit = this.pageSize
+ $.ajax({
+ url: baseUrl + "/apiList/page/auth",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ data: data,
+ dataType: 'json',
+ contentType: 'application/json;charset=UTF-8',
+ method: 'GET',
+ success: function(res) {
+ if (res.code == 200) {
+ that.tableData = res.data.records
+ that.pageTotal = res.data.total
+ } else {
+ that.$message({
+ message: res.msg,
+ type: 'error'
+ });
+ }
+ }
+ });
+ },
+ handleSizeChange(val) {
+ console.log(`姣忛〉 ${val} 鏉);
+ this.pageSize = val
+ this.getTableData()
+ },
+ handleCurrentChange(val) {
+ console.log(`褰撳墠椤�: ${val}`);
+ this.currentPage = val
+ this.getTableData()
+ },
+ resetParam() {
+ this.tableSearchParam = {
+ task_no: null,
+ status: null,
+ wrk_no: null
+ }
+ this.getTableData()
+ },
+ switchPage(url) {
+ location.href = url
+ },
+ showAddApi(data) {
+ this.formVisible = true;
+ if (data != null) {
+ this.formData = {
+ id: data.id,
+ url: data.url,
+ type: data.type,
+ status: "" + data.status,
+ hostId: data.hostId
+ }
+ }else {
+ this.formData = {
+ id: null,
+ url: "",
+ type: "",
+ status: "",
+ hostId: ""
+ }
+ }
+ },
+ addApi() {
+ let that = this;
+ if(this.formData.url == '' || this.formData.type == '' || this.formData.status == '' || this.formData.hostId == ''){
+ this.$message({
+ message: '鍙傛暟涓嶈兘涓虹┖',
+ type: 'error'
+ });
+ return;
+ }
+ $.ajax({
+ url: baseUrl + "/apiList/add/auth",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ data: this.formData,
+ dataType: 'json',
+ contentType: 'application/json;charset=UTF-8',
+ method: 'GET',
+ success: function(res) {
+ if (res.code == 200) {
+ that.formVisible = false;
+ that.formData = {
+ id: null,
+ url: "",
+ type: "",
+ status: "",
+ hostId: ""
+ }
+ that.getTableData()
+ that.$message({
+ message: '娣诲姞鎴愬姛',
+ type: 'success'
+ });
+ }else {
+ that.$message({
+ message: res.msg,
+ type: 'error'
+ });
+ }
+ }
+ });
+ },
+ updateApi() {
+ let that = this;
+ if(this.formData.id == null || this.formData.url == '' || this.formData.type == '' || this.formData.status == '' || this.formData.hostId == ''){
+ this.$message({
+ message: '鍙傛暟涓嶈兘涓虹┖',
+ type: 'error'
+ });
+ return;
+ }
+ $.ajax({
+ url: baseUrl + "/apiList/update/auth",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ data: this.formData,
+ dataType: 'json',
+ contentType: 'application/json;charset=UTF-8',
+ method: 'GET',
+ success: function(res) {
+ if (res.code == 200) {
+ that.formVisible = false;
+ that.formData = {
+ id: null,
+ url: "",
+ type: "",
+ status: "",
+ hostId: ""
+ }
+ that.getTableData()
+ that.$message({
+ message: '鏇存柊鎴愬姛',
+ type: 'success'
+ });
+ }else {
+ that.$message({
+ message: res.msg,
+ type: 'error'
+ });
+ }
+ }
+ });
+ },
+ deleteApi(data) {
+ let that = this;
+ $.ajax({
+ url: baseUrl + "/apiList/delete/auth",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ data: {
+ ids: [data.id]
+ },
+ dataType: 'json',
+ contentType: 'application/json;charset=UTF-8',
+ method: 'GET',
+ success: function(res) {
+ if (res.code == 200) {
+ that.getTableData()
+ that.$message({
+ message: '鍒犻櫎鎴愬姛',
+ type: 'success'
+ });
+ }else {
+ that.$message({
+ message: res.msg,
+ type: 'error'
+ });
+ }
+ }
+ });
+ },
+ getHostList() {
+ let that = this;
+ $.ajax({
+ url: baseUrl + "/host/list",
+ headers: {
+ 'token': localStorage.getItem('token')
+ },
+ dataType: 'json',
+ contentType: 'application/json;charset=UTF-8',
+ method: 'GET',
+ success: function(res) {
+ that.hostList = res.data
+ }
+ });
+ }
+ }
+ })
+ </script>
+</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1