|
|
@@ -2,8 +2,8 @@
|
|
|
<template>
|
|
|
<div class="g-view-tree">
|
|
|
<app-view>
|
|
|
- <el-tree :data="nodeList" node-key="id" :props="{ label: 'name' }" :default-expanded-keys="['-1']"
|
|
|
- @node-click="nodeClick" highlight-current />
|
|
|
+ <el-tree ref="treeRef" :data="nodeList" node-key="id" :props="{ label: 'name' }"
|
|
|
+ :default-expanded-keys="['-1']" @node-click="nodeClick" highlight-current />
|
|
|
</app-view>
|
|
|
<app-view>
|
|
|
<div style="display: flex;justify-content: space-between;">
|
|
|
@@ -83,7 +83,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, computed, reactive, toRaw } from 'vue'
|
|
|
+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'
|
|
|
@@ -97,11 +97,13 @@ import AppOperation from '@pc/components/base/operation/index.vue'
|
|
|
import AppTableDetails from '@pc/components/base/table-details/index.vue'
|
|
|
import { i18n } from '@/stores'
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
const customerTypeEnum = useEnum('customerType')
|
|
|
const feetypeEnum = useEnum('feetype')
|
|
|
const scfRiskMode = useEnum('SCFRiskMode')
|
|
|
|
|
|
-const nodeList = ref<(Model.InvestorTreeRsp & { children: Model.InvestorTreeRsp[]; })[]>([])
|
|
|
+const treeRef = ref()
|
|
|
+const nodeList = ref<(Investor.InvestorTreeRsp & { children: Investor.InvestorTreeRsp[]; })[]>([])
|
|
|
const selectedNode = ref<Node>()
|
|
|
|
|
|
const currentInfo = reactive({
|
|
|
@@ -112,7 +114,7 @@ const currentInfo = reactive({
|
|
|
marginValue: ''
|
|
|
})
|
|
|
|
|
|
-const qs = computed<Model.TradeConfigViewReq>(() => {
|
|
|
+const qs = computed<Investor.TradeConfigViewReq>(() => {
|
|
|
const data = selectedNode.value?.data
|
|
|
return {
|
|
|
usergroupid: data?.usergroupid,
|
|
|
@@ -121,9 +123,7 @@ const qs = computed<Model.TradeConfigViewReq>(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const { global: { t } } = i18n
|
|
|
-
|
|
|
-const { componentMap, componentId, openComponent, closeComponent, getActionButtons } = useOperation<Model.TradeConfigViewRsp>({
|
|
|
+const { componentMap, componentId, openComponent, closeComponent, getActionButtons } = useOperation<Investor.TradeConfigViewRsp>({
|
|
|
onClose: (componentId) => {
|
|
|
getNodeList()
|
|
|
if (componentId === 'investor_custom_tradecfg_modify') {
|
|
|
@@ -149,6 +149,14 @@ const { run: getNodeList } = useRequest(getInvestorTree, {
|
|
|
}
|
|
|
)
|
|
|
nodeList.value = buildTree(res.data, 'id', 'pid', (node) => node.pid === '0')
|
|
|
+
|
|
|
+ // 设置选中节点
|
|
|
+ nextTick(() => {
|
|
|
+ const data = selectedNode.value?.data
|
|
|
+ if (data) {
|
|
|
+ treeRef.value.setCurrentKey(data.id)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
onError: (err) => {
|
|
|
ElMessage.error(err)
|
|
|
@@ -184,7 +192,7 @@ const feeColumns = computed<Model.TableColumn[]>(() => [
|
|
|
{ field: 'cvalue', label: 'investor.custom.tradecfg.cvalue' },
|
|
|
])
|
|
|
|
|
|
-const nodeClick = (data: Model.InvestorTreeRsp, node: Node) => {
|
|
|
+const nodeClick = (data: Investor.InvestorTreeRsp, node: Node) => {
|
|
|
if (data.goodsid) {
|
|
|
selectedNode.value = node
|
|
|
currentInfo.goodsName = node.label
|