From accebdce93486d3b4f26e55ffdea047549cce20c Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期一, 28 七月 2025 21:12:38 +0800
Subject: [PATCH] Merge branch 'master' of http://125.76.225.53:18448/r/xhj/vue_mdc_xhj

---
 src/views/mdc/base/AlarmManager.vue |  346 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 346 insertions(+), 0 deletions(-)

diff --git a/src/views/mdc/base/AlarmManager.vue b/src/views/mdc/base/AlarmManager.vue
new file mode 100644
index 0000000..ea207ee
--- /dev/null
+++ b/src/views/mdc/base/AlarmManager.vue
@@ -0,0 +1,346 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 鏌ヨ鍖哄煙 -->
+    <div class="table-page-search-wrapper">
+      <a-form
+        layout="inline"
+        @keyup.enter.native="searchQuery"
+      >
+        <a-row :gutter="24">
+          <a-col
+            :xl="6"
+            :lg="7"
+            :md="8"
+            :sm="24"
+          >
+            <a-form-item label="鎺у埗绯荤粺绫诲瀷">
+              <a-auto-complete
+                v-model="queryParam.driveType"
+                :data-source="driveTypeList"
+                placeholder="璇烽�夋嫨鎺у埗绯荤粺绫诲瀷"
+                :filter-option="filterOption"
+                :allowClear="true"
+              />
+            </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.alarmCode"
+                ></a-input>
+              </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.alarmContent"
+                ></a-input>
+              </a-form-item>
+            </a-col>
+
+          <a-col
+            :xl="4"
+            :lg="4"
+            :md="4"
+            :sm="24"
+          >
+            <span
+              style="float: left;overflow: hidden;"
+              class="table-page-search-submitButtons"
+            >
+              <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-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 鏌ヨ鍖哄煙-END -->
+
+    <!-- 鎿嶄綔鎸夐挳鍖哄煙 -->
+    <div class="table-operator">
+      <a-button
+        @click="handleAddTRype"
+        type="primary"
+        icon="plus"
+      >鏂板</a-button>
+      <!--<a-button-->
+        <!--@click="handleAdd"-->
+        <!--type="primary"-->
+        <!--icon="plus"-->
+      <!--&gt;璁惧鏂板</a-button>-->
+      <!--<a-upload-->
+        <!--name="file"-->
+        <!--:showUploadList="false"-->
+        <!--:multiple="false"-->
+        <!--:headers="tokenHeader"-->
+        <!--:action="importExcelUrl"-->
+        <!--@change="handleImportExcel"-->
+      <!--&gt;-->
+        <!--<a-button-->
+          <!--type="primary"-->
+          <!--icon="import"-->
+        <!--&gt;瀵煎叆</a-button>-->
+      <!--</a-upload>-->
+      <a-dropdown v-if="selectedRowKeys.length > 0">
+        <a-menu slot="overlay">
+          <a-menu-item
+            key="1"
+            @click="batchDel"
+          >
+            <a-icon type="delete" />鍒犻櫎
+          </a-menu-item>
+        </a-menu>
+        <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔
+          <a-icon type="down" />
+        </a-button>
+      </a-dropdown>
+    </div>
+
+    <!-- table鍖哄煙-begin -->
+    <div>
+      <div
+        class="ant-alert ant-alert-info"
+        style="margin-bottom: 16px;"
+      >
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤�
+        <a
+          style="margin-left: 24px"
+          @click="onClearSelected"
+        >娓呯┖</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:'max-content',y:465}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+      >
+
+        <span
+          slot="action"
+        slot-scope="text, record"
+        >
+          <a @click="handleEdit(record)">缂栬緫</a>
+
+          <a-divider type="vertical" />
+           <a-popconfirm
+             title="纭畾鍒犻櫎鍚�?"
+             @confirm="() => handleDelete(record.id)"
+           >
+                  <a>鍒犻櫎</a>
+                </a-popconfirm>
+        </span>
+
+      </a-table>
+    </div>
+
+    <!--<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>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  // import MdcDriveTypeParamConfigModal from './modules/mdcDriveTypeParamConfig/MdcDriveTypeParamConfigModal'
+  import AlarmManagerModal from './modules/alarmManager/alarmManagerModal'
+  import AlarmManagerForm from './modules/alarmManager/alarmManagerForm'
+  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],
+    components: {
+      AlarmManagerEdit,
+      AlarmManagerForm,
+      AlarmManagerModal
+    },
+    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: [
+          {
+            title: '#',
+            dataIndex: '',
+            key: 'rowIndex',
+            width: 60,
+            align: "center",
+            customRender: function (t, r, index) {
+              return parseInt(index) + 1;
+            }
+          },
+          {
+            title: '鎶ヨ鍙�',
+            align: "center",
+            // sorter: true,
+            dataIndex: 'alarmCode',
+            width:400
+          },
+          {
+            title: '鎶ヨ鍐呭',
+            align: "center",
+            // sorter: true,
+            dataIndex: 'alarmContent',
+            width:400
+          },
+
+          {
+            title: '璁惧椹卞姩绫诲瀷',
+            align: "center",
+            // sorter: true,
+            dataIndex: 'driveType',
+            width:400
+          },
+          // {
+          //   title: '鏄惁杩囨护',
+          //   align: "center",
+          //   dataIndex: 'isUse',
+          //   customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
+          // },
+          {
+            dataIndex:'isUse_dictText',
+            title: '鏄惁鍚敤',
+            align: "center",
+            width:380
+           // dictCode:'alarm_is_use'
+          },
+          {
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+            align: "center",
+            fixed: "right",
+            width: 150,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          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: '0' }, { text: '鍚�', value: '-1' }])
+      this.getSuperFieldList();
+      this.getDriveTypeByApi()
+    },
+    computed: {
+      // importExcelUrl: function () {
+      //   return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}`;
+      // },
+    },
+    methods: {
+      handleEdit: function (record) {
+        this.$refs.modalFormEdit.edit(record);
+        this.$refs.modalFormEdit.title = "缂栬緫";
+        this.$refs.modalFormEdit.disableSubmit = false;
+      },
+      handleAddTRype(){
+        this.$refs.modalFormType.add();
+        this.$refs.modalFormType.title = "鏂板";
+        this.$refs.modalFormType.disableSubmit = false
+      },
+      initDictConfig() {
+      },
+      getSuperFieldList() {
+        let fieldList = [];
+        fieldList.push({ type: 'string', value: 'alarmCode', 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: '鏄惁鍚敤' })
+        this.superFieldList = fieldList
+      },
+
+      getQueryParams() {
+        // 閲嶅啓鏌ヨ鏉′欢
+        let sqp = {}
+        if (this.superQueryParams) {
+          sqp['superQueryParams'] = encodeURI(this.superQueryParams)
+          sqp['superQueryMatchType'] = this.superQueryMatchType
+        }
+        var param = Object.assign(sqp, this.queryParam, {}, this.filters)
+        param.field = this.getQueryField()
+        param.pageNo = this.ipagination.current
+        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
+        );
+      },
+
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>
\ No newline at end of file

--
Gitblit v1.9.3