|
@@ -5,23 +5,22 @@
|
|
<div class="filter-container mb-10">
|
|
<div class="filter-container mb-10">
|
|
<div>
|
|
<div>
|
|
<div class="filter-item">
|
|
<div class="filter-item">
|
|
- 台区:
|
|
|
|
- <el-input
|
|
|
|
- v-model="input"
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- style="width: 240px"
|
|
|
|
- ></el-input>
|
|
|
|
- </div>
|
|
|
|
|
|
+ 台区:
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="input"
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ style="width: 240px"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" class="search-button">
|
|
|
|
+ 搜索
|
|
|
|
+ </el-button>
|
|
|
|
|
|
- <el-button type="primary" icon="el-icon-search" class="search-button"
|
|
|
|
- >搜索</el-button
|
|
|
|
- >
|
|
|
|
-
|
|
|
|
- <el-button icon="el-icon-plus" type="success" @click="addItem()"
|
|
|
|
- >新增</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <el-button icon="el-icon-plus" type="success" @click="addItem()">
|
|
|
|
+ 新增
|
|
|
|
+ </el-button>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
<!-- 筛选end -->
|
|
<!-- 筛选end -->
|
|
|
|
|
|
@@ -33,38 +32,52 @@
|
|
:header-cell-style="headClass"
|
|
:header-cell-style="headClass"
|
|
:cell-style="cellStyle"
|
|
:cell-style="cellStyle"
|
|
>
|
|
>
|
|
- <el-table-column fixed prop="stationName" label="台区名称" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="stationCode" label="台区编号" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="stationAddress" label="台区地址" width="">
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ fixed
|
|
|
|
+ prop="stationName"
|
|
|
|
+ label="台区名称"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="stationCode"
|
|
|
|
+ label="台区编号"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="stationAddress"
|
|
|
|
+ label="台区地址"
|
|
|
|
+ width=""
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column prop="pointNum" label="点位数量" width="">
|
|
<el-table-column prop="pointNum" label="点位数量" width="">
|
|
- <template #default="scope">
|
|
|
|
- <span @click="goSiteList"> {{ scope.row.pointNum }}</span>
|
|
|
|
- <!-- <router-link style="margin-right:15px;" :to="{ path:'siteList',query:{id:scope.row.stationName}}">
|
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <span @click="goSiteList">{{ scope.row.pointNum }}</span>
|
|
|
|
+ <!-- <router-link style="margin-right:15px;" :to="{ path:'siteList',query:{id:scope.row.stationName}}">
|
|
{{ scope.row.pointNum }}
|
|
{{ scope.row.pointNum }}
|
|
</router-link> -->
|
|
</router-link> -->
|
|
- </template>
|
|
|
|
-
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column prop="deviceNum" label="挂载设备数量" width="350">
|
|
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="deviceNum"
|
|
|
|
+ label="挂载设备数量"
|
|
|
|
+ width="350"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column fixed="right" label="操作" width="250">
|
|
<el-table-column fixed="right" label="操作" width="250">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
@click.prevent="editRow(scope.row)"
|
|
@click.prevent="editRow(scope.row)"
|
|
- >编辑</el-button
|
|
|
|
>
|
|
>
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
@click="handleDelete(scope.$index, scope.row)"
|
|
@click="handleDelete(scope.$index, scope.row)"
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
class="delete-text"
|
|
class="delete-text"
|
|
- >删除</el-button
|
|
|
|
>
|
|
>
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -84,128 +97,131 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import DialogComponent from "./dialogComponent";
|
|
|
|
|
|
+import { defineComponent, ref, reactive } from 'vue'
|
|
|
|
+import DialogComponent from './dialogComponent'
|
|
import siteList from './siteList'
|
|
import siteList from './siteList'
|
|
-// import { mapGetters } from "vuex";
|
|
|
|
-
|
|
|
|
-export default {
|
|
|
|
- // name: "Dashboard",
|
|
|
|
- // computed: {
|
|
|
|
- // ...mapGetters(["name"]),
|
|
|
|
- // },
|
|
|
|
|
|
|
|
- components: { DialogComponent,siteList },
|
|
|
|
|
|
+export default defineComponent({
|
|
|
|
+ components: { DialogComponent, siteList },
|
|
|
|
+ setup() {
|
|
|
|
+ const input = ref('请输入台区名称')
|
|
|
|
+ const pageShow = ref(true)
|
|
|
|
+ const showDialog = ref(false)
|
|
|
|
+ const tableData = ref([
|
|
|
|
+ {
|
|
|
|
+ stationName: '台区1',
|
|
|
|
+ stationCode: 'tq02',
|
|
|
|
+ stationAddress: '青浦区徐泾镇',
|
|
|
|
+ pointNum: '8',
|
|
|
|
+ deviceNum: '10',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ stationName: '台区1',
|
|
|
|
+ stationCode: 'tq02',
|
|
|
|
+ stationAddress: '青浦区徐泾镇',
|
|
|
|
+ pointNum: '8',
|
|
|
|
+ deviceNum: '10',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ stationName: '台区1',
|
|
|
|
+ stationCode: 'tq02',
|
|
|
|
+ stationAddress: '青浦区徐泾镇',
|
|
|
|
+ pointNum: '8',
|
|
|
|
+ deviceNum: '10',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ stationName: '台区1',
|
|
|
|
+ stationCode: 'tq02',
|
|
|
|
+ stationAddress: '青浦区徐泾镇',
|
|
|
|
+ pointNum: '8',
|
|
|
|
+ deviceNum: '10',
|
|
|
|
+ },
|
|
|
|
+ ])
|
|
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- pageShow: true,
|
|
|
|
- showDialog: false,
|
|
|
|
-
|
|
|
|
- input: "请输入台区名称",
|
|
|
|
- tableData: [
|
|
|
|
- {
|
|
|
|
- stationName: "台区1",
|
|
|
|
- stationCode: "tq02",
|
|
|
|
- stationAddress: "青浦区徐泾镇",
|
|
|
|
- pointNum: "8",
|
|
|
|
- deviceNum: "10",
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- stationName: "台区1",
|
|
|
|
- stationCode: "tq02",
|
|
|
|
- stationAddress: "青浦区徐泾镇",
|
|
|
|
- pointNum: "8",
|
|
|
|
- deviceNum: "10",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- stationName: "台区1",
|
|
|
|
- stationCode: "tq02",
|
|
|
|
- stationAddress: "青浦区徐泾镇",
|
|
|
|
- pointNum: "8",
|
|
|
|
- deviceNum: "10",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- stationName: "台区1",
|
|
|
|
- stationCode: "tq02",
|
|
|
|
- stationAddress: "青浦区徐泾镇",
|
|
|
|
- pointNum: "8",
|
|
|
|
- deviceNum: "10",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- goSiteList() {
|
|
|
|
- this.pageShow = !this.pageShow
|
|
|
|
- },
|
|
|
|
- getMsgFormSon() {
|
|
|
|
- this.pageShow = !this.pageShow
|
|
|
|
- },
|
|
|
|
|
|
+ const goSiteList = () => {
|
|
|
|
+ pageShow.value = !pageShow.value
|
|
|
|
+ }
|
|
|
|
+ const getMsgFormSon = () => {
|
|
|
|
+ pageShow.value = !pageShow.value
|
|
|
|
+ }
|
|
|
|
|
|
// 表头样式设置
|
|
// 表头样式设置
|
|
- headClass() {
|
|
|
|
- return "background:#FAFAFA;";
|
|
|
|
- },
|
|
|
|
|
|
+ const headClass = () => {
|
|
|
|
+ return 'background:#FAFAFA;'
|
|
|
|
+ }
|
|
|
|
|
|
//自定义列样式
|
|
//自定义列样式
|
|
- cellStyle({ row, column, rowIndex, columnIndex }) {
|
|
|
|
|
|
+ const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
|
|
row, column, rowIndex
|
|
row, column, rowIndex
|
|
if (columnIndex === 3) {
|
|
if (columnIndex === 3) {
|
|
- return `color:#0284E8;cursor:pointer`;
|
|
|
|
|
|
+ return `color:#0284E8;cursor:pointer`
|
|
} else {
|
|
} else {
|
|
- return "";
|
|
|
|
|
|
+ return ''
|
|
}
|
|
}
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ const tableItem = reactive([])
|
|
|
|
+ const dialogTitle = ref('')
|
|
// 添加操作
|
|
// 添加操作
|
|
- addItem() {
|
|
|
|
- this.tableItem = {
|
|
|
|
- id: "",
|
|
|
|
- stationName: "",
|
|
|
|
- stationCode: "",
|
|
|
|
- stationAddress: "",
|
|
|
|
|
|
+
|
|
|
|
+ const dialogComponent = ref()
|
|
|
|
+ const addItem = () => {
|
|
|
|
+ tableItem.value = {
|
|
|
|
+ id: '',
|
|
|
|
+ stationName: '',
|
|
|
|
+ stationCode: '',
|
|
|
|
+ stationAddress: '',
|
|
siteList: [],
|
|
siteList: [],
|
|
- done: "",
|
|
|
|
- guaZai: "",
|
|
|
|
- };
|
|
|
|
- this.dialogTitle = "新增";
|
|
|
|
- this.showDialog = true;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs["dialogComponent"].showDialog = true;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ done: '',
|
|
|
|
+ guaZai: '',
|
|
|
|
+ }
|
|
|
|
+ dialogTitle.value = '新增'
|
|
|
|
+ showDialog.value = true
|
|
|
|
+
|
|
|
|
+ console.log(dialogComponent)
|
|
|
|
+ // dialogComponent.value.showDialog = true
|
|
|
|
+ }
|
|
// 编辑操作
|
|
// 编辑操作
|
|
- editRow(row) {
|
|
|
|
- console.log(row);
|
|
|
|
- this.tableItem = row;
|
|
|
|
- this.dialogTitle = "编辑";
|
|
|
|
- this.showDialog = true;
|
|
|
|
|
|
+ const editRow = (row) => {
|
|
|
|
+ console.log(row)
|
|
|
|
+ this.tableItem = row
|
|
|
|
+ this.dialogTitle = '编辑'
|
|
|
|
+ this.showDialog = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- this.$refs["dialogComponent"].showDialog = true;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ this.$refs['dialogComponent'].showDialog = true
|
|
|
|
+ })
|
|
|
|
+ }
|
|
// 关闭操作
|
|
// 关闭操作
|
|
- closeDialog(flag) {
|
|
|
|
|
|
+ const closeDialog = (flag) => {
|
|
if (flag) {
|
|
if (flag) {
|
|
// 重新刷新表格内容
|
|
// 重新刷新表格内容
|
|
- this.fetchData();
|
|
|
|
|
|
+ this.fetchData()
|
|
}
|
|
}
|
|
- this.showDialog = false;
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // handleEdit(index, row) {
|
|
|
|
- // console.log(index, row);
|
|
|
|
- // },
|
|
|
|
|
|
+ this.showDialog = false
|
|
|
|
+ }
|
|
|
|
|
|
//删除操作
|
|
//删除操作
|
|
- handleDelete(index, row) {
|
|
|
|
- console.log(index, row);
|
|
|
|
- alert(index);
|
|
|
|
- },
|
|
|
|
|
|
+ const handleDelete = (index, row) => {
|
|
|
|
+ console.log(index, row)
|
|
|
|
+ alert(index)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ tableData,
|
|
|
|
+ input,
|
|
|
|
+ pageShow,
|
|
|
|
+ showDialog,
|
|
|
|
+
|
|
|
|
+ goSiteList,
|
|
|
|
+ getMsgFormSon,
|
|
|
|
+ headClass,
|
|
|
|
+ cellStyle,
|
|
|
|
+ addItem,
|
|
|
|
+ editRow,
|
|
|
|
+ closeDialog,
|
|
|
|
+ handleDelete,
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-};
|
|
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
-</style>
|
|
|