|
|
@@ -1,56 +1,58 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<!-- <view class="content-title" v-t="'PersonalManagement.Title.FileManagement'"></view>-->
|
|
|
- <view class="content-title">
|
|
|
- <view/>
|
|
|
- <view class="content-title-btns">
|
|
|
-<!-- -->
|
|
|
- <button v-if="!isSHowBtn.isSHowIdentity" type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(1)" >
|
|
|
- <view class="d-flex align-items-center">
|
|
|
- <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
- <text v-t="'PersonalManagement.Title.ProofOfIdentity'" />
|
|
|
- </view>
|
|
|
- </button>
|
|
|
- <button v-if="!isSHowBtn.isSHowAddress" type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(2)" >
|
|
|
- <view class="d-flex align-items-center">
|
|
|
- <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
- <text v-t="'PersonalManagement.Title.ProofOfAddress'" />
|
|
|
- </view>
|
|
|
- </button>
|
|
|
- <button type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(3)" >
|
|
|
- <view class="d-flex align-items-center">
|
|
|
- <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
- <text v-t="'PersonalManagement.Title.AttachedFile'" />
|
|
|
- </view>
|
|
|
- </button>
|
|
|
-<!-- -->
|
|
|
- </view>
|
|
|
+ <view v-show="!loading" class="content-title">
|
|
|
+ <view/>
|
|
|
+ <view v-if="isShowBtn" class="content-title-btns">
|
|
|
+
|
|
|
+
|
|
|
+ <button v-if="!isShowBtn.isSHowIdentity" type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(1)" >
|
|
|
+ <view class="d-flex align-items-center">
|
|
|
+ <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
+ <text v-t="'PersonalManagement.Title.ProofOfIdentity'" />
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
+ <button v-if="!isShowBtn.isSHowAddress" type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(2)" >
|
|
|
+ <view class="d-flex align-items-center">
|
|
|
+ <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
+ <text v-t="'PersonalManagement.Title.ProofOfAddress'" />
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
+ <button type="button" class="btn btn-danger btn-shadow waves-effect" @click="openAddFileDialog(3)" >
|
|
|
+ <view class="d-flex align-items-center">
|
|
|
+ <cwg-icon name="crm-plus" :size="14" color="#fff" />
|
|
|
+ <text v-t="'PersonalManagement.Title.AttachedFile'" />
|
|
|
+ </view>
|
|
|
+ </button>
|
|
|
+
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<cwg-tabel ref="tableRef" :columns="columns" :api="customFileApi" :show-operation="false"
|
|
|
- :showPagination="false">
|
|
|
- <template #type="{ row }">
|
|
|
- <view :class="['status-badge', row.status]">{{ typeMap[row.type] }}</view>
|
|
|
- </template>
|
|
|
- <template #status="{ row }">
|
|
|
- <view class="table-cell-center">
|
|
|
- <view :class="['status-badge', row.status]">{{ stateMap[row.status] }}</view>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
- <template #btn="{ row }">
|
|
|
- <view class="table-cell-center">
|
|
|
- <button class="btn-submit" :class="['operation-btn', row.status !== 4 ? 'disabled' : '']" :disabled="row.status !== 4" @click.stop="openAddFile(row)">
|
|
|
- <cwg-icon name="crm-image" :size="16" color="#1d293d" />
|
|
|
- <text v-t="'State.Again'" />
|
|
|
- </button>
|
|
|
- </view>
|
|
|
- </template>
|
|
|
+ :showPagination="false">
|
|
|
+ <template #type="{ row }">
|
|
|
+ <view :class="['status-badge', row.status]">{{ typeMap[row.type] }}</view>
|
|
|
+ </template>
|
|
|
+ <template #status="{ row }">
|
|
|
+ <view class="table-cell-center">
|
|
|
+ <view :class="['status-badge', row.status]">{{ stateMap[row.status] }}</view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <template #btn="{ row }">
|
|
|
+ <view class="table-cell-center">
|
|
|
+ <button class="btn-submit" :class="['operation-btn', row.status !== 4 ? 'disabled' : '']" :disabled="row.status !== 4" @click.stop="openAddFile(row)">
|
|
|
+ <cwg-icon name="crm-image" :size="16" color="#1d293d" />
|
|
|
+ <text v-t="'State.Again'" />
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
</cwg-tabel>
|
|
|
+
|
|
|
<add-file-dialog ref="addFileDialog" @file-added="customFileList" @success="addSuccess" />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { computed, ref, onMounted } from 'vue';
|
|
|
+import { computed, ref, onMounted, watch } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import AddFileDialog from './AddFileDialog.vue';
|
|
|
const { t } = useI18n();
|
|
|
@@ -84,7 +86,8 @@ const tableData = computed(() => {
|
|
|
return tableRef.value ? tableRef.value.tableData : [];
|
|
|
});
|
|
|
const loading = ref(false)
|
|
|
-const isSHowBtn = computed(() => {
|
|
|
+const isShowBtn = ref()
|
|
|
+const setShowBtn = () => {
|
|
|
const a = tableData.value
|
|
|
let tableIdentity = [];
|
|
|
const tableAddress = [];
|
|
|
@@ -100,8 +103,8 @@ const isSHowBtn = computed(() => {
|
|
|
});
|
|
|
const isSHowIdentity = tableIdentity.length > 1;
|
|
|
const isSHowAddress = tableAddress.length > 0;
|
|
|
- return { isSHowIdentity, isSHowAddress };
|
|
|
-});
|
|
|
+ isShowBtn.value = { isSHowIdentity, isSHowAddress };
|
|
|
+}
|
|
|
|
|
|
// 表格列配置
|
|
|
const columns = computed(() => [
|
|
|
@@ -171,6 +174,18 @@ const openAddFile = (row) => {
|
|
|
const addSuccess = () => {
|
|
|
tableRef.value.refreshTable()
|
|
|
}
|
|
|
+
|
|
|
+watch(tableData, (newVal) => {
|
|
|
+ if (newVal && newVal.length > 0) {
|
|
|
+ loading.value = true
|
|
|
+ setShowBtn()
|
|
|
+ setTimeout(()=>{
|
|
|
+ loading.value = false
|
|
|
+
|
|
|
+ },300)
|
|
|
+ }
|
|
|
+}, { immediate: true })
|
|
|
+
|
|
|
defineProps<Props>();
|
|
|
</script>
|
|
|
|