添加按钮相关API接口,未完成

This commit is contained in:
ngfchl
2022-12-04 20:15:24 +08:00
parent fdea1e5564
commit 158ddc5e33
3 changed files with 114 additions and 19 deletions

View File

@@ -269,25 +269,97 @@
deep: true,
}
},
methods: {
signIn(id) {
alert(id)
},
updateSite(id) {
alert(id)
},
editSite(id) {
alert(id)
},
showHistoryList(id) {
axios.get(
"{% url 'site_data_api' %}" + '?id=' + id
).then(res => {
console.log('获取数据列表成功', res.data)
let data = res.data
if ((typeof res.data) == "string") {
data = JSON.parse(data)
}
methods: {
signIn(id) {
axios.get(
"{% url 'sign_in_api' %}" + '?id=' + id
).then(res => {
console.log('获取数据列表成功', res.data)
let data = res.data
{#console.log(typeof res.data.data)#}
if (res.data.code === 0) {
this.$message({
type: 'success',
message: res.data.msg
});
} else {
this.loading = false
this.$message({
type: 'warning',
message: '获取数据列表失败!'
});
}
}).catch(res => {
console.log('获取数据列表失败', res)
this.$message({
type: 'warning',
message: '获取数据列表失败!' + res
});
})
},
updateSite(id) {
axios.get(
"{% url 'update_site_api' %}" + '?id=' + id
).then(res => {
console.log('获取数据列表成功', res.data)
let data = res.data
{#console.log(typeof res.data.data)#}
if (res.data.code === 0) {
this.$message({
type: 'success',
message: res.data.msg
});
} else {
this.loading = false
this.$message({
type: 'warning',
message: '获取数据列表失败!'
});
}
}).catch(res => {
console.log('获取数据列表失败', res)
this.$message({
type: 'warning',
message: '获取数据列表失败!' + res
});
})
},
editSite(id) {
axios.get(
"{% url 'edit_site_api' %}" + '?id=' + id
).then(res => {
console.log('获取数据列表成功', res.data)
let data = res.data
{#console.log(typeof res.data.data)#}
if (res.data.code === 0) {
this.$message({
type: 'success',
message: res.data.msg
});
} else {
this.loading = false
this.$message({
type: 'warning',
message: '获取数据列表失败!'
});
}
}).catch(res => {
console.log('获取数据列表失败', res)
this.$message({
type: 'warning',
message: '获取数据列表失败!' + res
});
})
},
showHistoryList(id) {
axios.get(
"{% url 'site_data_api' %}" + '?id=' + id
).then(res => {
console.log('获取数据列表成功', res.data)
let data = res.data
if ((typeof res.data) == "string") {
data = JSON.parse(data)
}
{#console.log(typeof res.data.data)#}
if (res.data.code === 0) {
{#this.ptData = res.data.data#}