| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <template>
- <el-row
- :class="{
- [element.options && element.options.customClass]: element.options && element.options.customClass?true: false
- }"
- :type="element.options.flex ? 'flex' : ''"
- :gutter="element.options.gutter || 0"
- :justify="element.options.justify"
- :align="element.options.align"
- v-if="elementDisplay"
- >
- <template v-for="(item, index) in element.columns" :key="index">
- <el-col
- v-if="!hideCols.includes(index)"
- :span="item.options ? getColMD(item.options) : item.span"
- :xs="item.options ? getColXS(item.options) : item.span"
- :sm="item.options ? getColSM(item.options) : item.span"
- :md="item.options ? getColMD(item.options) : item.span"
- :lg="item.options ? getColMD(item.options) : item.span"
- :xl="item.options ? getColMD(item.options) : item.span"
- :offset="item.options ? item.options.offset : 0"
- :push="item.options ? item.options.push : 0"
- :pull="item.options ? item.options.pull : 0"
- :class="{
- [item.options && item.options.customClass]: item.options && item.options.customClass?true: false
- }"
- >
- <template v-for="col in item.list">
- <generate-col-item
- v-if="col.type == 'grid'"
- :key="`grid-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-col-item>
- <generate-tab-item
- v-else-if="col.type == 'tabs'"
- :key="`tabs-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-tab-item>
- <generate-collapse
- v-else-if="col.type == 'collapse'"
- :key="`collapse-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-collapse>
- <generate-report
- v-else-if="col.type == 'report'"
- :key="`report-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-report>
- <generate-card
- v-else-if="col.type == 'card'"
- :key="`card-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-card>
- <generate-inline
- v-else-if="col.type == 'inline'"
- :key="`inline-${col.key}`"
- :model="dataModels"
- :rules="rules"
- :element="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-inline>
- <generate-form-item
- v-else
- :key="`form-item-${col.key}`"
- :models="dataModels"
- :rules="rules"
- :widget="col"
- :remote="remote"
- :blanks="blanks"
- :display="display"
- :sub-hide-fields="subHideFields"
- :sub-disabled-fields="subDisabledFields"
- :edit="edit"
- :remote-option="remoteOption"
- :platform="platform"
- :preview="preview"
- :container-key="containerKey"
- :data-source-value="dataSourceValue"
- :event-function="eventFunction"
- :print-read="printRead"
- :is-subform="isSubform"
- :row-index="rowIndex"
- :sub-name="subName"
- :is-dialog="isDialog"
- :dialog-name="dialogName"
- :is-group="isGroup"
- :group="group"
- :field-node="fieldNode"
- >
- <template v-slot:[blank.name]="scope" v-for="blank in blanks">
- <slot :name="blank.name" :model="scope.model"></slot>
- </template>
- </generate-form-item>
- </template>
- </el-col>
- </template>
- </el-row>
- </template>
- <script>
- import GenerateFormItem from './GenerateFormItem.vue'
- import GenerateInline from './GenerateInline.vue'
- import { defineAsyncComponent } from 'vue'
- import { generateColItemMixin } from '../mixins/generateColItem'
- export default {
- name: 'generate-col-item',
- components: {
- GenerateFormItem,
- GenerateInline,
- GenerateTabItem: defineAsyncComponent(() => import('./GenerateTabItem.vue')),
- GenerateReport: defineAsyncComponent(() => import('./GenerateReport.vue')),
- GenerateCollapse: defineAsyncComponent(() => import('./GenerateCollapse.vue')),
- GenerateCard: defineAsyncComponent(() => import('./GenerateCard.vue'))
- },
- props: ['element', 'model', 'rules', 'remote', 'blanks', 'display', 'edit', 'remoteOption', 'platform', 'preview', 'containerKey', 'dataSourceValue', 'eventFunction', 'printRead', 'isSubform', 'rowIndex', 'subName', 'subHideFields', 'subDisabledFields', 'isDialog', 'dialogName', 'group', 'fieldNode', 'isGroup'],
- mixins: [generateColItemMixin]
- }
- </script>
|