<template>
  <Detail :selectedRow="selectedRow">
    <fieldset class="formFieldSet">
      <legend>其它信息</legend>
      <Des :list="desList" />
    </fieldset>
  </Detail>
</template>

<script lang="ts">
import { defineComponent, PropType } from 'vue';
import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
import { formatValue } from '@/common/methods';
import Detail from '../common-detail/index.vue';
import { Des, handleDesList } from '@/common/components/commonDes';
import { businessManager, findManagerName } from '../../list/setup';

export default defineComponent({
    name: 'spot-contract-info-detail',
    components: { Detail, Des },
    props: {
        selectedRow: {
            type: Object as PropType<Ermcp3ContractRsp>,
            default: {},
        },
    },
    setup(props, context) {
        // 预览附件
        const { desList, getDesList } = handleDesList();
        const data = props.selectedRow;
        const list = [
            { label: '保证金', value: formatValue(data.contractmargin) },
            { label: '业务员', value: formatValue(findManagerName(data.saleuserid, businessManager.value)) },
            { label: '跟单员', value: formatValue(findManagerName(data.meruserid, businessManager.value)) },
            { label: '交易用户', value: formatValue(data.tradeusername) },
            { label: '备注', value: formatValue(data.remark) },
        ];
        getDesList(list);
        return {
            desList,
        };
    },
});
</script>

<style lang="less">
.custom-detail {
    .upload {
        .look {
            margin-left: 0;
        }
    }
}
</style>;
