<template>
    <el-table
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="handleSelectionChange"
    >
        <el-table-column type="selection" width="55" />
        <el-table-column label="标题" width="120">
            <template v-slot="{ row }">{{ row.title }}</template>
        </el-table-column>
        <el-table-column prop="type" label="类型" width="120">
            <template v-slot="{ row }">
                <span>{{ typeList[row.type - 1].label }}</span>
            </template>
        </el-table-column>
        <el-table-column prop="content" label="内容">
            <template v-slot="{ row }">
                <!--未选择-->
                <template v-if="!row.type">
                    <span style="color: #F56C6C;">请选择类型</span>
                </template>
                <!--图片-->
                <template v-if="row.type == 1">
                    <imageUpload class="setting-imageUpload" v-model="row.content" :limit="6" disabled :isShowTip="false"/>
                </template>
                <!--视频-->
                <template v-if="row.type == 2">
                    <videoUpload class="setting-videoUpload" v-model="row.content" :value="row.content" disabled :isShowTip="false"/>
                </template>
                <!--文本/无标-->
                <template v-if="row.type == 3 || row.type == 5">
                    <div class="flex-acenter w100">
                        <span>{{ row.content }}</span>
                    </div>
                </template>
                <!--长文本/无标-->
                <template v-if="row.type == 4 || row.type == 6">
                    <div class="flex-acenter w100">
                        <span>{{ row.content }}</span>
                    </div>
                </template>
                <!--地图-->
                <template v-if="row.type == 7">
                    <el-button disabled>选择地点</el-button>
                </template>
                <!--大图-->
                <template v-if="row.type == 8">
                    <imageUpload class="setting-imageUpload" v-model="row.content" :limit="3" :isShowTip="false" />
                </template>
                <!--PDF-->
                <template v-if="row.type == 9">
                    <fileUpload class="" v-model="row.content" :limit="1" :fileType="fileType" :isShowTip="false" />
                </template>
            </template>
        </el-table-column>
    </el-table>
</template>

<script>
import imageUpload from '@/components/ImageUpload';
import videoUpload from '@/components/VideoUpload';
import fileUpload from '@/components/FileUpload';
import amap from '@/components/Customer/amap';
export default {
    name: "SelectOperateView",
    components: {
        imageUpload,
        videoUpload,
        fileUpload,
        amap
    },
    props: {
        tableData: {
            type: Array,
            default: [],
        },
        typeList: {
            type: Array,
            default: [],
        },
        selectedOperateDetails: {
            type: Array,
            default: [],
        },
    },
    data() {
        return {
        }
    },
    created() {},
    mounted() {},
    watch:{},
    methods: {
        handleSelectionChange(val) {
            this.$emit('update:selectedOperateDetails', val);
        },
    }
}
</script>
<style scoped lang="scss">
</style>