mirror of
https://github.com/ngfchl/ptools
synced 2023-07-10 13:41:22 +08:00
添加按钮相关API接口,未完成
This commit is contained in:
@@ -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#}
|
||||
|
||||
Reference in New Issue
Block a user