|
@@ -66,7 +66,6 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <!-- 日程时间 -->
|
|
|
<a-row :gutter="24">
|
|
|
<!-- <a-col :span="12">
|
|
|
<a-form-item label="提醒类型">
|
|
@@ -143,7 +142,7 @@
|
|
|
</a-col>
|
|
|
<!-- 引入富文本组件 -->
|
|
|
<a-col :span="24">
|
|
|
- <RichText ref="RichText" :modelValue="smallText" style="margin:0 170px 0 130px;"></RichText>
|
|
|
+ <RichText ref="RichText" :richTextVal="smallText" style="margin:0 170px 0 130px;"></RichText>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -172,9 +171,8 @@ export default {
|
|
|
formLayout: 'horizontal',
|
|
|
addForm: this.$form.createForm(this, { name: 'coordinated' }),
|
|
|
checked: true,
|
|
|
- memo: '',
|
|
|
formData: {}, // 表单数据(回显)
|
|
|
- showTime: [], // 开始结束时间集合
|
|
|
+ timeList: [], // 开始/结束时间集合
|
|
|
isDate: false, // 默认无时分秒
|
|
|
smallText: '' // 富文本内容
|
|
|
}
|
|
@@ -214,7 +212,7 @@ export default {
|
|
|
this.formData.endTime = this.fatherData
|
|
|
/// 2、判断该时间 有无时分秒 赋值给 isDate
|
|
|
this.isDate = this.isDatetime(this.fatherData)
|
|
|
- var showTime = [
|
|
|
+ var timeList = [
|
|
|
moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
|
|
|
moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
|
|
|
]
|
|
@@ -230,14 +228,16 @@ export default {
|
|
|
// console.log('半小时后的时间', reaET)
|
|
|
var reaET = new Date(z)
|
|
|
// console.log('22', z)
|
|
|
- showTime = [moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'), moment(reaET, 'YYYY/MM/DD HH:mm')]
|
|
|
+ timeList = [moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'), moment(reaET, 'YYYY/MM/DD HH:mm')]
|
|
|
} else {
|
|
|
- showTime = [moment(this.formData.startTime, 'YYYY/MM/DD'), moment(this.formData.endTime, 'YYYY/MM/DD')]
|
|
|
+ timeList = [moment(this.formData.startTime, 'YYYY/MM/DD'), moment(this.formData.endTime, 'YYYY/MM/DD')]
|
|
|
}
|
|
|
// ==============================================================
|
|
|
// 赋值
|
|
|
- this.addForm.setFieldsValue({
|
|
|
- continue: showTime
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.addForm.setFieldsValue({
|
|
|
+ continue: timeList
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -245,16 +245,19 @@ export default {
|
|
|
// 回显表单的赋值
|
|
|
getFormInfo () {
|
|
|
console.log('点击日程的ID:', this.formData.id)
|
|
|
- this.addForm.setFieldsValue({
|
|
|
- title: this.formData.title,
|
|
|
- type: this.formData.type, // 日程类型
|
|
|
- degreeOfUrgency: this.formData.degreeOfUrgency, // 紧急程度
|
|
|
- memo: this.formData.memo, // 备注
|
|
|
- backgroundColor: this.formData.backgroundColor,
|
|
|
- continue: [
|
|
|
- moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
|
|
|
- moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
|
|
|
- ]
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.addForm.setFieldsValue({
|
|
|
+ title: this.formData.title,
|
|
|
+ type: this.formData.type, // 日程类型
|
|
|
+ degreeOfUrgency: this.formData.degreeOfUrgency, // 紧急程度
|
|
|
+ backgroundColor: this.formData.backgroundColor,
|
|
|
+ continue: [
|
|
|
+ moment(this.formData.startTime, 'YYYY/MM/DD HH:mm'),
|
|
|
+ moment(this.formData.endTime, 'YYYY/MM/DD HH:mm')
|
|
|
+ ],
|
|
|
+ content: this.$refs.RichText.content
|
|
|
+ })
|
|
|
+ console.log(this.$refs.RichText.content)
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -263,15 +266,15 @@ export default {
|
|
|
this.addForm.validateFields((err, values) => {
|
|
|
console.log('跑出来', values)
|
|
|
if (!err) {
|
|
|
- // ------------------------------------------------------
|
|
|
- var scheduleObject = {} // 赋值
|
|
|
+ // ---赋值-------------------------------------------
|
|
|
+ var scheduleObject = {}
|
|
|
scheduleObject.title = values.title
|
|
|
scheduleObject.type = values.type
|
|
|
scheduleObject.degreeOfUrgency = values.degreeOfUrgency
|
|
|
scheduleObject.startTime = values.continue[0].format('YYYY-MM-DD HH:mm:ss')
|
|
|
scheduleObject.endTime = values.continue[1].format('YYYY-MM-DD HH:mm:ss')
|
|
|
- scheduleObject.memo = values.memo
|
|
|
scheduleObject.backgroundColor = values.backgroundColor
|
|
|
+ scheduleObject.content = this.$refs.RichText.content
|
|
|
// 修改------------------------------------------------
|
|
|
if (this.formData.id) {
|
|
|
scheduleObject.id = this.formData.id
|
|
@@ -285,13 +288,6 @@ export default {
|
|
|
// 调用父组件方法(查询数据)
|
|
|
this.fatherMethod()
|
|
|
}
|
|
|
- // if (this.scheduleObject === this.formData) {
|
|
|
- // console.log('00', this.scheduleObject)
|
|
|
- // console.log('11', this.formData)
|
|
|
- // console.log('没做修改的状态')
|
|
|
- // this.$message.success('您未做任何修改')
|
|
|
- // // 未做任何修改,状态不变
|
|
|
- // }
|
|
|
})
|
|
|
} else {
|
|
|
// 新增------------------------------------------
|
|
@@ -299,7 +295,7 @@ export default {
|
|
|
if (res.success) {
|
|
|
this.savePlanModalVisible = false
|
|
|
this.$message.success('新增日程成功')
|
|
|
- this.addForm.resetFields() // 清空
|
|
|
+ this.addForm.resetFields() // 清空表单
|
|
|
// 调用父组件的方法(查询数据)
|
|
|
this.fatherMethod()
|
|
|
}
|
|
@@ -308,7 +304,7 @@ export default {
|
|
|
// ----------------------------------------------
|
|
|
} else {
|
|
|
this.$message.error('请填写信息')
|
|
|
- console.log('没有填写相关信息')
|
|
|
+ console.log('未填写相关信息')
|
|
|
}
|
|
|
})
|
|
|
},
|