diff --git a/index.html b/index.html index 8388c4b..4daef50 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,10 @@ - + - Vite + Vue + 鼎新工具集
diff --git a/src/apis/update.js b/src/apis/update.js index 698bdc2..014592f 100644 --- a/src/apis/update.js +++ b/src/apis/update.js @@ -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 }) } diff --git a/src/views/update/index.vue b/src/views/update/index.vue index ed657cc..e6adfe7 100644 --- a/src/views/update/index.vue +++ b/src/views/update/index.vue @@ -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( - + @@ -127,14 +144,14 @@ onMounted( 重置 - 刷新 + 刷新 - +