|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<script setup> |
|
|
|
|
import {ref, reactive, unref, onMounted, onBeforeMount} from 'vue'; |
|
|
|
|
import {cinema_list} from "@/apis/update.js"; |
|
|
|
|
import {onBeforeMount, onMounted, reactive, ref, unref} from 'vue'; |
|
|
|
|
import {cinema_list, cinema_search} from "@/apis/update.js"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表单部分 |
|
|
|
@ -29,9 +29,27 @@ const ipRule = reactive({ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 数据提交 |
|
|
|
|
const submitSearch = (formEl) => { |
|
|
|
|
const submitSearch = async (formEl) => { |
|
|
|
|
console.log('至少执行了') |
|
|
|
|
console.log(cinemaSearch.ip) |
|
|
|
|
const {ip, version} = unref(cinemaSearch) |
|
|
|
|
|
|
|
|
|
await cinema_search({ip, version}).then( |
|
|
|
|
res => { |
|
|
|
|
if (Array.isArray(res)) { |
|
|
|
|
tableData.value = [...res] |
|
|
|
|
console.log(tableData) |
|
|
|
|
} else { |
|
|
|
|
console.log('else') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
).catch( |
|
|
|
|
err => { |
|
|
|
|
console.log('err') |
|
|
|
|
console.log(err) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// console.log(formEl) |
|
|
|
|
console.log(ip, version) |
|
|
|
|
if (!formEl) return |
|
|
|
@ -52,66 +70,32 @@ const resetSearch = (formEl) => { |
|
|
|
|
formEl.resetFields() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// const get_table_data = { |
|
|
|
|
// async |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// 表格部分 |
|
|
|
|
// const tableData = cinema_list().then(res => { |
|
|
|
|
// |
|
|
|
|
// if (res.code === 200) { |
|
|
|
|
// console.log(res) |
|
|
|
|
// return res.data |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// // console.log(tableData) |
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
const get_table_data = async () => { |
|
|
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
|
|
async function get_table_data() { |
|
|
|
|
await cinema_list().then(res => { |
|
|
|
|
if (res.length > 0) { |
|
|
|
|
console.log(res) |
|
|
|
|
return reactive([...res]) |
|
|
|
|
// console.log(tableData) |
|
|
|
|
if (Array.isArray(res)) { |
|
|
|
|
tableData.value = [...res] |
|
|
|
|
console.log(tableData) |
|
|
|
|
} else { |
|
|
|
|
console.log('else') |
|
|
|
|
return reactive([]); |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log('err') |
|
|
|
|
console.log(err) |
|
|
|
|
return reactive([]); |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
// |
|
|
|
|
// let tableData = reactive( |
|
|
|
|
// [ |
|
|
|
|
// { |
|
|
|
|
// 'update_time': '2023-12-13 16:16:18', |
|
|
|
|
// 'name': '鼎新测试环境3.112', |
|
|
|
|
// 'ip': '172.16.3.112', |
|
|
|
|
// 'zz_num': '14105121', |
|
|
|
|
// 'inner_id': '2105', |
|
|
|
|
// 'db_user': 'test', |
|
|
|
|
// 'db_pwd': 'cine123456', |
|
|
|
|
// 'sys_ver': '2.0.33.0337ZZ', |
|
|
|
|
// 'client_ver': '2.033.0337.8894' |
|
|
|
|
// } |
|
|
|
|
// ] |
|
|
|
|
// ) |
|
|
|
|
// console.log(tableData) |
|
|
|
|
// |
|
|
|
|
|
|
|
|
|
onMounted( |
|
|
|
|
async () => { |
|
|
|
|
console.log('onMounted1') |
|
|
|
|
const tableData = await get_table_data(); |
|
|
|
|
console.log('onMounted2') |
|
|
|
|
await get_table_data(); |
|
|
|
|
console.log(tableData) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
@ -142,19 +126,23 @@ onMounted( |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="resetSearch(cinemaSearchRef)">重置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button @click="get_table_data()">刷新</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</el-form> |
|
|
|
|
<el-table :data="tableData" style="width: 100%"> |
|
|
|
|
<el-table-column prop="update_time" label="更新时间" width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="影院名称" width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="ip" label="影院IP" width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="zz_num" label="专资编码" width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="inner_id" label="鼎新编码" width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="sys_ver" label="系统版本" width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="client_ver" label="客户端版本" width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="db_user" label="数据库账号" width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="db_pwd" label="数据库密码" width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="update_time" label="更新时间" min-width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="影院名称" min-width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="ip" label="影院IP" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="zz_num" label="专资编码" min-width="120"></el-table-column> |
|
|
|
|
<el-table-column prop="inner_id" label="鼎新编码" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="sys_ver" label="系统版本" min-width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="client_ver" label="客户端版本" min-width="200"></el-table-column> |
|
|
|
|
<el-table-column prop="db_user" label="数据库账号" min-width="100"></el-table-column> |
|
|
|
|
<el-table-column prop="db_pwd" label="数据库密码" min-width="120"></el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|