li.shaoyi 7 hónapja
szülő
commit
fcb3782989

+ 1 - 1
src/filters/index.ts

@@ -278,7 +278,7 @@ export function extractFilePaths(uploadFiles: UploadUserFile[]) {
 export function getFirstPathFullUrl(path?: string) {
     if (path) {
         const baseUrl = service.getConfig('apiUrl')
-        const paths = path?.split(',')
+        const paths = path.split(',')
         return new URL(paths[0], baseUrl).href
     }
     return ''

+ 12 - 12
src/hooks/datatable-v2/index.ts

@@ -16,22 +16,22 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
     // 过滤筛选值
     const filterData = shallowRef<FilterData<T>[]>([])
 
+    const matchesFilter = (row: T, filter: FilterData<T>) => {
+        return filter.fields.some((field) => {
+            const value = row[field]
+            if (typeof value === 'number') {
+                return filter.values.includes(value)
+            }
+            return filter.values.some((text) => String(value).toLowerCase().includes(String(text).toLowerCase()))
+        })
+    }
+
     // 数据列表
     const dataList = computed<UnwrapRef<T[]>>({
         get() {
             const result = dataSource.value.filter((row) => {
                 // 过滤所有查询条件
-                return filterData.value.every((e) => {
-                    return e.fields.some((field) => {
-                        const value = row[field]
-                        if (typeof value === 'number') {
-                            return e.values.includes(value as T[keyof T])
-                        }
-                        return e.values.some((text) => {
-                            return String(value).toLowerCase().indexOf(String(text)) >= 0
-                        })
-                    })
-                })
+                return filterData.value.every((filter) => matchesFilter(row as T, filter))
             })
             // 本地分页
             if (options.localPagination) {
@@ -95,7 +95,7 @@ export function useDataFilter<T>(defaultOption: FilterOption<T, keyof T>) {
     // 获取查询参数,支持多条件查询
     const getQueryParams = (clear = false) => {
         if (clear) resetFilters()
-        const params: Partial<T> = Object.create({})
+        const params: Partial<T> = {}
 
         filterOption.filters.forEach((e) => {
             if (e.value !== undefined) {

+ 32 - 16
src/packages/pc/views/investor/manage/user/components/details/view.vue

@@ -61,16 +61,17 @@
             </template>
             <!-- 证件类型 -->
             <template #cardTypeId="{ value }">
-                <p>{{ certificatetypeEnum.getEnumTypeName(value) }}</p>
+                <p>{{ Number.isFinite(value) ? certificatetypeEnum.getEnumTypeName(value) : handleNoneValue() }}</p>
                 <p class="g-red" v-if="newData && newData.userinfoDetailVo.cardTypeId !== value">
-                    {{ certificatetypeEnum.getEnumTypeName(newData.userinfoDetailVo.cardTypeId) }}
+                    {{ Number.isFinite(value) ?
+                        certificatetypeEnum.getEnumTypeName(newData.userinfoDetailVo.cardTypeId) : handleNoneValue() }}
                 </p>
             </template>
             <!-- 证件号码 -->
             <template #cardNum="{ value }">
-                <p>{{ value }}</p>
+                <p>{{ handleNoneValue(value) }}</p>
                 <p class="g-red" v-if="newData && newData.userinfoDetailVo.cardNum !== value">
-                    {{ newData.userinfoDetailVo.cardNum }}
+                    {{ handleNoneValue(newData.userinfoDetailVo.cardNum) }}
                 </p>
             </template>
             <!-- 公司 -->
@@ -145,44 +146,59 @@
             </template>
             <!-- 证件照正面 -->
             <template #cardFrontPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.cardFrontPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.cardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.cardFrontPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 证件照反面 -->
             <template #cardBackPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
-                <template v-if="newData && newData.userinfoDetailVo.cardFrontPhotoUrl !== value">
-                    <el-image :src="newData.userinfoDetailVo.cardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
+                <template v-if="newData && newData.userinfoDetailVo.cardBackPhotoUrl !== value">
+                    <el-image :src="newData.userinfoDetailVo.cardBackPhotoUrl" fit="cover" lazy
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.cardBackPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 手持证件照 -->
             <template #halfBodyPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.halfBodyPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.halfBodyPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.halfBodyPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 法人身份证正面 -->
             <template #legalCardFrontPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.legalCardFrontPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.legalCardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.legalCardFrontPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 法人身份证反面 -->
             <template #legalCardBackPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.legalCardBackPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.legalCardBackPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.legalCardBackPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
+            <!-- 法人授权书 -->
+            <template #otherUrl="{ value }">
+                <el-link type="primary" :href="value" target="_blank" v-if="value">下载</el-link>
+                <span v-else>{{ handleNoneValue() }}</span>
+            </template>
         </app-table-details>
         <template #footer>
             <el-button @click="close(false)">{{ t('operation.close') }}</el-button>

+ 5 - 2
src/packages/pc/views/investor/manage/user/components/edit/index.vue

@@ -131,8 +131,11 @@
                             :type-message="t('common.tips21')" :max-size="uploadConfig.maxFileSize" />
                     </el-form-item>
                     <el-form-item :label="t('investor.manage.user.edit.otherUrl')" prop="otherUrl">
-                        <app-upload v-model="uploadFiles.otherUrl" :file-types="['image']"
-                            :type-message="t('common.tips21')" :max-size="uploadConfig.maxFileSize" />
+                        <div>
+                            <app-upload v-model="uploadFiles.otherUrl" :max-size="uploadConfig.maxFileSize" />
+                            <a href="/template/法人授权书模板.zip" target="_blank"
+                                style="color: royalblue; text-decoration: underline;">下载模板</a>
+                        </div>
                     </el-form-item>
                 </template>
                 <el-form-item class="el-form-item--row" :label="t('investor.manage.user.edit.remark')" prop="remark">

+ 15 - 8
src/packages/pc/views/investor/user/open/components/details/index.vue

@@ -5,31 +5,38 @@
         <app-table-details :data="data" :label-width="140" :cell-props="detailProps" :column="2">
             <!-- 证件照正面 -->
             <template #cardfrontphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 证件照反面 -->
             <template #cardbackphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 手持证件照 -->
             <template #halfbodyphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 法人身份证正面 -->
             <template #legalcardfrontphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 法人身份证反面 -->
             <template #legalcardbackphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 法人授权书 -->
             <template #otherurl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-link type="primary" :href="value" target="_blank" v-if="value">下载</el-link>
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
             <!-- 银行卡正面 -->
             <template #bankcardfrontphotourl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
             </template>
         </app-table-details>
         <template #footer>
@@ -52,7 +59,7 @@
 <script lang="ts" setup>
 import { reactive, PropType, computed } from 'vue'
 import { ElMessage } from 'element-plus'
-import { getFirstPathFullUrl } from '@/filters'
+import { getFirstPathFullUrl, handleNoneValue } from '@/filters'
 import { decryptAES } from '@/services/crypto'
 import { getUserInfoTypeName, getGenderName, UserInfoType } from '@/constants/member'
 import { useEnum } from '@/hooks/enum'

+ 35 - 25
src/packages/pc/views/member/subinstitution/manage/components/details/index.vue

@@ -32,26 +32,24 @@
             </template>
             <!-- 企业性质 -->
             <template #bizNature="{ value }">
-                <template v-if="value">
-                    <p>{{ biznatureEnum.getEnumTypeName(value) }}</p>
-                    <p class="g-red" v-if="newData && newData.userinfoDetailVo.bizNature !== value">
-                        {{ biznatureEnum.getEnumTypeName(newData.userinfoDetailVo.bizNature) }}
-                    </p>
-                </template>
-                <template v-else>{{ handleNoneValue() }}</template>
+                <p>{{ value ? biznatureEnum.getEnumTypeName(value) : handleNoneValue() }}</p>
+                <p class="g-red" v-if="newData && newData.userinfoDetailVo.bizNature !== value">
+                    {{ value ? biznatureEnum.getEnumTypeName(newData.userinfoDetailVo.bizNature) : handleNoneValue() }}
+                </p>
             </template>
             <!-- 证件类型 -->
             <template #cardTypeId="{ value }">
-                <p>{{ certificatetypeEnum.getEnumTypeName(value) }}</p>
+                <p>{{ Number.isFinite(value) ? certificatetypeEnum.getEnumTypeName(value) : handleNoneValue() }}</p>
                 <p class="g-red" v-if="newData && newData.userinfoDetailVo.cardTypeId !== value">
-                    {{ certificatetypeEnum.getEnumTypeName(newData.userinfoDetailVo.cardTypeId) }}
+                    {{ Number.isFinite(value) ?
+                        certificatetypeEnum.getEnumTypeName(newData.userinfoDetailVo.cardTypeId) : handleNoneValue() }}
                 </p>
             </template>
             <!-- 证件号码 -->
             <template #cardNum="{ value }">
-                <p>{{ value }}</p>
+                <p>{{ handleNoneValue(value) }}</p>
                 <p class="g-red" v-if="newData && newData.userinfoDetailVo.cardNum !== value">
-                    {{ newData.userinfoDetailVo.cardNum }}
+                    {{ handleNoneValue(newData.userinfoDetailVo.cardNum) }}
                 </p>
             </template>
             <!-- 联系人 -->
@@ -112,42 +110,52 @@
             </template>
             <!-- 证件照正面 -->
             <template #cardFrontPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.cardFrontPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.cardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.cardFrontPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 证件照反面 -->
             <template #cardBackPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
-                <template v-if="newData && newData.userinfoDetailVo.cardFrontPhotoUrl !== value">
-                    <el-image :src="newData.userinfoDetailVo.cardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
+                <template v-if="newData && newData.userinfoDetailVo.cardBackPhotoUrl !== value">
+                    <el-image :src="newData.userinfoDetailVo.cardBackPhotoUrl" fit="cover" lazy
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.cardBackPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 手持证件照 -->
             <template #halfBodyPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.halfBodyPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.halfBodyPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.halfBodyPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 法人身份证正面 -->
             <template #legalCardFrontPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.legalCardFrontPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.legalCardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.legalCardFrontPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
             <!-- 法人身份证反面 -->
             <template #legalCardBackPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.legalCardBackPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.legalCardBackPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.legalCardBackPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
         </app-table-details>
@@ -170,10 +178,12 @@
             </template>
             <!-- 银行卡正面 -->
             <template #bankCardFrontPhotoUrl="{ value }">
-                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
+                <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" v-if="value" />
+                <span v-else>{{ handleNoneValue() }}</span>
                 <template v-if="newData && newData.userinfoDetailVo.bankCardFrontPhotoUrl !== value">
                     <el-image :src="newData.userinfoDetailVo.bankCardFrontPhotoUrl" fit="cover" lazy
-                        style="width: 128px; height: 72px" />
+                        style="width: 128px; height: 72px" v-if="newData.userinfoDetailVo.bankCardFrontPhotoUrl" />
+                    <span v-else>{{ handleNoneValue() }}</span>
                 </template>
             </template>
         </app-table-details>