From e79a5eb40825f67e0b65243b2b397b67e962b2f8 Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 21 三月 2024 13:30:40 +0800
Subject: [PATCH] UI上下文展示引擎,参照组件
---
Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue | 266 ++++++++++++++++++----------------------------------
1 files changed, 94 insertions(+), 172 deletions(-)
diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
index 61a6339..ef67cc1 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-form.vue
@@ -1,187 +1,109 @@
<template>
- <basic-container>
- <el-dialog v-if="dialogFormVisible" :visible.sync="dialogFormVisible" :title="title" append-to-body>
-
- </el-dialog>
- </basic-container>
+ <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
+ <avue-form v-model="form" :option="option">
+ <template v-for="item in slotData" :slot="item.prop + 'Label'">
+ <span>
+ <span>{{ item.label }} </span>
+ <el-tooltip
+ v-if="item.keyAttr"
+ class="item"
+ content="璇ュ睘鎬т负鍏抽敭灞炴��"
+ effect="dark"
+ placement="top-start"
+ >
+ <i class="el-icon-star-on" style="font-size: 17px !important; color: red;vertical-align: baseline;"></i>
+ </el-tooltip>
+ </span>
+ </template>
+ <template slot="menuForm">
+ <dynamic-button type="form" :butttonList="componentVO.buttons" @buttonClick="buttonClick"></dynamic-button>
+ </template>
+ </avue-form>
+ </div>
</template>
<script>
export default {
name: "dynamic-form",
- props:{
- visible:{
- type: Boolean,
- default: false,
+ props: {
+ componentVO: {
+ type: Object,
+ default: {}
},
- title:{
- type:String
- }
+ inDialog: {
+ type: Boolean,
+ default: false
+ },
+ areasName: {
+ type: String,
+ default: ''
+ },
+ sourceData: {
+ //鑿滃崟婧愭暟鎹垨鑰呭脊绐楁椂鎸夐挳鎵�灞炲尯鍩熺殑涓婁竴鍖哄煙閫変腑鏁版嵁
+ type: Object,
+ default: {}
+ },
+ paramVOS: {
+ type: Object,
+ default: {}
+ },
+ isShow: {
+ //鎵�鍦ㄥ尯鍩熸槸鍚﹀凡鏄剧ず锛岄拡瀵箃ab鍜宑ollapse
+ type: Boolean,
+ default: true
+ },
},
data() {
return {
- formList: [
- {
- comboxKey: null,
- customClass: null,
- data: null,
- dateFormate: null,
- defaultValue: "",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "name",
- hidden: false,
- keyAttr: false,
- prefix: null,
- readOnly: false,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "鍚嶇О",
- tooltips: null,
- type: "text",
- unique: false,
- verify: ""
- },
- {
- comboxKey: null,
- customClass: null,
- data: null,
- dateFormate: null,
- defaultValue: "",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "code",
- hidden: false,
- keyAttr: false,
- prefix: null,
- readOnly: false,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "缂栫爜",
- tooltips: null,
- type: "text",
- unique: false,
- verify: ""
- },
- {
- comboxKey: "EnumReviewType",
- customClass: null,
- data: null,
- dateFormate: null,
- defaultValue: "department",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "reviewtype",
- hidden: false,
- keyAttr: false,
- prefix: null,
- readOnly: true,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "绫诲瀷",
- tooltips: null,
- type: "combox",
- unique: false,
- verify: ""
- },
- {
- comboxKey: null,
- customClass: null,
- data: null,
- dateFormate: null,
- defaultValue: "",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "content",
- hidden: false,
- keyAttr: false,
- prefix: null,
- readOnly: false,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "澶囨敞",
- tooltips: null,
- type: "textarea",
- unique: false,
- verify: ""
- },
- {
- comboxKey: null,
- customClass: null,
- data: null,
- dateFormate: null,
- defaultValue: "",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "creator",
- hidden: true,
- keyAttr: false,
- prefix: null,
- readOnly: true,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "鍒涘缓浜�",
- tooltips: null,
- type: "text",
- unique: false,
- verify: ""
- },
- {
- comboxKey: null,
- customClass: null,
- data: null,
- dateFormate: "yyyy-MM-dd HH:mm:ss",
- defaultValue: "",
- displayExtension: "",
- extendAttrMap: null,
- extendAttrString: null,
- field: "createtime",
- hidden: true,
- keyAttr: false,
- prefix: null,
- readOnly: false,
- referConfig: null,
- required: false,
- selectLibFlag: null,
- showField: null,
- suffix: null,
- text: "鍒涘缓鏃堕棿",
- tooltips: null,
- type: "date",
- unique: false,
- verify: ""
- }
- ],
+ form: {},
}
},
- computed:{
- dialogFormVisible: {
- get() {
- return this.visible;
- },
- set(val) {
- this.$emit("update:visible", val);
- },
+ mounted() {
+ // console.log('componentVO--',this.componentVO.tableDefineVO.cols[0])
+ },
+ computed: {
+ option() {
+ return {
+ submitBtn: false,
+ emptyBtn: false,
+ height: 300,
+ column: this.formColumn(this.componentVO.tableDefineVO.cols[0])
+ }
+ },
+ slotData() {
+ return this.formColumn(this.componentVO.tableDefineVO.cols[0])
+ }
+ },
+ methods: {
+ //杞寲鏁版嵁
+ formColumn(formList) {
+ return formList.map(item => {
+ const typeValue = item.type === 'text' ? 'input' : item.type === 'combox' ? 'select' : item.type;
+
+ return {
+ label: item.text,
+ prop: item.field,
+ type: typeValue,
+ value: item.defaultValue,
+ dicData: item.type === 'combox' ? item.dicData : item.dicUrl,
+ readonly: item.readOnly,
+ disabled: item.disabled,
+ labelSuffix: item.suffix,
+ suffixIcon: item.prefix,
+ placeholder: item.placeholder,
+ clearable: item.clearable,
+ tip: item.tooltips,
+ keyAttr: item.keyAttr,
+ rules: [{
+ required: item.required,
+ message: `璇疯緭鍏�${item.text}!`,
+ trigger: "blur"
+ }]
+ }
+ })
+ },
+ buttonClick(item) {
+ console.log(item.id)
},
}
}
--
Gitblit v1.9.3