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/modules/alarmManager/alarmManagerForm.vue |  260 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 260 insertions(+), 0 deletions(-)

diff --git a/src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue b/src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue
new file mode 100644
index 0000000..23245fd
--- /dev/null
+++ b/src/views/mdc/base/modules/alarmManager/alarmManagerForm.vue
@@ -0,0 +1,260 @@
+<template>
+  <div ref="device">
+    <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" :getContainer="() => this.$refs.device"
+             :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴">
+      <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 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="['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>-->
+                  <!--<j-dict-select-tag-->
+                    <!--placeholder="璇烽�夋嫨椹卞姩绫诲瀷"-->
+                    <!--v-decorator="['driveType', validatorRules.driveType]"-->
+                    <!--dictCode="mdc_driveType"-->
+                  <!--/>-->
+              <a-auto-complete
+                v-decorator="['driveType', validatorRules.driveType]"
+                :data-source="driveTypeList"
+                placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
+                :filter-option="filterOption"
+                :allowClear="true"
+              />
+            </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="鏄惁鍚敤" :labelCol="labelCol" :wrapperCol="wrapperCol">
+                <a-switch :checked="isFilterChecked"  v-decorator="['isUse', validatorRules.isUse]" @change="isFilterChange"></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-->
+                <!--&gt;-->
+                <!--</a-input>-->
+              <!--</a-form-item>-->
+            <!--</a-col>-->
+          </a-row>
+        </a-form>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+  import moment from 'moment'
+  import pick from 'lodash.pick'
+  import {
+    getAction,
+    postAction,
+    requestPut,
+    putAction
+  } from '@/api/manage'
+  import {
+    duplicateCheck
+  } from '@/api/api'
+
+  export default {
+    name: 'alarmManagerForm',
+    // components: {AlarmManagerEqupment},
+    props: {
+      driveTypeList:{
+        type:Array
+      },
+      filterOption:{
+        type:Function
+      }
+    },
+    data() {
+      return {
+        isFilterChecked:true,
+        isUse:true,
+        title: '',
+        visible: false,
+        show: false,
+        model: {},
+        checked: false,
+        labelCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 6
+          }
+        },
+        wrapperCol: {
+          xs: {
+            span: 24
+          },
+          sm: {
+            span: 18
+          }
+        },
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules: {
+          driveType:{
+            rules: [{
+              required: true, message: '璇烽�夋嫨椹卞姩绫诲瀷!',
+            }],
+          },
+          alarmCode:{
+            rules: [{
+              required: true, message: '璇疯緭鍏ユ姤璀﹀彿!',
+            }],
+          },
+          alarmContent:{
+            rules: [{
+              required: true, message: '璇疯緭鍏ユ姤璀﹀唴瀹�!',
+            }],
+          },
+        },
+        url: {
+          add: '/mdc/mdcAlarmInfo/add',
+          // edit:'/mdc/alarmInfo/edit',
+          //椹卞姩绫诲瀷
+          initShiftList: '/mdc/mdcequipment/driveTypeSelected',
+
+          //鏂板鏂瑰紡
+        },
+        shiftList: [],
+        shiftSubList: [],
+        disableSubmit: true
+      }
+    },
+    created() {
+    },
+
+    methods: {
+      initShiftList() {
+        getAction(this.url.initShiftList).then((res) => {
+          if (res.success) {
+            this.shiftList = res.result
+          }
+        })
+      },
+      add(record) {
+        let _this = this
+        this.isFilterChecked=true
+        this.form.resetFields()
+        this.model = Object.assign({}, record)
+        // this.initShiftList()
+        this.visible = true
+        this.$nextTick(() => {
+
+        })
+      },
+      close() {
+        this.$emit('close')
+        this.visible = false
+        this.show = false
+      },
+      handleOk() {
+        const that = this
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true
+            let formData = Object.assign(this.model, values)
+            // console.log(formData)
+            // formData.isUse = formData.isUse ? "1" : "2"
+            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.success({
+                  message:'娑堟伅',
+                  description:res.message
+                });
+                that.$emit('ok', res.result)
+              } else {
+                // that.$message.warning(res.message)
+                that.$notification.warning({
+                  message:'娑堟伅',
+                  description:res.message
+                });
+              }
+            }).finally(() => {
+              that.confirmLoading = false
+              that.close()
+            })
+          }
+        })
+      },
+      handleCancel() {
+        this.close()
+      },
+      /**
+       * 鏄惁杩囨护鍒囨崲鍣╟hange浜嬩欢
+       * @param checked 鍒囨崲鍚庣殑鐘舵��
+       */
+      isFilterChange(checked){
+        this.isFilterChecked=checked
+      }
+    }
+  }
+</script>
+
+<style scoped lang="less">
+  /deep/ .ant-modal-content{
+    /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/
+    /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/
+    /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
+    /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
+    /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
+    /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/
+    /*background-color: #000;*/
+  }
+  /deep/ .ant-modal-close{
+    color: #1191b0;
+    font-size: 24px;
+  }
+  /deep/ .ant-modal-close-x{
+    font-size: 24px;
+  }
+  .ant-btn {
+    padding: 0 10px;
+    margin-left: 3px;
+  }
+
+  .ant-form-item-control {
+    line-height: 0px;
+  }
+
+  /** 涓昏〃鍗曡闂磋窛 */
+  .ant-form .ant-form-item {
+    margin-bottom: 10px;
+  }
+
+  /** Tab椤甸潰琛岄棿璺� */
+  .ant-tabs-content .ant-form-item {
+    margin-bottom: 0px;
+  }
+</style>

--
Gitblit v1.9.3