zhuzhuanzhuan
2023-09-05 584e17205f4cabd39bbc1b5d2489a59b48aa739e
报警号管理界面,功能
已修改8个文件
247 ■■■■ 文件已修改
src/mixins/JeecgListMixin.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/getters.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/DepartTree.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/Departs.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/mutation-types.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/AlarmManager.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mixins/JeecgListMixin.js
@@ -197,7 +197,7 @@
                //重新计算分页问题
                that.reCalculatePage(that.selectedRowKeys.length)
                // that.$message.success(res.message);
                this.$notification.warning({
                that.$notification.success({
                  message:'消息',
                  description:res.message
                });
@@ -205,7 +205,7 @@
                that.onClearSelected();
              } else {
                // that.$message.warning(res.message);
                this.$notification.warning({
                that.$notification.warning({
                  message:'消息',
                  description:res.message
                });
src/store/getters.js
@@ -20,7 +20,7 @@
  },
  sysSafeMode: state => state.user.sysSafeMode,
  ProductionNode:state => state.Production.ProductionTree,
  DepartNode:state => state.Depart.DepartTree,
  DepartNode:state => state.Departs.DepartTree,
  DepartTree:state => state.DepartTree.DepartTreeType
src/store/modules/DepartTree.js
@@ -1,6 +1,6 @@
import Vue from 'vue'
import {ajaxGetDictItems,getDictItemsFromCache} from '@/api/api'
import { SET_DEPARTTREE  } from "@/store/mutation-types"
import { SYS_DEPARTTREE  } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
const DepartTree = {
@@ -29,7 +29,7 @@
        ajaxGetDictItems('depart_is', null).then((res) => {
          if (res.success) {
            const result = res.result
            Vue.ls.set(SET_DEPARTTREE, result)
            Vue.ls.set(SYS_DEPARTTREE, result)
            commit('SET_DEPARTTREE', result)
            resolve(res)
          }else{
src/store/modules/Departs.js
@@ -2,9 +2,9 @@
import { queryTreeListByDepart } from "@/api/Tree"
import { SYS_DEPART } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
const Depart = {
const Departs = {
  state: {
    token: '',
    //部门树
    DepartTree:[]
@@ -43,4 +43,4 @@
  }
}
export default Depart
export default Departs
src/store/mutation-types.js
@@ -32,4 +32,4 @@
//部门树
export const SYS_DEPART = 'SYS_DEPART'
//部门树权限
export const  SET_DEPARTTREE = 'SYS_DEPARTTREE'
export const  SYS_DEPARTTREE = 'SYS_DEPARTTREE'
src/views/mdc/base/AlarmManager.vue
@@ -7,33 +7,46 @@
        @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-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 +66,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 +115,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"-->
@@ -223,18 +236,18 @@
              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",
@@ -242,10 +255,10 @@
            dataIndex: 'alarmCode'
          },
          {
            title: '报警描述',
            title: '报警内容',
            align: "center",
            // sorter: true,
            dataIndex: 'alarmDescription'
            dataIndex: 'alarmContent'
          },
          {
@@ -254,11 +267,17 @@
            // sorter: true,
            dataIndex: 'driveType'
          },
          // {
          //   title: '是否过滤',
          //   align: "center",
          //   dataIndex: 'isUse',
          //   customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
          // },
          {
            dataIndex:'isUse_dictText',
            title: '是否过滤',
            align: "center",
            dataIndex: 'isUse',
            customRender: (text) => (text ? filterMultiDictText(this.dictOptions['isUse'], text) : ''),
           // dictCode:'alarm_is_use'
          },
          {
            title: '操作',
@@ -270,9 +289,9 @@
          }
        ],
        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",
        },
@@ -281,7 +300,7 @@
      }
    },
    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();
    },
    computed: {
@@ -305,9 +324,8 @@
      },
      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: '是否过滤' })
        this.superFieldList = fieldList
src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue
@@ -5,20 +5,20 @@
      <a-spin :spinning="confirmLoading">
        <a-form :form="form">
          <a-row :gutter="24">
            <a-col :span="24">
              <a-form-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <!--<a-input v-decorator="['equipmentId', validatorRules.equipmentId]">-->
                  <a-input :disabled='disabled'  placeholder="请输入设备编号" v-decorator="['equipmentId', validatorRules.equipmentId]"></a-input>
              </a-form-item>
            </a-col>
            <!--<a-col :span="24">-->
              <!--<a-form-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
                <!--&lt;!&ndash;<a-input v-decorator="['equipmentId', validatorRules.equipmentId]">&ndash;&gt;-->
                  <!--<a-input :disabled='disabled'  placeholder="请输入设备编号" v-decorator="['equipmentId', validatorRules.equipmentId]"></a-input>-->
              <!--</a-form-item>-->
            <!--</a-col>-->
            <a-col :span="24">
              <a-form-item label="报警号" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input  placeholder="请输入报警号" v-decorator="['alarmCode', validatorRules.alarmCode]"></a-input>
              </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="报警描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input  placeholder="请输入报警描述" v-decorator="['alarmDescription', validatorRules.alarmDescription]"></a-input>
              <a-form-item label="报警内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input  placeholder="请输入报警内容" v-decorator="['alarmContent', validatorRules.alarmContent]"></a-input>
              </a-form-item>
            </a-col>
            <a-col :span='24'>
