Commit 17762b2c authored by Zachary's avatar Zachary

test(测试国别):测试国别

parent d0e3d2e3
<template>
<div class="testLog-manage">
<el-table
:data="datas"
border
style="width: 100%">
<el-table-column
fixed
prop="id"
label="序号"
width="150">
</el-table-column>
<el-table-column
prop="data"
label="数据"
width="120">
</el-table-column>
<el-table-column
label="操作">
<template slot-scope="scope">
<el-button @click="addData" type="text" size="small" >增加</el-button>
<el-button @click="updateData(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="delData(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="修改" :visible.sync="dialogFormVisible">
<el-form :model="form">
<el-form-item label="数据" >
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { list, add, del, update,detectIp } from '@/api/monitor/testLog'
export default {
name: 'testLog',
data() {
return {
datas:[],
dialogFormVisible: false,
}
},
created() {
this.getList()
this.detectIP()
},
methods: {
detectIP(){
detectIp().then(res=>{
console.log('国家是:',res)
})
},
getList() {
list().then(res => {
res.data.forEach(e => {
this.datas.push(e)
})
})
},
delData(row){
del(row.id)
window.location.reload()
},
clearData(){
this.datas = []
},
addData() {
this.$prompt('请输入测试数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
}).then(({ value }) => {
add(value)
}).catch(() => {
});
},
updateData(row){
this.$prompt('修改数据','修改',{
confirmButtonText:'确定',
cancelButtonText:'取消'
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment