<template>
  <div id="quote" style="width: 100%;">
    <spcp-iframe v-if="type === 'chartView' || type === 'dashBd'" :src='url' :style='{
            position: "relative",
            height: chartViewControlHeight + "px",
            paddingBottom:"32px",
            width: controlWidth
            }' :frameBorder="0">
    </spcp-iframe>

    <table-form-render v-else-if="type === 'editTable' || type === 'viewTableForm'" v-bind="tableFormRenderProps">
    </table-form-render>

    <pl-diy-custom-comp v-else-if="type === 'diyComponent'" v-bind="diyCustomCompProps"></pl-diy-custom-comp>

    <div v-else style="height:100%;color:red">{{ remind }}</div>
  </div>
</template>
<script>
import proto from '../spcp-proto.vue';
import SpcpIframe from "./spcp-iframe";
import TableFormRender from "../../../formRender/tableFormRender";
import PlDiyCustomComp from "../../../../../components/public/plDiyCustomComp";
export default {
    name: "spcp-quote",
  components: {PlDiyCustomComp, TableFormRender, SpcpIframe},
    extends: proto,
    props:{
      type: {type: String, default: ''},
      /** iframe start **/
      url: {type: String,default:''},
      remind:{type:String,default:''},
      chartViewControlHeight:{type:Number,default:0},
      controlWidth:{type:String,default:'100%'},
      /** iframe end
       * tableFormRender start **/
      tableFormRenderProps: {type: Object, default: () => {return {}}},
      /** tableFormRender end
       * diyComponent start **/
      diyCustomCompProps: {type: Object, default: () => {return {}}},
      /** diyComponent end **/
    },
    data(){
        return {

        }
    },
    created() {
      console.log('quote', this.tableFormRenderProps)
    },
}
</script>
<style scoped>

</style>
