loading修改
This commit is contained in:
1 parent
4388bcf509
commit
c521ad4feb
1 file changed
+28
-14
@@ -19,7 +19,7 @@
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@sort-change="sortChangeHandle"
|
||||
max-height="calc(100vh - 300px)"
|
||||
max-height="calc(100vh - 260px)"
|
||||
>
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column prop="apiUrl" label="apiUrl" show-overflow-tooltip min-width="160" />
|
||||
@@ -30,7 +30,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="orgRes" label="原始res" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.orgRes" text type="primary" @click="row.orgRes && handleClickJsonView(row.orgRes)"> 查看 </el-button>
|
||||
<el-button v-if="row.orgRes" text type="primary" @click="row.orgRes && handleClickJsonView(row.orgRes)">查看</el-button>
|
||||
<div class="color-danger" v-else>null</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -70,7 +70,6 @@
|
||||
<div v-else class="color-danger">null</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="version" label="同步版本" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
@@ -95,7 +94,7 @@ import "vue-json-pretty/lib/styles.css"
|
||||
import { syncAllDept, syncAllMch, syncAllRole, syncAllUser } from "/@/api/wallet/mch-thrid-zy"
|
||||
import { syncNativeCardTradeInfo } from "/@/api/hard/hard-thrid-zy"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { NextLoading } from "/@/utils/loading"
|
||||
import { ElLoading } from "element-plus"
|
||||
|
||||
const LogDetail = defineAsyncComponent(() => import("./detail.vue"))
|
||||
|
||||
@@ -107,6 +106,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList,
|
||||
})
|
||||
const loading = ref()
|
||||
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, tableStyle } = useTable(state)
|
||||
|
||||
@@ -116,9 +116,18 @@ const handleClickJsonView = (json: any) => {
|
||||
jsonData.value = JSON.parse(json)
|
||||
}
|
||||
|
||||
// 开启全屏loading
|
||||
const loadingStart = () => {
|
||||
loading.value = ElLoading.service({
|
||||
lock: true,
|
||||
text: "同步中...",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
})
|
||||
}
|
||||
|
||||
// 商户信息同步
|
||||
const merchantInfoSync = async () => {
|
||||
NextLoading.start()
|
||||
loadingStart()
|
||||
try {
|
||||
const res = await syncAllMch()
|
||||
if (res.code === 0) {
|
||||
@@ -128,12 +137,13 @@ const merchantInfoSync = async () => {
|
||||
} catch (error: any) {
|
||||
useMessage().error(error)
|
||||
} finally {
|
||||
NextLoading.done()
|
||||
loading.value.close()
|
||||
loading.value = null
|
||||
}
|
||||
}
|
||||
// 记账单位同步
|
||||
const unitOfAccountSync = async () => {
|
||||
NextLoading.start()
|
||||
loadingStart()
|
||||
try {
|
||||
const res = await syncAllDept()
|
||||
if (res.code === 0) {
|
||||
@@ -143,12 +153,13 @@ const unitOfAccountSync = async () => {
|
||||
} catch (error: any) {
|
||||
useMessage().error(error)
|
||||
} finally {
|
||||
NextLoading.done()
|
||||
loading.value.close()
|
||||
loading.value = null
|
||||
}
|
||||
}
|
||||
// 账户信息同步
|
||||
const accountInfoSync = async () => {
|
||||
NextLoading.start()
|
||||
loadingStart()
|
||||
try {
|
||||
const res = await syncAllRole()
|
||||
if (res.code === 0) {
|
||||
@@ -158,12 +169,13 @@ const accountInfoSync = async () => {
|
||||
} catch (error: any) {
|
||||
useMessage().error(error)
|
||||
} finally {
|
||||
NextLoading.done()
|
||||
loading.value.close()
|
||||
loading.value = null
|
||||
}
|
||||
}
|
||||
// 身份信息同步
|
||||
const identityInfoSync = async () => {
|
||||
NextLoading.start()
|
||||
loadingStart()
|
||||
try {
|
||||
const res = await syncAllUser()
|
||||
if (res.code === 0) {
|
||||
@@ -173,12 +185,13 @@ const identityInfoSync = async () => {
|
||||
} catch (error: any) {
|
||||
useMessage().error(error)
|
||||
} finally {
|
||||
NextLoading.done()
|
||||
loading.value.close()
|
||||
loading.value = null
|
||||
}
|
||||
}
|
||||
// 交易数据同步
|
||||
const transactionDataSync = async () => {
|
||||
NextLoading.start()
|
||||
loadingStart()
|
||||
try {
|
||||
const res = await syncNativeCardTradeInfo()
|
||||
if (res.code === 0) {
|
||||
@@ -188,7 +201,8 @@ const transactionDataSync = async () => {
|
||||
} catch (error: any) {
|
||||
useMessage().error(error)
|
||||
} finally {
|
||||
NextLoading.done()
|
||||
loading.value.close()
|
||||
loading.value = null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user