|  |  |  | 
|---|
|  |  |  | <SearchFormCollapse slot="search-form" :need-more="false"> | 
|---|
|  |  |  | <el-form ref="searchForm" :model="searchForm" label-width="100px" inline> | 
|---|
|  |  |  | <el-form-item label="" prop="name"> | 
|---|
|  |  |  | <el-input v-model="searchForm.name" placeholder="请输入月台名称" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | <el-input v-model="searchForm.name" clearable placeholder="请输入月台名称" | 
|---|
|  |  |  | @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <section> | 
|---|
|  |  |  | <el-form-item label=""> | 
|---|
|  |  |  | <el-select v-model="searchForm.groupId" placeholder="请选择月台分组" @change="search" clearable> | 
|---|
|  |  |  | <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"> | 
|---|
|  |  |  | </el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <!-- <section> --> | 
|---|
|  |  |  | <el-button type="primary" @click="search">搜索</el-button> | 
|---|
|  |  |  | <el-button @click="reset">重置</el-button> | 
|---|
|  |  |  | </section> | 
|---|
|  |  |  | <!-- </section> --> | 
|---|
|  |  |  | </el-form> | 
|---|
|  |  |  | </SearchFormCollapse> | 
|---|
|  |  |  | <!-- 表格和分页 --> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['business:hksync:platforms']"> | 
|---|
|  |  |  | <li><el-button type="primary" :loading="working" @click="syncData" icon="el-icon-plus" v-permissions="['business:hksync:platforms']">同步</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" :loading="working1" @click="syncStatus" icon="el-icon-plus" v-permissions="['business:hksync:platforms']">同步状态</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" :loading="working" @click="syncData" icon="el-icon-plus" | 
|---|
|  |  |  | v-permissions="['business:hksync:platforms']">同步</el-button></li> | 
|---|
|  |  |  | <li><el-button type="primary" :loading="working1" @click="syncStatus" icon="el-icon-plus" | 
|---|
|  |  |  | v-permissions="['business:hksync:platforms']">同步实时状态</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | v-loading="isWorking.search" | 
|---|
|  |  |  | :data="tableData.list" | 
|---|
|  |  |  | stripe | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="name" label="月台名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="hkId" label="月台编码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="groupName" label="所属月台组" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="workingNum" label="同时叫号车辆数" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="alermTime" label="停留超时报警时间(分钟)" min-width="100px"> | 
|---|
|  |  |  | <template scope="{row}">{{row.alermTime?(row.alermTime/60):'-'}}</template> | 
|---|
|  |  |  | <el-table-column prop="name" label="月台名称" fixed min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="code" label="月台编码" fixed min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="groupName" label="所属月台组" fixed min-width="150px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="workingNum" label="同时叫号车辆数" min-width="120px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="stayTimeoutAlarmTime" label="停留超时报警时间(分钟)" min-width="180px"> | 
|---|
|  |  |  | <template scope="{row}">{{ row.stayTimeoutAlarmTime ? (row.stayTimeoutAlarmTime) : '-' }}</template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="waitCallTime" label="作业超时报警时间(分钟)" min-width="100px"> | 
|---|
|  |  |  | <template scope="{row}"> {{row.waitCallTime?(row.alermTime/60):'-'}}</template> | 
|---|
|  |  |  | <el-table-column prop="workTimeoutAlarmTime" label="作业超时报警时间(分钟)" min-width="180px"> | 
|---|
|  |  |  | <template scope="{row}"> {{ row.workTimeoutAlarmTime ? (row.workTimeoutAlarmTime) : '-' }}</template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="workRate" label="月台作业效率(万只/小时)" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="status" label="状态" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="broadcastName" label="关联广播" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="ledName" label="关联LED" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="hkDate" label="同步时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-if="containPermissions(['business:platform:update', 'business:platform:delete'])" | 
|---|
|  |  |  | label="操作" | 
|---|
|  |  |  | min-width="120" | 
|---|
|  |  |  | fixed="right" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column prop="workRate" label="月台作业效率(万只/小时)" min-width="180px"></el-table-column> | 
|---|
|  |  |  | <!-- <el-table-column prop="platformStatus" label="月台状态" min-width="100px"> | 
|---|
|  |  |  | <template scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.platformStatus == 0">无车</span> | 
|---|
|  |  |  | <span v-if="row.platformStatus == 1">有车</span> | 
|---|
|  |  |  | <span v-if="row.platformStatus == 2">超时停靠</span> | 
|---|
|  |  |  | <span v-if="row.platformStatus == 3">错误停靠</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> --> | 
|---|
|  |  |  | <el-table-column prop="broadcastNames" label="关联广播" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="ledNames" label="关联LED" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="ledContent" label="LED空闲文案" min-width="180px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="hkDate" label="同步时间" min-width="150px"></el-table-column> | 
|---|
|  |  |  | <el-table-column label="月台状态" fixed="right" width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.operaPlatformWindow.open('编辑月台信息表', row)" icon="el-icon-edit" v-permissions="['business:platform:update']">编辑</el-button> | 
|---|
|  |  |  | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:platform:delete']">删除</el-button> | 
|---|
|  |  |  | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" | 
|---|
|  |  |  | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> | 
|---|
|  |  |  | </el-switch> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column v-if="containPermissions(['business:platform:update', 'business:platform:delete'])" label="操作" | 
|---|
|  |  |  | min-width="120" fixed="right"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.operaPlatformWindow.open('编辑月台信息表', row)" icon="el-icon-edit" | 
|---|
|  |  |  | v-permissions="['business:platform:update']">编辑</el-button> | 
|---|
|  |  |  | <!-- <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" | 
|---|
|  |  |  | v-permissions="['business:platform:delete']">删除</el-button> --> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <pagination | 
|---|
|  |  |  | @size-change="handleSizeChange" | 
|---|
|  |  |  | @current-change="handlePageChange" | 
|---|
|  |  |  | :pagination="tableData.pagination" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <!-- 新建/修改 --> | 
|---|
|  |  |  | <OperaPlatformWindow ref="operaPlatformWindow" @success="handlePageChange"/> | 
|---|
|  |  |  | <OperaPlatformWindow ref="operaPlatformWindow" @success="handlePageChange" /> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | import SearchFormCollapse from '@/components/common/SearchFormCollapse' | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import OperaPlatformWindow from '@/components/business/OperaPlatformWindow' | 
|---|
|  |  |  | import { syncDevices, updateEntranceById } from '@/api/business/device' | 
|---|
|  |  |  | import { syncPlatforms } from '@/api/platform/platform' | 
|---|
|  |  |  | import { allList } from '@/api/platform/platformGroup' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'Platform', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | components: { SearchFormCollapse, TableLayout, Pagination, OperaPlatformWindow }, | 
|---|
|  |  |  | data () { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | groupList: [], | 
|---|
|  |  |  | // 搜索 | 
|---|
|  |  |  | working: false, | 
|---|
|  |  |  | working1: false, | 
|---|
|  |  |  | searchForm: { | 
|---|
|  |  |  | name: '' | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | groupId: null | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '月台信息表', | 
|---|
|  |  |  | api: '/platform/platform', | 
|---|
|  |  |  | 
|---|
|  |  |  | 'field.main': 'id' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | this.loadGroupList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | changeManufature (e, row) { | 
|---|
|  |  |  | updateEntranceById({ | 
|---|
|  |  |  | loadGroupList() { | 
|---|
|  |  |  | allList({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.groupList = res || [] | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeStatus(e, row) { | 
|---|
|  |  |  | this.api.updateStatusById({ | 
|---|
|  |  |  | id: row.id, | 
|---|
|  |  |  | isEntrance: e | 
|---|
|  |  |  | status: e | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | syncData () { | 
|---|
|  |  |  | syncData() { | 
|---|
|  |  |  | this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.isWorking.working = true | 
|---|
|  |  |  | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | // this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.working = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(() => {}) | 
|---|
|  |  |  | .catch(() => { }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | syncStatus () { | 
|---|
|  |  |  | syncStatus() { | 
|---|
|  |  |  | this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.isWorking.working = true | 
|---|
|  |  |  | this.api.syncPlatforms({}) | 
|---|
|  |  |  | this.api.syncPlatformStatus({}) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.$tip.apiSuccess(res || '同步成功') | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$tip.apiFailed(e) | 
|---|
|  |  |  | // this.$tip.apiFailed(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.working = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(() => {}) | 
|---|
|  |  |  | .catch(() => { }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|