|
|
@@ -117,7 +117,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { computed, ref, nextTick, reactive } from 'vue';
|
|
|
+import { computed, ref, nextTick, reactive, watch } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
const { t, locale } = useI18n();
|
|
|
@@ -243,23 +243,27 @@ const filterFields = computed(() => [
|
|
|
{
|
|
|
key: 'orderStatus', type: 'select', label: t('Custom.PaymentHistory.Status'), placeholder: t('placeholder.choose'), options: orderStatusMap.value, defaultValue: null
|
|
|
},
|
|
|
- isLoaded.value && isSuccess.value && { key: 'login', type: 'select', label: t('Custom.PaymentHistory.TradingAccount'), placeholder: t('placeholder.login'), options: loginOptions || [], defaultValue: search.login || undefined, clearable: true },
|
|
|
+ isLoaded.value && isSuccess.value && { key: 'login', type: 'select', label: t('Custom.PaymentHistory.TradingAccount'), placeholder: t('placeholder.login'), options: loginOptions || [], defaultValue: undefined, clearable: true },
|
|
|
{ key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange' }
|
|
|
])
|
|
|
|
|
|
const searchParams = ref({})
|
|
|
|
|
|
-const handleSearch = (params) => {
|
|
|
+const handleSearch = (params, type) => {
|
|
|
Object.assign(search, params)
|
|
|
- search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
|
|
|
- nextTick(() => {
|
|
|
+ search.platform = loginOptions?.find(item => item.value === params.login)?.platform || ''
|
|
|
+ search.login = params.login && Number(params.login)
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ console.log(search, params, 10000, type);
|
|
|
tableRef.value.refreshTable()
|
|
|
- })
|
|
|
+ }, 10)
|
|
|
}
|
|
|
|
|
|
const handleReset = (params) => {
|
|
|
Object.assign(search, params)
|
|
|
- search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
|
|
|
+ search.platform = loginOptions?.find(item => item.value === params.login)?.platform || ''
|
|
|
+ search.login = params.login && Number(params.login)
|
|
|
nextTick(() => {
|
|
|
tableRef.value.refreshTable()
|
|
|
})
|
|
|
@@ -332,10 +336,22 @@ const cancle = async (id, type) => {
|
|
|
console.log('取消删除')
|
|
|
}
|
|
|
}
|
|
|
-onLoad((e) => {
|
|
|
+onLoad(async (e) => {
|
|
|
+ let targetLogin: number | null = null
|
|
|
if (e.login) {
|
|
|
- search.login = Number(e.login)
|
|
|
+ targetLogin = Number(e.login)
|
|
|
}
|
|
|
+ await new Promise<void>(resolve => {
|
|
|
+ const stopWatch = watch([isLoaded, isSuccess], ([loaded, success]) => {
|
|
|
+ if (loaded && success) {
|
|
|
+ stopWatch()
|
|
|
+ resolve()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ searchParams.value.login = targetLogin
|
|
|
+ search.platform = loginOptions?.find(item => item.value === searchParams.value.login)?.platform || ''
|
|
|
+ search.login = searchParams.value.login && Number(searchParams.value.login)
|
|
|
})
|
|
|
</script>
|
|
|
|