@@ -106,7 +106,7 @@
        },
        url: {
          // add: '/mdc/alarmInfo/add',
          edit: '/mdc/alarmInfo/edit',
          edit: '/mdc/mdcAlarmInfo/edit',
          //驱动类型
          initShiftList: '/mdc/mdcequipment/driveTypeSelected',
        },
@@ -124,7 +124,7 @@
        this.model = Object.assign({}, record)
        this.visible = true
        this.$nextTick(() => {
          this.form.setFieldsValue(pick(this.model,'equipmentId', 'alarmCode', 'alarmDescription','driveType'))
          this.form.setFieldsValue(pick(this.model, 'alarmCode', 'alarmContent','driveType'))
        })
      },
      initShiftList() {
@@ -146,7 +146,7 @@
          if (!err) {
            that.confirmLoading = true
            let formData = Object.assign(this.model, values)
            formData.isUse = this.isUse ? "1" : "2"
            formData.isUse = this.isUse ? "0" : "-1"
            let obj
            if (!this.model.id) {
              // obj = postAction(this.url.add, formData)
@@ -158,7 +158,7 @@
            obj.then((res) => {
              if (res.success) {
                // that.$message.success("添加成功")
                that.$notification.warning({
                that.$notification.success({
                  message:'消息',
                  description:"添加成功"
                });
src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue
@@ -11,15 +11,20 @@
              </a-form-item>
            </a-col>
            <a-col :span="24">
              <a-form-item label="报警描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input placeholder="请输入报警描述" v-decorator="['alarmDescription', validatorRules.alarmDescription]"></a-input>
              <a-form-item label="报警内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-input placeholder="请输入报警内容" v-decorator="['alarmContent', validatorRules.alarmContent]"></a-input>
              </a-form-item>
            </a-col>
            <a-col :span='24'>
            <a-form-item label="驱动类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-select v-decorator="['driveType', validatorRules. driveType]" placeholder="请选择驱动类型"
                      :options="shiftList">
            </a-select>
            <!--<a-select v-decorator="['driveType', validatorRules. driveType]" placeholder="请选择驱动类型"-->
                      <!--:options="shiftList">-->
            <!--</a-select>-->
                  <j-dict-select-tag
                    placeholder="请选择驱动类型"
                    v-decorator="['driveType', validatorRules.driveType]"
                    dictCode="mdc_driveType"
                  />
            </a-form-item>
            </a-col>
            <a-col :span="24">
@@ -27,28 +32,28 @@
                <a-switch :default-checked = 'showM' v-decorator="['isUse', validatorRules.isUse]"></a-switch>
              </a-form-item>
            </a-col>
            <a-col :span='24'>
              <a-form-item
                :labelCol="labelCol"
                :wrapperCol="wrapperCol"
                label="新增方式"
                hidden>
                <a-input
                  v-decorator="[
                'addWay',
                { rules:
                      [
                          { required: true, message: '' }
                      ],
                  initialValue: '2'
                }
              ]"
                  placeholder="请输入新增方式"
                  allowClear
                >
                </a-input>
              </a-form-item>
            </a-col>
            <!--<a-col :span='24'>-->
              <!--<a-form-item-->
                <!--:labelCol="labelCol"-->
                <!--:wrapperCol="wrapperCol"-->
                <!--label="新增方式"-->
                <!--hidden>-->
                <!--<a-input-->
                  <!--v-decorator="[-->
                <!--'addWay',-->
                <!--{ rules:-->
                      <!--[-->
                          <!--{ required: true, message: '' }-->
                      <!--],-->
                  <!--initialValue: '2'-->
                <!--}-->
              <!--]"-->
                  <!--placeholder="请输入新增方式"-->
                  <!--allowClear-->
                <!--&gt;-->
                <!--</a-input>-->
              <!--</a-form-item>-->
            <!--</a-col>-->
          </a-row>
        </a-form>
      </a-spin>
@@ -100,11 +105,11 @@
        },
        confirmLoading: false,        form: this.$form.createForm(this),
        validatorRules: {
          driveType:{
            rules: [{
              required: true, message: '请选择驱动类型!',
            }],
          },
          // driveType:{
          //   rules: [{
          //     required: true, message: '请选择驱动类型!',
          //   }],
          // },
          // isUse:{
          //   rules: [{
          //     required: true, message: !',
@@ -117,12 +122,12 @@
          },
          alarmDescription:{
            rules: [{
              required: true, message: '请输入报警描述!',
              required: true, message: '请输入报警内容!',
            }],
          },
        },
        url: {
          add: '/mdc/alarmInfo/add',
          add: '/mdc/mdcAlarmInfo/add',
          // edit:'/mdc/alarmInfo/edit',
          //驱动类型
          initShiftList: '/mdc/mdcequipment/driveTypeSelected',
@@ -150,7 +155,7 @@
        this.visible = true
        this.form.resetFields()
        this.model = Object.assign({}, record)
        this.initShiftList()
        // this.initShiftList()
        this.$nextTick(() => {
        })
@@ -169,11 +174,11 @@
            let formData = Object.assign(this.model, values)
            // console.log(formData)
            // formData.isUse = formData.isUse ? "1" : "2"
            formData.isUse = formData.isUse == true || formData.isUse == undefined ? "1" : "2"
            putAction(this.url.add, formData).then((res) => {
            formData.isUse = formData.isUse == true || formData.isUse == undefined ? "0" : "-1"
            postAction(this.url.add, formData).then((res) => {
              if (res.success) {
                // that.$message.success(res.message)
                that.$notification.warning({
                that.$notification.success({
                  message:'消息',
                  description:res.message
                });