Browse Source

动态表单配置

preview
wxz 2 years ago
parent
commit
cae3b9a56d
  1. 6
      epmet-oper-web/src/views/modules/dyform/createFormItem.vue
  2. 24
      epmet-oper-web/src/views/modules/dyform/itemList.vue

6
epmet-oper-web/src/views/modules/dyform/createFormItem.vue

@ -88,7 +88,7 @@ export default {
tableName: null, tableName: null,
columnName: null, columnName: null,
itemType: null, itemType: null,
required: null, required: false,
optionSourceType: null, optionSourceType: null,
optionSourceValue: null optionSourceValue: null
}, },
@ -295,7 +295,7 @@ export default {
}); });
this.resetForm() this.resetForm()
this.$emit("onClose") // this.$emit("onClose", { type: 'submit' }) //
} else { } else {
this.$message({ this.$message({
type: 'error', type: 'error',
@ -312,7 +312,7 @@ export default {
*/ */
onCancelBtnClick() { onCancelBtnClick() {
this.resetForm() this.resetForm()
this.$emit("onClose") this.$emit("onClose", { type: 'cancel' })
}, },
resetForm() { resetForm() {

24
epmet-oper-web/src/views/modules/dyform/itemList.vue

@ -38,14 +38,15 @@
</el-card> </el-card>
<el-card> <el-card>
<!-- :span-method="mergeCells"-->
<!-- default-expand-all-->
<el-table <el-table
:span-method="mergeCells"
:data="formItemList" :data="formItemList"
style="width: 100%;margin-bottom: 20px;" :span-method="mergeCells"
style="width: 100%"
row-key="id" row-key="id"
border border
default-expand-all :tree-props="{children: 'children'}">
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column <el-table-column
prop="formCode" prop="formCode"
label="表单编码" label="表单编码"
@ -61,6 +62,11 @@
label="表单项名称" label="表单项名称"
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column
prop="parentItemLabel"
label="上级表单项"
width="180">
</el-table-column>
<el-table-column <el-table-column
prop="optionSourceType" prop="optionSourceType"
label="选项来源类型"> label="选项来源类型">
@ -213,10 +219,12 @@ export default {
this.setMergeRowQty(httpData.data[i], httpData.data[i + 1], i === 0); this.setMergeRowQty(httpData.data[i], httpData.data[i + 1], i === 0);
// hasChildren // hasChildren
item.hasChildren = (item.children.length > 0); // item.hasChildren = (item.children.length > 0);
} }
debugger
this.formItemList = httpData.data; this.formItemList = httpData.data;
console.log(this.formItemList)
}) })
}) })
}, },
@ -349,9 +357,11 @@ export default {
}) })
}, },
onClose() { onClose({ type: type }) {
this.createDlgVisible = false; this.createDlgVisible = false;
if (type === 'submit') {
this.loadItemList() //
}
} }
}, },

Loading…
Cancel
Save