li.shaoyi 7 months ago
parent
commit
ab46687884

+ 0 - 28
src/constants/common.ts

@@ -1,28 +0,0 @@
-/**
- * 确认状态
- */
-export enum Confirmation {
-    Yes = 1, // 是
-    No = 0, // 否
-}
-
-/**
- * 获取确认状态列表
- * @returns 
- */
-export function getConfirmationList() {
-    return [
-        { label: '是', value: Confirmation.Yes },
-        { label: '否', value: Confirmation.No }
-    ]
-}
-
-/**
- * 获取确认状态名称
- * @param value 
- * @returns 
- */
-export function getConfirmationName(value?: number) {
-    const item = getConfirmationList().find((e) => e.value === value)
-    return item?.label ?? value
-}

+ 25 - 3
src/hooks/enum/index.ts

@@ -1,5 +1,7 @@
 import { reactive, toRefs, onUnmounted } from 'vue'
+import { Language } from '@/constants/language'
 import { enumType } from '@/services/api/common'
+import { i18n } from '@/stores'
 
 export function useEnum(code: string) {
     const state = reactive({
@@ -10,22 +12,41 @@ export function useEnum(code: string) {
     const controller = new AbortController()
     const readyCallbackMap = new Map<symbol, () => void>()
 
+    // 获取本地化属性键
+    const getLocalizedKey: () => keyof Model.EnumTypeRsp = () => {
+        switch (i18n.global.locale) {
+            case Language.Simplified:
+                return 'enumdicname'
+            case Language.Thai:
+                return 'enumdicnameth'
+            case Language.Traditional:
+                return 'enumdicnamezhtw'
+            case Language.Vietnamese:
+                return 'enumdicnamevi'
+            default:
+                return 'enumdicnameen'
+        }
+    }
+
     // 获取枚举名称
     const getEnumTypeName = (value?: number) => {
+        const localizedKey = getLocalizedKey()
         const item = state.enums.find((e) => e.enumitemname === value)
-        const { enumdicname = value?.toString() } = item ?? {}
-        return enumdicname
+        return item ? item[localizedKey].toString() : value?.toString()
     }
 
     // 获取枚举列表
     const getEnumOptions = (filtered: number | number[] = [], reverse = false) => {
+        const localizedKey = getLocalizedKey()
         const valuesSet = new Set(Array.isArray(filtered) ? filtered : [filtered])
+
         if (valuesSet.size === 0) {
             return state.enums.map((e) => ({
-                label: e.enumdicname,
+                label: e[localizedKey].toString(),
                 value: e.enumitemname
             }))
         }
+
         const result = state.enums.filter((e) => {
             if (reverse) {
                 // 排除枚举
@@ -35,6 +56,7 @@ export function useEnum(code: string) {
                 return valuesSet.has(e.enumitemname)
             }
         })
+
         return result.map((e) => ({
             label: e.enumdicname,
             value: e.enumitemname

+ 3 - 3
src/packages/pc/App.vue

@@ -32,8 +32,8 @@ const router = useRouter()
 // 国际化语言
 const locale = computed(() => {
   switch (i18n.global.locale) {
-    case Language.English:
-      return en
+    case Language.Simplified:
+      return zhCn
     case Language.Thai:
       return th
     case Language.Traditional:
@@ -41,7 +41,7 @@ const locale = computed(() => {
     case Language.Vietnamese:
       return vi
     default:
-      return zhCn
+      return en
   }
 })
 

+ 7 - 5
src/packages/pc/components/layouts/header/index.vue

@@ -6,7 +6,7 @@
                 <template v-for="(item, index) in $route.matched" :key="index">
                     <el-breadcrumb-item>
                         <!--<i :class="item.meta.icon" v-if="item.meta.icon"></i>-->
-                        <span>{{ t('routes.'+(item.name ?? item.meta.name)) }}</span>
+                        <span>{{ t('routes.' + (item.name ?? item.meta.name)) }}</span>
                     </el-breadcrumb-item>
                 </template>
             </el-breadcrumb>
@@ -41,7 +41,7 @@
                 <template #dropdown>
                     <el-dropdown-menu>
                         <el-dropdown-item :icon="Key" @click="openComponent('Password')">{{ t('operation.modifypwd')
-                        }}</el-dropdown-item>
+                            }}</el-dropdown-item>
                         <el-dropdown-item :icon="SwitchButton" @click="eventBus.$emit('Logout')">{{
                             t('operation.loginout') }}</el-dropdown-item>
                     </el-dropdown-menu>
@@ -85,9 +85,11 @@ const exitFullSreen = () => {
 
 // 切换语言
 const switchLanguage = (lange: Language) => {
-    //i18n.global.locale = lange
-    localData.setValue('appLanguage', lange)
-    location.reload() // 强制刷新页面
+    if (i18n.global.locale !== lange) {
+        //i18n.global.locale = lange
+        localData.setValue('appLanguage', lange)
+        location.reload() // 强制刷新页面
+    }
 }
 
 onMounted(() => {

+ 2 - 10
src/packages/pc/router/dynamicRouter.ts

@@ -33,15 +33,7 @@ export default new (class {
                 }
             ]
         })
-    }
-
-    /**
-     * 移除404页面
-     */
-    private removeNotFound() {
-        if (router.hasRoute('NotFound')) {
-            router.removeRoute('NotFound');
-        }
+        this.registeredRouteNames.push('NotFound')
     }
 
     /**
@@ -94,11 +86,11 @@ export default new (class {
      * 移除所有已注册的路由
      */
     unregisterRoutes() {
-        this.removeNotFound();
         this.registeredRouteNames.forEach((name) => {
             router.removeRoute(name);
         })
         this.registeredRouteNames = [];
+        this.isReady = false;
     }
 
     /**

+ 0 - 1
src/packages/pc/router/index.ts

@@ -94,7 +94,6 @@ router.beforeEach((to, from, next) => {
                 next({ ...to, replace: true });
             }
         } else {
-            dynamicRouter.isReady = false;
             if (isLoginOrRegister) {
                 next();
             } else {

+ 5 - 3
src/packages/pc/views/auth/components/layout/index.vue

@@ -56,9 +56,11 @@ const languageLabel = computed(() => getLanguageLabelByValue(i18n.global.locale)
 
 // 切换语言
 const switchLanguage = (lange: Language) => {
-  //i18n.global.locale = lange
-  localData.setValue('appLanguage', lange)
-  location.reload() // 强制刷新页面
+  if (i18n.global.locale !== lange) {
+    //i18n.global.locale = lange
+    localData.setValue('appLanguage', lange)
+    location.reload() // 强制刷新页面
+  }
 }
 </script>
 

+ 3 - 4
src/packages/pc/views/investor/custom/group/components/edit/index.vue

@@ -35,7 +35,6 @@
 <script lang="ts" setup>
 import { ref, reactive, PropType, computed, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import { getConfirmationName } from '@/constants/common'
 import { useEnum } from '@/hooks/enum'
 import { addPersonalized, getRiskRatioTypeForMarketer } from '@/services/api/investor'
 import { CellProp } from '@pc/components/base/table-details/types'
@@ -50,8 +49,8 @@ const props = defineProps({
     }
 })
 
-// 风险客户类别
-const customerTypeEnum = useEnum('customerType')
+const flagEnum = useEnum('flag') // 确认状态
+const customerTypeEnum = useEnum('customerType') // 风险客户类别
 
 const userStore = useUserStore()
 const { global: { t } } = i18n
@@ -106,7 +105,7 @@ const detailProps = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'investor.custom.group.edit.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'investor.custom.group.edit.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'investor.custom.group.edit.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'investor.custom.group.edit.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'investor.custom.group.edit.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'investor.custom.group.edit.markets' },
     ]
 })

+ 3 - 4
src/packages/pc/views/investor/custom/riskcfg/components/details/index.vue

@@ -12,7 +12,6 @@
 <script lang="ts" setup>
 import { ref, PropType, computed } from 'vue'
 import { ElMessage } from 'element-plus'
-import { getConfirmationName } from '@/constants/common'
 import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { getRiskRatioTypeForMarketer } from '@/services/api/investor'
@@ -28,8 +27,8 @@ const props = defineProps({
     }
 })
 
-// 风险客户类别
-const customerTypeEnum = useEnum('customerType')
+const flagEnum = useEnum('flag') // 确认状态
+const customerTypeEnum = useEnum('customerType') // 风险客户类别
 
 const { global: { t } } = i18n
 const show = ref(true)
@@ -65,7 +64,7 @@ const detailProps2 = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'investor.custom.riskcfg.details.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'investor.custom.riskcfg.details.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'investor.custom.riskcfg.details.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'investor.custom.riskcfg.details.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'investor.custom.riskcfg.details.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'investor.custom.riskcfg.details.markets' },
     ]
 })

+ 3 - 4
src/packages/pc/views/investor/custom/riskcfg/components/edit/index.vue

@@ -39,7 +39,6 @@
 <script lang="ts" setup>
 import { ref, reactive, PropType, computed, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import { getConfirmationName } from '@/constants/common'
 import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { addAccountRiskConfig, getRiskRatioTypeForMarketer, getTaaccountList } from '@/services/api/investor'
@@ -55,8 +54,8 @@ const props = defineProps({
     }
 })
 
-// 风险率类型
-const customerTypeEnum = useEnum('customerType')
+const flagEnum = useEnum('flag') // 确认状态
+const customerTypeEnum = useEnum('customerType') // 风险率类型
 
 const { global: { t } } = i18n
 const formRef = ref<FormInstance>()
@@ -118,7 +117,7 @@ const detailProps = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'investor.custom.riskcfg.edit.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'investor.custom.riskcfg.edit.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'investor.custom.riskcfg.edit.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'investor.custom.riskcfg.edit.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'investor.custom.riskcfg.edit.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'investor.custom.riskcfg.edit.markets' },
     ]
 })

+ 3 - 3
src/packages/pc/views/investor/manage/user/index.vue

@@ -42,7 +42,7 @@ import { i18n } from '@/stores'
 const { global: { t } } = i18n
 
 // 是否实名
-const hasauthEnum = useEnum('hasauth')
+const flagEnum = useEnum('flag')
 // 状态
 const areastatusEnum = useEnum('areastatus')
 // 变更状态
@@ -71,7 +71,7 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { field: 'memberUserName', label: 'investor.manage.user.memberUserName' },
     { field: 'parentName', label: 'investor.manage.user.parentName' },
     { field: 'refereeName', label: 'investor.manage.user.refereeName' },
-    { field: 'hasAuth', label: 'investor.manage.user.isAuth', formatValue: (val) => hasauthEnum.getEnumTypeName(val) },
+    { field: 'hasAuth', label: 'investor.manage.user.isAuth', formatValue: (val) => flagEnum.getEnumTypeName(val) },
     { field: 'accountStatus', label: 'investor.manage.user.accountStatus', formatValue: (val) => areastatusEnum.getEnumTypeName(val) },
     { field: 'modifyStatus', label: 'investor.manage.user.modifyStatus', formatValue: (val) => modifystatusEnum.getEnumTypeName(val) },
     { field: 'createTime', label: 'investor.manage.user.createTime', formatValue: (val) => formatDate(val) },
@@ -95,7 +95,7 @@ filterOptons.selectList = [
     {
         key: 'hasAuth',
         label: t('investor.manage.user.isAuth'),
-        options: () => hasauthEnum.getEnumOptions(),
+        options: () => flagEnum.getEnumOptions(),
     }
 ]
 

+ 43 - 41
src/packages/pc/views/member/institution/goodscfg/components/edit/index.vue

@@ -1,45 +1,43 @@
 <!-- 会员机构管理-机构管理-商品限制设置-编辑 -->
 <template>
     <app-drawer title="编辑" width="900" v-model:show="show" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" label-width="140px" :model="formData" :rules="formRules" :show-message="false">
-            <fieldset class="g-fieldset el-form--horizontal">
-                <legend class="g-fieldset__legend">机构</legend>
-                <el-form-item label="经纪会员" prop="userid">
-                    <app-select-member v-model="formData.userid" />
-                </el-form-item>
-                <el-form-item label="市场" prop="marketid">
-                    <el-select v-model="formData.marketid">
-                        <template v-for="item in getMarketOptions(99, true)" :key="item.value">
-                            <el-option :label="item.label" :value="item.value" />
-                        </template>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="商品" prop="goodsid">
-                    <app-select-goods v-model="formData.goodsid"
-                        :params="{ marketId: formData.marketid, goodsStatusIds: '3,6,7' }" />
-                </el-form-item>
-                <el-form-item label="是否不显示" prop="isnodisplay">
-                    <el-radio-group v-model="formData.isnodisplay">
-                        <template v-for="item in getConfirmationList()" :key="item.value">
-                            <el-radio :label="item.label" :value="item.value" />
-                        </template>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item label="是否不能建买" prop="iscannotbuy">
-                    <el-radio-group v-model="formData.iscannotbuy">
-                        <template v-for="item in getConfirmationList()" :key="item.value">
-                            <el-radio :label="item.label" :value="item.value" />
-                        </template>
-                    </el-radio-group>
-                </el-form-item>
-                <el-form-item label="是否不能建卖" prop="iscannotsell">
-                    <el-radio-group v-model="formData.iscannotsell">
-                        <template v-for="item in getConfirmationList()" :key="item.value">
-                            <el-radio :label="item.label" :value="item.value" />
-                        </template>
-                    </el-radio-group>
-                </el-form-item>
-            </fieldset>
+        <el-form ref="formRef" class="el-form--horizontal" label-width="140px" :model="formData" :rules="formRules"
+            :show-message="false">
+            <el-form-item label="经纪会员" prop="userid">
+                <app-select-member v-model="formData.userid" :params="{ usertype: '2', roles: '7' }" />
+            </el-form-item>
+            <el-form-item label="市场" prop="marketid">
+                <el-select v-model="formData.marketid" @change="goodsRef.onReset()">
+                    <template v-for="item in getMarketOptions([15, 97, 99], true)" :key="item.value">
+                        <el-option :label="item.label" :value="item.value" />
+                    </template>
+                </el-select>
+            </el-form-item>
+            <el-form-item label="商品" prop="goodsid">
+                <app-select-goods ref="goodsRef" v-model="formData.goodsid"
+                    :params="{ marketId: formData.marketid ?? -1, goodsStatusIds: '3,6,7' }" />
+            </el-form-item>
+            <el-form-item label="是否不显示" prop="isnodisplay">
+                <el-radio-group v-model="formData.isnodisplay">
+                    <template v-for="item in flagEnum.getEnumOptions()" :key="item.value">
+                        <el-radio :label="item.label" :value="item.value" />
+                    </template>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item label="是否不能建买" prop="iscannotbuy">
+                <el-radio-group v-model="formData.iscannotbuy">
+                    <template v-for="item in flagEnum.getEnumOptions()" :key="item.value">
+                        <el-radio :label="item.label" :value="item.value" />
+                    </template>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item label="是否不能建卖" prop="iscannotsell">
+                <el-radio-group v-model="formData.iscannotsell">
+                    <template v-for="item in flagEnum.getEnumOptions()" :key="item.value">
+                        <el-radio :label="item.label" :value="item.value" />
+                    </template>
+                </el-radio-group>
+            </el-form-item>
         </el-form>
         <template #footer>
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
@@ -52,11 +50,11 @@
 import { ref, shallowRef, PropType, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { addLimit } from '@/services/api/member'
+import { useEnum } from '@/hooks/enum'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 import AppSelectGoods from '@pc/components/modules/select-goods/index.vue'
 import { i18n } from '@/stores'
-import { getConfirmationList } from '@/constants/common'
 import { useMarket } from '@/hooks/market'
 
 const props = defineProps({
@@ -65,14 +63,18 @@ const props = defineProps({
     }
 })
 
+const flagEnum = useEnum('flag') // 确认状态
+
 const { getMarketOptions } = useMarket()
 const { global: { t } } = i18n
 const formRef = ref<FormInstance>()
+const goodsRef = ref() // 商品组件实例
 const show = ref(true)
 const refresh = ref(false)
 const loading = shallowRef(false)
 
-const formData = ref<Partial<Member.AddLimitReq>>({
+const formData = ref<Member.AddLimitReq>({
+    roletype: 7,
     iscannotbuy: 0,
     iscannotsell: 0,
     isnodisplay: 0,

+ 17 - 15
src/packages/pc/views/member/institution/goodscfg/index.vue

@@ -5,14 +5,14 @@
             <app-filter :option="filterOption">
                 <template #userid="{ item }">
                     <el-form-item :label="item.label" prop="userid">
-                        <app-select-member v-model="item.value" :params="{ usertype: '2,3' }"
+                        <app-select-member v-model="item.value" :params="{ usertype: '2', roles: '7' }"
                             :placeholder="t('member.institution.goodscfg.tips2')" />
                     </el-form-item>
                 </template>
                 <template #goodsid="{ item }">
                     <el-form-item :label="item.label" prop="goodsid">
-                        <app-select-goods v-model="item.value"
-                            :params="{ trademodels: '52', goodsStatusIds: '3,6,7' }" />
+                        <app-select-goods ref="goodsRef" v-model="item.value"
+                            :params="{ marketId: queryParams.marketid ?? -1, goodsStatusIds: '3,6,7' }" />
                     </el-form-item>
                 </template>
             </app-filter>
@@ -45,6 +45,7 @@ import { useDataFilter } from '@/hooks/datatable-v2'
 import { useRequest } from '@/hooks/request'
 import { useOperation } from '@/hooks/operation'
 import { useMarket } from '@/hooks/market'
+import { useEnum } from '@/hooks/enum'
 import { queryMemberGoodsLimit } from '@/services/api/member'
 import { i18n } from '@/stores'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -54,8 +55,11 @@ import AppFilter from '@pc/components/base/table-filter-v2/index.vue'
 import AppSelectGoods from '@pc/components/modules/select-goods/index.vue'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 
+const flagEnum = useEnum('flag') // 确认状态
+
 const { getMarketOptions } = useMarket()
 const { global: { t } } = i18n
+const goodsRef = ref() // 商品组件实例
 
 const { componentMap, componentId, record, openComponent, closeComponent, getActionButtons } = useOperation<Member.MemberGoodsLimitRsp>({
     onClose: () => onSearch()
@@ -64,7 +68,8 @@ const { componentMap, componentId, record, openComponent, closeComponent, getAct
 const { dataList, total, pageSize, pageIndex, loading, run } = useRequest(queryMemberGoodsLimit, {
     params: {
         pageNum: 1,
-        pageSize: 20
+        pageSize: 20,
+        roletype: 7
     },
     onError: (err) => {
         ElMessage.error(err)
@@ -75,29 +80,27 @@ const tableColumns = ref<Model.TableColumn[]>([
     { field: 'membername', label: 'member.institution.goodscfg.membername' },
     { field: 'roledisplay', label: 'member.institution.goodscfg.roledisplay' },
     { field: 'goodsdisplay', label: 'member.institution.goodscfg.goodsdisplay' },
-    { field: 'nodisplay', label: 'member.institution.goodscfg.nodisplay' },
-    { field: 'cannotbuy', label: 'member.institution.goodscfg.cannotsell' },
-    { field: 'cannotsell', label: 'member.institution.goodscfg.tips1' },
+    { field: 'isnodisplay', label: 'member.institution.goodscfg.nodisplay', formatValue: (val) => flagEnum.getEnumTypeName(val) },
+    { field: 'iscannotbuy', label: 'member.institution.goodscfg.cannotsell', formatValue: (val) => flagEnum.getEnumTypeName(val) },
+    { field: 'iscannotsell', label: 'member.institution.goodscfg.tips1', formatValue: (val) => flagEnum.getEnumTypeName(val) },
     { field: 'operate', label: 'common.operate', fixed: 'right' }
 ])
 
-const { filterOption, getQueryParams, resetFilters } = useDataFilter<Member.MemberGoodsLimitReq>({
+const { filterOption, queryParams, getQueryParams, resetFilters } = useDataFilter<Member.MemberGoodsLimitReq>({
     filters: [
         {
             field: 'userid',
-            label: t('member.institution.goodscfg.userid'),
-            required: true,
+            label: t('member.institution.goodscfg.userid')
         },
         {
             field: 'marketid',
             label: t('member.institution.goodscfg.marketid'),
-            required: true,
-            options: () => getMarketOptions()
+            options: () => getMarketOptions([15, 97, 99], true),
+            onChange: () => goodsRef.value.onReset()
         },
         {
             field: 'goodsid',
-            label: t('member.institution.goodscfg.goodsid'),
-            required: true,
+            label: t('member.institution.goodscfg.goodsid')
         }
     ],
     buttons: [
@@ -110,5 +113,4 @@ const onSearch = () => {
     const qs = getQueryParams()
     run(qs)
 }
-
 </script>

+ 7 - 7
src/packages/pc/views/member/institution/marketer/components/details/index.vue

@@ -18,16 +18,10 @@ import { useRequest } from '@/hooks/request'
 import { CellProp } from '@pc/components/base/table-details/types'
 import { useEnum } from '@/hooks/enum'
 import { queryRoleDetail } from '@/services/api/member'
-import { getConfirmationName } from '@/constants/common'
 import { getRiskRatioTypeForMarketer } from '@/services/api/investor'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTableDetails from '@pc/components/base/table-details/index.vue'
 
-const { global: { t } } = i18n
-const customerTypeEnum = useEnum('customerType')
-// 风险率类型
-const marketerTypeEnum = useEnum('marketerType')
-
 const props = defineProps({
     record: {
         type: Object as PropType<Member.OrganRoleRsp>,
@@ -35,6 +29,12 @@ const props = defineProps({
     }
 })
 
+const { global: { t } } = i18n
+
+const flagEnum = useEnum('flag') // 确认状态
+const customerTypeEnum = useEnum('customerType')
+const marketerTypeEnum = useEnum('marketerType') // 风险率类型
+
 const show = shallowRef(true)
 const refresh = shallowRef(false)
 const loading = shallowRef(false)
@@ -87,7 +87,7 @@ const detailProps3 = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'member.institution.marketer.details.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'member.institution.marketer.details.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'member.institution.marketer.details.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'member.institution.marketer.details.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'member.institution.marketer.details.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'member.institution.marketer.details.markets' },
     ]
 })

+ 3 - 4
src/packages/pc/views/member/institution/riskcfg/components/details/index.vue

@@ -12,7 +12,6 @@
 <script lang="ts" setup>
 import { ref, PropType, computed } from 'vue'
 import { ElMessage } from 'element-plus'
-import { getConfirmationName } from '@/constants/common'
 import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { getRiskRatioTypeForMarketer } from '@/services/api/investor'
@@ -30,8 +29,8 @@ const props = defineProps({
 
 const { global: { t } } = i18n
 
-// 风险率类型
-const marketerTypeEnum = useEnum('marketerType')
+const flagEnum = useEnum('flag') // 确认状态
+const marketerTypeEnum = useEnum('marketerType') // 风险率类型
 
 const show = ref(true)
 const refresh = ref(false)
@@ -66,7 +65,7 @@ const detailProps2 = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'member.institution.riskcfg.details.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'member.institution.riskcfg.details.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'member.institution.riskcfg.details.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'member.institution.riskcfg.details.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'member.institution.riskcfg.details.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'member.institution.riskcfg.details.markets' },
     ]
 })

+ 3 - 4
src/packages/pc/views/member/institution/riskcfg/components/edit/index.vue

@@ -38,7 +38,6 @@
 <script lang="ts" setup>
 import { ref, reactive, PropType, computed, onMounted } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
-import { getConfirmationName } from '@/constants/common'
 import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { getRiskRatioTypeForMarketer, getTaaccountList } from '@/services/api/investor'
@@ -55,8 +54,8 @@ const props = defineProps({
     }
 })
 
-// 风险率类型
-const marketerTypeEnum = useEnum('marketerType')
+const flagEnum = useEnum('flag') // 确认状态
+const marketerTypeEnum = useEnum('marketerType') // 风险率类型
 
 const { global: { t } } = i18n
 const formRef = ref<FormInstance>()
@@ -118,7 +117,7 @@ const detailProps = computed<CellProp[]>(() => {
         { prop: 'addsaferatio', label: 'member.institution.riskcfg.edit.addsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'recoversaferatio', label: 'member.institution.riskcfg.edit.recoversaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
         { prop: 'cutsaferatio', label: 'member.institution.riskcfg.edit.cutsaferatio', formatValue: (val) => val + '%', show: !!notesaferatio },
-        { prop: 'isdefault', label: 'member.institution.riskcfg.edit.isdefault', formatValue: (val) => getConfirmationName(val) },
+        { prop: 'isdefault', label: 'member.institution.riskcfg.edit.isdefault', formatValue: (val) => flagEnum.getEnumTypeName(val) },
         { prop: 'markets', label: 'member.institution.riskcfg.edit.markets' },
     ]
 })

+ 4 - 0
src/types/model/common.d.ts

@@ -102,6 +102,10 @@ declare namespace Model {
         enumdiccode: string; // 所属枚举代码
         enumdicid: number; // 所属枚举ID
         enumdicname: string; // 枚举项名称
+        enumdicnameen: string;
+        enumdicnameth: string;
+        enumdicnamevi: string;
+        enumdicnamezhtw: string;
         enumitemname: number; // 枚举项值
         enumitemstatus: number; // 枚举项状态 - 1.启用 2.不启用
         enumitemvalue: string; // 通用值 - [币种通用简写]

+ 11 - 14
src/types/model/member.d.ts

@@ -730,19 +730,16 @@ declare namespace Member {
 
     /** 会员机构管理-->机构管理-->商品限制设置-->获取列表 响应 */
     interface MemberGoodsLimitRsp {
-        autoid: number
-        // 不能挂买
-        cannotbuy: number
-        // 不能挂卖
-        cannotsell: number
-        // 商品
-        goodsdisplay: string
-        // 会员机构
-        membername: string
-        // 不显示
-        nodisplay: number
-        // 机构角色
-        roledisplay: string
+        autoid: number;
+        goodsdisplay: string; // 商品
+        goodsid: number;
+        iscannotbuy: number; // 不能挂买
+        iscannotsell: number; // 不能挂卖
+        isnodisplay: number; // 不显示
+        marketid: number;
+        membername: string; // 会员机构
+        roledisplay: string; // 机构角色
+        userid: number;
     }
 
     /** 会员机构管理-->机构管理-->商品限制设置--> 删除 请求 */
@@ -2120,7 +2117,7 @@ declare namespace Member {
         tradeProperty?: number
     }
 
-    interface Arearoledivideconfig { 
+    interface Arearoledivideconfig {
         // 创建时间
         createtime?: string
         // 创建人ID