From 18688e9d36b2d75efa79a9b0a7a8b1b44fdee6bd Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 01 十一月 2022 16:08:43 +0800
Subject: [PATCH] Merge branch 'master' of http://42.193.1.25:9521/r/sccg_ui into master

---
 src/views/systemSetting/device/loudspeaker/index.vue |  358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 358 insertions(+), 0 deletions(-)

diff --git a/src/views/systemSetting/device/loudspeaker/index.vue b/src/views/systemSetting/device/loudspeaker/index.vue
new file mode 100644
index 0000000..de78e41
--- /dev/null
+++ b/src/views/systemSetting/device/loudspeaker/index.vue
@@ -0,0 +1,358 @@
+<template>
+  <div class="list">
+    <header>
+      <div class="header-content">
+        <div class="search">
+          <span style="padding-right: 20px">绛涢�夋潯浠�:</span>
+          <el-select
+            v-model="context"
+            placeholder="绛涢�夋潯浠�"
+            @change="handleStateChange"
+          >
+            <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="dialogCreate = true"
+            >娣诲姞</el-button
+          >
+        </div>
+        <!-- 鏁版嵁灞曠ず -->
+        <el-table
+          ref="multipleTable"
+          :header-cell-style="{
+            background: '#06122c',
+            'font-size': '12px',
+            color: '#4b9bb7',
+            'font-weight': '650',
+            'line-height': '45px',
+          }"
+          :data="list"
+          style="width: 100%"
+          :row-class-name="tableRowClassName"
+        >
+          <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="code" label="闊虫煴缂栧彿" min-width="10">
+          </el-table-column>
+          <el-table-column prop="power" label="棰濆畾鍔熺巼" min-width="10">
+          </el-table-column>
+          <el-table-column
+            prop="frequencyResponse"
+            label="棰戠巼鍝嶅簲"
+            min-width="10"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="fullRangeSpeaker"
+            label="鍠囧彮鍗曞厓"
+            min-width="10"
+          >
+          </el-table-column>
+          <el-table-column
+            prop="state"
+            :formatter="formatSate"
+            label="鐘舵��"
+            min-width="5"
+          >
+          </el-table-column>
+          <el-table-column prop="operation" label="鎿嶄綔" min-width="20">
+            <template slot-scope="scope">
+              <div class="btn">
+                <span @click="handleEdit(scope.row)">缂栬緫</span>
+                <span class="line">|</span>
+                <span @click="handleDelete(scope.row)">鍒犻櫎</span>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <!-- tools -->
+        <div class="tools">
+          <div class="funs"></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%"
+        v-if="dialogCreate"
+        :before-close="handleClose"
+      >
+        <MyForm :info="loudspeakerInfo" :closeDialog="null"></MyForm>
+      </el-dialog>
+    </footer>
+  </div>
+</template>
+  <script>
+import { createNamespacedHelpers } from "vuex";
+const { mapActions } = createNamespacedHelpers("loudspeaker");
+import MyForm from "./components/dialogForm.vue";
+
+export default {
+  components: {
+    MyForm,
+  },
+  data() {
+    return {
+      dialogCreate: false,
+      context: null,
+      options: [
+        {
+          value: null,
+          label: "鍏ㄩ儴",
+        },
+        {
+          value: 1,
+          label: "鍦ㄧ嚎",
+        },
+        {
+          value: 0,
+          label: "绂荤嚎",
+        },
+      ],
+      list: [],
+      totalNum: 0,
+      pageSize: 10,
+      currentPage: 1,
+      renderFlag: false,
+      loudspeakerInfo: {
+        id: 0,
+        name: "",
+        code: "",
+        power: "",
+        frequencyResponse: "",
+        fullRangeSpeaker: "",
+      },
+    };
+  },
+  created() {
+    this.setTableData();
+  },
+  methods: {
+    ...mapActions([
+      "getLoudspeakerList",
+      "saveLoudspeaker",
+      "updateLoudspeaker",
+    ]),
+    handleEdit(row) {
+      this.loudspeakerInfo = row;
+      this.dialogCreate = true;
+    },
+    handleDelete(row) {},
+    formatSate(row, column) {
+      return row.state == 1 ? "鍦ㄧ嚎" : "绂荤嚎";
+    },
+
+    // 璁剧疆琛ㄦ牸鏂戦┈绾�
+    tableRowClassName({ row, rowIndex }) {
+      if ((rowIndex + 1) % 2 == 0) {
+        return "warning-row";
+      } else {
+        return "success-row";
+      }
+      return "";
+    },
+    // 寮圭獥鍏抽棴
+    handleClose(done) {
+      this.$confirm("纭鍏抽棴?").then((_) => {
+        done();
+      });
+    },
+    // 璁剧疆tableData
+    setTableData() {
+      const { currentPage, pageSize, context } = this;
+      this.getLoudspeakerList({
+        currentPage,
+        pageSize,
+        state: context,
+      }).then((res) => {
+        if (res.data.code == 200) {
+          this.list = res.data.data.records;
+          this.totalNum = res.data.data.total;
+        }
+      });
+    },
+    handleStateChange(e) {
+      this.setTableData();
+    },
+    // 褰撳墠椤垫敼鍙樿Е鍙戜簨浠�
+    changeCurrentPage(page) {
+      this.currentPage = page;
+      this.setTableData();
+    },
+    // 涓婁竴椤电偣鍑讳簨浠�
+    handlePrev(page) {
+      this.currentPage = page;
+      this.setTableData();
+    },
+    // 涓嬩竴椤电偣鍑讳簨浠�
+    handleNext(page) {
+      this.currentPage = page;
+      this.setTableData();
+    },
+  },
+};
+</script>
+  <style lang="scss" scoped>
+.list {
+  text-align: left;
+  margin: 10px 20px;
+  color: #4b9bb7;
+
+  header {
+    background-color: #09152f;
+    border: 1pox solid #fff;
+
+    .header-content {
+      padding: 0 40px;
+      display: flex;
+      line-height: 100px;
+      justify-content: space-between;
+      align-items: center;
+
+      .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;
+          }
+        }
+      }
+    }
+  }
+
+  main {
+    background-color: #09152f;
+    margin-top: 20px;
+    padding-bottom: 50px;
+    border: 1pox solid #fff;
+
+    .main-title {
+      line-height: 60px;
+      padding: 10px 20px;
+    }
+
+    .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;
+          }
+        }
+      }
+    }
+
+    .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

--
Gitblit v1.8.0