|
@@ -1,32 +1,64 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
+ <div class="content-main-manage">
|
|
|
<div class="search-list">
|
|
|
<div class="search-left">
|
|
|
- <Select v-model="tableParams.level" placeholder="层级">
|
|
|
- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="tableParams.lineName" placeholder="线路">
|
|
|
- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="tableParams.stationName" placeholder="站点">
|
|
|
- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="tableParams.equipmentCheck" placeholder="接入设备">
|
|
|
- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- <Select v-model="tableParams.instrumentCheck" placeholder="接入仪表">
|
|
|
- <Option v-for="item in cityList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
- </Select>
|
|
|
- <Button type="primary" class="common-btn-search">
|
|
|
- <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
|
|
|
- </Button>
|
|
|
+ <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
|
|
|
+ <FormItem label="" prop="level">
|
|
|
+ <Select v-model="tableParams.level" placeholder="层级">
|
|
|
+ <Option v-for="item in levelData" :value="item.id" :key="item.id">{{ item.value }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" prop="lineId">
|
|
|
+ <Select v-model="tableParams.lineId" placeholder="线路" @on-select="selectLine">
|
|
|
+ <Option v-for="item in lineTypeData" :value="String(item.id)" :key="item.id">{{ item.lineName }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" prop="stationId">
|
|
|
+ <Select v-model="tableParams.stationId" placeholder="站点">
|
|
|
+ <Option v-for="item in stationTypeData" :value="String(item.id)" :key="item.id">{{ item.stationName }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" prop="equipmentCheck">
|
|
|
+ <Select v-model="tableParams.equipmentCheck" placeholder="接入设备">
|
|
|
+ <Option v-for="item in equipmentCheckData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" prop="instrumentCheck">
|
|
|
+ <Select v-model="tableParams.instrumentCheck" placeholder="接入仪表">
|
|
|
+ <Option v-for="item in instrumentData" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ </Select>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem label="" >
|
|
|
+ <Button type="primary" class="common-btn-search" @click="searchClick">
|
|
|
+ <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 筛选
|
|
|
+ </Button>
|
|
|
+ <Button type="primary" class="common-btn-search" style="margin-left:10px" @click="resetClick('tableParams')">
|
|
|
+ <Icon type="ios-search" style="margin-right:4px;font-size: 16px"/> 重置
|
|
|
+ </Button>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
</div>
|
|
|
<div class="btn-container">
|
|
|
- <Button icon="ios-add" class="common-add-btn" @click="addClick">新增线路</Button>
|
|
|
+ <Button icon="ios-add" class="common-add-btn" @click="addClick">新增应用</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="manage-main-center">
|
|
|
- <Table :columns="columns" :data="data1" class="common-table" :row-class-name="rowClassName"></Table>
|
|
|
+ <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
|
|
|
+ <template slot="loading">
|
|
|
+ <Loading-animation></Loading-animation>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{ row }" slot="action">
|
|
|
+ <Tooltip content="详情" placement="top">
|
|
|
+ <i class="iconfont icon-xiangqingmingxi" style="cursor:pointer;color:#B8B532;fontSize:20px;marginRight:6px" @click="detailClick(row)"></i>
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip content="编辑" placement="top">
|
|
|
+ <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip content="删除" placement="top">
|
|
|
+ <i class="iconfont icon-shanchu" style="cursor:pointer;color:#E92E2E;fontSize:20px;marginRight:6px" @click="delClick(row)"></i>
|
|
|
+ </Tooltip>
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
</div>
|
|
|
<Page :total="tableTotal" :current="tableParams.pageNum" :page-size="tableParams.pageSize" @on-change="changePage" @on-page-size-change="sizeChange" show-elevator class="common-page"/>
|
|
|
<Modal
|
|
@@ -35,42 +67,37 @@
|
|
|
width="34"
|
|
|
ref="modalGrag"
|
|
|
draggable
|
|
|
+ reset-drag-position
|
|
|
+ @on-visible-change="modalChange"
|
|
|
:mask-closable="false"
|
|
|
class-name="common-modal">
|
|
|
- <!-- :rules="ruleValidate" -->
|
|
|
- <Form class="common-form" ref="formOption" :model="formOption" :label-width="120">
|
|
|
- <FormItem label="归属线路:" prop="lineName">
|
|
|
- <Select v-model="formOption.lineName" placeholder="线路">
|
|
|
- <Option v-for="item in typeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120">
|
|
|
+ <FormItem label="归属线路:" prop="lineId">
|
|
|
+ <Select v-model="formOption.lineId" placeholder="线路" @on-change="selectModalLine" label-in-value>
|
|
|
+ <Option v-for="item in lineTypeData" :value="String(item.id)" :key="item.id">{{ item.lineName }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="归属站点:" prop="stationName">
|
|
|
- <Select v-model="formOption.station" placeholder="线路">
|
|
|
- <Option v-for="item in typeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ <FormItem label="归属站点:" prop="stationId">
|
|
|
+ <Select v-model="formOption.stationId" placeholder="站点" @on-change="selectModalStation" label-in-value>
|
|
|
+ <Option v-for="item in stationTypeData" :value="String(item.id)" :key="item.id">{{ item.stationName }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="应用ID:" prop="station">
|
|
|
+ <FormItem label="应用ID:">
|
|
|
<span v-show="title=='新增应用'">系统自动生成,唯一不重复</span>
|
|
|
- <span v-show="title=='编辑应用'"></span>
|
|
|
+ <span v-show="title=='编辑应用'">{{formOption.appCode}}</span>
|
|
|
</FormItem>
|
|
|
- <FormItem label="应用名称:" prop="station">
|
|
|
- <Input v-model="formOption.station" maxlength="100" show-word-limit />
|
|
|
+ <FormItem label="应用名称:" prop="appName">
|
|
|
+ <Input v-model="formOption.appName" maxlength="100" show-word-limit />
|
|
|
</FormItem>
|
|
|
- <FormItem label="层级:" prop="station">
|
|
|
- <Select v-model="formOption.station" placeholder="线路">
|
|
|
- <Option v-for="item in typeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
|
+ <FormItem label="层级:" prop="level">
|
|
|
+ <Select v-model="formOption.level" placeholder="层级" @on-change="selectModalLevel" label-in-value>
|
|
|
+ <Option v-for="item in levelModalData" :value="String(item.id)" :key="item.id">{{ item.value }}</Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem label="服务器名称:" prop="station">
|
|
|
- <Input v-model="formOption.station" maxlength="20" show-word-limit />
|
|
|
- </FormItem>
|
|
|
- <FormItem label="IP地址:" prop="station" v-show="title == '新增线路'">
|
|
|
- <Input v-model="formOption.station" />
|
|
|
- </FormItem>
|
|
|
</Form>
|
|
|
<div slot="footer">
|
|
|
<Button @click="modalCancel">取消</Button>
|
|
|
- <Button type="primary" @click="modalOk">确定</Button>
|
|
|
+ <Button type="primary" @click="modalOk('formOption')">确定</Button>
|
|
|
</div>
|
|
|
</Modal>
|
|
|
<Modal
|
|
@@ -79,6 +106,7 @@
|
|
|
width="30"
|
|
|
ref="modalGrag"
|
|
|
draggable
|
|
|
+ reset-drag-position
|
|
|
:mask-closable="false"
|
|
|
class-name="common-modal">
|
|
|
<Icon type="ios-information-circle" :style="{ color: activeColor}" class="modal-icon"></Icon>
|
|
@@ -94,313 +122,199 @@
|
|
|
width="45"
|
|
|
ref="modalGrag"
|
|
|
draggable
|
|
|
+ reset-drag-position
|
|
|
footer-hide
|
|
|
:mask-closable="false"
|
|
|
- class-name="common-modal">
|
|
|
+ class-name="common-modal common-modal-detail">
|
|
|
<Tabs :value="currentModalTabs" @on-click="tabsClick" class="common-tabs">
|
|
|
<TabPane v-for="tab in tabsModalData" :key="tab.label" :label="tab.label" :name="tab.label"></TabPane>
|
|
|
</Tabs>
|
|
|
<div v-if="currentModalTabs =='基础信息'" class="modal-tabs-item">
|
|
|
- <div v-for="(item,index) in detailLabel" :key="index">
|
|
|
<div class="common-modal-content">
|
|
|
- <div class="modal-content-item" v-for="(val,i) in item.arr" :key="i" :class="{'modal-content-item-last': val.name == '说明'}">
|
|
|
+ <div class="modal-content-item" :class="{'item-especial': item.name == '层级'}" v-for="(item,index) in detailLabel" :key="index">
|
|
|
<span class="modal-content-item-name">
|
|
|
- {{val.name}}
|
|
|
+ {{item.name}}
|
|
|
</span>
|
|
|
- <span class="modal-content-item-value">4号线</span>
|
|
|
+ <span class="modal-content-item-value">{{item.value}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
- <Table :columns="columns" :data="data1" class="common-table modal-tabs-item" :row-class-name="rowClassName" v-if="currentModalTabs =='关联设备类型'"></Table>
|
|
|
- <Table :columns="columns" :data="data1" class="common-table modal-tabs-item" :row-class-name="rowClassName" v-if="currentModalTabs =='关联仪表类型'"></Table>
|
|
|
+ <rolling-detail-table :columns1="columnsEquip" apiUrl="metroapi/application/equipmentTypeInfo" ref="detailTable"
|
|
|
+ class="rolling-detail-table" v-if="currentModalTabs =='关联设备类型'"></rolling-detail-table>
|
|
|
+ <!-- <Table :columns="columnsEquip" :data="equipTableData" class="common-table modal-tabs-item modal-table" no-data-text="" :row-class-name="rowClassName" v-if="currentModalTabs =='关联设备类型'" :loading="modalLoading">
|
|
|
+ <template slot="loading">
|
|
|
+ <Loading-animation></Loading-animation>
|
|
|
+ </template>
|
|
|
+ </Table> -->
|
|
|
</Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+const defaultFrom = {lineId: '',lineName: '',stationId: '',stationName: '',appName: '',level:''}
|
|
|
export default {
|
|
|
name: "ApplicationStation",
|
|
|
components:{
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- tableParams: {
|
|
|
+ loading: true,
|
|
|
+ modalLoading: true,
|
|
|
+ // tableParams: {
|
|
|
+ // level: '',
|
|
|
+ // lineId: '-1',
|
|
|
+ // stationId: '-1',
|
|
|
+ // equipmentCheck: '-1',
|
|
|
+ // instrumentCheck: '-1',
|
|
|
+ // pageNum: 1,
|
|
|
+ // pageSize: 10
|
|
|
+ // },
|
|
|
+ tableParams: {
|
|
|
level: '',
|
|
|
- lineName: '',
|
|
|
- stationName: '',
|
|
|
+ lineId: '',
|
|
|
+ stationId: '',
|
|
|
equipmentCheck: '',
|
|
|
instrumentCheck: '',
|
|
|
- pageSize: 1,
|
|
|
- pageNum: 10
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
},
|
|
|
- tableTotal: 100,
|
|
|
- cityList: [
|
|
|
- {
|
|
|
- value: 'New York',
|
|
|
- label: 'New York'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'London',
|
|
|
- label: 'London'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Sydney',
|
|
|
- label: 'Sydney'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Ottawa',
|
|
|
- label: 'Ottawa'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Paris',
|
|
|
- label: 'Paris'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Canberra',
|
|
|
- label: 'Canberra'
|
|
|
- }
|
|
|
+ tableData: [],
|
|
|
+ tableTotal: 0,
|
|
|
+ rowObj: {},
|
|
|
+ levelData: [],
|
|
|
+ lineTypeData: [],
|
|
|
+ stationTypeData: [],
|
|
|
+ equipmentCheckData: [
|
|
|
+ {
|
|
|
+ value: '-1',
|
|
|
+ label: '接入设备'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '有'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label: '无'
|
|
|
+ },
|
|
|
],
|
|
|
- data1: [
|
|
|
- {
|
|
|
- name: 'John',
|
|
|
- age: 1,
|
|
|
- address: 'New York No.',
|
|
|
- date: '2016-10-03'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Jim',
|
|
|
- age: 2,
|
|
|
- address: 'London No.',
|
|
|
- date: '2016-10-01'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Joe',
|
|
|
- age: 3,
|
|
|
- address: 'Sydney No.',
|
|
|
- date: '2016-10-02'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Jon',
|
|
|
- age: 2,
|
|
|
- address: 'Ottawa No.',
|
|
|
- date: '2016-10-04'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'John',
|
|
|
- age: 1,
|
|
|
- address: 'New York No.',
|
|
|
- date: '2016-10-03'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Jim',
|
|
|
- age: 2,
|
|
|
- address: 'London No.',
|
|
|
- date: '2016-10-01'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Joe',
|
|
|
- age: 3,
|
|
|
- address: 'Sydney No.',
|
|
|
- date: '2016-10-02'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Jon',
|
|
|
- age: 2,
|
|
|
- address: 'Ottawa No.',
|
|
|
- date: '2016-10-04'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Joe',
|
|
|
- age: 3,
|
|
|
- address: 'Sydney No',
|
|
|
- date: '2016-10-02'
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'Jon',
|
|
|
- age: 2,
|
|
|
- address: '合肥城市轨道交通有限公司',
|
|
|
- date: '2016-10-04'
|
|
|
- },
|
|
|
+ instrumentData: [
|
|
|
+ {
|
|
|
+ value: '-1',
|
|
|
+ label: '接入仪表'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '1',
|
|
|
+ label: '有'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: '0',
|
|
|
+ label: '无'
|
|
|
+ },
|
|
|
],
|
|
|
columns: [
|
|
|
{
|
|
|
- title: '线路序号',
|
|
|
- width: 100,
|
|
|
- key: 'name',
|
|
|
+ title: '应用ID',
|
|
|
+ key: 'appCode',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '线路名称',
|
|
|
- key: 'age',
|
|
|
- width: 100,
|
|
|
+ title: '应用名称',
|
|
|
+ key: 'appName',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '当前线路长度(km)',
|
|
|
- key: 'address',
|
|
|
+ title: '层级',
|
|
|
+ key: 'levelDesc',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '站点数量',
|
|
|
- key: 'name',
|
|
|
+ title: '归属线路',
|
|
|
+ key: 'lineName',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '运营机构',
|
|
|
- key: 'address',
|
|
|
+ title: '归属站点',
|
|
|
+ key: 'stationName',
|
|
|
align: 'center',
|
|
|
ellipsis: true,
|
|
|
tooltip: true
|
|
|
},
|
|
|
{
|
|
|
- title: '线路类型',
|
|
|
- key: 'address',
|
|
|
+ title: '接入设备数量',
|
|
|
+ key: 'equipmentNum',
|
|
|
align: 'center'
|
|
|
},
|
|
|
- {
|
|
|
- title: '启用状态',
|
|
|
- key: 'age',
|
|
|
- align: 'center',
|
|
|
- width: 120,
|
|
|
- render: (h, params) => {
|
|
|
- const parisEnb = params.row.age == 1 ? true:false
|
|
|
- return h('div', [
|
|
|
- h('i-switch', {
|
|
|
- props: { value: parisEnb,'true-color': '#57C44F',
|
|
|
- },
|
|
|
- on: {
|
|
|
- input: function (event) {
|
|
|
- console.log(event)
|
|
|
- params.row.isEnabled = event
|
|
|
- },
|
|
|
- 'on-change': (val)=> {
|
|
|
- console.log(params.row)
|
|
|
- console.log('click')
|
|
|
- }
|
|
|
- },
|
|
|
- nativeOn:{
|
|
|
- "mousedown":(event)=>{ // 监听组件原生事件mousedown,此事件在click之前触发
|
|
|
- console.log(params.row)
|
|
|
- this.rowObj = params.row
|
|
|
- if (!parisEnb) {
|
|
|
- this.commonTitle = '确认启用'
|
|
|
- this.activeColor = '#57C44F'
|
|
|
- this.activeClass = 'icon-qiyong'
|
|
|
- this.modalTitle = '启用后此线路统计数据将在各管理模块及前端显示页面生效。'
|
|
|
- this.modalStatus = true
|
|
|
- } else {
|
|
|
- this.commonTitle = '确认关闭'
|
|
|
- this.activeColor = '#E92E2E'
|
|
|
- this.activeClass = 'icon-guanbi'
|
|
|
- this.modalTitle = '关闭后线路下所有站点将同时关闭,线路及站点统计数据不可见。'
|
|
|
- this.modalStatus = true
|
|
|
- }
|
|
|
- // thatValue.switchOneInfo = {
|
|
|
- // name:params.row.name,
|
|
|
- // is_show:params.row.is_show
|
|
|
- // }
|
|
|
- },
|
|
|
- }
|
|
|
- }),
|
|
|
- ])
|
|
|
- }
|
|
|
- },
|
|
|
- { title: "操作", key: "action", align: 'center',
|
|
|
- render: (h, params) => {
|
|
|
- return h('div',[
|
|
|
- h('Tooltip', {
|
|
|
- props: { placement: 'top' },
|
|
|
- }, [
|
|
|
- h('span', { slot: 'content', style: { whiteSpace: 'normal', wordBreak: 'break-all' } },'详情'),
|
|
|
- h('i',{style: { cursor:'pointer',color:'#B8B532',fontSize:'20px',marginRight:'6px'},
|
|
|
- on: {
|
|
|
- click: () => {
|
|
|
- this.detailStatus = true
|
|
|
- }
|
|
|
- },
|
|
|
- class: 'iconfont icon-xiangqingmingxi'})]),
|
|
|
- h('Tooltip', {
|
|
|
- props: { placement: 'top' },
|
|
|
- }, [
|
|
|
- h('span', { slot: 'content', style: { whiteSpace: 'normal', wordBreak: 'break-all' } },'编辑'),
|
|
|
- h('i',{style: { cursor:'pointer',color:'#64ACFE',fontSize:'20px',marginRight:'6px'},
|
|
|
- on: {
|
|
|
- click: () => {
|
|
|
- this.title = '编辑应用'
|
|
|
- this.showModal = true
|
|
|
- }
|
|
|
- },
|
|
|
- class: 'iconfont icon-bianji'})]),
|
|
|
- h('Tooltip', {
|
|
|
- props: { placement: 'top' },
|
|
|
- }, [
|
|
|
- h('span', { slot: 'content', style: { whiteSpace: 'normal', wordBreak: 'break-all' } },'编辑'),
|
|
|
- h('i',{style: { cursor:'pointer',color:'#E92E2E',fontSize:'20px',marginRight:'6px'},
|
|
|
- on: {
|
|
|
- click: () => {
|
|
|
- this.commonTitle = '确认删除'
|
|
|
- this.modalTitle = '只能删除没有关联设备类型和仪表类型的应用,删除不影响已产生的操作和记录。'
|
|
|
- this.modalStatus = true
|
|
|
- }
|
|
|
- },
|
|
|
- class: 'iconfont icon-shanchu'}),
|
|
|
- ])
|
|
|
- ])
|
|
|
- }
|
|
|
- },
|
|
|
- ],
|
|
|
- typeList: [
|
|
|
- {
|
|
|
- value: 'New York',
|
|
|
- label: 'New York'
|
|
|
- },
|
|
|
{
|
|
|
- value: 'London',
|
|
|
- label: 'London'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Sydney',
|
|
|
- label: 'Sydney'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Ottawa',
|
|
|
- label: 'Ottawa'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Paris',
|
|
|
- label: 'Paris'
|
|
|
+ title: '接入监测仪表',
|
|
|
+ key: 'instrumentNum',
|
|
|
+ align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- value: 'Canberra',
|
|
|
- label: 'Canberra'
|
|
|
- }
|
|
|
- ],
|
|
|
- tableTotal: 100,
|
|
|
+ title: '操作',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'action',
|
|
|
+ width: 120,
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ tableTotal: 0,
|
|
|
showModal: false,
|
|
|
detailStatus: false,
|
|
|
modalStatus: false,
|
|
|
- title: '新增线路',
|
|
|
+ title: '新增应用',
|
|
|
commonTitle: "确认删除",
|
|
|
activeColor: '#E92E2E',
|
|
|
activeClass: '',
|
|
|
modalTitle: '',
|
|
|
- formOption: {line: null,station: null,equipmentName: 1,type:'',switch:false},
|
|
|
+ formOption: {lineId: '',lineName: '',stationId: '',stationName: '',appName: '',level:''},
|
|
|
ruleValidate: {
|
|
|
- line: [{
|
|
|
- type: 'number',
|
|
|
- message: '请选择线路',
|
|
|
+ lineId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择所属线路',
|
|
|
+ trigger: 'change'
|
|
|
+ }],
|
|
|
+ stationId: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择所属站点',
|
|
|
trigger: 'change'
|
|
|
}],
|
|
|
- station: [{
|
|
|
+ appName: [{
|
|
|
required: true,
|
|
|
- type: 'number',
|
|
|
- message: '请选择站点',
|
|
|
+ message: '请输入应用名称',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
+ level: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择层级',
|
|
|
trigger: 'change'
|
|
|
}]
|
|
|
},
|
|
|
+ levelModalData: [],
|
|
|
currentModalTabs:'基础信息',
|
|
|
- tabsModalData: [{label:'基础信息'},{label:'关联设备类型'},{label:'关联仪表类型'}],
|
|
|
- detailLabel: [{name:'基础信息',arr:[{name: '线路名称',value:0},{name: '线路序号',value:0},{name: '上级节点',value:0},{name: '启用状态',value:0},{name: '运营机构',value:0},{name: '线路类型',value:0},{name: '说明',value:0}]}]
|
|
|
+ tabsModalData: [{label:'基础信息'},{label:'关联设备类型'}],
|
|
|
+ detailLabel: [],
|
|
|
+ columnsEquip: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ type: 'index',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '设备类型名称',
|
|
|
+ key: 'equipmentName',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '监测模型指标数',
|
|
|
+ key: 'equipmentNum',
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // equipTableData: [],
|
|
|
+ detailParams: {
|
|
|
+ applicationId: "",
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -416,39 +330,265 @@ export default {
|
|
|
// 分页
|
|
|
changePage (val) {
|
|
|
this.tableParams.pageNum = val
|
|
|
- // this.getTableData()
|
|
|
+ this.getTableData()
|
|
|
},
|
|
|
//跳转
|
|
|
sizeChange (val) {
|
|
|
this.tableParams.pageSize = val
|
|
|
- // this.getTableData()
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ getType () {
|
|
|
+ //获取所属线路
|
|
|
+ this.$get('metroapi/lineStation/queryLine', {lineName:''}).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.lineTypeData = res.data
|
|
|
+ this.lineTypeData.unshift({ id: '-1', lineName: '线路' })
|
|
|
+ this.getStationData ('-1')
|
|
|
+ } else {
|
|
|
+ this.lineTypeData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 获取层级
|
|
|
+ this.$get('metroapi/dic/queryDictionary', {name:'层级类型'}).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.levelData = res.data
|
|
|
+ } else {
|
|
|
+ this.levelData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectLine (val) {
|
|
|
+ // 获取站点类型
|
|
|
+ this.tableParams.stationId = ''
|
|
|
+ this.tableParams.lineId = val.value
|
|
|
+ if (this.tableParams.lineId) {
|
|
|
+ this.getStationData(val.value)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取所属站点
|
|
|
+ getStationData (lineId) {
|
|
|
+ if(lineId == '-1') {
|
|
|
+ this.stationTypeData = [{ id: '-1', stationName: '站点' }]
|
|
|
+ } else {
|
|
|
+ this.$get('metroapi/lineStation/queryStationByLineId', {lineId:lineId}).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.stationTypeData = res.data
|
|
|
+ this.stationTypeData.unshift({ id: '-1', stationName: '站点' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取表格数据
|
|
|
+ getTableData () {
|
|
|
+ let params = JSON.parse(JSON.stringify(this.tableParams))
|
|
|
+ params.lineId = params.lineId == '-1' ? '':params.lineId
|
|
|
+ params.stationId = params.stationId == '-1' ?'':params.stationId
|
|
|
+ params.equipmentCheck = params.equipmentCheck == '-1' ?'':params.equipmentCheck
|
|
|
+ params.instrumentCheck = params.instrumentCheck == '-1' ?'':params.instrumentCheck
|
|
|
+ this.loading = true
|
|
|
+ this.$get('metroapi/application/info/list', params).then(res=>{
|
|
|
+ this.loading = false
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.tableData = res.data.data
|
|
|
+ this.tableTotal = res.data.count
|
|
|
+ if (res.data.data.length==0 && this.tableParams.pageNum>1) {
|
|
|
+ this.tableParams.pageNum--
|
|
|
+ return this.getTableData()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.tableData = []
|
|
|
+ this.tableTotal = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectModalLine (val) {
|
|
|
+ this.formOption.stationId = ''
|
|
|
+ this.formOption.level = ''
|
|
|
+ if (val) {
|
|
|
+ this.formOption.lineName = val.label
|
|
|
+ this.formOption.lineId =val.value
|
|
|
+ this.getStationData(val.value)
|
|
|
+ }
|
|
|
+ this.levelModalData = this.getCurrentLevel()
|
|
|
+ },
|
|
|
+ selectModalStation (val) {
|
|
|
+ if (val) {
|
|
|
+ this.formOption.stationName = val.label
|
|
|
+ this.formOption.stationId =val.value
|
|
|
+ this.levelModalData = this.getCurrentLevel()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectModalLevel (val) {
|
|
|
+ if (val) {
|
|
|
+ this.formOption.levelDesc = val.label
|
|
|
+ this.formOption.level =val.value
|
|
|
+ }
|
|
|
},
|
|
|
+ // 获取对话框层级数据
|
|
|
+ getCurrentLevel () {
|
|
|
+ let arr = []
|
|
|
+ if (this.formOption.lineId == '-1') {
|
|
|
+ if (this.formOption.stationId == '' || this.formOption.stationId == '-1') {
|
|
|
+ arr = [{value:'线网',id:'9'}]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.formOption.stationId == '' || this.formOption.stationId == '-1') {
|
|
|
+ arr = [{value:'线路',id:'8'}]
|
|
|
+ } else {
|
|
|
+ arr = [{value:'站点',id:'7'}]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return arr
|
|
|
+ },
|
|
|
+ searchClick () {
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ resetClick (name) {
|
|
|
+ this.$refs[name].resetFields()
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
addClick () {
|
|
|
+ this.formOption = JSON.parse(JSON.stringify(defaultFrom))
|
|
|
this.title = '新增应用'
|
|
|
this.showModal = true
|
|
|
- this.$refs.modalGrag.dragData.x = null
|
|
|
- this.$refs.modalGrag.dragData.y = null
|
|
|
},
|
|
|
- modalOk () {
|
|
|
- this.showModal = false
|
|
|
+ detailClick (row) {
|
|
|
+ this.rowObj = row
|
|
|
+ this.currentModalTabs = '基础信息'
|
|
|
+ this.detailStatus = true
|
|
|
+ this.$get('metroapi/application/info', {appCode:row.appCode}).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.detailLabel = res.data
|
|
|
+ } else {
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editClick (row) {
|
|
|
+ this.rowObj = row
|
|
|
+ this.formOption = JSON.parse(JSON.stringify(row));
|
|
|
+ this.formOption.lineId = this.formOption.lineId ? String(this.formOption.lineId) : '-1'
|
|
|
+ this.formOption.stationId = this.formOption.stationId ? String(this.formOption.stationId) : '-1'
|
|
|
+ this.formOption.level = String(this.formOption.level)
|
|
|
+ this.getStationData(this.formOption.lineId)
|
|
|
+ this.levelModalData = this.getCurrentLevel()
|
|
|
+ this.title = '编辑应用'
|
|
|
+ this.showModal = true
|
|
|
+ },
|
|
|
+ delClick (row) {
|
|
|
+ this.rowObj = row
|
|
|
+ this.commonTitle = '确认删除'
|
|
|
+ this.activeColor = '#E92E2E'
|
|
|
+ this.activeClass = ''
|
|
|
+ this.modalTitle = '只能删除没有关联设备类型和仪表类型的应用,删除不影响已产生的操作和记录。'
|
|
|
+ this.modalStatus = true
|
|
|
+ },
|
|
|
+ modalChange (modalStatus) {
|
|
|
+ if (!modalStatus) {
|
|
|
+ this.$refs.formOption.resetFields();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ modalOk (formName) {
|
|
|
+ let params = JSON.parse(JSON.stringify(this.formOption)) //把对象中的数据给了某个变量,改变一个对象的值,另一个对象也变化的解决方法
|
|
|
+ params.lineId = params.lineId == '-1' ? null:params.lineId
|
|
|
+ params.lineName = params.lineName == '线路' ? null:params.lineName
|
|
|
+ params.stationId = params.stationId == '-1' ? null:params.stationId
|
|
|
+ params.stationName = params.stationName == '站点' ? null:params.stationName
|
|
|
+ if (this.title == '新增应用') {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$post('metroapi/application/addApp', params).then(res=>{
|
|
|
+ if ( res.httpCode == 1 ){
|
|
|
+ this.showModal = false
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ this.getTableData()
|
|
|
+ } else {
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.showModal = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ params.lineName = params.lineName == '/' ? null:params.lineName
|
|
|
+ params.stationName = params.stationName == '/' ? null:params.stationName
|
|
|
+ this.$post('metroapi/application/addApp', params).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.showModal = false
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ this.getTableData()
|
|
|
+ } else {
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.showModal = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
modalCancel () {
|
|
|
this.showModal = false
|
|
|
},
|
|
|
commonOk () {
|
|
|
- this.modalStatus = false
|
|
|
+ let params = {
|
|
|
+ applicationId: this.rowObj.id
|
|
|
+ }
|
|
|
+ this.delData(params)
|
|
|
},
|
|
|
commonCancel () {
|
|
|
this.modalStatus = false
|
|
|
},
|
|
|
+ // 删除 关闭/接口
|
|
|
+ delData (params) {
|
|
|
+ this.$post('metroapi/application/deleteApp',params).then(res=>{
|
|
|
+ if (res.httpCode == 1 ){
|
|
|
+ this.modalStatus = false
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ this.getTableData()
|
|
|
+ } else {
|
|
|
+ this.$Message.info(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
tabsClick (name) {
|
|
|
this.currentModalTabs = name
|
|
|
- }
|
|
|
-
|
|
|
+ if (this.currentModalTabs == '关联设备类型') {
|
|
|
+ // this.equipDetail (this.rowObj)
|
|
|
+ this.detailParams.applicationId = this.rowObj.id
|
|
|
+ this.$nextTick(() => {
|
|
|
+ document.querySelector(".common-modal-detail .ivu-table-body").scrollTo(0, 0)
|
|
|
+ this.$refs.detailTable.getChartsDetail(this.detailParams)
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // equipDetail (row) {
|
|
|
+ // this.modalLoading = true
|
|
|
+ // let params = {
|
|
|
+ // pageNum: 1,
|
|
|
+ // pageSize: 9999,
|
|
|
+ // applicationId: row.id
|
|
|
+ // }
|
|
|
+ // this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
|
|
|
+ // this.modalLoading = false
|
|
|
+ // if ( res.httpCode == 1 ){
|
|
|
+ // this.equipTableData = res.data.data
|
|
|
+ // } else {
|
|
|
+ // this.equipTableData = []
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="stylus">
|
|
|
+.content-main-manage {
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
.search-list {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
@@ -458,7 +598,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
.ivu-select {
|
|
|
- width: 160px;
|
|
|
+ width: 150px;
|
|
|
padding-right: 10px;
|
|
|
height: 32px;
|
|
|
}
|
|
@@ -474,19 +614,46 @@ export default {
|
|
|
max-height: 100%;
|
|
|
}
|
|
|
>>> .common-table .ivu-table th {
|
|
|
- height: 56px;
|
|
|
+ height: 53px;
|
|
|
}
|
|
|
>>> .common-table .ivu-table td {
|
|
|
- height: 55.5px;
|
|
|
+ height: 53px;
|
|
|
+ }
|
|
|
+ >>> .ivu-spin-fix {
|
|
|
+ top: 53px;
|
|
|
+ }
|
|
|
+ >>> .app-table .ivu-spin-fix {
|
|
|
+ height: calc(100vh - 355px);
|
|
|
+ }
|
|
|
+ >>> .ivu-table-tip {
|
|
|
+ background: url('../../../assets/images/noData.png') no-repeat center;
|
|
|
+}
|
|
|
+>>> .app-table .ivu-table-tip {
|
|
|
+ height: calc(100vh - 355px);
|
|
|
+ }
|
|
|
+ >>> .modal-table {
|
|
|
+ overflow: auto !important;
|
|
|
+ }
|
|
|
+ >>> .modal-table .ivu-spin-fix {
|
|
|
+ height: 200px;
|
|
|
+ }
|
|
|
+ >>> .modal-table .ivu-table-tip {
|
|
|
+ height: 200px;
|
|
|
}
|
|
|
.common-page {
|
|
|
margin-top: 15px;
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ right: 0;
|
|
|
}
|
|
|
>>> .modal-tabs-item {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+// >>> .common-modal .ivu-modal-body {
|
|
|
+// min-height: 243px;
|
|
|
+// }
|
|
|
>>> .common-modal-content {
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
@@ -499,7 +666,7 @@ export default {
|
|
|
width: 50%;
|
|
|
display: flex;
|
|
|
}
|
|
|
->>> .modal-content-item-last {
|
|
|
+>>> .item-especial {
|
|
|
width: 100%;
|
|
|
}
|
|
|
>>> .modal-content-item-name {
|
|
@@ -526,7 +693,7 @@ export default {
|
|
|
color: #F5F5F5;
|
|
|
padding-left: 20px;
|
|
|
}
|
|
|
->>> .modal-content-item-last .modal-content-item-name{
|
|
|
+>>> .item-especial .modal-content-item-name{
|
|
|
width: 25%;
|
|
|
height: auto;
|
|
|
min-height: 45px;
|
|
@@ -534,7 +701,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
}
|
|
|
->>> .modal-content-item-last .modal-content-item-value{
|
|
|
+>>> .item-especial .modal-content-item-value{
|
|
|
width: 75%;
|
|
|
height: auto;
|
|
|
min-height: 45px;
|