|
@@ -0,0 +1,64 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="main animate__animated animate__backInRight" v-loading="loading">
|
|
|
|
+ <custom-search-bar :fields="fields.filter((f) => f.isSearch)" v-model="searchForm" @search="search" @reset="toReset"> </custom-search-bar>
|
|
|
|
+ <custom-table :data="list" :fields="fields" @query="search" :total="total" :opera="opera" @reExecute="reExecute" @download="download" height="75vh"> </custom-table>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script setup>
|
|
|
|
+import { ExportConfigStore } from '@/store/api/exportConfig'
|
|
|
|
+import { get } from 'lodash-es'
|
|
|
|
+import { onMounted } from 'vue'
|
|
|
|
+const { t } = useI18n()
|
|
|
|
+const store = ExportConfigStore()
|
|
|
|
+const dialogShow = ref(false)
|
|
|
|
+const loading = ref(false)
|
|
|
|
+const $checkRes = inject('$checkRes')
|
|
|
|
+const searchForm = ref({})
|
|
|
|
+const list = ref([])
|
|
|
|
+let skip = 0
|
|
|
|
+let limit = inject('limit')
|
|
|
|
+const tabs = ref('1')
|
|
|
|
+onMounted(async () => {
|
|
|
|
+ loading.value = true
|
|
|
|
+ await search({ skip, limit })
|
|
|
|
+ loading.value = false
|
|
|
|
+})
|
|
|
|
+const search = async (query = { skip, limit }) => {
|
|
|
|
+ skip = query.skip
|
|
|
|
+ limit = query.limit
|
|
|
|
+ const info = { skip: query.skip, limit: query.limit, ...searchForm.value }
|
|
|
|
+ const res = await store.query(info)
|
|
|
|
+ if ($checkRes(res)) {
|
|
|
|
+ list.value = res.data
|
|
|
|
+ total.value = res.total
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const total = ref(0)
|
|
|
|
+const fields = [
|
|
|
|
+ { label: t('pages.export.user'), model: 'user_name' }, // , isSearch: true
|
|
|
|
+ { label: t('pages.export.user_type'), model: 'user_type_name' },
|
|
|
|
+ { label: t('pages.export.progress'), model: 'progress' }
|
|
|
|
+]
|
|
|
|
+const opera = [
|
|
|
|
+ { label: t('pages.export.reExecute'), method: 'reExecute', confirm: true },
|
|
|
|
+ { label: t('pages.export.download'), method: 'download', display: (i) => i.uri }
|
|
|
|
+]
|
|
|
|
+
|
|
|
|
+const reExecute = async (data) => {
|
|
|
|
+ console.log(data)
|
|
|
|
+ const id = get(data, 'id')
|
|
|
|
+ const result = await store.reExecute(id)
|
|
|
|
+ if ($checkRes(result, true, result.errmsg)) search({ skip, limit })
|
|
|
|
+}
|
|
|
|
+const download = (data) => {
|
|
|
|
+ const uri = get(data, 'uri')
|
|
|
|
+ window.open(uri)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const toReset = async () => {
|
|
|
|
+ searchForm.value = {}
|
|
|
|
+ await search({ skip, limit })
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style scoped lang="scss"></style>
|