Lius
8 天以前 2b6c67c330d86e84dfbeec9b7b66a45567aaeb00
src/views/mdc/base/MdcUtilizationRateList.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
<template>
  <a-card :bordered="false" class="mdcutilization_list">
    <!-- æŸ¥è¯¢åŒºåŸŸ -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="类别">
              <a-input placeholder="请输入类别" v-model="queryParam.rateParameterCategory"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- æ“ä½œæŒ‰é’®åŒºåŸŸ -->
    <!--<div class="table-operator">-->
      <!--<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
      <!--<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
    <!--</div>-->
    <!-- table区域-begin -->
    <div>
      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
               :pagination="ipagination" :loading="loading"
               @change="handleTableChange">
        <span slot="rateParameterColor" slot-scope="text, record">
          <div :style="{background:record.rateParameterColor}"> &nbsp;&nbsp;</div>
        </span>
        <span slot="action" slot-scope="text, record">
          <a href="javascript:;" @click="handleEdit(record)">编辑</a>
        </span>
        <!--<span slot="action1" slot-scope="text,record">-->
          <!--<span><=</span>-->
        <!--</span>-->
      </a-table>
    </div>
    <!-- table区域-end -->
    <mdc-utilization-rate-model ref="formModel" @ok="modalFormOk"></mdc-utilization-rate-model>
  </a-card>
</template>
<script>
  import {
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import {
    initDictOptions,
    filterDictText
  } from '@/components/dict/JDictSelectUtil'
  import {
    requestPut
  } from '@/api/manage'
  import JInput from '@/components/jeecg/JInput'
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import JDate from '@/components/jeecg/JDate'
  import moment from 'moment'
  import {
    getAction,
    postAction,
    deleteAction
  } from '@/api/manage'
  import MdcUtilizationRateModel from './modules/mdcUtilizationRate/MdcUtilizationRateModel'
  export default {
    name: 'MdcUtilizationRateList',
    mixins: [JeecgListMixin],
    components: {
      JDictSelectTag,
      JInput,
      JEllipsis,
      JDate,
      MdcUtilizationRateModel
    },
    data() {
      return {
        /* åˆ†é¡µå‚æ•° */
        ipagination:{
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['30', '50', '100'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " å…±" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        columns: [{
          title: '类别',
          align: 'center',
          dataIndex: 'rateParameterCategory'
        },
          {
            title: '颜色',
            align: 'center',
            dataIndex: 'rateParameterColor',
            scopedSlots: {
              customRender: 'rateParameterColor'
            }
          },
          {
            title: '最小范围(单位:%)',
            align: 'center',
            dataIndex: 'minimumRange'
          },
          // {
          //   title:'',
          //   dataIndex:'action1',
          //   align:'center',
          //   scopedSlots: {
          //     customRender: 'action1'
          //   }
          // },
          {
            title: '最大范围(单位:%)',
            align: 'center',
            dataIndex: 'maximumRange'
          },
          {
            title: '等级',
            align: 'center',
            dataIndex: 'rateParameterLevel'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: 'center',
            scopedSlots: {
              customRender: 'action'
            }
          }
        ],
        url: {
          list: '/mdc/MdcUtilizationRate/queryWrapper'
        }
      }
    },
    created() {
      this.loadData()
    },
    methods: {
      searchReset() {
        this.queryParam = {}
        this.loadData()
        this.onClearSelected()
      },
      searchQuery() {
        this.loadData()
        this.onClearSelected()
      },
      modalFormOk(val) {
        // æ–°å¢ž/修改 æˆåŠŸæ—¶ï¼Œé‡è½½åˆ—è¡¨
        this.loadData()
        this.selectedRowKeys = [val.borrowSubId]
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectionRows = selectionRows
      },
      handleEdit(record) {
        this.$refs.formModel.edit(record)
        this.$refs.formModel.title = '编辑'
        this.$refs.formModel.disableSubmit = false
      }
    }
  }
</script>
<style>
  @import '~@assets/less/common.less';
  @media screen and (min-width: 1920px){
    .mdcutilization_list{
      height: 825px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1680px) and (max-width: 1920px){
    .mdcutilization_list{
      height: 825px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1400px) and (max-width: 1680px){
    .mdcutilization_list{
      height: 655px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1280px) and (max-width: 1400px){
    .mdcutilization_list{
      height: 552px!important;
      overflow: scroll;
    }
  }
  @media screen and (max-width: 1280px){
    .mdcutilization_list{
      height: 552px!important;
      overflow: scroll;
    }
  }
</style>