<template>
|
<div class="list">
|
<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>
|
</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%"
|
>
|
<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="user" label="使用人员" min-width="10">
|
</el-table-column>
|
<el-table-column prop="phone" label="联系方式" min-width="10">
|
</el-table-column>
|
<el-table-column prop="pDepartName" label="所属部门" min-width="10">
|
</el-table-column>
|
<el-table-column prop="departName" 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>
|
</div>
|
</main>
|
<footer>
|
<!-- 添加音柱 -->
|
<el-dialog
|
title="添加音柱"
|
:visible.sync="dialogCreate"
|
width="60%"
|
: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: 0,
|
options: [
|
{
|
value: null,
|
label: "全部",
|
},
|
{
|
value: 1,
|
label: "在线",
|
},
|
{
|
value: 0,
|
label: "离线",
|
},
|
],
|
list: [],
|
current: 1,
|
size: 10,
|
loudspeakerInfo: {
|
id: 0,
|
name: "",
|
code: "",
|
power: "",
|
frequencyResponse: "",
|
fullRangeSpeaker: "",
|
},
|
};
|
},
|
created() {
|
this.setTableData();
|
},
|
methods: {
|
...mapActions([
|
"getLoudspeakerList",
|
"saveLoudspeaker",
|
"updateLoudspeaker",
|
]),
|
formatSate(row, column) {
|
return row.state == 1 ? "在线" : "离线";
|
},
|
// 弹窗关闭
|
handleClose(done) {
|
this.$confirm("确认关闭?").then((_) => {
|
done();
|
});
|
},
|
// 设置tableData
|
setTableData() {
|
const { current, size, context } = this;
|
let arr = this.getLoudspeakerList({
|
current,
|
size,
|
}).then((res) => {
|
this.list = arr.data.data;
|
});
|
},
|
},
|
};
|
</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>
|