cuijian
2025-07-28 accebdce93486d3b4f26e55ffdea047549cce20c
src/views/mdc/base/modules/DepartList/DepartListContent/DepartListModel.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,187 @@
<template>
  <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel"
    cancelText="关闭">
    <a-card :bordered="false">
      <!-- æŸ¥è¯¢åŒºåŸŸ -->
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="6">
              <a-form-item label="统一编码">
                <a-input placeholder="请输入统一编码检索" v-model="queryParam.equipmentId"></a-input>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="设备名称">
                <a-input placeholder="请输入设备名称检索" v-model="queryParam.equipmentName"></a-input>
              </a-form-item>
            </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" style="margin-left: 8px">重置</a-button>
      </div>
      <!-- table区域-begin -->
      <div>
        <a-table ref="table" size="middle" bordered rowKey="index" :scroll="{  y: 300 }" :columns="columns"
          :dataSource="dataSource" :pagination="ipagination" :loading="loading"
          :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
          @change="handleTableChange">
        </a-table>
      </div>
      <!-- table区域-end -->
    </a-card>
  </a-modal>
</template>
<script>
  import {
    ajaxGetSelectItems
  } from '@/api/api'
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import {
    deleteAction,
    requestPut,
    getAction
  } from '@/api/manage'
  import {
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  import JInput from '@/components/jeecg/JInput'
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import Tooltip from 'ant-design-vue/es/tooltip'
  import JDate from '@/components/jeecg/JDate'
  import moment from 'moment'
  export default {
    name: 'DeviceListModel',
    mixins: [JeecgListMixin],
    components: {
      JDictSelectTag,
      JEllipsis,
      JInput,
      Tooltip,
      JDate
    },
    props: {
      status: {
        type: Number,
        default: 1
      }
    },
    data() {
      return {
        title:'',
        visible: false,
        disableMixinCreated: true,
        queryParam: {},
        columns: [{
          title: '统一编码',
            align: 'center',
            dataIndex: 'equipmentId',
          },
          {
            title: '设备名称',
            align: 'center',
            dataIndex: 'equipmentName',
          },
          {
            title: '设备型号',
            align: 'center',
            dataIndex: 'equipmentModel',
          },
          // {
          //   title: '设备类型',
          //   align: 'center',
          //   dataIndex: 'equipmentType',
          // },
          {
            title: '机床IP',
            align: 'center',
            dataIndex: 'equipmentIp',
          },
          {
            title: '驱动类型',
            align: 'center',
            dataIndex: 'driveType',
          },
          {
            title: '端口',
            align: 'center',
            dataIndex: 'dataPort',
          },
          {
            title: '数控系统',
            align: 'center',
            dataIndex: 'controlSystem',
          }
        ],
        url: {
          list: '/mdc/sectionEquipment/pageList',
        },
      }
    },
    created() {
    },
    methods: {
      openPage() {
        this.visible = true
        this.onClearSelected()
        this.dataSource = [];
        this.queryParam = {
          status: this.status
        };
        this.loadData();
      },
      modalFormOk(val) {
        // æ–°å¢ž/修改 æˆåŠŸæ—¶ï¼Œé‡è½½åˆ—è¡¨
        this.loadData();
        this.selectedRowKeys = [val.id];
      },
      searchQuery() {
        this.loadData();
        this.onClearSelected()
      },
      searchReset() {
        this.queryParam = {
          status: 1
        };
        this.loadData();
        this.onClearSelected()
      },
      close() {
        this.$emit('close')
        this.visible = false
      },
      handleCancel() {
        this.close()
      },
      handleOk() {
        this.$emit('sendSelectionRows', this.selectionRows[0])
        this.close()
      },
    },
  }
</script>
<style>
  @import '~@assets/less/common.less';
  .frozenRowClass {
    color: #c9c9c9;
  }
  .success {
    color: green;
  }
  .error {
    color: red;
  }
</style>