|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <div class="filter-container" style="padding-bottom:0px">
|
|
|
+ <div class="filter-container" style="padding-bottom: 0px">
|
|
|
<div class="search-box-area" id="searchBox">
|
|
|
<div class="search-item">
|
|
|
<el-cascader
|
|
@@ -18,8 +18,8 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<el-input
|
|
|
- v-model="queryParam.name"
|
|
|
- placeholder="基站名称"
|
|
|
+ v-model="queryParam.number"
|
|
|
+ placeholder="编号"
|
|
|
clearable
|
|
|
class="filter-item form-search-input fl"
|
|
|
@keyup.enter.native="handleSearch"
|
|
@@ -27,8 +27,8 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<el-input
|
|
|
- v-model="queryParam.mac"
|
|
|
- placeholder="基站Mac"
|
|
|
+ v-model="queryParam.name"
|
|
|
+ placeholder="名称"
|
|
|
clearable
|
|
|
class="filter-item form-search-input fl"
|
|
|
@keyup.enter.native="handleSearch"
|
|
@@ -36,55 +36,57 @@
|
|
|
</div>
|
|
|
<div class="search-item">
|
|
|
<el-input
|
|
|
- v-model="queryParam.shortcode"
|
|
|
- placeholder="基站简码"
|
|
|
+ v-model="queryParam.model"
|
|
|
+ placeholder="型号"
|
|
|
clearable
|
|
|
- style="width:180px"
|
|
|
class="filter-item form-search-input fl"
|
|
|
@keyup.enter.native="handleSearch"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <div class="search-item">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParam.is_used"
|
|
|
+ placeholder="使用状态"
|
|
|
+ class="filter-item form-search-input fl"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option value="0" label="未使用">未使用</el-option>
|
|
|
+ <el-option value="1" label="已使用">已使用</el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="search-operate-area">
|
|
|
<!-- <el-input v-model="queryParam.code" placeholder="唯一编码" clearable class="filter-item form-search-input fl" /> -->
|
|
|
- <el-button class="filter-item search fl" icon="el-icon-search" @click="handleSearch">搜索</el-button>
|
|
|
- <el-button class="filter-item fl" icon="el-icon-refresh" @click="handleRefresh">重置</el-button>
|
|
|
- <!-- <el-button
|
|
|
+ <el-button
|
|
|
+ class="filter-item search fl"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="handleSearch"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="filter-item fl"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ @click="handleRefresh"
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
class="filter-item search fl"
|
|
|
- :icon="this.searchDisplay?'el-icon-arrow-up':'el-icon-arrow-down'"
|
|
|
+ :icon="this.searchDisplay ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
|
|
|
@click="searchDis"
|
|
|
- >{{word}}</el-button> -->
|
|
|
+ >{{ word }}</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class="list-operate-area">
|
|
|
- <!-- 动态隐藏显示列 -->
|
|
|
-
|
|
|
- <el-popover
|
|
|
- placement="bottom"
|
|
|
- min-width="80"
|
|
|
- trigger="click"
|
|
|
- popper-class="col-setting-popover"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- slot="reference"
|
|
|
- icon="el-icon-setting"
|
|
|
- class="filter-item search fl"
|
|
|
- >列设置</el-button>
|
|
|
- <!-- <div class="col-setting-title">选择表列</div> -->
|
|
|
- <el-checkbox-group v-model="visibleIndexs" :min="1" class="col-setting-group">
|
|
|
- <el-checkbox
|
|
|
- v-for="colInfo in columnInfos"
|
|
|
- :label="colInfo.index"
|
|
|
- :key="colInfo.index"
|
|
|
- :disabled="colInfo.disabled"
|
|
|
- v-show="!colInfo.disabled || showAlwaysShowColumnInCheckbox"
|
|
|
- >{{ colInfo.label }}</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- </el-popover>
|
|
|
-
|
|
|
- <el-button
|
|
|
+ <!-- <el-button size="mini" class="filter-item search fl" icon="el-icon-plus" @click="handleCreate">添加</el-button> -->
|
|
|
+ <el-button
|
|
|
+ class="filter-item search fl"
|
|
|
+ icon="el-icon-setting"
|
|
|
+ @click="showColumnOption"
|
|
|
+ >列设置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
class="filter-item search fl"
|
|
|
icon="el-icon-refresh-right"
|
|
|
- style="margin-left:10px"
|
|
|
@click="refresh"
|
|
|
>刷新</el-button
|
|
|
>
|
|
@@ -94,52 +96,50 @@
|
|
|
:data="data"
|
|
|
v-loading="loading"
|
|
|
ref="multipleTable"
|
|
|
- :columnVisibles="columnVisibles"
|
|
|
- @selection-change="handleSelectMulti"
|
|
|
- :showAlwaysShowColumnInCheckbox="true"
|
|
|
- :dynamicColumnSetting="true"
|
|
|
+ @selection-change="hydraulicSelectMulti"
|
|
|
@sort-change="sortChange"
|
|
|
+ :dynamicColumnSetting="true"
|
|
|
tooltip-effect="dark"
|
|
|
style="width: 100%"
|
|
|
border
|
|
|
fit
|
|
|
>
|
|
|
- <el-table-column type="selection" v-if="columnVisibles[0]" fixed="left" width="55"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ fixed="left"
|
|
|
+ width="55"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column
|
|
|
prop="depart_name"
|
|
|
label="所属部门"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[1]"
|
|
|
+ v-if="showColumn.depart_name"
|
|
|
:show-overflow-tooltip="true"
|
|
|
+ width="150"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="name"
|
|
|
- label="基站名称"
|
|
|
+ prop="alarm_state_text"
|
|
|
+ label="告警状态"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[2]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="mac"
|
|
|
- label="基站mac"
|
|
|
- align="center"
|
|
|
- v-if="columnVisibles[3]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="140"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="shortcode"
|
|
|
- label="基站简码"
|
|
|
- align="center"
|
|
|
- v-if="columnVisibles[4]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
+ v-if="showColumn.alarm_state_text"
|
|
|
width="120"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot-scope="record">
|
|
|
+ <el-tag
|
|
|
+ effect="dark"
|
|
|
+ slot="reference"
|
|
|
+ :type="current_type[record.row.alarm_state] || ''"
|
|
|
+ size="small"
|
|
|
+ >{{ record.row.alarm_state_text }}</el-tag
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
prop="net_state"
|
|
|
label="在线状态"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[5]"
|
|
|
+ v-if="showColumn.net_state"
|
|
|
:show-overflow-tooltip="true"
|
|
|
width="120"
|
|
|
>
|
|
@@ -153,406 +153,277 @@
|
|
|
<el-tag type="danger" v-else>从未上线</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="open_status"
|
|
|
- label="基站状态"
|
|
|
- align="center"
|
|
|
- v-if="columnVisibles[6]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="record">
|
|
|
- <el-tag type="success" v-if="record.row.open_status == 1"
|
|
|
- >已开局</el-tag
|
|
|
- >
|
|
|
- <el-tag type="gray" v-else>未开局</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="online_time"
|
|
|
- label="在线时间"
|
|
|
+ prop="number"
|
|
|
+ label="编号"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[7]"
|
|
|
+ v-if="showColumn.number"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="200"
|
|
|
- sortable="custom"
|
|
|
+ width="150"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- prop="open_time"
|
|
|
- label="开局时间"
|
|
|
- align="center"
|
|
|
- v-if="columnVisibles[8]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="160"
|
|
|
- sortable="custom"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="open_user_name"
|
|
|
- label="开局员工"
|
|
|
- align="center"
|
|
|
- v-if="columnVisibles[9]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="created_at"
|
|
|
- label="入库时间"
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="名称"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[10]"
|
|
|
+ v-if="showColumn.name"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="160"
|
|
|
- sortable="custom"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- prop="creator_name"
|
|
|
- label="入库员工"
|
|
|
+ <el-table-column
|
|
|
+ prop="brand"
|
|
|
+ label="品牌"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[11]"
|
|
|
+ v-if="showColumn.brand"
|
|
|
:show-overflow-tooltip="true"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- prop="remark"
|
|
|
- label="备注"
|
|
|
+ <el-table-column
|
|
|
+ prop="supplier"
|
|
|
+ label="供应商"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[12]"
|
|
|
+ v-if="showColumn.supplier"
|
|
|
:show-overflow-tooltip="true"
|
|
|
+ width="120"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="model_text"
|
|
|
- label="基站型号"
|
|
|
+ prop="model"
|
|
|
+ label="型号"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[13]"
|
|
|
+ v-if="showColumn.model"
|
|
|
:show-overflow-tooltip="true"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="address"
|
|
|
- label="安装地址"
|
|
|
+ prop="out_date"
|
|
|
+ label="出厂日期"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[14]"
|
|
|
+ v-if="showColumn.out_date"
|
|
|
:show-overflow-tooltip="true"
|
|
|
+ width="150"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="sim_no"
|
|
|
- label="SIM卡号"
|
|
|
+ prop="is_used"
|
|
|
+ label="使用状态"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[15]"
|
|
|
+ v-if="showColumn.is_used"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="160"
|
|
|
- />
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <template slot-scope="record">
|
|
|
+ <el-tag type="danger" v-if="record.row.is_used == 0"
|
|
|
+ >未使用</el-tag
|
|
|
+ >
|
|
|
+ <el-tag type="success" v-else>已使用</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
- prop=" version"
|
|
|
- label="基站版本"
|
|
|
+ prop="online_time"
|
|
|
+ label="在线时间"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[16]"
|
|
|
+ v-if="showColumn.online_time"
|
|
|
+ width="200"
|
|
|
+ sortable
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="creator_user"
|
|
|
+ label="导入用户"
|
|
|
+ align="center"
|
|
|
+ v-if="showColumn.creator_user"
|
|
|
:show-overflow-tooltip="true"
|
|
|
- width="160"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- prop="longitude"
|
|
|
- label="经度"
|
|
|
+ <el-table-column
|
|
|
+ prop="created_at"
|
|
|
+ label="添加时间"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[17]"
|
|
|
+ v-if="showColumn.created_at"
|
|
|
:show-overflow-tooltip="true"
|
|
|
+ width="200"
|
|
|
+ sortable
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="latitude"
|
|
|
- label="纬度"
|
|
|
+ prop="remark"
|
|
|
+ label="备注"
|
|
|
align="center"
|
|
|
- v-if="columnVisibles[18]"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
+ v-if="showColumn.remark"
|
|
|
+ width="100"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
label="操作"
|
|
|
- min-width="240"
|
|
|
- v-if="columnVisibles[19]"
|
|
|
+ min-width="185"
|
|
|
align="center"
|
|
|
fixed="right"
|
|
|
>
|
|
|
<template slot-scope="record">
|
|
|
- <el-button type="primary" icon="el-icon-edit" @click="handleUpdate(record.row)"></el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" @click="handleDelete(record.row.id)"></el-button>
|
|
|
+ <el-tooltip
|
|
|
+ content="修改"
|
|
|
+ placement="top"
|
|
|
+ :enterable="false"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(record.row)"
|
|
|
+ ></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ content="查看"
|
|
|
+ placement="top"
|
|
|
+ :enterable="false"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-view"
|
|
|
+ @click="handleDetail(record.row)"
|
|
|
+ ></el-button>
|
|
|
+ </el-tooltip>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <transition name="fade">
|
|
|
+ <div class="columnOption" v-show="isShowColumn">
|
|
|
+ <div class="content">
|
|
|
+ <div class="head">选择显示字段</div>
|
|
|
+ <div class="body">
|
|
|
+ <el-checkbox v-model="checkList.depart_name" disabled>所属部门</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.alarm_state_text" disabled>告警状态</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.net_state">在线状态</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.number">编号</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.name">名称</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.brand">品牌</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.supplier">供应商</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.model">型号</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.out_date">出厂日期</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.is_used">使用状态</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.online_time">在线时间</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.creator_user">导入用户</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.created_at">添加时间</el-checkbox>
|
|
|
+ <el-checkbox v-model="checkList.remark">备注</el-checkbox>
|
|
|
+ </div>
|
|
|
+ <div class="footer">
|
|
|
+ <el-button size="small" type="primary" plain @click="saveColumn"
|
|
|
+ >保存列配置</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
- v-action="'Station@save'"
|
|
|
+ v-action="'Device@save'"
|
|
|
:loading="downloadLoading"
|
|
|
style="margin-top: 15px"
|
|
|
@click="handleCreate"
|
|
|
>添加</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
- type="warning"
|
|
|
- icon="el-icon-download"
|
|
|
- v-action="'Station@export_station'"
|
|
|
- :loading="downloadLoading"
|
|
|
- style="margin-top: 15px"
|
|
|
- @click="exportExcel"
|
|
|
- >导出</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- icon="el-icon-upload"
|
|
|
- v-action="'Station@import_station'"
|
|
|
- :loading="downloadLoading"
|
|
|
- style="margin-top: 15px"
|
|
|
- @click="importExcel"
|
|
|
- >导入</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
type="danger"
|
|
|
icon="el-icon-delete"
|
|
|
- v-if="selectedIds.length>0"
|
|
|
- style="margin-top:15px"
|
|
|
- v-action="'Station@delete'"
|
|
|
+ v-if="selectedIds.length > 0"
|
|
|
+ style="margin-top: 15px"
|
|
|
+ v-action="'Hydraulic@delete'"
|
|
|
@click="handleMultiDelete()"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
<el-pagination
|
|
|
background
|
|
|
class="pagination-container"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="paginate.current"
|
|
|
-
|
|
|
:page-sizes="paginate.sizes"
|
|
|
:page-size="paginate.limit"
|
|
|
:layout="paginate.layout"
|
|
|
:total="paginate.total"
|
|
|
/>
|
|
|
- <!--------------------------------- 新增 修改弹框------------------------------------------------------->
|
|
|
- <!-- 上传弹窗 -->
|
|
|
- <el-dialog
|
|
|
- title="导入基站"
|
|
|
- append-to-body
|
|
|
- width="400px"
|
|
|
- :visible.sync="uploadDialogVisible"
|
|
|
- custom-class="upload-dialog"
|
|
|
- >
|
|
|
- <el-cascader
|
|
|
- v-model="selectedDepartId"
|
|
|
- class="filter-item form-search-input fl"
|
|
|
- :options="departments"
|
|
|
- :props="{ checkStrictly: true, label: 'department_name', value: 'id' }"
|
|
|
- style="margin-bottom: 10px"
|
|
|
- placeholder="所属部门"
|
|
|
- @change="changeDepart"
|
|
|
- ></el-cascader>
|
|
|
- <el-select v-model="selectedModelId" placeholder="设备型号" @change="changeModel" style="margin-bottom: 10px">
|
|
|
- <el-option
|
|
|
- v-for="item in models"
|
|
|
- :key="item.value"
|
|
|
- :label="item.text"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- drag
|
|
|
- :action="actionUrl"
|
|
|
- :headers="headers"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- :show-file-list="true"
|
|
|
- :on-change="onchange"
|
|
|
- :on-remove="onremove"
|
|
|
- :on-exceed="onexeced"
|
|
|
- :limit="1"
|
|
|
- ref="upload"
|
|
|
- >
|
|
|
- <i class="el-icon-upload"></i>
|
|
|
- <div class="el-upload__text">
|
|
|
- 将文件拖到此处,或
|
|
|
- <em>点击上传</em>
|
|
|
- </div>
|
|
|
- <div class="el-upload__tip upload-tips" slot="tip">
|
|
|
- 只能上传xls/xlsx文件
|
|
|
- </div>
|
|
|
- </el-upload>
|
|
|
- <el-link
|
|
|
- type="primary"
|
|
|
- href="https://rlfd.oss-cn-hangzhou.aliyuncs.com/catch_fd/excel_temp/fd_stations.xls"
|
|
|
- style="margin-top: 10px"
|
|
|
- >下载模板</el-link
|
|
|
- >
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="uploadDialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="importStations" :loading="loadings">{{
|
|
|
- submitText
|
|
|
- }}</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <form-model
|
|
|
+ <form-model
|
|
|
@sendVal="closeDialog"
|
|
|
:formModelVisible="formVisible"
|
|
|
:title="title"
|
|
|
:ref="formName"
|
|
|
- :location="location"
|
|
|
/>
|
|
|
- <!-- <heartLogTable
|
|
|
- :displayVisible="tableFormVisible"
|
|
|
- @formCancel="heartTableCancle"
|
|
|
- :currentRecord="currentRecord"
|
|
|
- ref="heartLog"
|
|
|
- /> -->
|
|
|
- <bmap-model @sendVal="closeBmapDialog" :bmapModelVisible="bmapVisible" />
|
|
|
+ <detail
|
|
|
+ :detailVisible="detailVisible"
|
|
|
+ @sendVal="closeDrawer"
|
|
|
+ :data="detail"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import rlListOperate from "@/layout/rl-list-operate/rlListOperate";
|
|
|
-import formModel from "./formModel";
|
|
|
-import { getToken } from "../../../utils/auth";
|
|
|
import { action } from "@/directive/permission/index.js";
|
|
|
-// import heartLogTable from "./heartLogTable";
|
|
|
-import bmapModel from "./bmapModel.vue";
|
|
|
+import detail from "./detail.vue"
|
|
|
+import formModel from './formModel.vue'
|
|
|
export default {
|
|
|
- name: "station",
|
|
|
- mixins: [rlListOperate],
|
|
|
+ name: "hydraulic",
|
|
|
directives: { action },
|
|
|
+ mixins: [rlListOperate],
|
|
|
components: {
|
|
|
formModel,
|
|
|
- bmapModel,
|
|
|
- // heartLogTable
|
|
|
+ detail,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- url: "station",
|
|
|
+ url: "hydraulic",
|
|
|
queryParam: {
|
|
|
- department_id: "",
|
|
|
- mac: "",
|
|
|
- shortcode: "",
|
|
|
- name:''
|
|
|
+ number: "",
|
|
|
+ department_id: [],
|
|
|
+ name: "",
|
|
|
+ model: "",
|
|
|
+ is_used: ""
|
|
|
},
|
|
|
- exportUrl: "station/export_station", //导出url
|
|
|
- bmapVisible: false,
|
|
|
- location: "",
|
|
|
- formName: "station",
|
|
|
- formVisible: false,
|
|
|
- configFormVisible: false,
|
|
|
- // tableFormVisible: false,
|
|
|
- //导入请求url
|
|
|
- loadings: false,
|
|
|
- submitText: "确 定",
|
|
|
- uploadDialogVisible:false,
|
|
|
- actionUrl: process.env.VUE_APP_BASE_API + "/upload/file_excel",
|
|
|
- headers: { authorization: "Bearer " + getToken() },
|
|
|
- excel_url: "", //上传Excel返回的url
|
|
|
- selectedDepartId: "",
|
|
|
- selectedModelId:"",
|
|
|
-
|
|
|
- departments:[],
|
|
|
- models:[],
|
|
|
- currentRecord: {},
|
|
|
- tableVisible: false,
|
|
|
-
|
|
|
+ current_type: {
|
|
|
+ 0: "success",
|
|
|
+ 1: "danger",
|
|
|
+ },
|
|
|
+ formName:'hydraulic',
|
|
|
+ formVisible:false,
|
|
|
+ //搜索
|
|
|
searchDisplay: true,
|
|
|
+ departments: [],
|
|
|
|
|
|
- columnVisibles: new Array(20).fill(true), //初始为全true,并在每个列标签中使用v-if引用对应列下标的值。列下标从0开始。
|
|
|
- columnInfos: [], // 所有列的信息
|
|
|
- hidenColumnIndexs: [10,11,13,14,15,16,17,18], //初始隐藏的列的下标。列下标从 0 开始
|
|
|
- visibleIndexs: [], // 可见列的下标集合
|
|
|
- showAlwaysShowColumnInCheckbox: true, //设置是否在checkbox显示不允许隐藏的列信息
|
|
|
- alwaysShowColumnIndexs: [0, 1, 2, 3, 4, 5, 6, 7,8,, 9, 12, 19] // 总是显示的列的下标(不可隐藏的列)。列下标从 0 开始
|
|
|
+ //详情
|
|
|
+ detailVisible:false,
|
|
|
+ detail:{},
|
|
|
+
|
|
|
+ isShowColumn: false,
|
|
|
+ // 列的配置化对象,存储配置信息
|
|
|
+ checkList: {},
|
|
|
+ showColumn: {
|
|
|
+ depart_name: true,
|
|
|
+ alarm_state_text: true,
|
|
|
+ net_state:true,
|
|
|
+ number: true,
|
|
|
+ name: true,
|
|
|
+ brand: true,
|
|
|
+ supplier: true,
|
|
|
+ model: true,
|
|
|
+ online_time: true
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.$http.get("departments").then((response) => {
|
|
|
this.departments = response.data;
|
|
|
});
|
|
|
- this.$http.post('sysDictData/getOptions', {type: "StationModel"})
|
|
|
- .then( resp => {
|
|
|
- this.models = resp.data
|
|
|
- })
|
|
|
},
|
|
|
methods: {
|
|
|
- changeDepart(v) {
|
|
|
- this.selectedDepartId = v[v.length - 1];
|
|
|
- },
|
|
|
- changeModel(v){
|
|
|
- this.selectedModelId = v;
|
|
|
- },
|
|
|
- importExcel() {
|
|
|
- this.uploadDialogVisible = true;
|
|
|
- },
|
|
|
+
|
|
|
handleChange(val) {
|
|
|
+ // console.log(val)
|
|
|
this.queryParam.department_id = val;
|
|
|
this.handleSearch();
|
|
|
},
|
|
|
- handleUpdateConfig(record) {
|
|
|
- this.currentRecord = record;
|
|
|
- this.configFormVisible = true;
|
|
|
- },
|
|
|
- beforeUpload(file) {
|
|
|
- if (!/\.(xlsx|xls|XLSX|XLS)$/.test(file.name)) {
|
|
|
- this.$notify.error({
|
|
|
- title: "错误",
|
|
|
- message: "上传文件只能为excel文件,且为xlsx,xls格式",
|
|
|
- });
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
- },
|
|
|
- onremove() {
|
|
|
- //移除文件钩子
|
|
|
- this.excel_url = "";
|
|
|
- },
|
|
|
- onexeced(files) {
|
|
|
- if (files.length == 1) {
|
|
|
- this.$message.error("只能上传一个文件");
|
|
|
- }
|
|
|
- },
|
|
|
- onchange(file, fileList) {
|
|
|
- if (file.response) {
|
|
|
- this.$message.success(file.response.data.msg);
|
|
|
- this.excel_url = file.response.data.excel_url;
|
|
|
- } else {
|
|
|
- // console.log(file);
|
|
|
- }
|
|
|
- },
|
|
|
- importStations() {
|
|
|
- // console.log(this.excel_url);
|
|
|
- var url = this.excel_url,depart_id = this.selectedDepartId,model_id = this.selectedModelId;
|
|
|
- if (depart_id == "") {
|
|
|
- this.$message.error("请选择部门");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (model_id == "") {
|
|
|
- this.$message.error("请选择型号");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (url == "") {
|
|
|
- this.$message.error("请上传文件");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.loadings = true;
|
|
|
- this.submitText = "导入中";
|
|
|
- this.$http
|
|
|
- .post("import_station", { url: url, depart_id: depart_id,model_id:model_id })
|
|
|
- .then((response) => {
|
|
|
- if (response.data.error) {
|
|
|
- this.$message.error(response.data.msg);
|
|
|
- } else {
|
|
|
- this.$message.success(response.data);
|
|
|
- }
|
|
|
- this.excel_url = "";
|
|
|
- this.selectedDepartId = "";
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
- this.loadings = false;
|
|
|
- this.submitText = "确定";
|
|
|
- this.uploadDialogVisible = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ hydraulicSelectMulti(data) {
|
|
|
+ this.selectedIds = [];
|
|
|
+ data.forEach((item) => {
|
|
|
+ this.selectedIds.push(item.id);
|
|
|
+ });
|
|
|
},
|
|
|
refresh() {
|
|
|
this.queryParam.page = this.paginate.current;
|
|
|
this.getList();
|
|
|
},
|
|
|
- // 处理初始隐藏的列
|
|
|
- oprColumns(indexs, isShow) {
|
|
|
- let self = this;
|
|
|
- indexs.forEach(index => {
|
|
|
- self.$set(self.columnVisibles, index, isShow);
|
|
|
- });
|
|
|
- },
|
|
|
searchDis() {
|
|
|
this.searchDisplay = !this.searchDisplay;
|
|
|
var searchBoxHeght = document.getElementById("searchBox");
|
|
@@ -561,25 +432,36 @@ export default {
|
|
|
} else {
|
|
|
searchBoxHeght.style.height = "auto";
|
|
|
}
|
|
|
+ },
|
|
|
+ showColumnOption() {
|
|
|
+ this.isShowColumn = true;
|
|
|
+ },
|
|
|
+ saveColumn() {
|
|
|
+ localStorage.setItem("hydColumnSet", JSON.stringify(this.checkList));
|
|
|
+ this.isShowColumn = false;
|
|
|
+ },
|
|
|
+ handleDetail(row){
|
|
|
+ this.detailVisible = true,
|
|
|
+ this.detail = row
|
|
|
+ },
|
|
|
+ closeDrawer(){
|
|
|
+ this.detailVisible = false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- visibleIndexs(newValue, oldValue) {
|
|
|
- let self = this;
|
|
|
- var willHideIndexs = [],
|
|
|
- willShowIndexs = [];
|
|
|
-
|
|
|
- willShowIndexs = newValue.filter(index => {
|
|
|
- return oldValue.indexOf(index) === -1;
|
|
|
- });
|
|
|
-
|
|
|
- willHideIndexs = oldValue.filter(index => {
|
|
|
- return newValue.indexOf(index) === -1;
|
|
|
- });
|
|
|
-
|
|
|
- self.oprColumns(willShowIndexs, true);
|
|
|
- self.oprColumns(willHideIndexs, false);
|
|
|
- }
|
|
|
+ // 监听复选框配置列所有的变化
|
|
|
+ checkList: {
|
|
|
+ handler: function (newnew, oldold) {
|
|
|
+ // console.log(newnew);
|
|
|
+ this.showColumn = newnew;
|
|
|
+ // 这里需要让表格重新绘制一下,否则会产生固定列错位的情况
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.multipleTable.doLayout();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
word: function () {
|
|
@@ -592,82 +474,29 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- let self = this;
|
|
|
- if (self.$refs.multipleTable.$slots.default) {
|
|
|
- self.$refs.multipleTable.$slots.default.forEach((columnIns, index) => {
|
|
|
- if (columnIns.componentOptions === undefined) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let props = columnIns.componentOptions.propsData;
|
|
|
- if (
|
|
|
- props.label === undefined &&
|
|
|
- props.type !== "selection" &&
|
|
|
- props.type !== "index"
|
|
|
- ) {
|
|
|
- return;
|
|
|
- }
|
|
|
- // 保存所有列的信息
|
|
|
- let label =
|
|
|
- props.type === "selection"
|
|
|
- ? "多选框"
|
|
|
- : props.type === "index"
|
|
|
- ? "索引"
|
|
|
- : props.label,
|
|
|
- // 默认多选框和索引不可隐藏
|
|
|
- disabled =
|
|
|
- props.type === "selection" || props.type === "index" ? true : false;
|
|
|
- self.columnInfos.push({
|
|
|
- label: label,
|
|
|
- index: index,
|
|
|
- disabled: disabled
|
|
|
- });
|
|
|
- // console.log(this.columnInfos)
|
|
|
- // 记录初始展示的列的下标
|
|
|
- if (self.hidenColumnIndexs.indexOf(index) === -1) {
|
|
|
- self.visibleIndexs.push(index);
|
|
|
- }
|
|
|
- });
|
|
|
- // 处理总是显示的列(不可隐藏的列)
|
|
|
- self.alwaysShowColumnIndexs.forEach(
|
|
|
- index => (self.columnInfos[index].disabled = true)
|
|
|
- );
|
|
|
- // 处理初始隐藏的列
|
|
|
- self.oprColumns(self.hidenColumnIndexs, false);
|
|
|
+ // this.getIsUseVoice();
|
|
|
+ this.$nextTick(function () {
|
|
|
+ this.searchDis();
|
|
|
+ });
|
|
|
+ // 发请求得到checkListInitData的列的名字
|
|
|
+ if (localStorage.getItem("hydColumnSet")) {
|
|
|
+ this.checkList = JSON.parse(localStorage.getItem("hydColumnSet"));
|
|
|
+ } else {
|
|
|
+ this.checkList = {
|
|
|
+ depart_name: true,
|
|
|
+ alarm_state_text: true,
|
|
|
+ net_state:true,
|
|
|
+ number: true,
|
|
|
+ name: true,
|
|
|
+ brand: true,
|
|
|
+ supplier: true,
|
|
|
+ model: true,
|
|
|
+ online_time: true
|
|
|
+ };
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.col-setting-popover {
|
|
|
- min-width: 100px;
|
|
|
- padding: 9px 16px;
|
|
|
- .col-setting-title {
|
|
|
- color: #7f8b93;
|
|
|
- font-size: 12px;
|
|
|
- }
|
|
|
- .col-setting-group {
|
|
|
- .el-checkbox {
|
|
|
- display: block;
|
|
|
- margin-top: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-.search-box-area {
|
|
|
- width: 70%;
|
|
|
- height: 44px;
|
|
|
- float: left;
|
|
|
-}
|
|
|
-.search-operate-area {
|
|
|
- width: 20%;
|
|
|
- height: 44px;
|
|
|
- float: left;
|
|
|
-}
|
|
|
-.search-item {
|
|
|
- width: 25%;
|
|
|
- height: 44px;
|
|
|
- float: left;
|
|
|
-}
|
|
|
-#searchBox {
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
-</style>
|
|
|
+ @import "@/views/device/hydraulic/index.scss";
|
|
|
+</style>
|