From cc2df46ba6192b1541b976cb992e2ea3f76b8fc7 Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期五, 09 十二月 2022 17:32:54 +0800
Subject: [PATCH] 点位管理视频加载
---
src/views/systemSetting/device/bayonet/index.vue | 650 +++++++++++++++++++++++++++-------------------------------
1 files changed, 302 insertions(+), 348 deletions(-)
diff --git a/src/views/systemSetting/device/bayonet/index.vue b/src/views/systemSetting/device/bayonet/index.vue
index 23b3a98..47b00eb 100644
--- a/src/views/systemSetting/device/bayonet/index.vue
+++ b/src/views/systemSetting/device/bayonet/index.vue
@@ -1,376 +1,330 @@
<template>
- <div class="userList">
- <header>
- <div class="header-content">
- <div class="search">
- <span style="padding-right:20px">绛涢�夋潯浠�:</span>
- <el-select v-model="context" placeholder="璇烽�夋嫨">
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
- </el-option>
- </el-select>
- <!-- <el-input placeholder="璇疯緭鍏ュ唴瀹�" v-model="context"></el-input> -->
- </div>
- </div>
- </header>
- <main>
- <div class="main-content">
- <div class="main-title">
- <el-button class="el-icon-plus" type="primary" @click="dialogCreate = true">娣诲姞</el-button>
- <el-button class="">瀵煎嚭鍗″彛</el-button>
- </div>
- <!-- 鏁版嵁灞曠ず -->
- <el-table ref="multipleTable"
- :header-cell-style="{background:'#06122c','font-size':'12px',color:'#4b9bb7','font-weight':'650','line-height':'45px'}"
- :data="tableData" style="width: 100%" :row-class-name="tableRowClassName"
- @selection-change="tableChange">
- <el-table-column type="selection" min-width="5">
- </el-table-column>
- <el-table-column prop="name" label="鍗″彛鍚嶇О" min-width="10">
- </el-table-column>
- <el-table-column prop="sort" label="缁忕含搴︿綅缃�" min-width="10">
- </el-table-column>
- <el-table-column prop="adminCount" label="鎵�灞炲尯鍩�" min-width="10">
- </el-table-column>
- <el-table-column prop="description" label="鍩熷悕/IP" min-width="10">
- </el-table-column>
- <el-table-column prop="description" label="绔彛鍙�" min-width="10">
- </el-table-column>
- <el-table-column prop="description" label="鍓嶇绫诲瀷" min-width="10">
- </el-table-column>
- <el-table-column prop="description" label="鍑哄叆鍩庣被鍨�" min-width="10">
- </el-table-column>
- <el-table-column prop="operation" label="鎿嶄綔" min-width="15">
- <template slot-scope="scope">
- <div class="operation">
- <span>缂栬緫</span>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- tools -->
- <!-- <div class="tools">
- <div class="funs">
- <div class="funsItem">
- <el-checkbox v-model="all" @change="selectAll()">鍏ㄩ��</el-checkbox>
- </div>
- <div class="funsItem">
- <el-checkbox v-model="unsame" @change="disSame(tableData)">鍙嶉��</el-checkbox>
- </div>
- <div class="funsItem">
- <el-select v-model="myIdx" placeholder="鎵归噺鎿嶄綔" @change="selectChange">
- <el-option v-for="item in options" :key="item.value" :label="item.label"
- :value="item.value" :disabled="item.disabled">
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="pagination">
- <el-pagination background :current-page="currentPage" layout="prev, pager, next"
- :total="totalNum" :page-size="pageSize" @current-change="changeCurrentPage"
- @prev-click="handlePrev" @next-click="handleNext">
- </el-pagination>
- </div>
- </div> -->
- </div>
- </main>
- <footer>
- <!-- 娣诲姞鍗″彛 -->
- <el-dialog title="娣诲姞鍗″彛" :visible.sync="dialogCreate" width="60%" :before-close="handleClose">
- <MyCreate></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="璇疯緭鍏�" @change="getBayonetListData"></el-input>
+ </div>
+ </div>
+ </header>
+ <main>
+ <div class="main-content">
+ <div class="main-title">
+ <el-button
+ class="el-icon-plus button-addition"
+ type="primary"
+ @click="showDialog(false, null)"
+ >娣诲姞</el-button
+ >
+ <el-button @click="handleExport">瀵煎嚭鍗″彛</el-button>
+ </div>
+ <!-- 鏁版嵁灞曠ず -->
+ <MyTable :tableOption="tableOption" :get-table-list="getBayonetListData" :tableData="list" :pageShow="false">
+ <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>
+ </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 helper from "@/utils/mydate.js"
-import MyCreate from './create'
-export default {
- components: {
- MyCreate
- },
- data() {
- return {
- tableData: [],
- context: 0,
- dialogCreate: false,
- totalNum: null,
- pageSize: 10,
- currentPage: 1,
- all: false,
- unsame: false,
- myIdx: 0,
- preMyIdx: 0,
- options: [
- {
- value: 0,
- label: '绂荤嚎',
- },
- {
- value: 1,
- label: '鍦ㄧ嚎',
- }
- ],
- tempList: []
- }
- },
- created() {
- },
- methods: {
- async selectChange(list) {
- console.log(this.tempList);
- if (this.tempList.length !== 0) {
- this.preMyIdx = list;
- if (list === 3) {
- await this.handleDelete(this.tempList);
- } else if (list === 2) {
- await this.mulUpdateStatus(this.tempList, 0);
- } else {
- await this.mulUpdateStatus(this.tempList, 1);
- }
- this.myIdx = 0;
- } else {
- this.myIdx = this.preMyIdx;
- this.$message({
- type: 'warning',
- message: '鎮ㄨ繕娌¢�変腑浠讳綍鏁版嵁',
- })
- }
- },
- mulUpdateStatus(idArr, flag) {
- this.$confirm(flag === 1 ? "鎮ㄧ‘瀹氳杩涜鎵归噺鍚敤瑙掕壊鍚�?" : '鎮ㄧ‘瀹氳杩涜鎵归噺绂佺敤瑙掕壊鍚�?')
- .then(_ => {
- this.$axios({
- method: 'post',
- url: 'sccg/role/updateStatusBatch?ids=' + idArr + '&status=' + flag,
- })
- .then(res => {
- if (res.code === 200) {
- this.$message({
- type: 'success',
- message: '鏇存敼鐢ㄦ埛鐘舵�佹垚鍔�',
- })
- this.getUserList();
- } else {
- this.$message({
- type: 'error',
- message: res.message
- })
- }
- console.log(res);
- })
- })
- .catch(err => { console.log(err) })
- },
- tableChange(list) {
- this.tempList = [];
- list.forEach(item => {
- this.tempList.push(item.id);
- })
- if (list.length === this.tableData.length) {
- this.all = true;
- } else {
- this.all = false
- }
- },
- changeTime({ createTime }) {
- return helper(createTime);
- },
- selectAll() {
- this.$refs.multipleTable.toggleAllSelection();
- },
- disSame(list) {
- list.forEach(row => {
- this.$refs.multipleTable.toggleRowSelection(row)
- })
- },
- handleDelete(id) {
- const that = this;
- // let arr = [];
- // arr.push(id);
- this.$confirm('纭鍒犻櫎锛�')
- .then(_ => {
- that.$axios({
- method: 'post',
- url: 'sccg/role/delete?ids=' + id,
- })
- .then(res => {
- this.myIdx = 0;
- this.preMyIdx = 0;
- console.log(res);
- this.$message({
- type: 'success',
- message: res.message
- })
+import MyCreate from "./create";
+import MyTable from "@/components/Table";
+import bayonet from "@/api/system/bayonet";
+import { downloadFile } from "@/utils/helper";
- this.getUserList();
- })
- })
- .catch(_ => { });
+export default {
+ components: {
+ MyCreate,
+ MyTable,
+ },
+ data() {
+ return {
+ isShowDialog: false,
+ context: "",
+ options: [
+ {
+ value: 0,
+ label: "绂荤嚎",
},
- // 璁剧疆琛ㄦ牸鏂戦┈绾�
- tableRowClassName({ row, rowIndex }) {
- if ((rowIndex + 1) % 2 == 0) {
- return 'warning-row';
- } else {
- return 'success-row';
- }
- return '';
+ {
+ value: 1,
+ label: "鍦ㄧ嚎",
},
- // 褰撳墠椤垫敼鍙樿Е鍙戜簨浠�
- changeCurrentPage(page) {
- this.currentPage = page;
- },
- // 涓婁竴椤电偣鍑讳簨浠�
- handlePrev(page) {
- this.currentPage = page;
- },
- // 涓嬩竴椤电偣鍑讳簨浠�
- handleNext(page) {
- this.currentPage = page;
- },
- // 鍏抽棴寮圭獥
- handleClose(done) {
- this.$confirm('纭鍏抽棴锛�')
- .then(_ => {
- done();
- })
- .catch(_ => { });
- }
- }
-}
+ ],
+ list: [],
+ current: 1,
+ size: 10,
+ 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() {
+ this.getBayonetListData();
+ },
+ methods: {
+ getBayonetListData() {
+ bayonet
+ .getBayonetList({
+ bayonetName: this.context,
+ current: this.current,
+ size: this.size,
+ })
+ .then(({ records }) => {
+ this.list = records;
+ })
+ .catch((err) => {
+ this.$message({ type: "error", message: err });
+ });
+ },
+ // 寮圭獥鍏抽棴
+ handleClose(done) {
+ this.$confirm("纭鍏抽棴?").then((_) => {
+ done();
+ });
+ },
+
+ 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 });
+ });
+ },
+ 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;
+ margin: 10px 20px;
+ color: #4b9bb7;
- header {
- background-color: #09152f;
- border: 1pox solid #fff;
+ header {
+ background-color: #09152f;
- .header-content {
- padding: 0 40px;
- 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 {
+ background-color: #09152f;
+ margin-top: 20px;
+ padding-bottom: 50px;
+
+ .main-title {
+ line-height: 60px;
+ padding: 10px 20px;
}
- main {
- background-color: #09152f;
- margin-top: 20px;
- padding-bottom: 50px;
- border: 1pox solid #fff;
+ .tools {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 20px;
- .main-title {
- line-height: 60px;
- padding: 10px 20px;
- }
+ .funs {
+ display: flex;
- .tools {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 20px;
+ .funsItem {
+ line-height: 28px;
+ display: flex;
+ align-items: center;
+ border: 1px solid #17324c;
+ border-radius: 4px;
+ font-size: 12px;
+ margin-left: 10px;
- .funs {
- display: flex;
+ .el-checkbox {
+ width: 80px;
+ padding: 0 10px;
+ }
- .funsItem {
- line-height: 28px;
- display: flex;
- align-items: center;
- border: 1px solid #17324c;
- border-radius: 4px;
- font-size: 12px;
- margin-left: 10px;
+ .el-select {
+ width: 120px;
+ }
- .el-checkbox {
- width: 80px;
- padding: 0 10px;
- }
+ &::v-deep .el-input__inner {
+ border: none;
+ background-color: #09152f;
+ }
- .el-select {
- width: 120px;
- }
+ &:hover {
+ border: 1px solid #4b9bb7;
+ }
- &::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;
- }
- }
- }
- }
-
- .el-table {
+ &:hover .el-checkbox {
color: #4b9bb7;
- font-size: 10px;
-
- .operation {
- display: flex;
-
- .line {
- padding: 0 5px;
- }
-
- span:hover {
- cursor: pointer;
- }
- }
+ }
}
+ }
+
+ .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;
+ }
+ }
+ }
}
+
+ .el-table {
+ color: #4b9bb7;
+ font-size: 10px;
+
+ .cell {
+ display: flex;
+
+ &::v-deep .line {
+ padding: 0 5px;
+ }
+
+ span:hover {
+ cursor: pointer;
+ }
+ }
+ }
+ }
+}
+.line {
+ padding: 0 5px;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0