|
@@ -153,7 +153,6 @@ export default {
|
|
|
city_arr_id: [],//行政区划
|
|
|
city_id: '',//城市id
|
|
|
content: "",
|
|
|
- timelist: "",
|
|
|
file: "",//文件路径
|
|
|
department_arr_id: [],//部门id
|
|
|
department_id: '',//部门id
|
|
@@ -397,7 +396,6 @@ export default {
|
|
|
}
|
|
|
|
|
|
delete this.form.cat_arr_id;
|
|
|
- delete this.form.timelist;
|
|
|
delete this.form.catid;
|
|
|
this.form.file = this.file;
|
|
|
console.log(this.form, 'this.form-----------------')
|
|
@@ -475,7 +473,6 @@ export default {
|
|
|
this.form.city_id = res.data.city_id;
|
|
|
this.form.department_id = res.data.department_id;
|
|
|
this.form.cat_id = res.data.cat_id;
|
|
|
- this.form.time = [res.data.start, res.data.end];
|
|
|
this.form.file = res.data.file;
|
|
|
this.file = res.data.file;
|
|
|
const filePath = res.data.file;
|
|
@@ -483,6 +480,8 @@ export default {
|
|
|
this.fileType = fileExtension; // 设置文件类型
|
|
|
this.form.is_group = parseInt(res.data.is_group);
|
|
|
this.form.group_name = res.data.group_name;
|
|
|
+ this.form.want = res.data.want;
|
|
|
+ this.form.start = res.data.start ? new Date(res.data.start) : null; // 处理时间格式
|
|
|
})
|
|
|
},
|
|
|
async loadCascaderPath(path) {
|
|
@@ -519,14 +518,12 @@ export default {
|
|
|
//添加要修改的id
|
|
|
this.form.id = this.editId;
|
|
|
//先进行验证
|
|
|
- if (this.form.islong == 1 && this.form.validity == null) {
|
|
|
- this.form.validity = '1970-01-01 00:00:00';
|
|
|
- }
|
|
|
+
|
|
|
this.$refs.form.validate(valid => {
|
|
|
|
|
|
if (valid) {
|
|
|
- if (this.form.validity) {
|
|
|
- this.form.validity = formatLocalDate(this.form.validity);
|
|
|
+ if (this.form.start) {
|
|
|
+ this.form.start = formatLocalDate(this.form.start);
|
|
|
}
|
|
|
if (this.form.department_arr_id.length == 0) {
|
|
|
this.form.department_id = 0;
|
|
@@ -543,14 +540,9 @@ export default {
|
|
|
this.form.department_id = this.form.department_arr_id.at(-1) || 0;
|
|
|
this.form.department_arr_id = JSON.stringify(this.form.department_arr_id);
|
|
|
}
|
|
|
- console.log(typeof this.form.time, '---=-==-=')
|
|
|
- if (typeof this.form.time == 'object' && this.form.time.length > 0) {
|
|
|
- this.form.start = this.formatDate(this.form.time[0]);
|
|
|
- this.form.end = this.formatDate(this.form.time[1]);
|
|
|
- delete this.form.time;
|
|
|
- }
|
|
|
+
|
|
|
delete this.form.cat_arr_id;
|
|
|
- delete this.form.timelist;
|
|
|
+ delete this.form.time;
|
|
|
delete this.form.catid;
|
|
|
this.form.file = this.file;
|
|
|
console.log(this.form, 'this.form-----------------')
|
|
@@ -592,6 +584,14 @@ export default {
|
|
|
|
|
|
},
|
|
|
watch: {
|
|
|
+ '$route'(to, from) {
|
|
|
+ console.log(from, '---------------------------------------');
|
|
|
+ // 监听路由参数中的 id 变化,若变化则更新页面状态并获取数据
|
|
|
+ if (to.query.id) {
|
|
|
+ this.getMainData();
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
},
|
|
|
mounted() {
|
|
|
//1.判断是新建还是回显
|