src/views/mdc/base/AlarmManager.vue
@@ -7,33 +7,52 @@
        @keyup.enter.native="searchQuery"
      >
        <a-row :gutter="24">
          <!--<a-col-->
            <!--:xl="4"-->
            <!--:lg="4"-->
            <!--:md="4"-->
            <!--:sm="24"-->
          <!--&gt;-->
            <!--<a-form-item label="设备编号">-->
              <!--<a-input-->
                <!--placeholder="请输入设备编号"-->
                <!--v-model="queryParam.equipmentId"-->
              <!--&gt;</a-input>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <!--<a-col-->
            <!--:xl="4"-->
            <!--:lg="4"-->
            <!--:md="4"-->
            <!--:sm="24"-->
          <!--&gt;-->
            <!--<a-form-item label="设备名称">-->
              <!--<a-input-->
                <!--placeholder="请输入设备名称"-->
                <!--v-model="queryParam.equipmentName"-->
              <!--&gt;</a-input>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <a-col
            :xl="4"
            :lg="4"
            :md="4"
            :xl="6"
            :lg="7"
            :md="8"
            :sm="24"
          >
            <a-form-item label="设备编号">
              <a-input
                placeholder="请输入设备编号"
                v-model="queryParam.equipmentId"
              ></a-input>
            <a-form-item label="控制系统类型">
              <!--<j-dict-select-tag-->
                <!--placeholder="请选择控制系统类型"-->
                <!--v-model="queryParam.driveType"-->
                <!--dictCode="mdc_driveType"-->
              <!--/>-->
              <a-auto-complete
                v-model="queryParam.driveType"
                :data-source="driveTypeList"
                placeholder="请选择控制系统类型"
                :filter-option="filterOption"
              />
            </a-form-item>
          </a-col>
          <a-col
            :xl="4"
            :lg="4"
            :md="4"
            :sm="24"
          >
            <a-form-item label="设备名称">
              <a-input
                placeholder="请输入设备名称"
                v-model="queryParam.equipmentName"
              ></a-input>
            </a-form-item>
          </a-col>
            <a-col
              :xl="4"
              :lg="4"
@@ -53,10 +72,10 @@
              :md="4"
              :sm="24"
            >
              <a-form-item label="报警描述">
              <a-form-item label="报警内容">
                <a-input
                  placeholder="请输入报警描述"
                  v-model="queryParam.alarmDescription"
                  placeholder="请输入报警内容"
                  v-model="queryParam.alarmContent"
                ></a-input>
              </a-form-item>
            </a-col>
@@ -102,12 +121,12 @@
        @click="handleAddTRype"
        type="primary"
        icon="plus"
      >驱动新增</a-button>
      <a-button
        @click="handleAdd"
        type="primary"
        icon="plus"
      >设备新增</a-button>
      >新增</a-button>
      <!--<a-button-->
        <!--@click="handleAdd"-->
        <!--type="primary"-->
        <!--icon="plus"-->
      <!--&gt;设备新增</a-button>-->
      <!--<a-upload-->
        <!--name="file"-->
        <!--:showUploadList="false"-->
@@ -152,7 +171,7 @@
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        :scroll="{x:'max-content',y:465}"
        bordered
        rowKey="id"
        :columns="columns"
@@ -164,10 +183,9 @@
        @change="handleTableChange"
      >
        <span
          slot="action"
          slot-scope="text, record"
        slot-scope="text, record"
        >
          <a @click="handleEdit(record)">编辑</a>
@@ -183,8 +201,8 @@
      </a-table>
    </div>
    <alarm-manager-modal ref="modalForm" @ok="modalFormOk"></alarm-manager-modal>
    <alarm-manager-form ref="modalFormType" @ok="modalFormOk"></alarm-manager-form>
    <!--<alarm-manager-modal ref="modalForm" @ok="modalFormOk"></alarm-manager-modal>-->
    <alarm-manager-form ref="modalFormType" @ok="modalFormOk" :driveTypeList="driveTypeList" :filterOption="filterOption"></alarm-manager-form>
    <alarm-manager-edit ref="modalFormEdit" @ok="modalFormOk"></alarm-manager-edit>
  </a-card>
