¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |