Обновление таблицы
This commit is contained in:
1 parent
643d14c35d
commit
785f9f0ba8
6 files changed
+52
-52
No files matched your search
@@ -99,17 +99,26 @@ export default {
|
||||
const tab_userComment = ref([])
|
||||
const t_userComment = ref([])
|
||||
|
||||
function f_baseCriteria() {
|
||||
axiosApiInstance.get('api/feedback/baseCriteria/')
|
||||
.then(data => {
|
||||
t_baseCriteria.value = data.data.results
|
||||
})
|
||||
console.log(t_baseCriteria.value, 't_baseCriteria.value');
|
||||
}
|
||||
|
||||
function f_userComment() {
|
||||
axiosApiInstance.get(`api/feedback/userComment/`)
|
||||
.then(data => {
|
||||
t_userComment.value = data.data.results
|
||||
})
|
||||
console.log(t_userComment.value, 't_userComment.value');
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
axiosApiInstance.get('api/feedback/baseCriteria/')
|
||||
.then(data => {
|
||||
t_baseCriteria.value = data.data.results
|
||||
})
|
||||
|
||||
axiosApiInstance.get(`api/feedback/userComment/`)
|
||||
.then(data => {
|
||||
t_userComment.value = data.data.results
|
||||
})
|
||||
f_baseCriteria()
|
||||
f_userComment()
|
||||
|
||||
})
|
||||
|
||||
@@ -134,7 +143,7 @@ export default {
|
||||
t_baseCriteria.value.map(e =>
|
||||
{
|
||||
const { id, rating } = {...e}
|
||||
decFeed.push({id:id, rating:rating})
|
||||
decFeed.push({crit_id:id, rating:rating})
|
||||
});
|
||||
return { decFeed }
|
||||
});
|
||||
@@ -164,19 +173,17 @@ export default {
|
||||
}
|
||||
|
||||
function proba() {
|
||||
|
||||
console.log(ratingStatus.value.decFeed, 'ratingStatus.value.decFeed');
|
||||
const feedObj = {}
|
||||
|
||||
feedObj.comment = comment.value
|
||||
feedObj.ratingstatus = ratingStatus.value.decFeed
|
||||
if (t_userComment.value.length==0) {
|
||||
axiosApiInstance.post(`api/feedback/userComment/`, feedObj)
|
||||
}
|
||||
else {
|
||||
console.log('------------------yuiyui----/${t_userComment.value[0].id}------', );
|
||||
axiosApiInstance.put(`api/feedback/userCommentUp/${t_userComment.value[0].id}/`, feedObj)
|
||||
}
|
||||
|
||||
// console.log(t_userComment.value.length, 't_userComment.value');
|
||||
}
|
||||
|
||||
return {t_baseCriteria, tab_userComment, comment, average, feedAll, feedUp, menusCloses, myLabel, proba}
|
||||
|
||||
Reference in new issue
Block a user