zhaowei
2024-12-13 fb1e6ab905adea16f680d4eb5ead8d0d517777d9
src/views/mdc/base/modules/MdcUnplannedCloseManagement/MdcUnplannedCloseList.vue
@@ -6,7 +6,7 @@
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备编号">
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId" allowClear/>
              <a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
@@ -17,15 +17,14 @@
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="日期">
              <a-date-picker v-model="queryParam.theDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                             style="width: 100%"></a-date-picker>
              <a-range-picker v-model="dates" style="width: 100%" @change="dateParamChange"></a-range-picker>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
            </a-space>
          </a-col>
        </a-row>
      </a-form>
@@ -35,8 +34,8 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('计划停机模板')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('计划停机管理')">导出</a-button>
      <a-button type="primary" icon="download" @click="importTemplate('非计划停机管理')">导入模板</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('非计划停机管理')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
                @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
@@ -59,7 +58,6 @@
    <!-- table区域-begin -->
    <div id="DeviceList" style="flex: 1;overflow: hidden">
      <a-table
        id="planClose"
        ref="table"
        size="middle"
        :scroll="{x:'max-content',y:scrollY}"
@@ -70,7 +68,6 @@
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
@@ -100,22 +97,21 @@
</template>
<script>
  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import moment from 'moment'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import MdcUnplannedCloseModal from './MdcUnplannedCloseModal'
  export default {
    name: 'MdcUnplannedCloseList',
    mixins: [JeecgListMixin, mixinDevice],
    mixins: [JeecgListMixin],
    components: {
      MdcUnplannedCloseModal
    },
    props: { nodeTree: '', Type: '', nodePeople: '' },
    data() {
      return {
        description: 'mdcPlanClose管理页面',
        description: 'mdcUnplannedClose管理页面',
        disableMixinCreated: true,
        /* 分页参数 */
        ipagination: {
          current: 1,
@@ -128,6 +124,7 @@
          showSizeChanger: true,
          total: 0
        },
        dates: [moment().subtract(1, 'day'), moment()],
        queryParam: {
          closeType: 2
        },
@@ -190,8 +187,6 @@
          exportXlsUrl: '/mdc/mdcPlanClose/exportXls',
          importExcelUrl: 'mdc/mdcPlanClose/importExcel'
        },
        dictOptions: {},
        superFieldList: []
      }
    },
    watch: {
@@ -231,20 +226,26 @@
      }
    },
    methods: {
      dateParamChange(v1, v2) {
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
        this.dates = [v1[0], v1[1]]
      },
      importTemplate(fileName) {
        var a = document.createElement('a')
        a.href = '/static/计划停机管理.xls'
        a.download = '计划停机管理.xls'
        a.href = `/static/${fileName}.xls`
        a.download = `${fileName}.xls`
        a.style.display = 'none'
        document.body.appendChild(a)
        a.click()
        a.remove()
      },
      initDictConfig() {
      },
      searchReset() {
        this.dates = [moment().subtract(1, 'day'), moment()]
        this.queryParam = {
          closeType: 2
          closeType: 2,
          startTime: this.dates[0].format('YYYY-MM-DD'),
          endTime: this.dates[1].format('YYYY-MM-DD')
        }
        this.loadData(1)
      },
@@ -257,6 +258,11 @@
        this.scrollY = boxHeight - tableHeadHeight - 50
      }
    },
    created() {
      this.queryParam.startTime = this.dates[0].format('YYYY-MM-DD')
      this.queryParam.endTime = this.dates[1].format('YYYY-MM-DD')
      this.loadData()
    },
    mounted() {
      window.addEventListener('resize', this.handleWindowResize)
      this.handleWindowResize()