|
@@ -6,7 +6,7 @@
|
|
|
<el-card header="全年计划信息">
|
|
|
<el-form :model="info" :rules="rules" label-width="60px" size="small" @submit.native.prevent>
|
|
|
<el-form-item label="年份">
|
|
|
- {{ year }}
|
|
|
+ {{ info.year }}
|
|
|
</el-form-item>
|
|
|
<el-form-item label="标题" prop="title" required>
|
|
|
<el-input v-model="info.title"></el-input>
|
|
@@ -84,11 +84,12 @@ export default {
|
|
|
components: { detailFrame, calendar, dataTable },
|
|
|
data: () => ({
|
|
|
info: {
|
|
|
+ year: '',
|
|
|
termnum: {
|
|
|
batchnum: [],
|
|
|
},
|
|
|
},
|
|
|
- year: '',
|
|
|
+
|
|
|
form: { color: '#409EFF' },
|
|
|
rules: {
|
|
|
title: [{ required: true, message: '请输入标题' }],
|
|
@@ -148,7 +149,7 @@ export default {
|
|
|
color: '#409EFF',
|
|
|
name: '第一期特殊1班',
|
|
|
title: '第一期特殊1班',
|
|
|
- id: 'p1580869422726',
|
|
|
+ id: 'p1580869422724',
|
|
|
},
|
|
|
],
|
|
|
classnum: 2,
|
|
@@ -165,7 +166,7 @@ export default {
|
|
|
batch: '1',
|
|
|
class: '1',
|
|
|
title: '第2期第1批次',
|
|
|
- id: 'p1580869239498',
|
|
|
+ id: 'p1580869239490',
|
|
|
},
|
|
|
{
|
|
|
start: '2020-01-01',
|
|
@@ -185,7 +186,7 @@ export default {
|
|
|
color: '#409EFF',
|
|
|
name: '第二期特殊2班',
|
|
|
title: '第二期特殊2班',
|
|
|
- id: 'p1580869422726',
|
|
|
+ id: 'p1580869422725',
|
|
|
},
|
|
|
],
|
|
|
classnum: 3,
|
|
@@ -213,11 +214,12 @@ export default {
|
|
|
},
|
|
|
}),
|
|
|
created() {
|
|
|
- if (this.isNew) this.$set(this, `year`, new Date().getFullYear());
|
|
|
+ if (this.isNew) this.$set(this.info, `year`, new Date().getFullYear());
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
// ...mapClass(['fetch', 'create', 'update']),
|
|
|
+ //查询计划
|
|
|
async search() {
|
|
|
// const res = await this.fetch(this.id);
|
|
|
// if (this.$checkRes(res)) this.$set(this, `info`, res.data);
|
|
@@ -235,13 +237,14 @@ export default {
|
|
|
let { termnum, year, title } = this.axiosData;
|
|
|
this.$set(this, `events`, events);
|
|
|
this.$set(this, `info`, { title, year });
|
|
|
- this.$set(this, `year`, year);
|
|
|
},
|
|
|
+ //拖拽选择事件
|
|
|
selectDate(object) {
|
|
|
this.$set(this.form, `start`, JSON.parse(JSON.stringify(object.startStr)));
|
|
|
this.$set(this.form, `end`, JSON.parse(JSON.stringify(object.endStr)));
|
|
|
this.drawer = true;
|
|
|
},
|
|
|
+ //日历事件点击事件
|
|
|
eventClick({ event }) {
|
|
|
let arr = this.events.filter(fil => fil.id == event.id);
|
|
|
if (arr.length > 0) this.form = arr[0];
|
|
@@ -251,13 +254,16 @@ export default {
|
|
|
}
|
|
|
this.drawer = true;
|
|
|
},
|
|
|
+ //列表编辑事件
|
|
|
toEdit({ data, index }) {
|
|
|
this.$set(this, `form`, JSON.parse(JSON.stringify(data)));
|
|
|
this.drawer = true;
|
|
|
},
|
|
|
+ //列表删除事件
|
|
|
toDelete({ data, index }) {
|
|
|
this.events.splice(index, 1);
|
|
|
},
|
|
|
+ //保存计划事件
|
|
|
savePlan() {
|
|
|
//全年计划内容
|
|
|
let data = JSON.parse(JSON.stringify(this.info));
|
|
@@ -277,6 +283,7 @@ export default {
|
|
|
data.termnum = termnum;
|
|
|
//TODO 连接接口
|
|
|
},
|
|
|
+ //保存表单函数
|
|
|
saveForm() {
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
@@ -287,10 +294,12 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //重置表单函数
|
|
|
resetForm() {
|
|
|
this.$refs.form.resetFields();
|
|
|
this.setHeight();
|
|
|
},
|
|
|
+ //添加/修改函数
|
|
|
setEvent() {
|
|
|
//TODO 需要根据班级类型把数据分开
|
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
@@ -319,6 +328,7 @@ export default {
|
|
|
}
|
|
|
if (_.findIndex(this.predefineColors, item => item == data.color) < 0) this.predefineColors.push(data.color);
|
|
|
},
|
|
|
+ //关闭抽屉函数
|
|
|
toClose() {
|
|
|
this.drawer = false;
|
|
|
this.resetForm();
|