li.shaoyi 1 éve
szülő
commit
bc1540fb76

+ 1 - 1
src/hooks/datatable/types.ts

@@ -25,7 +25,7 @@ export interface FilterSelect<T> {
     locked?: boolean, // 重置时是否阻止清空当前值
     placeholder?: string,
     multiple?: boolean,
-    options: {
+    options: () => {
         label: string,
         value: T[keyof T],
     }[],

+ 2 - 2
src/packages/pc/components/base/table-filter/index.vue

@@ -6,7 +6,7 @@
     <el-form-item v-for="item in options.selectList" :key="item.key" :label="item.label">
       <el-select :placeholder="item.placeholder ?? '请选择'" v-model="item.selectedValue" :multiple="item.multiple" collapse-tags
         @change="item.onChange">
-        <el-option v-for="option in item.options" :key="option.value" :value="option.value" :label="option.label" />
+        <el-option v-for="option in item.options()" :key="option.value" :value="option.value" :label="option.label" />
       </el-select>
     </el-form-item>
     <el-form-item v-for="(item, i) in options.inputList" :key="i" :label="item.label">
@@ -32,7 +32,7 @@ import { FilterOptions } from '@/hooks/datatable/types'
 
 defineProps({
   options: {
-    type: Object as PropType<FilterOptions>,
+    type: Object as PropType<FilterOptions<any>>,
     default: () => ({}),
   },
   loading: {

+ 1 - 1
src/packages/pc/views/account/tradeacct/components/bankstatement/index.vue

@@ -75,7 +75,7 @@ filterOptons.selectList = [
         label: '流水类型',
         selectedValue: 1,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 1 },
             { label: '历史', value: 2 },
         ],

+ 1 - 1
src/packages/pc/views/admin/user/index.vue

@@ -94,7 +94,7 @@ filterOptons.selectList = [
     {
         label: '状态',
         key: 'managerStatus',
-        options: getAdminStatusList()
+        options: () => getAdminStatusList()
     }
 ]
 

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

@@ -87,12 +87,12 @@ filterOptons.selectList = [
     {
         key: 'accountStatus',
         label: '交易商状态',
-        options: [],
+        options: () => areastatusEnum.getEnumOptions(),
     },
     {
         key: 'isAuth',
         label: '是否实名',
-        options: [],
+        options: () => hasauthEnum.getEnumOptions(),
     }
 ]
 
@@ -110,12 +110,4 @@ const onSearch = (clear = false) => {
     const qs = getQueryParams(clear)
     run(qs)
 }
-
-areastatusEnum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[0].options = areastatusEnum.getEnumOptions()
-})
-
-hasauthEnum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[1].options = hasauthEnum.getEnumOptions()
-})
 </script>

+ 1 - 1
src/packages/pc/views/member/subinstitution/user/index.vue

@@ -89,7 +89,7 @@ filterOptons.inputList = [
 ]
 
 filterOptons.selectList = [
-    { label: '机构状态', key: 'username', options: [] }
+    { label: '机构状态', key: 'username', options: () => [] }
 ]
 
 filterOptons.buttonList = [

+ 3 - 7
src/packages/pc/views/query/order/accountsumm/index.vue

@@ -32,7 +32,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.AccountTransactionsReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.AccountTransactionsReq>()
@@ -72,14 +72,14 @@ filterOptons.selectList = [
         key: 'marketid',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions([15, 97, 99], true),
     },
     {
         key: 'summode',
         label: '汇总方式',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '按账户汇总', value: 0 },
             { label: '按账户+日期汇总', value: 1 },
         ],
@@ -109,8 +109,4 @@ const processRequiredParams = (callback: (params: Model.AccountTransactionsReq)
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions([15, 97, 99], true)
-})
 </script>

+ 5 - 13
src/packages/pc/views/query/order/order/index.vue

@@ -40,7 +40,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, getMarketById, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions, getMarketById } = useMarket()
 // 委托类型
 const buildtypeEnum = useEnum('buildtype')
 // 委托状态
@@ -93,14 +93,14 @@ filterOptons.selectList = [
         key: 'marketId',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions([15, 97, 99], true),
     },
     {
         key: 'isHis',
         label: '查询类型',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 0 },
             { label: '历史', value: 1 },
         ],
@@ -108,12 +108,12 @@ filterOptons.selectList = [
     {
         key: 'buildType',
         label: '单据类型',
-        options: [],
+        options: () => buildtypeEnum.getEnumOptions(),
     },
     {
         key: 'orderStatus',
         label: '状态',
-        options: [],
+        options: () => [],
     }
 ]
 
@@ -142,12 +142,4 @@ const processRequiredParams = (callback: (params: Model.CommissionSheetReq) => v
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions([15, 97, 99], true)
-})
-
-buildtypeEnum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[2].options = buildtypeEnum.getEnumOptions()
-})
 </script>