</template>
@@ -200,6 +218,7 @@
  import AlarmManagerEdit from './modules/alarmManager/alarmManagerEdit'
  import { filterMultiDictText } from '@/components/dict/JDictSelectUtil'
  import { filterObj } from '@/utils/util';
  import api from '@/api/mdc'
  export default {
    name: 'AlarmManager',
    mixins: [JeecgListMixin, mixinDevice],
@@ -211,6 +230,18 @@
    data() {
      return {
        description: '报警号管理界面',
        /* 分页参数 */
        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: [
          {
@@ -223,66 +254,78 @@
              return parseInt(index) + 1;
            }
          },
          {
            title: '设备编号',
            align: "center",
            // sorter: true,
            dataIndex: 'equipmentId'
          },
          {
            title: '设备名称',
            align: "center",
            // sorter: true,
            dataIndex: 'equipmentName'
          },
          // {
          //   title: '设备编号',
          //   align: "center",
          //   // sorter: true,
          //   dataIndex: 'equipmentId'
          // },
          // {
          //   title: '设备名称',
          //   align: "center",
          //   // sorter: true,
          //   dataIndex: 'equipmentName'
          // },
          {
            title: '报警号',
            align: "center",
            // sorter: true,
            dataIndex: 'alarmCode'
            dataIndex: 'alarmCode',
            width:400
          },
          {
            title: '报警描述',
            title: '报警内容',
            align: "center",
            // sorter: true,
            dataIndex: 'alarmDescription'
            dataIndex: 'alarmContent',
            width:400
          },
          {
            title: '设备驱动类型',
            align: "center",
            // sorter: true,
            dataIndex: 'driveType'
            dataIndex: 'driveType',
            width:400
          },
          // {
          //   title: '是否过滤',
          //   align: "center",
          //   dataIndex: 'isUse',
          //   customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
          // },
          {
            title: '是否过滤',
            dataIndex:'isUse_dictText',
            title: '是否启用',
            align: "center",
            dataIndex: 'isUse',
            customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
            width:380
           // dictCode:'alarm_is_use'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: "center",
            fixed: "right",
            width: 147,
            width: 150,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/mdc/alarmInfo/page",
          delete: "/mdc/alarmInfo/delete",
          deleteBatch: "/mdc/alarmInfo/deleteBatch",
          list: "/mdc/mdcAlarmInfo/list",
          delete: "/mdc/mdcAlarmInfo/delete",
          deleteBatch: "/mdc/mdcAlarmInfo/deleteBatch",
          importExcelUrl: "mdc/mdcDriveTypeParamConfig/importExcel",
        },
        dictOptions: {},
        superFieldList: [],
        driveTypeList:[]
      }
    },
    created() {
      this.$set(this.dictOptions, 'isUse', [{ text: '是', value: '1' }, { text: '否', value: '2' }])
      this.$set(this.dictOptions, 'isUse', [{ text: '是', value: '0' }, { text: '否', value: '-1' }])
      this.getSuperFieldList();
      this.getDriveTypeByApi()
    },
    computed: {
      // importExcelUrl: function () {
@@ -294,7 +337,6 @@
        this.$refs.modalFormEdit.edit(record);
        this.$refs.modalFormEdit.title = "编辑";
        this.$refs.modalFormEdit.disableSubmit = false;
        this.$refs.modalFormEdit.isUse = record.isUse === '1' ? true : false
      },
      handleAddTRype(){
        this.$refs.modalFormType.add();
@@ -305,11 +347,10 @@
      },
      getSuperFieldList() {
        let fieldList = [];
        fieldList.push({ type: 'string', value: 'equipmentId', text: '设备编号', dictCode: '' })
        fieldList.push({ type: 'string', value: 'alarmCode', text: '报警号', dictCode: '' })
        fieldList.push({ type: 'string', value: 'alarmDescription', text: '报警描述', dictCode: '' })
        fieldList.push({ type: 'string', value: 'alarmDescription', text: '报警内容', dictCode: '' })
        fieldList.push({ type: 'int', value: 'driveType', text: '设备驱动类型', dictCode: '' })
        fieldList.push({ type: 'switch', value: 'isUse', text: '是否过滤' })
        fieldList.push({ type: 'switch', value: 'isUse', text: '是否启用' })
        this.superFieldList = fieldList
      },
@@ -326,6 +367,25 @@
        param.pageSize = this.ipagination.pageSize
        return filterObj(param)
      },
      /**
       * 调用接口获取控制系统类型
       */
      getDriveTypeByApi(){
        api.getDriveTypeApi().then((res)=>{
          this.driveTypeList=res.result.map(item=>item.value)
        })
      },
      /**
       * 联想输入框筛选功能
       * @param input 输入的内容
       * @param option 配置
       * @returns {boolean} 判断是否筛选
       */
      filterOption(input, option) {
        return (
          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
        );
      },
    }
  }