|
|
@ -5,44 +5,14 @@ |
|
|
|
<draggable v-bind="{draggable:'.drag-item',animation:500}" :disabled="!isDisabled" @update="datadragEnd"> |
|
|
|
<el-col v-for="(item,index) in formPreviewData" :key="index" class="drag-item" :span="item.isLine ? 24 : 12"> |
|
|
|
<el-form-item :label="item.fieldCnName" :prop="item.fieldName"> |
|
|
|
<!-- select --> |
|
|
|
<treeselect |
|
|
|
v-if="item.isInputClass === 'select'" |
|
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
|
:load-options="loadOptions" |
|
|
|
:options="item.options" |
|
|
|
:normalizer="normalizer" |
|
|
|
placeholder="" |
|
|
|
:style="{ width: item.editLength+'px'}" |
|
|
|
:disabled="isDisabled" |
|
|
|
:validate-event="isDisabled" |
|
|
|
/> |
|
|
|
<!-- select :load-options="loadOptions"--> |
|
|
|
<treeselect v-if="item.isInputClass === 'select'" v-model="addOrUpdateForm[item.fieldName]" :options="item.options" :normalizer="normalizer" placeholder="" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="isDisabled" /> |
|
|
|
<!-- text / number / textarea / popover --> |
|
|
|
<el-input |
|
|
|
v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date'" |
|
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
|
:type="item.isInputClass === 'popover'? 'text' : item.isInputClass" |
|
|
|
:rows="item.isInputClass === 'textarea' ? 3 : ''" |
|
|
|
:class="{'input-popover':(item.isInputClass === 'popover')}" |
|
|
|
:style="{ width: item.editLength+'px'}" |
|
|
|
:disabled="isDisabled" |
|
|
|
:validate-event="isDisabled" |
|
|
|
> |
|
|
|
<el-input v-if="item.isInputClass !== 'select' && item.isInputClass !== 'date'" v-model="addOrUpdateForm[item.fieldName]" :type="item.isInputClass === 'popover'? 'text' : item.isInputClass" :rows="item.isInputClass === 'textarea' ? 3 : ''" :class="{'input-popover':(item.isInputClass === 'popover')}" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="isDisabled"> |
|
|
|
<i v-if="item.isInputClass === 'popover'" slot="suffix" class="el-input__icon iconfont icon-weibiaoti-2" @click="popoverVisible = true" /> |
|
|
|
</el-input> |
|
|
|
<!-- date --> |
|
|
|
<el-date-picker |
|
|
|
v-if="item.isInputClass === 'date'" |
|
|
|
v-model="addOrUpdateForm[item.fieldName]" |
|
|
|
type="date" |
|
|
|
align="right" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
placeholder="" |
|
|
|
:clearable="false" |
|
|
|
:style="{ width: item.editLength+'px'}" |
|
|
|
:disabled="isDisabled" |
|
|
|
:validate-event="isDisabled" |
|
|
|
/> |
|
|
|
<el-date-picker v-if="item.isInputClass === 'date'" v-model="addOrUpdateForm[item.fieldName]" type="date" align="right" format="yyyy-MM-dd" placeholder="" :clearable="false" :style="{ width: item.editLength+'px'}" :disabled="isDisabled" :validate-event="isDisabled" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</draggable> |
|
|
@ -54,16 +24,7 @@ |
|
|
|
<span class="dialog-right-top" /> |
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
<div class="setting-dialog"> |
|
|
|
<el-table |
|
|
|
ref="table" |
|
|
|
:data="tableData" |
|
|
|
highlight-current-row |
|
|
|
row-key="id" |
|
|
|
:tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" |
|
|
|
style="width: 100%;" |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
@row-click="clickRowHandler" |
|
|
|
> |
|
|
|
<el-table ref="table" :data="tableData" highlight-current-row row-key="id" :tree-props="{children: 'childMenus', hasChildren: 'hasChildren'}" style="width: 100%;" @selection-change="handleSelectionChange" @row-click="clickRowHandler"> |
|
|
|
<el-table-column type="selection" width="55" /> |
|
|
|
<el-table-column prop="dicName" label="字典名称" /> |
|
|
|
<el-table-column prop="dicCode" label="字典代码" /> |
|
|
@ -126,16 +87,19 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.getAllSubset() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取对应字典子集数据 |
|
|
|
getAllSubset() { |
|
|
|
this.formPreviewData.map(item => { |
|
|
|
if (item.dictionaryConfigId) { |
|
|
|
// item.options = [] |
|
|
|
item.options = [] |
|
|
|
console.log(item.options) |
|
|
|
FetchFindAllSubsetById({ id: item.dictionaryConfigId.id }).then(res => { |
|
|
|
if (item.isInputClass === 'select') { |
|
|
|
item.options = res |
|
|
|
// Vue.set(item, "options", res) |
|
|
|
console.log(item.options) |
|
|
|
} else if (item.isInputClass === 'popover') { |
|
|
|
this.tableData = res |
|
|
|
} |
|
|
@ -228,7 +192,7 @@ export default { |
|
|
|
padding: 20px 15px 20px 0 !important; |
|
|
|
margin-top: 0 !important; |
|
|
|
border-radius: 4px; |
|
|
|
border: 1px solid #3A99FD; |
|
|
|
border: 1px solid #3a99fd; |
|
|
|
::v-deep .el-input__inner { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|