<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">{{title}}</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="12">
                    产品名称
                    </Col>
                    <Col span="10">占比</Col>
                    <Col span="2">操作</Col>
                </Row>
                <Row v-for="(item,index) in packageSetList" style="margin-bottom:10px">
                    <Col span="8">
                    <Select v-model="item.info.productName" style="width:80%" placeholder="请选择产品" @on-change="handleSelect($event,index)" :disabled="item.id!=undefined">
                        <Option v-for="otem in packageList" :value="otem" :key="otem">{{otem}}</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.productName" type="primary" @click="saveSet(item,index)">保存配置</Button>
                    </Col>
                </Row>
            </div>
        </Modal>
    </div>
</template>
<script src="./js/package_set.js"></script>
