123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <template>
- <div class="hum-page-container">
- <div class="hum-page-title">断面管理</div>
- <div class="hum-page-main">
- <div class="hum-page-search">
- <el-form :model="queryParams" size="large" ref="queryForm" label-position="top">
- <el-row :gutter="30">
- <el-col :span="6">
- <el-form-item label="选择站点">
- <el-select v-model="siteId" placeholder="请选择站点" @change="getList">
- <el-option
- v-for="item in siteList"
- :key="item.siteId"
- :label="item.siteName"
- :value="item.siteId">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item class="hum-page-search-action">
- <el-button type="primary" @click="handleQuery">查询</el-button>
- <el-button @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="hum-page-action">
- <el-button type="primary" @click="$router.push(`/site/section/add?siteId=${siteId}`)">新增断面</el-button>
- </div>
- <el-table v-loading="loading" :data="list" border>
- <el-table-column label="站码" prop="id" />
- <el-table-column label="站点名称" prop="siteName" />
- <el-table-column label="断面名称" prop="berthingName" />
- <el-table-column label="创建日期">
- <template slot-scope="scope">
- <span>{{ formatDateTime(scope.row.createTime) }}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-s-operation"
- @click="handleUpdate(scope.row)"
- >断面图</el-button>
- <el-button
- v-if="scope.$index > 0"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleUpdate(scope.row)"
- >删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </template>
- <script>
- import { listSite } from "@/api/site/site";
- import { listSection } from "@/api/site/berthing";
- export default {
- data() {
- return {
- siteId: '',
- siteList: [],
- queryParams: {
- page: 1,
- size: 1000,
- },
- loading: true,
- total: 0,
- list: []
- }
- },
- created() {
- this.init();
- },
- methods: {
- handleQuery() {
- this.getList()
- },
- resetQuery() {},
- init() {
- this.loading = true;
- listSite({ page: 1, size: 1000 }).then(response => {
- this.siteList = response.data.records || [];
- if (this.siteList.length > 0) {
- this.siteId = this.siteList[0].siteId;
- this.getList();
- }
- }
- ).catch(() => {
- this.loading = false;
- });
- },
- getList() {
- this.loading = true;
- listSection({ ...this.queryParams, siteId: this.siteId }).then(response => {
- this.list = response.data.records;
- this.total = response.data.total;
- this.loading = false;
- }
- );
- },
- handleUpdate(site) {
- this.$router.push(`/site/site/edit/${site.siteId}`);
- },
- handleDelete(site) {
- this.$router.push(`/site/site/config/${site.siteId}`);
- },
- }
- }
- </script>
- <style scoped>
- </style>
|