li.shaoyi 3 mēneši atpakaļ
vecāks
revīzija
d2df558224

+ 1 - 1
src/packages/pc/components/modules/select-account/index.vue

@@ -51,7 +51,7 @@ const remoteMethod = (query: string) => {
             run({
                 searchcode: query
             })
-        } else if (!dataList.value.length) {
+        } else if (!selectedValue.value) {
             onReset()
         }
     }

+ 1 - 1
src/packages/pc/components/modules/select-account2/index.vue

@@ -55,7 +55,7 @@ const remoteMethod = (query: string) => {
             run({
                 searchCode: query
             })
-        } else if (!dataList.value.length) {
+        } else if (!selectedValue.value) {
             onReset()
         }
     }

+ 1 - 1
src/packages/pc/components/modules/select-account3/index.vue

@@ -55,7 +55,7 @@ const remoteMethod = (query: string) => {
             run({
                 accountName: query
             })
-        } else if (!dataList.value.length) {
+        } else if (!selectedValue.value) {
             onReset()
         }
     }

+ 1 - 1
src/packages/pc/components/modules/select-goods/index.vue

@@ -76,7 +76,7 @@ const remoteMethod = (query: string) => {
                     ...props.params,
                     searchCode: query
                 })
-            } else if (!dataList.value.length) {
+            } else if (!selectedValue.value) {
                 onReset()
             }
         }

+ 1 - 1
src/packages/pc/components/modules/select-goods2/index.vue

@@ -76,7 +76,7 @@ const remoteMethod = (query: string) => {
                     ...props.params,
                     searchCode: query
                 })
-            } else if (!dataList.value.length) {
+            } else if (!selectedValue.value) {
                 onReset()
             }
         }

+ 1 - 1
src/packages/pc/components/modules/select-institution/index.vue

@@ -60,7 +60,7 @@ const remoteMethod = (query: string) => {
                 ...props.params,
                 searchcode: query
             })
-        } else if (!dataList.value.length) {
+        } else if (!selectedValue.value) {
             onReset()
         }
     }

+ 1 - 1
src/packages/pc/components/modules/select-investor/index.vue

@@ -56,7 +56,7 @@ const remoteMethod = (query: string) => {
                 ...props.params,
                 searchName: query
             })
-        } else if (!dataList.value.length) {
+        } else if (!selectedValue.value) {
             onReset()
         }
     }

+ 1 - 1
src/packages/pc/components/modules/select-member/index.vue

@@ -66,7 +66,7 @@ const remoteMethod = (query: string) => {
                     ...props.params,
                     searchcode: query
                 })
-            } else if (!dataList.value.length) {
+            } else if (!selectedValue.value) {
                 onReset()
             }
         }

+ 1 - 1
src/packages/pc/components/modules/select-member2/index.vue

@@ -66,7 +66,7 @@ const remoteMethod = (query: string) => {
                     ...props.params,
                     searchcode: query
                 })
-            } else if (!dataList.value.length) {
+            } else if (!selectedValue.value) {
                 onReset()
             }
         }

+ 151 - 1
src/packages/pc/views/base/dictionary/index.vue

@@ -1,7 +1,157 @@
 <!-- 基础数据管理-数据字典管理 -->
 <template>
-    <app-view></app-view>
+    <div class="g-view-tree">
+        <app-view>
+            <el-tree ref="treeRef" :data="nodeList"
+                :props="{ label: (data: { enumgroupname: string; enumdicname: string }) => data.enumgroupname || data.enumdicname }"
+                :expand-on-click-node="false" @node-click="nodeClick" highlight-current default-expand-all />
+        </app-view>
+        <app-view>
+            <app-table :data="dataList" :columns="tableColumns">
+                <template #headerLeft>
+                    <app-operation :data-list="getActionButtons(['investor_custom_tradecfg_add'])"
+                        @click="openComponent" />
+                    <app-operation
+                        :data-list="getActionButtons(['investor_custom_tradecfg_modify', 'investor_custom_tradecfg_delete'])"
+                        @click="openComponent" v-if="data" />
+                </template>
+            </app-table>
+        </app-view>
+        <component :is="componentMap.get(componentId)" v-bind="{ record: toRaw(data) }" @closed="closeComponent"
+            v-if="componentId" />
+    </div>
 </template>
 
 <script lang="ts" setup>
