123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- <template>
- <div class="app-container">
- <div class="filter-container" style="padding-bottom: 0px">
- <div class="search-box-area" id="searchBox">
- <div class="search-item">
-
- <el-cascader
- class="filter-item form-search-input fl"
- v-model="queryParam.department_id"
- :options="departments"
- clearable
- :props="{
- emitPath:false,
- label: 'department_name',
- value: 'id',
- }"
- @change="handleChange"
- ></el-cascader>
- </div>
- <div class="search-item">
- <el-input
- v-model="queryParam.number"
- placeholder="编号"
- clearable
- class="filter-item form-search-input fl"
- @keyup.enter.native="handleSearch"
- />
- </div>
- <div class="search-item">
- <el-input
- v-model="queryParam.name"
- placeholder="名称"
- clearable
- class="filter-item form-search-input fl"
- @keyup.enter.native="handleSearch"
- />
- </div>
- <div class="search-item">
- <el-select
- v-model="queryParam.model"
- placeholder="模型"
- class="filter-item form-search-input fl"
- clearable
- >
- <el-option v-for="item in deviceModels"
- :key="item.value"
- :label="item.text"
- :value="item.value"></el-option>
- </el-select>
- </div>
- <div class="search-item">
- <el-select
- v-model="queryParam.is_used"
- placeholder="使用状态"
- class="filter-item form-search-input fl"
- clearable
- >
- <el-option value="-2" label="未使用">已报废</el-option>
- <el-option value="-1" 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
- class="filter-item search fl"
- :icon="this.searchDisplay ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
- @click="searchDis"
- >{{ word }}</el-button
- >
- </div>
- <div class="list-operate-area">
- <!-- <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"
- @click="refresh"
- >刷新</el-button
- >
- </div>
- </div>
- <el-table
- :data="data"
- v-loading="loading"
- ref="multipleTable"
- @selection-change="hydraulicSelectMulti"
- @sort-change="sortChange"
- :dynamicColumnSetting="true"
- tooltip-effect="dark"
- style="width: 100%"
- border
- fit
- >
- <el-table-column
- type="selection"
- fixed="left"
- width="55"
- ></el-table-column>
- <el-table-column
- prop="wind_name"
- label="风场名称"
- align="center"
- v-if="showColumn.wind_name"
- :show-overflow-tooltip="true"
-
- />
- <el-table-column
- prop="fan_number"
- label="风机机位号"
- align="center"
- v-if="showColumn.fan_number"
- :show-overflow-tooltip="true"
-
- />
- <el-table-column
- prop="number"
- label="编号"
- align="center"
- v-if="showColumn.number"
- :show-overflow-tooltip="true"
-
- />
- <el-table-column
- prop="work_local_name"
- label="工作位置"
- align="center"
- v-if="showColumn.work_local"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="parts_name"
- label="所属部件"
- align="center"
- v-if="showColumn.parts"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="bolt_style_name"
- label="螺栓样式"
- align="center"
- v-if="showColumn.bolt_style"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="boit_type_name"
- label="螺栓型号"
- align="center"
- v-if="showColumn.boit_type"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="torque"
- label="扭矩"
- align="center"
- v-if="showColumn.torque"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="pressure"
- label="压力"
- align="center"
- v-if="showColumn.pressure"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="external_diameter"
- label="外径"
- align="center"
- v-if="showColumn.external_diameter"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- prop="created_at"
- label="创建时间"
- align="center"
- v-if="showColumn.external_diameter"
- :show-overflow-tooltip="true"
- />
- <el-table-column
- label="操作"
- width="150"
- align="center"
- fixed="right"
- >
- <template slot-scope="record">
- <el-tooltip
- content="查看"
- placement="top"
- :enterable="false"
- >
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-view"
- @click="handleView(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.wind_name" disabled>风场名称</el-checkbox>
- <el-checkbox v-model="checkList.fan_number" disabled>风机机位号</el-checkbox>
- <el-checkbox v-model="checkList.number">编号</el-checkbox>
- <el-checkbox v-model="checkList.parts">所属部件</el-checkbox>
- <el-checkbox v-model="checkList.bolt_style">螺丝样式</el-checkbox>
- <el-checkbox v-model="checkList.boit_type">螺栓型号</el-checkbox>
- <el-checkbox v-model="checkList.torque">扭矩</el-checkbox>
- <el-checkbox v-model="checkList.pressure">压力</el-checkbox>
- <el-checkbox v-model="checkList.external_diameter">外径</el-checkbox>
- <el-checkbox v-model="checkList.created_at">创建时间</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"
- :loading="downloadLoading"
- style="margin-top: 15px"
- @click="handleCreate"
- >添加</el-button
- >
- <el-button
- type="danger"
- icon="el-icon-delete"
- v-if="selectedIds.length > 0"
- style="margin-top: 15px"
- @click="handleMultiDelete()"
- >删除</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"
- />
- <form-model
- @sendVal="closeDialog"
- :formModelVisible="formVisible"
- :title="title"
- :ref="formName"
- />
- <detail
- :detailVisible="detailVisible"
- @sendVal="closeDrawer"
- :data="detail"
- />
- </div>
- </template>
- <script>
- import rlListOperate from "@/layout/rl-list-operate/rlListOperate";
- import { action } from "@/directive/permission/index.js";
- import formModel from './formModel.vue'
- export default {
- name: "workLocation",
- directives: { action },
- mixins: [rlListOperate],
- components: {
- formModel,
- detail,
- },
- data() {
- return {
- url: "workLocation",
- queryParam: {
- number: "",
- department_id: [],
- name: "",
- model: "",
- is_used: "",
- },
- defaultQueryParam:['type'],
- current_type: {
- 0: "success",
- 1: "danger",
- },
- formName:'workLocation',
- formVisible:false,
- //搜索
- searchDisplay: true,
- departments: [],
- deviceModels:[],
- //详情
- detailVisible:false,
- detail:{},
- isShowColumn: false,
- // 列的配置化对象,存储配置信息
- checkList: {},
- showColumn: {
- wind_name:true,
- fan_number:true,
- number: true,
- work_local: true,
- parts:true,
- bolt_style: true,
- boit_type: true,
- torque:true,
- pressure:true,
- external_diameter:true,
- created_at:true
- }
- };
- },
- created() {
- this.$http.get("departments").then((response) => {
- this.departments = response.data;
- });
- this.$http.get("get_device_mold",{ params: {type:2} }).then(resp => {
- this.deviceModels = resp.data
- });
- },
- methods: {
- //重置
- handleChange(val) {
- this.queryParam.department_id = val;
- this.handleSearch();
- },
- hydraulicSelectMulti(data) {
- this.selectedIds = [];
- data.forEach((item) => {
- this.selectedIds.push(item.id);
- });
- },
- refresh() {
- this.queryParam.page = this.paginate.current;
- this.getList();
- },
- searchDis() {
- this.searchDisplay = !this.searchDisplay;
- var searchBoxHeght = document.getElementById("searchBox");
- if (this.searchDisplay == false) {
- searchBoxHeght.style.height = 40 + "px";
- } else {
- searchBoxHeght.style.height = "auto";
- }
- },
- showColumnOption() {
- this.isShowColumn = true;
- },
- saveColumn() {
- localStorage.setItem("WorklocalSet", JSON.stringify(this.checkList));
- this.isShowColumn = false;
- },
- handleDetail(row){
- this.detailVisible = true,
- this.detail = row
- },
- closeDrawer(){
- this.detailVisible = false
- }
- },
- watch: {
- // 监听复选框配置列所有的变化
- checkList: {
- handler: function (newnew, oldold) {
- // console.log(newnew);
- this.showColumn = newnew;
- // 这里需要让表格重新绘制一下,否则会产生固定列错位的情况
- this.$nextTick(() => {
- this.$refs.multipleTable.doLayout();
- });
- },
- deep: true,
- immediate: true,
- },
- },
- computed: {
- word: function () {
- if (this.searchDisplay == false) {
- //对文字进行处理
- return "展开";
- } else {
- return "收起";
- }
- },
- },
- mounted() {
- // this.getIsUseVoice();
- this.$nextTick(function () {
- this.searchDis();
- });
- // 发请求得到checkListInitData的列的名字
- if (localStorage.getItem("WorklocalSet")) {
- this.checkList = JSON.parse(localStorage.getItem("WorklocalSet"));
- } else {
- this.checkList = {
- wind_name:true,
- fan_number:true,
- number: true,
- work_local: true,
- parts:true,
- bolt_style: true,
- boit_type: true,
- torque:true,
- pressure:true,
- external_diameter:true,
- created_at:true
- };
- }
- },
- };
- </script>
- <style lang="scss" scoped>
- @import "@/views/device/hydraulic/index.scss";
- </style>
|