+ 4 - 8
src/packages/pc/views/query/order/position/index.vue

@@ -39,7 +39,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.PositionSheetReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.PositionSheetReq>()
@@ -95,14 +95,14 @@ filterOptons.selectList = [
         key: 'marketId',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions(),
     },
     {
         key: 'isHis',
         label: '单据类型',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 0 },
             { label: '历史', value: 1 },
         ],
@@ -110,7 +110,7 @@ filterOptons.selectList = [
     {
         key: 'buyOrSell',
         label: '方向',
-        options: getBuyOrSellList(),
+        options: () => getBuyOrSellList(),
     }
 ]
 
@@ -137,8 +137,4 @@ const processRequiredParams = (callback: (params: Model.ContractSheetReq) => voi
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions()
-})
 </script>

+ 2 - 6
src/packages/pc/views/query/order/positionsumm/index.vue

@@ -33,7 +33,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.PositionSumSheetReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.PositionSumSheetReq>()
@@ -81,7 +81,7 @@ filterOptons.selectList = [
         key: 'marketid',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions(),
     }
 ]
 
@@ -108,8 +108,4 @@ const processRequiredParams = (callback: (params: Model.PositionSumSheetReq) =>
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions()
-})
 </script>

+ 7 - 15
src/packages/pc/views/query/order/trade/index.vue

@@ -40,7 +40,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const buildtypeEnum = useEnum('buildtype') // 单据类型
 const queryParams = shallowRef<Model.ContractSheetReq>()
 
@@ -90,14 +90,14 @@ filterOptons.selectList = [
         key: 'marketId',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions([15, 97, 99], true),
     },
     {
         key: 'isHis',
         label: '查询类型',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 0 },
             { label: '历史', value: 1 },
         ],
@@ -105,22 +105,22 @@ filterOptons.selectList = [
     {
         key: 'buyOrSell',
         label: '方向',
-        options: getBuyOrSellList(),
+        options: () => getBuyOrSellList(),
     },
     {
         key: 'buildType',
         label: '类型',
-        options: [],
+        options: () => buildtypeEnum.getEnumOptions(),
     },
     {
         key: 'tradeTypes',
         label: '成交类别',
-        options: [],
+        options: () => [],
     },
     {
         key: 'feeSearchType',
         label: '手续费',
-        options: [],
+        options: () => [],
     }
 ]
 
@@ -147,12 +147,4 @@ const processRequiredParams = (callback: (params: Model.ContractSheetReq) => voi
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions([15, 97, 99], true)
-})
-
-buildtypeEnum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[3].options = buildtypeEnum.getEnumOptions()
-})
 </script>

+ 3 - 8
src/packages/pc/views/query/order/tradesumm/index.vue

@@ -32,7 +32,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.GoodsTradeReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.GoodsTradeReq>()
@@ -68,14 +68,14 @@ filterOptons.selectList = [
         key: 'marketid',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions([15, 97, 99], true),
     },
     {
         key: 'summode',
         label: '汇总方式',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '按商品汇总', value: 0 },
             { label: '按商品+日期汇总', value: 1 },
         ],
@@ -105,9 +105,4 @@ const processRequiredParams = (callback: (params: Model.GoodsTradeReq) => void,
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions([15, 97, 99], true)
-})
-
 </script>

+ 4 - 8
src/packages/pc/views/query/other/bank_inout/index.vue

@@ -74,22 +74,22 @@ filterOptons.selectList = [
     {
         key: 'executetype',
         label: '类型',
-        options: [],
+        options: () => executetypeEnum.getEnumOptions(),
     },
     {
         key: 'applystatus',
         label: '状态',
-        options: [],
+        options: () => [],
     },
     {
         key: 'cusbankid',
         label: '托管银行',
-        options: [],
+        options: () => [],
     },
     {
         key: 'usertype',
         label: '账户类型',
-        options: [],
+        options: () => [],
     }
 ]
 
@@ -108,8 +108,4 @@ const onSearch = (clear = false) => {
     const qs = getQueryParams(clear)
     run(qs)
 }
-
-executetypeEnum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[0].options = executetypeEnum.getEnumOptions()
-})
 </script>

+ 3 - 7
src/packages/pc/views/query/other/bank_statement/index.vue

@@ -32,7 +32,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getEnumOptions, registerEnumReadyCallback } = useEnum('operatetypesearch') // 业务类型
+const { getEnumOptions } = useEnum('operatetypesearch') // 业务类型
 const queryParams = shallowRef<Model.AmountStreamReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.AmountStreamReq>()