+import { ref, computed, reactive, toRaw, nextTick } from 'vue'
+import { ElMessage } from 'element-plus'
+import type Node from 'element-plus/es/components/tree/src/model/node'
+import { buildTree, handleNoneValue } from '@/filters'
+import { Language } from '@/constants/language'
+import { useEnum } from '@/hooks/enum'
+import { useRequest } from '@/hooks/request'
+import { useOperation } from '@/hooks/operation'
+import { getInvestorTree, tradeConfigView } from '@/services/api/investor'
+import { queryEnumDicItemByPage, getEnumDics } from '@/services/api/base'
+import { CellProp } from '@pc/components/base/table-details/types'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppOperation from '@pc/components/base/operation/index.vue'
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
+import { i18n } from '@/stores'
+
+const { t } = i18n.global
+const customerTypeEnum = useEnum('customerType')
+const feetypeEnum = useEnum('feetype')
+const scfRiskMode = useEnum('SCFRiskMode')
+const traderuleEnum = useEnum('traderule') // 交易规则
+const tradefeeEnum = useEnum('tradefee') // 交易费用
+
+const treeRef = ref()
+const nodeList = ref<(Base.EnumGroup & { children: Base.EnumDic[]; })[]>([])
+const selectedNode = ref<Node>()
+
+const currentInfo = reactive({
+    groupName: '',
+    marketName: '',
+    goodsName: '',
+    customerType: '',
+    marginValue: ''
+})
+
+const qs = computed<Investor.TradeConfigViewReq>(() => {
+    const data = selectedNode.value?.data
+    return {
+        usergroupid: data?.usergroupid,
+        marketid: data?.marketid,
+        goodsid: data?.goodsid,
+    }
+})
+
+const { componentMap, componentId, openComponent, closeComponent, getActionButtons } = useOperation<Investor.TradeConfigViewRsp>({
+    onClose: (componentId) => {
+        getNodeList()
+        if (componentId === 'investor_custom_tradecfg_modify') {
+            getDetails(qs.value)
+        }
+        if (componentId === 'investor_custom_tradecfg_delete') {
+            data.value = undefined
+        }
+    }
+})
+
+const { run: getNodeList } = useRequest(getEnumDics, {
+    onSuccess: (res) => {
+        nodeList.value = res.data.enumgroups.map((e) => {
+            const children: Base.EnumDic[] = []
+            res.data.enumdics.forEach((item) => {
+                if (e.enumgroupid === item.enumgroupid) {
+                    children.push(item)
+                }
+            })
+            return {
+                ...e,
+                children,
+            }
+        })
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const { data, run: getDetails } = useRequest(tradeConfigView, {
+    manual: true,
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const { dataList, run: getDataList } = useRequest(queryEnumDicItemByPage, {
+    manual: true,
+    defaultParams: {
+        pageNum: 1,
+        pageSize: 20
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const detailProps = computed<CellProp[]>(() => [
+    { prop: 'groupName', label: 'investor.custom.tradecfg.usergroupid1' },
+    { prop: 'marketName', label: 'investor.custom.tradecfg.marketid1' },
+    { prop: 'goodsName', label: 'investor.custom.tradecfg.goodsid1' },
+    { prop: 'customerType', label: 'investor.custom.tradecfg.paramid', formatValue: () => customerTypeEnum.getEnumTypeName(data.value?.paramid) },
+    { prop: 'marginValue', label: 'investor.custom.tradecfg.marketmarginvaluedisplay', formatValue: () => data.value?.marketmarginvaluedisplay },
+])
+
+const tableColumns: Model.TableColumn[] = [
+    { field: 'enumdiccode', label: '所属枚举代码' },
+    { field: 'enumdicname', label: '枚举项名称' },
+    { field: 'enumitemname', label: '枚举项值' },
+    { field: 'itemstatus', label: '枚举项状态' },
+    { field: 'operate', label: 'common.operate', fixed: 'right' }
+]
+
+const nodeClick = (data: Base.EnumGroup | Base.EnumDic, node: Node) => {
+    if ('enumdiccode' in data) {
+        getDataList({
+            enumgroupid: data.enumgroupid,
+            enumdiccode: data.enumdiccode,
+            ismappingtobank: data.ismappingtobank
+        })
+    } else {
+        getDataList({
+            enumgroupid: data.enumgroupid
+        })
+    }
+
+    if (data.goodsid) {
+        selectedNode.value = node
+        currentInfo.goodsName = node.label
+        currentInfo.marketName = node.parent.label
+        currentInfo.groupName = node.parent.parent.label
+        getDetails(qs.value)
+    }
+}
 </script>

+ 1 - 1
src/packages/pc/views/marketrun/monitor/positionsumm/index.vue

@@ -7,7 +7,7 @@
                 <template #goodsid="{ item }">
                     <el-form-item :label="item.label" prop="goodsid">
                         <app-select-goods2 v-model="item.value"
-                            :params="{ trademodels: '40,41,48,51', goodsStatusIds: '3' }" />
+                            :params="{ excludetrademodels: '40,41,48,51', goodsStatusIds: '3' }" />
                     </el-form-item>
                 </template>
                 <!-- 交易商 -->

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

@@ -208,6 +208,7 @@ declare namespace Model {
         searchCode?: string;
         trademodels?: string;
         yyareauserid?: number;
+        excludetrademodels?: string;
     }
 
     /** 下拉查询商品: 平台+运营机构同时有权限的菜单中过滤商品时使用 响应 */