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/alarmManagerEdit.vue | 234 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 234 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue b/src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue new file mode 100644 index 0000000..4955e2e --- /dev/null +++ b/src/views/mdc/base/modules/alarmManager/alarmManagerEdit.vue @@ -0,0 +1,234 @@ +<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 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"> + <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-input v-decorator="['driveType', validatorRules.driveType]"--> + <!--/>--> + <a-input :disabled='disabled' placeholder="璇疯緭鍏ラ┍鍔ㄧ被鍨�" v-decorator="['driveType', validatorRules.driveType]"></a-input> + </a-form-item> + </a-col> + <a-col :span="24"> + <a-form-item label="鏄惁鍚敤" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <!--<j-switch v-model="model.isUse"></j-switch>--> + <a-switch v-model="isUse"/> + <!--<a-radio-group v-model="model.isUse">--> + <!--<a-radio :value="1">--> + <!--鏄�--> + <!--</a-radio>--> + <!--<a-radio :value="2">--> + <!--鍚�--> + <!--</a-radio>--> + <!--</a-radio-group>--> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + <!--<device-calend-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-calend-list-model>--> + <!--<alarm-manager-equpment ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></alarm-manager-equpment>--> + </a-modal> + </div> +</template> + +<script> + // import DeviceCalendListModel from './DeviceCalendarListModel' + // import AlarmManagerEqupment from './alarmManangerEqupment' + 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: 'alarmManagerEdit', + components: {}, + props: { + }, + data() { + return { + isUse:false, + disabled: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: { + // shiftId:{ + // rules: [{ + // required: true, message: '璇烽�夋嫨鐝埗!', + // }], + // }, + alarmCode:{ + rules: [{ + required: true, message: '璇疯緭鍏ユ姤璀﹀彿!', + }], + }, + alarmContent:{ + rules: [{ + required: true, message: '璇疯緭鍏ユ姤璀﹀唴瀹�!', + }], + }, + }, + url: { + // add: '/mdc/alarmInfo/add', + edit: '/mdc/mdcAlarmInfo/edit', + //椹卞姩绫诲瀷 + initShiftList: '/mdc/mdcequipment/driveTypeSelected', + }, + shiftList: [], + shiftSubList: [], + disableSubmit: true + } + }, + created() { + }, + + methods: { + edit(record) { + this.form.resetFields() + this.model = Object.assign({}, record) + this.visible = true + this.$nextTick(() => { + this.isUse=record.isUse===0?true:false + this.form.setFieldsValue(pick(this.model, 'alarmCode', 'alarmContent','driveType')) + }) + }, + initShiftList() { + getAction(this.url.initShiftList).then((res) => { + if (res.success) { + this.shiftList = res.result + } + }) + }, + 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) + formData.isUse = this.isUse ? "0" : "-1" + let obj + if (!this.model.id) { + // obj = postAction(this.url.add, formData) + } else { + obj = requestPut(this.url.edit, formData, { + id: this.model.id + }) + } + obj.then((res) => { + if (res.success) { + // that.$message.success("娣诲姞鎴愬姛") + that.$notification.success({ + message:'娑堟伅', + description:"淇敼鎴愬姛" + }); + // that.$message.success(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() + }, + } + } +</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