From 893fc457a2daeb0aa33a5a9d0b32eef7db238c1f Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 23 十月 2023 21:58:07 +0800
Subject: [PATCH] bug修改
---
src/views/systemSetting/device/bayonet/index.vue | 602 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 340 insertions(+), 262 deletions(-)
diff --git a/src/views/systemSetting/device/bayonet/index.vue b/src/views/systemSetting/device/bayonet/index.vue
index a493486..0b7b9ba 100644
--- a/src/views/systemSetting/device/bayonet/index.vue
+++ b/src/views/systemSetting/device/bayonet/index.vue
@@ -1,290 +1,368 @@
<template>
- <div class="userList">
- <header>
- <div class="header-content">
- <div class="search">
- <span style="padding-right:20px">绛涢�夋潯浠�:</span>
- <el-select v-model="context" placeholder="璇烽�夋嫨" @change="getBayonetListData">
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- </div>
- </div>
- </header>
- <main>
- <div class="main-content">
- <div class="main-title">
- <el-button class="el-icon-plus" type="primary" @click="showDialog(false, null)">娣诲姞</el-button>
- <el-button @click="handleExport">瀵煎嚭鍗″彛</el-button>
- </div>
- <!-- 鏁版嵁灞曠ず -->
- <MyTable
- :tableOption="tableOption"
- :tableData="list"
- :pageShow="false">
- <template #operation="info">
- <el-link :underline="false" style="color:#4b9bb7" @click="showDialog(true, info)">缂栬緫</el-link>
- </template>
- </MyTable>
- </div>
- </main>
- <footer>
- <!-- 娣诲姞鍗″彛 -->
- <el-dialog :destroy-on-close="true" :title="getDialogTitle" :visible.sync="isShowDialog" width="60%" :before-close="handleClose">
- <MyCreate v-if="isShowDialog" @closeDialog="closeDialog" :originalBayonet="originalBayonet" :isEdit="isEdit"></MyCreate>
- </el-dialog>
- </footer>
- </div>
+ <div class="userList">
+ <header>
+ <div class="header-content">
+ <div class="search">
+ <span style="padding-right: 20px">绛涢�夋潯浠�:</span>
+ <el-input v-model="context" placeholder="璇疯緭鍏�"></el-input>
+ </div>
+
+ <div class="main-title">
+ <el-button
+ type="primary"
+ icon="el-icon-search"
+ @click="getBayonetListData"
+ >鏌ヨ
+ </el-button>
+ <el-button
+ class="el-icon-plus button-addition"
+ type="primary"
+ @click="showDialog(false, null)"
+ >娣诲姞</el-button
+ >
+
+ <el-button @click="handleExport" type="primary">瀵煎嚭鍗″彛</el-button>
+ </div>
+ </div>
+ </header>
+ <main>
+ <div class="main-content">
+ <!-- 鏁版嵁灞曠ず -->
+ <MyTable
+ :tableOption="tableOption"
+ :get-table-list="getBayonetListData"
+ :tableData="list"
+ >
+ <template #operation="info">
+ <el-link
+ :underline="false"
+ style="color: #4b9bb7"
+ @click="showDialog(true, info)"
+ >缂栬緫</el-link
+ >
+
+ <span class="line">|</span>
+ <el-link
+ :underline="false"
+ style="color: #4b9bb7"
+ @click="handleDelete(info)"
+ >鍒犻櫎</el-link
+ >
+ </template>
+ </MyTable>
+
+ <div class="tools">
+ <div class="funs">
+ <div class="funsItem funs-sp"></div>
+ <div class="funsItem funs-sp"></div>
+ <div class="funsItem"></div>
+ </div>
+ <div class="pagination">
+ <el-pagination
+ background
+ :current-page="current"
+ layout="prev, pager, next"
+ :total="total"
+ :page-size="size"
+ @current-change="changeCurrentPage"
+ >
+ </el-pagination>
+ </div>
+ </div>
+ </div>
+ </main>
+ <footer>
+ <!-- 娣诲姞鍗″彛 -->
+ <el-dialog
+ :destroy-on-close="true"
+ :title="getDialogTitle"
+ :visible.sync="isShowDialog"
+ width="60%"
+ :before-close="handleClose"
+ >
+ <MyCreate
+ v-if="isShowDialog"
+ @closeDialog="closeDialog"
+ :originalBayonet="originalBayonet"
+ :isEdit="isEdit"
+ ></MyCreate>
+ </el-dialog>
+ </footer>
+ </div>
</template>
<script>
-import MyCreate from './create'
-import MyTable from '@/components/Table'
+import MyCreate from "./create";
+import MyTable from "@/components/Table";
import bayonet from "@/api/system/bayonet";
import { downloadFile } from "@/utils/helper";
export default {
- components: {
- MyCreate, MyTable,
- },
- data() {
- return {
- isShowDialog: false,
- context: 0,
- options: [
- {
- value: 0,
- label: '绂荤嚎',
- },
- {
- value: 1,
- label: '鍦ㄧ嚎',
- }
- ],
- list: [],
- current: 1,
- size: 10,
- tableOption: {
- group: [
- {
- label: '鍗″彛鍚嶇О',
- type: 'text',
- prop: 'bayonetName',
- },
- {
- label: '缁忕含搴︿綅缃�',
- type: 'text',
- prop: 'latitude',
- },
- {
- label: '鍩熷悕/IP',
- type: 'text',
- prop: 'ipAddress',
- },
- {
- label: '绔彛鍙�',
- type: 'text',
- prop: 'port',
- },
- {
- label: '鍓嶇绫诲瀷',
- type: 'text',
- prop: 'frontEndType',
- },
- {
- label: '鍑哄叆鍩庣被鍨�',
- type: 'text',
- prop: 'inOutCityType',
- },
- {
- label: '鎿嶄綔',
- type: 'operation',
- prop: 'operation',
- },
- ]
- },
- originalBayonet: null,
- isEdit: false
- }
- },
-
- computed: {
- getDialogTitle() {
- return this.isEdit ? '缂栬緫鍗″彛' : '鏂板缓鍗″彛';
+ components: {
+ MyCreate,
+ MyTable,
+ },
+ data() {
+ return {
+ isShowDialog: false,
+ context: "",
+ options: [
+ {
+ value: 0,
+ label: "绂荤嚎",
+ },
+ {
+ value: 1,
+ label: "鍦ㄧ嚎",
+ },
+ ],
+ list: [],
+ current: 1,
+ size: 10,
+ total: 0,
+ tableOption: {
+ group: [
+ {
+ label: "鍗″彛鍚嶇О",
+ type: "text",
+ prop: "name",
+ },
+ {
+ label: "鍩熷悕/IP",
+ type: "text",
+ prop: "ipAddress",
+ },
+ {
+ label: "绔彛鍙�",
+ type: "text",
+ prop: "port",
+ },
+ {
+ label: "鍓嶇绫诲瀷",
+ type: "text",
+ prop: "frontEndTypeName",
+ },
+ {
+ label: "鍑哄叆鍩庣被鍨�",
+ type: "text",
+ prop: "inOutCityTypeName",
+ },
+ {
+ label: "鎿嶄綔",
+ type: "operation",
+ prop: "operation",
+ },
+ ],
},
+ originalBayonet: null,
+ isEdit: false,
+ };
+ },
+
+ computed: {
+ getDialogTitle() {
+ return this.isEdit ? "缂栬緫鍗″彛" : "鏂板缓鍗″彛";
},
- created() {
+ },
+ created() {
+ this.getBayonetListData();
+ },
+ methods: {
+ getBayonetListData() {
+ bayonet
+ .getBayonetList({
+ bayonetName: this.context,
+ current: this.current,
+ size: this.size,
+ })
+ .then(({ records, total }) => {
+ this.list = records;
+ this.total = total;
+ })
+ .catch((err) => {
+ this.$message({ type: "error", message: err });
+ });
+ },
+ // 褰撳墠椤垫敼鍙樿Е鍙戜簨浠�
+ changeCurrentPage(page) {
+ this.current = page;
this.getBayonetListData();
},
- methods: {
- getBayonetListData() {
- bayonet.getBayonetList({ bayonetName: '', current: this.current, size: this.size })
- .then(data => {
- this.list = data;
- })
- .catch(err => {
- this.$message({ type: 'error', message: err });
- })
- },
- // 寮圭獥鍏抽棴
- handleClose(done) {
- this.$confirm('纭鍏抽棴?')
- .then(_ => {
- done();
- })
- },
+ // 寮圭獥鍏抽棴
+ handleClose(done) {
+ this.$confirm("纭鍏抽棴?").then((_) => {
+ done();
+ });
+ },
- closeDialog() {
- this.isShowDialog = false;
- },
+ closeDialog() {
+ this.isShowDialog = false;
+ this.getBayonetListData();
+ },
- handleExport() {
- bayonet.exportBayonetList({ bayonetName: this.context, current: this.current, size: this.size })
- .then(res => {
- downloadFile(res);
- this.$message({ type: 'success', message: '鎿嶄綔鎴愬姛' });
- })
- .catch(err => {
- this.$message({ type: 'error', message: err });
- })
- },
- showDialog(isEdit, data) {
- this.isShowDialog = true;
- this.isEdit = isEdit;
- this.originalBayonet = data;
- }
- }
-}
+ handleExport() {
+ bayonet
+ .exportBayonetList({
+ bayonetName: this.context,
+ current: this.current,
+ size: this.size,
+ })
+ .then((res) => {
+ downloadFile(res);
+ this.$message({ type: "success", message: "鎿嶄綔鎴愬姛" });
+ })
+ .catch((err) => {
+ this.$message({ type: "error", message: err });
+ });
+ },
+ handleDelete(data) {
+ this.$confirm("纭鍒犻櫎锛�").then((_) => {
+ bayonet.deleteBayonet(data.info.row.id).then((res) => {
+ this.$message({
+ type: "success",
+ message: "鍒犻櫎鎴愬姛锛�",
+ });
+ this.getBayonetListData();
+ });
+ });
+ },
+ showDialog(isEdit, data) {
+ this.isShowDialog = true;
+ this.isEdit = isEdit;
+ this.originalBayonet = data ? data.info.row : null;
+ },
+ },
+};
</script>
<style lang="scss" scoped>
.userList {
- text-align: left;
- margin: 10px 20px;
- color: #4b9bb7;
+ text-align: left;
+ padding: 10px 20px;
+ // color: #4b9bb7;
+ border: 1px solid #ccc;
+ header {
+ // background-color: white;
- header {
- background-color: #09152f;
+ .header-content {
+ padding: 0;
+ display: flex;
+ line-height: 100px;
+ justify-content: space-between;
+ align-items: center;
- .header-content {
- padding: 0 40px;
- display: flex;
- line-height: 100px;
- justify-content: space-between;
- align-items: center;
+ .search {
+ display: flex;
+ justify-content: flex-start;
- .search {
- display: flex;
- justify-content: flex-start;
-
- span {
- flex: 1;
- }
-
- .el-input {
- flex: 2;
- color: #1d3f57;
-
- &::v-deep .el-input__inner {
- background-color: #09152f;
- border: 1px solid #17324c;
- }
- }
-
- }
+ span {
+ flex: 1;
}
+
+ .el-input {
+ flex: 2;
+ // color: #1d3f57;
+
+ // &::v-deep .el-input__inner {
+ // background-color: #09152f;
+ // border: 1px solid #17324c;
+ // }
+ }
+ }
+
+ .main-title {
+ line-height: 60px;
+ padding: 10px 0px;
+ }
+ }
+ }
+
+ main {
+ // background-color: #09152f;
+ margin-top: 20px;
+ padding-bottom: 50px;
+
+ .tools {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 20px;
+
+ .funs {
+ display: flex;
+
+ .funsItem {
+ line-height: 28px;
+ display: flex;
+ align-items: center;
+ // border: 1px solid #17324c;
+ border-radius: 4px;
+ font-size: 12px;
+ margin-left: 10px;
+
+ .el-checkbox {
+ width: 80px;
+ padding: 0 10px;
+ }
+
+ .el-select {
+ width: 120px;
+ }
+
+ // &::v-deep .el-input__inner {
+ // border: none;
+ // background-color: #09152f;
+ // }
+
+ // &:hover {
+ // border: 1px solid #4b9bb7;
+ // }
+
+ // &:hover .el-checkbox {
+ // color: #4b9bb7;
+ // }
+ }
+ }
+
+ .pagination {
+ margin-top: 50px;
+ display: flex;
+ line-height: 50px;
+ justify-content: center;
+
+ .el-pagination {
+ // &::v-deep li,
+ // &::v-deep .btn-prev,
+ // &::v-deep .btn-next {
+ // background-color: #071f39;
+ // color: #4b9bb7;
+ // }
+
+ // &::v-deep .active {
+ // background-color: #409eff;
+ // color: #fff;
+ // }
+ }
+ }
}
- main {
- background-color: #09152f;
- margin-top: 20px;
- padding-bottom: 50px;
+ .el-table {
+ // color: #4b9bb7;
+ // font-size: 10px;
- .main-title {
- line-height: 60px;
- padding: 10px 20px;
+ .cell {
+ display: flex;
+
+ &::v-deep .line {
+ padding: 0 5px;
}
- .tools {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20px;
-
- .funs {
- display: flex;
-
- .funsItem {
- line-height: 28px;
- display: flex;
- align-items: center;
- border: 1px solid #17324c;
- border-radius: 4px;
- font-size: 12px;
- margin-left: 10px;
-
- .el-checkbox {
- width: 80px;
- padding: 0 10px;
- }
-
- .el-select {
- width: 120px;
- }
-
- &::v-deep .el-input__inner {
- border: none;
- background-color: #09152f;
- }
-
- &:hover {
- border: 1px solid #4b9bb7;
- }
-
- &:hover .el-checkbox {
- color: #4b9bb7;
- }
- }
-
- }
-
- .pagination {
- margin-top: 50px;
- display: flex;
- line-height: 50px;
- justify-content: center;
-
- .el-pagination {
-
- &::v-deep li,
- &::v-deep .btn-prev,
- &::v-deep .btn-next {
- background-color: #071f39;
- color: #4b9bb7;
- }
-
- &::v-deep .active {
- background-color: #409eff;
- color: #fff;
- }
- }
- }
+ span:hover {
+ cursor: pointer;
}
-
- .el-table {
- color: #4b9bb7;
- font-size: 10px;
-
- .operation {
- display: flex;
-
- .line {
- padding: 0 5px;
- }
-
- span:hover {
- cursor: pointer;
- }
- }
- }
+ }
}
+ }
}
-</style>
\ No newline at end of file
+.line {
+ padding: 0 5px;
+}
+</style>
--
Gitblit v1.8.0