|
|
@@ -10,7 +10,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item :label="t('member.institution.self.edit.title1')" prop="userid" v-if="!record" >
|
|
|
<el-button @click="openComponent('Roles')">{{ t('member.institution.self.edit.look') }}</el-button>
|
|
|
- <span>{{ manger }}</span>
|
|
|
+ <span style="margin-left: 10px;">{{ manger }}</span>
|
|
|
</el-form-item>
|
|
|
</fieldset>
|
|
|
<fieldset class="g-fieldset el-form--horizontal">
|
|
|
@@ -62,11 +62,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, PropType, ref, onMounted, defineAsyncComponent } from 'vue'
|
|
|
-import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
+import { shallowRef, PropType, ref, onMounted, defineAsyncComponent, nextTick } from 'vue'
|
|
|
+import { ElMessage, FormInstance, FormRules, TableInstance } from 'element-plus'
|
|
|
import { i18n } from '@/stores'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
-import { initAdd, roleadd, getOragnDefaultManager } from '@/services/api/member'
|
|
|
+import { initAdd, roleadd, getOragnDefaultManager, queryRoleDetail } from '@/services/api/member'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { handleNoneValue } from '@/filters'
|
|
|
import AppSelectMember from '@pc/components/modules/select-member/index.vue'
|
|
|
@@ -95,6 +95,7 @@ const refresh = shallowRef(false)
|
|
|
const organSelect = ref<Model.OrganSelectRsp>()
|
|
|
const multipleSelection = ref<Model.UpdateTaAccountReq['dtype']>([]) // 已选中的市场数据
|
|
|
const marketbstype = [{value: 0, label: "无"}, {value:1, label: "可挂可摘"}, {value:2, label: "可挂"}, {value:3, label: "可摘"}]
|
|
|
+const tableRef = ref<TableInstance>()
|
|
|
|
|
|
const { loading } = useRequest(initAdd, {
|
|
|
params: {
|
|
|
@@ -103,7 +104,7 @@ const { loading } = useRequest(initAdd, {
|
|
|
onSuccess: (res) => {
|
|
|
// 赋值数据
|
|
|
formData.value.dtype = res.data.markets.map(e => ({
|
|
|
- checked: 0,
|
|
|
+ checked: 1,
|
|
|
dtype: 0,
|
|
|
fdType: 0,
|
|
|
fspotRightType: 0,
|
|
|
@@ -119,6 +120,39 @@ const { loading } = useRequest(initAdd, {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+const { run: runRoleDetail } = useRequest(queryRoleDetail, {
|
|
|
+ manual: true,
|
|
|
+ params: {
|
|
|
+ rolename: 'selfsupport',
|
|
|
+ userid: props.record?.userid
|
|
|
+ },
|
|
|
+ onSuccess: (res) => {
|
|
|
+ formData.value.dtype = formData.value.dtype?.map(e => ({
|
|
|
+ checked: res.data.markets.some(a => a.marketid === e.marketId) ? 1 : 0,
|
|
|
+ dtype: 0,
|
|
|
+ fdType: 0,
|
|
|
+ fspotRightType: 0,
|
|
|
+ marketId: e.marketId,
|
|
|
+ marketName: e.marketName,
|
|
|
+ spotRightType: 0,
|
|
|
+ tradeMode: e.tradeMode,
|
|
|
+ tradeProperty: e.tradeProperty,
|
|
|
+ })) ?? []
|
|
|
+ console.log(formData.value.dtype)
|
|
|
+ // 初始化已选中的市场
|
|
|
+ nextTick(() => {
|
|
|
+ formData.value.dtype?.forEach((e) => {
|
|
|
+ if (e.checked) {
|
|
|
+ tableRef.value?.toggleRowSelection(e, true)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onError: (err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
const { data: manger, run: runDefaultManager } = useRequest(getOragnDefaultManager, {
|
|
|
manual: true,
|
|
|
params: {
|
|
|
@@ -141,6 +175,7 @@ const handleSelectionChange = (selection: Model.UpdateTaAccountReq['dtype']) =>
|
|
|
const onSubmit = () => {
|
|
|
const rawData = { ...formData.value }
|
|
|
rawData.dtype = multipleSelection.value
|
|
|
+ console.log(rawData)
|
|
|
formRef.value?.validate((valid) => {
|
|
|
if (valid) {
|
|
|
loading.value = true
|
|
|
@@ -178,6 +213,7 @@ onMounted(() => {
|
|
|
const { userid, } = props.record ?? {}
|
|
|
if (userid) {
|
|
|
formData.value.userid = userid
|
|
|
+ runRoleDetail()
|
|
|
}
|
|
|
})
|
|
|
</script>
|