@@ -69,7 +69,7 @@ filterOptons.selectList = [
         label: '查询类型',
         selectedValue: 1,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 1 },
             { label: '历史', value: 2 },
         ],
@@ -77,7 +77,7 @@ filterOptons.selectList = [
     {
         key: 'operatetype',
         label: '业务类型',
-        options: [],
+        options: () => getEnumOptions(),
     },
 ]
 
@@ -108,8 +108,4 @@ const processRequiredParams = (callback: (params: Model.AmountStreamReq) => void
         ElMessage.warning('请选择账户')
     }
 }
-
-registerEnumReadyCallback(() => {
-    filterOptons.selectList[1].options = getEnumOptions()
-})
 </script>

+ 10 - 14
src/packages/pc/views/query/warehouse_receipt/wrsumm/index.vue

@@ -38,17 +38,7 @@ const { componentMap, componentId, record, openComponent, closeComponent, getFil
     onClose: () => onSearch()
 })
 
-useRequest(initWarehouse, {
-    onSuccess: (res) => {
-        filterOptons.selectList[1].options = res.data.wrStandardList.map((e) => ({
-            label: e.wrstandardname,
-            value: e.wrstandardid
-        }))
-        filterOptons.selectList[2].options = res.data.warehouseInfoList.map((e) => ({
-            label: e.warehousename,
-            value: e.autoid
-        }))
-    },
+const { data: warehouse } = useRequest(initWarehouse, {
     onError: (err) => {
         ElMessage.error(err)
     }
@@ -83,7 +73,7 @@ filterOptons.selectList = [
         label: '查询类型',
         selectedValue: 0,
         locked: true,
-        options: [
+        options: () => [
             { label: '当前', value: 0 },
             { label: '历史', value: 1 },
         ],
@@ -92,13 +82,19 @@ filterOptons.selectList = [
         key: 'wrsids',
         label: '仓库标准',
         multiple: true,
-        options: [],
+        options: () => warehouse.value?.wrStandardList.map((e) => ({
+            label: e.wrstandardname,
+            value: e.wrstandardid
+        })) || [],
     },
     {
         key: 'wareids',
         label: '仓库',
         multiple: true,
-        options: [],
+        options: () => warehouse.value?.warehouseInfoList.map((e) => ({
+            label: e.warehousename,
+            value: e.autoid
+        })) || [],
     }
 ]
 

+ 4 - 12
src/packages/pc/views/query/warehouse_receipt_order/order/index.vue

@@ -45,7 +45,7 @@ const wrtradetype2Enum = useEnum('wrtradetype2')
 // 状态
 const wrTradeOrderStatusEnum = useEnum('WRTradeOrderStatus')
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.WarehouseQueryReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.WarehouseQueryReq>()
@@ -88,17 +88,17 @@ filterOptons.selectList = [
         key: 'marketid',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions(),
     },
     {
         key: 'wrtradetype',
         label: '类型',
-        options: [],
+        options: () => wrtradetype2Enum.getEnumOptions(),
     },
     {
         key: 'buyorsell',
         label: '方向',
-        options: getBuyOrSellList(),
+        options: () => getBuyOrSellList(),
     }
 ]
 
@@ -129,12 +129,4 @@ const processRequiredParams = (callback: (params: Model.WarehouseQueryReq) => vo
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions()
-})
-
-wrtradetype2Enum.registerEnumReadyCallback(() => {
-    filterOptons.selectList[1].options = wrtradetype2Enum.getEnumOptions()
-})
 </script>

+ 4 - 8
src/packages/pc/views/query/warehouse_receipt_order/trade/index.vue

@@ -39,7 +39,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppOperation from '@pc/components/base/operation/index.vue'
 
-const { getMarketOptions, registerMarketReadyCallback } = useMarket()
+const { getMarketOptions } = useMarket()
 const queryParams = shallowRef<Model.TradeOrderReq>()
 
 const { filterOptons, getQueryParams } = useDataFilter<Model.TradeOrderReq>()
@@ -84,17 +84,17 @@ filterOptons.selectList = [
         key: 'marketid',
         label: '市场',
         locked: true,
-        options: [],
+        options: () => getMarketOptions(),
     },
     {
         key: 'wrtradetype',
         label: '类型',
-        options: [],
+        options: () => [],
     },
     {
         key: 'buyorsell',
         label: '方向',
-        options: getBuyOrSellList(),
+        options: () => getBuyOrSellList(),
     }
 ]
 
@@ -125,8 +125,4 @@ const processRequiredParams = (callback: (params: Model.WarehouseQueryReq) => vo
         ElMessage.warning('请选择市场')
     }
 }
-
-registerMarketReadyCallback(() => {
-    filterOptons.selectList[0].options = getMarketOptions()
-})
 </script>