|
|
@@ -2,8 +2,8 @@
|
|
|
* @Description: 传入record数据,通过判断record.type,来渲染对应的组件
|
|
|
-->
|
|
|
<template>
|
|
|
- <a-form-item :class="{ 'red-label': record?.options?.requiredFirst ||record?.rules?.find(f=>f.required)}"
|
|
|
- v-if="
|
|
|
+ <a-form-item :class="{ 'red-label': record?.options?.requiredFirst ||record?.rules?.find(f=>f.required)}"
|
|
|
+ v-if="
|
|
|
[
|
|
|
'input',
|
|
|
'textarea',
|
|
|
@@ -24,115 +24,115 @@
|
|
|
'deptAndPersonSelect',
|
|
|
].includes(record.type)
|
|
|
"
|
|
|
- :name="['domains', rowIndex, record.model]"
|
|
|
- :rules='record.rules'
|
|
|
+ :name="['domains', rowIndex, record.model]"
|
|
|
+ :rules='record.rules'
|
|
|
>
|
|
|
<!-- 多行文本 -->
|
|
|
<a-textarea
|
|
|
- :style='`width:${record.options.width}`'
|
|
|
- v-if="record.type === 'textarea'"
|
|
|
- :autoSize='{
|
|
|
+ :style='`width:${record.options.width}`'
|
|
|
+ v-if="record.type === 'textarea'"
|
|
|
+ :autoSize='{
|
|
|
minRows: record.options.minRows,
|
|
|
maxRows: record.options.maxRows
|
|
|
}'
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
- :allowClear='record.options.clearable'
|
|
|
- :maxLength='record.options.maxLength'
|
|
|
- :rows='4'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
- v-model:value='domains[rowIndex][record.model]'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
+ :allowClear='record.options.clearable'
|
|
|
+ :maxLength='record.options.maxLength'
|
|
|
+ :rows='4'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ v-model:value='domains[rowIndex][record.model]'
|
|
|
/>
|
|
|
<!-- 弹出框 -->
|
|
|
<PopUpQueryChild
|
|
|
- v-else-if="record.type === 'popUpSelect'"
|
|
|
- :options='computedOptions'
|
|
|
- :disabled='parentDisabled ||record.options.disabled'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
- :formConfig='formConfig'
|
|
|
- :rowData='domains[rowIndex]'
|
|
|
- :childTableFieldRecord='childTableFieldRecord'
|
|
|
- :record='record'
|
|
|
- :formData='formData'
|
|
|
- :content='value'
|
|
|
+ v-else-if="record.type === 'popUpSelect'"
|
|
|
+ :options='computedOptions'
|
|
|
+ :disabled='parentDisabled ||record.options.disabled'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ :formConfig='formConfig'
|
|
|
+ :rowData='domains[rowIndex]'
|
|
|
+ :childTableFieldRecord='childTableFieldRecord'
|
|
|
+ :record='record'
|
|
|
+ :formData='formData'
|
|
|
+ :content='value'
|
|
|
/>
|
|
|
<!-- 单选框 -->
|
|
|
<a-radio-group
|
|
|
- v-else-if="record.type === 'radio'"
|
|
|
- :options='computedOptions'
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
- v-model:value='domains[rowIndex][record.model]'
|
|
|
- v-model:checked='domains[rowIndex][record.model]'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ v-else-if="record.type === 'radio'"
|
|
|
+ :options='computedOptions'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
+ v-model:value='domains[rowIndex][record.model]'
|
|
|
+ v-model:checked='domains[rowIndex][record.model]'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
/>
|
|
|
|
|
|
<!-- 多选框 -->
|
|
|
<a-checkbox-group
|
|
|
- v-else-if="record.type === 'checkbox'"
|
|
|
- :options='computedOptions'
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
- v-model:value='domains[rowIndex][record.model]'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ v-else-if="record.type === 'checkbox'"
|
|
|
+ :options='computedOptions'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
+ v-model:value='domains[rowIndex][record.model]'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
/>
|
|
|
|
|
|
<!-- 滑块 -->
|
|
|
<div
|
|
|
- v-else-if="record.type === 'slider'"
|
|
|
- :style='`width:${record.options.width}`'
|
|
|
- class='slider-box'
|
|
|
+ v-else-if="record.type === 'slider'"
|
|
|
+ :style='`width:${record.options.width}`'
|
|
|
+ class='slider-box'
|
|
|
>
|
|
|
<div class='slider'>
|
|
|
<a-slider
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :min='record.options.min'
|
|
|
- :max='record.options.max'
|
|
|
- :step='record.options.step'
|
|
|
- v-model:value='domains[rowIndex][record.model]'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :min='record.options.min'
|
|
|
+ :max='record.options.max'
|
|
|
+ :step='record.options.step'
|
|
|
+ v-model:value='domains[rowIndex][record.model]'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
/>
|
|
|
</div>
|
|
|
<div class='number' v-if='record.options.showInput'>
|
|
|
<a-input-number
|
|
|
- style='width:100%'
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
- :min='record.options.min'
|
|
|
- :max='record.options.max'
|
|
|
- :step='record.options.step'
|
|
|
- v-model:value='domains[rowIndex][record.model]'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
+ style='width:100%'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled)? '' : record.options.placeholder"
|
|
|
+ :min='record.options.min'
|
|
|
+ :max='record.options.max'
|
|
|
+ :step='record.options.step'
|
|
|
+ v-model:value='domains[rowIndex][record.model]'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: domains[rowIndex], rows: domains, colIndex: tableScope.index || colIndex })'
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<component
|
|
|
- v-else
|
|
|
- :style='`width:${record.options.width}`'
|
|
|
- v-bind='componentOption'
|
|
|
- :min='
|
|
|
+ v-else
|
|
|
+ :style='`width:${record.options.width}`'
|
|
|
+ v-bind='componentOption'
|
|
|
+ :min='
|
|
|
record.options.min || record.options.min === 0
|
|
|
? record.options.min
|
|
|
: -Infinity
|
|
|
'
|
|
|
- :max='
|
|
|
+ :max='
|
|
|
record.options.max || record.options.max === 0
|
|
|
? record.options.max
|
|
|
: Infinity
|
|
|
'
|
|
|
- :count='record.options.max'
|
|
|
- :precision='record.options.precision || 0'
|
|
|
- :formatter="value =>record.options.thousandth==true&&value!=''?
|
|
|
+ :count='record.options.max'
|
|
|
+ :precision='record.options.precision || 0'
|
|
|
+ :formatter="value =>record.options.thousandth==true&&value!=''?
|
|
|
`${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','):value"
|
|
|
- :record='record'
|
|
|
- :config='config'
|
|
|
- :disabled='record.options.disabled || parentDisabled'
|
|
|
- :parentDisabled='record.options.disabled || parentDisabled'
|
|
|
- :allowClear='record.options.clearable'
|
|
|
- :dynamicData='dynamicData'
|
|
|
- :filterOption='
|
|
|
+ :record='record'
|
|
|
+ :config='config'
|
|
|
+ :disabled='record.options.disabled || parentDisabled'
|
|
|
+ :parentDisabled='record.options.disabled || parentDisabled'
|
|
|
+ :allowClear='record.options.clearable'
|
|
|
+ :dynamicData='dynamicData'
|
|
|
+ :filterOption='
|
|
|
record.options.showSearch
|
|
|
? (inputValue, option) => {
|
|
|
return (
|
|
|
@@ -141,35 +141,35 @@
|
|
|
}
|
|
|
: false
|
|
|
'
|
|
|
- :treeData='computedOptions'
|
|
|
- :options='computedOptions'
|
|
|
- :mode="record.options.multiple ? 'multiple' : ''"
|
|
|
- v-model:checked='currentVal'
|
|
|
- v-model:value='currentVal'
|
|
|
- @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: currentTableData[rowIndex], rows: domains, columns, pagination })'
|
|
|
- :is='componentItem'
|
|
|
- :placeholder="(record.options.disabled || parentDisabled) ? '' : record.options.placeholder"
|
|
|
+ :treeData='computedOptions'
|
|
|
+ :options='computedOptions'
|
|
|
+ :mode="record.options.multiple ? 'multiple' : ''"
|
|
|
+ v-model:checked='currentVal'
|
|
|
+ v-model:value='currentVal'
|
|
|
+ @change='handleChange($event, record.model, record, {...tableScope, rowIndex, row: currentTableData[rowIndex], rows: domains, columns, pagination })'
|
|
|
+ :is='componentItem'
|
|
|
+ :placeholder="(record.options.disabled || parentDisabled) ? '' : record.options.placeholder"
|
|
|
></component>
|
|
|
</a-form-item>
|
|
|
<!-- 文本 -->
|
|
|
<a-form-item v-else-if="record.type === 'text'">
|
|
|
<div :style='{ textAlign: record.options.textAlign }'>
|
|
|
<label
|
|
|
- :class="{ 'ant-form-item-required': record.options.showRequiredMark }"
|
|
|
- :style='{
|
|
|
+ :class="{ 'ant-form-item-required': record.options.showRequiredMark }"
|
|
|
+ :style='{
|
|
|
fontFamily: record.options.fontFamily,
|
|
|
fontSize: record.options.fontSize,
|
|
|
color: record.options.color
|
|
|
}'
|
|
|
- v-text='record.label'
|
|
|
+ v-text='record.label'
|
|
|
></label>
|
|
|
</div>
|
|
|
</a-form-item>
|
|
|
|
|
|
<!-- html -->
|
|
|
<div
|
|
|
- v-else-if="record.type === 'html'"
|
|
|
- v-html='record.options.defaultValue'
|
|
|
+ v-else-if="record.type === 'html'"
|
|
|
+ v-html='record.options.defaultValue'
|
|
|
></div>
|
|
|
|
|
|
<div v-else>
|
|
|
@@ -187,7 +187,7 @@ import UploadImg from '../../UploadImg/uploadImg.vue'
|
|
|
import StDatePicker from '../../StDatePicker/datePicker.vue'
|
|
|
import StTimePicker from '../../StTimePicker/timePicker.vue'
|
|
|
import ComponentArray from '../../core/components_use'
|
|
|
-import { PROVINCE_CITY_DISTRICT } from '/@/views/flow/stFormDesign/province-city-district.js';
|
|
|
+import {PROVINCE_CITY_DISTRICT} from '/@/views/flow/stFormDesign/province-city-district.js';
|
|
|
import _ from "lodash/object"
|
|
|
|
|
|
export default {
|
|
|
@@ -268,6 +268,7 @@ export default {
|
|
|
width: 70px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
::v-deep(.red-label .ant-form-item-label > label) {
|
|
|
color: red;
|
|
|
}
|