Merge remote-tracking branch 'origin/main'

main
roger_home_pc 11 months ago
commit b0ec53eeaf
  1. 4
      index.html
  2. 12
      src/apis/update.js
  3. 27
      src/views/update/index.vue

@ -1,10 +1,10 @@
<!doctype html>
<html lang="en">
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<title>鼎新工具集</title>
</head>
<body>
<div id="app"></div>

@ -3,15 +3,21 @@ import request from "@/request/index.js";
export const cinema_list = () => {
// console.log('cinema_list')
return request({
url: '/update/cinema/',
url: '/update/cinema/refresh/?ordering=ip',
method: 'get'
})
}
export const cinema_search = (params) => {
const req_params = {
ordering: 'ip',
search: params['version'],
ip: params['ip']
}
console.log(req_params)
return request({
url: '/update/cinema/search',
url: '/update/cinema/',
method: 'get',
params: params
params: req_params
})
}

@ -11,6 +11,12 @@ const cinemaSearch = reactive({
const cinemaSearchRef = ref()
//
const tableData = ref([])
let refresh_disable = ref(false)
let refresh_loading = ref(false)
//
const ip_validate = (rule, value, callback) => {
const regex = new RegExp('((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})(\\.((2(5[0-5]|[0-4]\\d))|[0-1]?\\d{1,2})){3}');
@ -33,7 +39,7 @@ const submitSearch = async (formEl) => {
console.log('至少执行了')
console.log(cinemaSearch.ip)
const {ip, version} = unref(cinemaSearch)
tableData.value = []
await cinema_search({ip, version}).then(
res => {
if (Array.isArray(res)) {
@ -70,11 +76,22 @@ const resetSearch = (formEl) => {
formEl.resetFields()
}
const refresh = (formEL) => {
formEL.resetFields()
refresh_disable.value = true;
refresh_loading.value = true;
get_table_data()
setTimeout(()=>{
refresh_disable.value = false;
refresh_loading.value = false;
}, 5000)
}
//
const tableData = ref([])
async function get_table_data() {
tableData.value = []
await cinema_list().then(res => {
if (Array.isArray(res)) {
tableData.value = [...res]
@ -116,7 +133,7 @@ onMounted(
</el-col>
<el-col :span="8">
<el-form-item label="系统版本" prop="version">
<el-input v-model="cinemaSearch.version" style="width: 160px;"></el-input>
<el-input v-model="cinemaSearch.version" placeholder="支持模糊查询" style="width: 160px;"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -127,14 +144,14 @@ onMounted(
<el-button @click="resetSearch(cinemaSearchRef)">重置</el-button>
</el-form-item>
<el-form-item>
<el-button @click="get_table_data()">刷新</el-button>
<el-button v-bind:disabled="refresh_disable" @click="refresh(cinemaSearchRef)" v-bind:loading="refresh_loading">刷新</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="更新时间" min-width="200"></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>

Loading…
Cancel
Save