<template>
    <div>
        <Modal :mask-closable="false" @on-visible-change="visibleChange" v-model="my_show" width="800" footer-hide>
            <div slot="header">
                <span style="margin-right:20px">平台配置</span>
                <Button type="primary" @click="addSet">添加</Button>
            </div>
            <div style="height:500px">
                <Row style="margin-bottom:10px;font-size:14px;font-weight: bold;">
                    <Col span="8">
                    平台名称
                    </Col>
                    <Col span="8">占比</Col>
                    <Col span="8">操作</Col>
                </Row>
                <Row v-for="(item,index) in applySetList" style="margin-bottom:10px">
                    <Col span="8">
                    <Select v-model="item.info.appId" style="width:80%" placeholder="请选择平台" label-in-value @on-change="handleSelect($event,index)" :disabled="item.id!=undefined">
                        <Option v-for="apply in applyList" :value="apply.id" :key="apply.id">{{ apply.appType}}</Option>
                    </Select>
                    </Col>
                    <Col span="8">
                    <Input v-model="item.info.percent" type="number" placeholder="请输入占比" clearable style="width:80%"/>
                    </Col>
                    <Col span="8">
                    <Button type="error" @click="delSet(item,index)" style="margin-right:20px">删除</Button>
                    <Button v-if="item.info.appId" type="primary" @click="agentSet(item,index)">配置下级机构</Button>
                    </Col>
                </Row>
            </div>
        </Modal>
        <agent-set :show.sync="agent.show" v-bind="agent"></agent-set>
    </div>
</template>
<script src="./js/platform_set.js"></script>
