更新功能修改

This commit is contained in:
linfeng 2023-06-02 16:28:23 +08:00
parent 0291f6e77f
commit 41cda3f4a8
2 changed files with 64 additions and 4 deletions

View File

@ -22,7 +22,14 @@
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
content: '' pid: '',
type: '',
uid: '',
toUid: '',
postId: '',
content: '',
status: '',
createTime: ''
}, },
dataRule: { dataRule: {
status: [ status: [
@ -44,7 +51,14 @@
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm.pid = data.comment.pid
this.dataForm.type = data.comment.type
this.dataForm.uid = data.comment.uid
this.dataForm.toUid = data.comment.toUid
this.dataForm.postId = data.comment.postId
this.dataForm.content = data.comment.content this.dataForm.content = data.comment.content
this.dataForm.status = data.comment.status
this.dataForm.createTime = data.comment.createTime
} }
}) })
} }
@ -59,7 +73,14 @@
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'id': this.dataForm.id || undefined, 'id': this.dataForm.id || undefined,
'content': this.dataForm.content 'pid': this.dataForm.pid,
'type': this.dataForm.type,
'uid': this.dataForm.uid,
'toUid': this.dataForm.toUid,
'postId': this.dataForm.postId,
'content': this.dataForm.content,
'status': this.dataForm.status,
'createTime': this.dataForm.createTime
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {

View File

@ -34,8 +34,21 @@ export default {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
uid: "",
topicId: "",
discussId: "",
voteId: "",
title: "",
content: "",
media: "",
readCount: "", readCount: "",
postTop: "" postTop: "",
type: "",
address: "",
longitude: "",
latitude: "",
createTime: "",
status: "",
}, },
}; };
}, },
@ -52,8 +65,21 @@ export default {
params: this.$http.adornParams(), params: this.$http.adornParams(),
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm.uid = data.post.uid;
this.dataForm.topicId = data.post.topicId;
this.dataForm.discussId = data.post.discussId;
this.dataForm.voteId = data.post.voteId;
this.dataForm.title = data.post.title;
this.dataForm.content = data.post.content;
this.dataForm.media = data.post.media;
this.dataForm.readCount = data.post.readCount; this.dataForm.readCount = data.post.readCount;
this.dataForm.postTop = data.post.postTop; this.dataForm.postTop = data.post.postTop;
this.dataForm.type = data.post.type;
this.dataForm.address = data.post.address;
this.dataForm.longitude = data.post.longitude;
this.dataForm.latitude = data.post.latitude;
this.dataForm.createTime = data.post.createTime;
this.dataForm.status = data.post.status;
} }
}); });
} }
@ -70,8 +96,21 @@ export default {
method: "post", method: "post",
data: this.$http.adornData({ data: this.$http.adornData({
id: this.dataForm.id || undefined, id: this.dataForm.id || undefined,
uid: this.dataForm.uid,
topicId: this.dataForm.topicId,
discussId: this.dataForm.discussId,
voteId: this.dataForm.voteId,
title: this.dataForm.title,
content: this.dataForm.content,
media: this.dataForm.media,
readCount: this.dataForm.readCount, readCount: this.dataForm.readCount,
postTop: this.dataForm.postTop postTop: this.dataForm.postTop,
type: this.dataForm.type,
address: this.dataForm.address,
longitude: this.dataForm.longitude,
latitude: this.dataForm.latitude,
createTime: this.dataForm.createTime,
status: this.dataForm.status,
}), }),
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {