提交 4e88387f 编写于 作者: ibizdev's avatar ibizdev

SYSTEM 发布系统代码

上级 2f1fad64
......@@ -15,42 +15,46 @@
</a-menu-item>
<a-menu-item key="2">
<a-icon type="upload" />
<span>基础编辑器</span>
<span>表单6</span>
</a-menu-item>
<a-menu-item key="3">
<a-icon type="user" />
<span>基础表单项</span>
<span>基础编辑器</span>
</a-menu-item>
<a-menu-item key="4">
<a-icon type="video-camera" />
<span>实体3编辑视图</span>
<span>基础表单项</span>
</a-menu-item>
<a-menu-item key="5">
<a-icon type="upload" />
<span>表单5</span>
<span>实体3编辑视图</span>
</a-menu-item>
<a-menu-item key="6">
<a-icon type="user" />
<span>实体4编辑视图</span>
<span>表单5</span>
</a-menu-item>
<a-menu-item key="7">
<a-icon type="video-camera" />
<span>实体5编辑视图</span>
<span>实体4编辑视图</span>
</a-menu-item>
<a-menu-item key="8">
<a-icon type="upload" />
<span>表单项动态逻辑示例</span>
<span>实体5编辑视图</span>
</a-menu-item>
<a-menu-item key="9">
<a-icon type="user" />
<span>实体2编辑视图</span>
<span>表单项动态逻辑示例</span>
</a-menu-item>
<a-menu-item key="10">
<a-icon type="video-camera" />
<span>DemoForm</span>
<span>实体2编辑视图</span>
</a-menu-item>
<a-menu-item key="11">
<a-icon type="upload" />
<span>DemoForm</span>
</a-menu-item>
<a-menu-item key="12">
<a-icon type="user" />
<span>表单3</span>
</a-menu-item>
</a-menu>
......@@ -59,16 +63,17 @@
<a-layout-content :style="{ margin: '24px 16px', padding: '24px', background: '#fff', minHeight: '280px' }">
<ExampleMain4EditView v-show="curSelected == '0'"/>
<EntityEditView v-show="curSelected == '1'"/>
<ExampleEditorType v-show="curSelected == '2'"/>
<ExampleEditView v-show="curSelected == '3'"/>
<Entity3EditView v-show="curSelected == '4'"/>
<ExampleMain5EditView v-show="curSelected == '5'"/>
<Entity4EditView v-show="curSelected == '6'"/>
<Entity5EditView v-show="curSelected == '7'"/>
<ExampleDLFEditView v-show="curSelected == '8'"/>
<Entity2EditView v-show="curSelected == '9'"/>
<ExampleMain2EditView v-show="curSelected == '10'"/>
<ExampleMain3EditView v-show="curSelected == '11'"/>
<ExampleMain6EditView v-show="curSelected == '2'"/>
<ExampleEditorType v-show="curSelected == '3'"/>
<ExampleEditView v-show="curSelected == '4'"/>
<Entity3EditView v-show="curSelected == '5'"/>
<ExampleMain5EditView v-show="curSelected == '6'"/>
<Entity4EditView v-show="curSelected == '7'"/>
<Entity5EditView v-show="curSelected == '8'"/>
<ExampleDLFEditView v-show="curSelected == '9'"/>
<Entity2EditView v-show="curSelected == '10'"/>
<ExampleMain2EditView v-show="curSelected == '11'"/>
<ExampleMain3EditView v-show="curSelected == '12'"/>
</a-layout-content>
</a-layout>
</a-layout>
......@@ -83,6 +88,7 @@ import AppService from "@service/AppService";
import ExampleMain4EditView from '@pages/exapmple/example-main4-edit-view/example-main4-edit-view.vue';
import EntityEditView from '@pages/module/entity-edit-view/entity-edit-view.vue';
import ExampleMain6EditView from '@pages/exapmple/example-main6-edit-view/example-main6-edit-view.vue';
import ExampleEditorType from '@pages/exapmple/example-editor-type/example-editor-type.vue';
import ExampleEditView from '@pages/exapmple/example-edit-view/example-edit-view.vue';
import Entity3EditView from '@pages/module3/entity3-edit-view/entity3-edit-view.vue';
......@@ -99,6 +105,7 @@ export default {
components: {
ExampleMain4EditView,
EntityEditView,
ExampleMain6EditView,
ExampleEditorType,
ExampleEditView,
Entity3EditView,
......
......@@ -2,12 +2,7 @@
<div class="app-form">
<a-form class="" style="">
<a-row>
<a-tabs defaultActiveKey="formpage1" @change="formPageSelected">
<a-tab-pane key="formpage1" class="app-form-page app-form-page-formpage1 " style="">
<span slot="tab">
基本信息
</span>
<a-col v-show="this.detailsModel.group1.visible" style="" :lg="{ span: 24, offset: 0}">
<div class="app-form-group app-form-group-group1" style="">
<a-collapse v-model="activeGroup">
......@@ -54,58 +49,14 @@
</app-form-item>
</a-col>
</a-tab-pane>
<a-tab-pane key="formpage2" class="app-form-page app-form-page-formpage2 " style="">
<span slot="tab">
其它
</span>
<a-col v-show="this.detailsModel.group2.visible" style="" :lg="{ span: 24, offset: 0}">
<div class="app-form-group app-form-group-group2" style="">
<a-collapse v-model="activeGroup">
<a-collapse-panel key="group2">
<template slot="header">
操作信息
</template>
<div class="app-form-group-content" style="">
<a-row>
<a-col v-show="this.detailsModel.createman.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.createman.error" :required="this.detailsModel.createman.required" :validateStatus="this.detailsModel.createman.validateStatus" :labelName="'建立人'" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-createman ">
<span>{{data.createman}}</span>
</app-form-item>
</a-col>
<a-col v-show="this.detailsModel.createdate.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.createdate.error" :required="this.detailsModel.createdate.required" :validateStatus="this.detailsModel.createdate.validateStatus" :labelName="'建立时间'" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-createdate ">
<span>{{data.createdate}}</span>
<a-col v-show="this.detailsModel.formitem4.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.formitem4.error" :required="this.detailsModel.formitem4.required" :validateStatus="this.detailsModel.formitem4.validateStatus" :labelName="''" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-formitem4 ">
<a-input v-model="data.formitem4" type="password" :disabled="detailsModel.formitem4.disabled" style="" @change="formItemChange('formitem4',$event.target.value)"/>
</app-form-item>
</a-col>
<a-col v-show="this.detailsModel.updateman.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.updateman.error" :required="this.detailsModel.updateman.required" :validateStatus="this.detailsModel.updateman.validateStatus" :labelName="'更新人'" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-updateman ">
<span>{{data.updateman}}</span>
</app-form-item>
</a-col>
<a-col v-show="this.detailsModel.updatedate.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.updatedate.error" :required="this.detailsModel.updatedate.required" :validateStatus="this.detailsModel.updatedate.validateStatus" :labelName="'更新时间'" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-updatedate ">
<span>{{data.updatedate}}</span>
</app-form-item>
</a-col>
</a-row>
</div>
</a-collapse-panel>
</a-collapse>
</div>
</a-col>
</a-tab-pane>
</a-tabs>
</a-row>
</a-form>
</div>
......@@ -145,7 +96,7 @@ export default {
* 激活分组
*
*/
activeGroup:["group1","group2",],
activeGroup:["group1",],
/**
* 激活分组
......@@ -165,10 +116,7 @@ export default {
formitem1: null,
formitem2: null,
formitem3: null,
createman: null,
createdate: null,
updateman: null,
updatedate: null,
formitem4: null,
entity5id: null,
},
......@@ -180,10 +128,6 @@ export default {
group1: new FormGroupPanelModel({ caption: '实体5基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
group2: new FormGroupPanelModel({ caption: '操作信息', detailType: 'GROUPPANEL', name: 'group2', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
formpage2: new FormPageModel({ caption: '其它', detailType: 'FORMPAGE', name: 'formpage2', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
......@@ -211,17 +155,10 @@ export default {
,
formitem3: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem3', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
createman: new FormItemModel({ caption: '建立人', detailType: 'FORMITEM', name: 'createman', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
createdate: new FormItemModel({ caption: '建立时间', detailType: 'FORMITEM', name: 'createdate', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
updateman: new FormItemModel({ caption: '更新人', detailType: 'FORMITEM', name: 'updateman', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
updatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'updatedate', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
formitem4: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem4', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
entity5id: new FormItemModel({ caption: '实体5标识', detailType: 'FORMITEM', name: 'entity5id', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [{ name: 'formpage1', index: 0, visible: true }, { name: 'formpage2', index: 1, visible: true }] }),
},
/**
......@@ -309,25 +246,10 @@ export default {
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
createman: [
{ type: 'string', message: '建立人 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '建立人 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '建立人 值不能为空', trigger: 'blur' },
],
createdate: [
{ type: 'string', message: '建立时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '建立时间 值不能为空', trigger: 'blur' },
],
updateman: [
{ type: 'string', message: '更新人 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新人 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新人 值不能为空', trigger: 'blur' },
],
updatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
formitem4: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
entity5id: [
{ type: 'string', message: '实体5标识 值必须为字符串类型', trigger: 'change' },
......@@ -463,11 +385,6 @@ export default {
......
......@@ -2,8 +2,96 @@
<div class="app-form">
<a-form class="" style="">
<a-row>
<a-tabs @change="formPageSelected">
</a-tabs>
<a-col v-show="this.detailsModel.grouppanel1.visible" style="" :lg="{ span: 24, offset: 0}">
<div class="app-form-group app-form-group-grouppanel1" style="">
<p class="app-form-group-content">
<a-row>
<a-col v-show="this.detailsModel.grouppanel2.visible" style="" :sm="{ span: 8, offset: 0 }" :md="{span: 8, offset: 0}" :lg="{ span: 8, offset: 0}" :xl="{ span: 8, offset: 0}">
<div class="app-form-group app-form-group-grouppanel2" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel3.visible" style="" :sm="{ span: 8, offset: 0 }" :md="{span: 8, offset: 0}" :lg="{ span: 8, offset: 0}" :xl="{ span: 8, offset: 0}">
<div class="app-form-group app-form-group-grouppanel3" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel4.visible" style="" :sm="{ span: 8, offset: 0 }" :md="{span: 8, offset: 0}" :lg="{ span: 8, offset: 0}" :xl="{ span: 8, offset: 0}">
<div class="app-form-group app-form-group-grouppanel4" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel5.visible" style="" :lg="{ span: 24, offset: 0}">
<div class="app-form-group app-form-group-grouppanel5" style="">
<p class="app-form-group-content">
<a-row>
<a-col v-show="this.detailsModel.grouppanel6.visible" style="" :sm="{ span: 6, offset: 0 }" :md="{span: 6, offset: 0}" :lg="{ span: 6, offset: 0}" :xl="{ span: 6, offset: 0}">
<div class="app-form-group app-form-group-grouppanel6" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel7.visible" style="" :sm="{ span: 6, offset: 0 }" :md="{span: 6, offset: 0}" :lg="{ span: 6, offset: 0}" :xl="{ span: 6, offset: 0}">
<div class="app-form-group app-form-group-grouppanel7" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel8.visible" style="" :sm="{ span: 6, offset: 0 }" :md="{span: 6, offset: 0}" :lg="{ span: 6, offset: 0}" :xl="{ span: 6, offset: 0}">
<div class="app-form-group app-form-group-grouppanel8" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.grouppanel9.visible" style="" :sm="{ span: 6, offset: 0 }" :md="{span: 6, offset: 0}" :lg="{ span: 6, offset: 0}" :xl="{ span: 6, offset: 0}">
<div class="app-form-group app-form-group-grouppanel9" style="">
<p class="app-form-group-content">
<a-row>
</a-row>
</p>
</div>
</a-col>
</a-row>
</p>
</div>
</a-col>
<a-col v-show="this.detailsModel.formitem.visible" style="" :lg="{ span: 24, offset: 0}">
<app-form-item :helpInfo="this.detailsModel.formitem.error" :required="this.detailsModel.formitem.required" :validateStatus="this.detailsModel.formitem.validateStatus" :labelName="''" :labelwidth="'130px'" :labelPosition="'LEFT'" :isShowCaption="true" :formItemStyle="{}" :isEmptyCaption="false" :formItemContentStyle="{}" class="app-form-item-formitem ">
<div style="">{{data.formitem}}</div>
</app-form-item>
</a-col>
</a-row>
</a-form>
</div>
......@@ -43,7 +131,7 @@ export default {
* 激活分组
*
*/
activeGroup:[],
activeGroup:["grouppanel2","grouppanel3","grouppanel4","grouppanel1","grouppanel6","grouppanel7","grouppanel8","grouppanel9","grouppanel5",],
/**
* 激活分组
......@@ -58,6 +146,7 @@ export default {
srfuf: null,
srfdeid: null,
srfsourcekey: null,
formitem: null,
exampleid: null,
},
......@@ -66,6 +155,26 @@ export default {
*
*/
detailsModel:{
grouppanel2: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel2', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel3: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel3', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel4: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel4', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel1: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel6: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel6', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel7: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel7', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel8: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel8', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel9: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel9', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
grouppanel5: new FormGroupPanelModel({ caption: '分组面板', detailType: 'GROUPPANEL', name: 'grouppanel5', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: '', extractMode: 'ITEM', details: [] } })
,
formpage1: new FormPageModel({ caption: '表单分页', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this })
,
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
......@@ -81,10 +190,11 @@ export default {
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
formitem: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'formitem', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
exampleid: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'exampleid', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
},
/**
......@@ -147,6 +257,11 @@ export default {
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
formitem: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
exampleid: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
......@@ -275,6 +390,17 @@ export default {
},
......
<template>
<div class="app-form">
<a-form class="" style="">
<a-row>
<a-tabs @change="formPageSelected">
</a-tabs>
</a-row>
</a-form>
</div>
</template>
<script>
import { FormButtonModel,FormDetailModel,FormItemModel,FormDRUIPartModel,FormGroupPanelModel,FormIFrameModel,FormPageModel,FormPartModel,FormRowItemModel,FormTabPageModel,FormTabPanelModel,FormUserControlModel} from "@models/index.js";
import Schema from "async-validator";
import ComUtil from '@utils/ComUtil';
import AppService from "@service/AppService";
export default {
name: "Main6form",
props:{
formData:Object
},
watch: {
'formData': {
handler: 'onFormDataChanged',
immediate: true,
deep: true
}
},
data() {
return {
/**
* 当前语言
*
*/
local:"",
/**
* 激活分组
*
*/
activeGroup:[],
/**
* 激活分组
*
*/
data:{
srfupdatedate: null,
srforikey: null,
srfkey: null,
srfmajortext: null,
srftempmode: null,
srfuf: null,
srfdeid: null,
srfsourcekey: null,
exampleid: null,
},
/**
* 表单模型
*
*/
detailsModel:{
srfupdatedate: new FormItemModel({ caption: '更新时间', detailType: 'FORMITEM', name: 'srfupdatedate', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srforikey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srforikey', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfkey: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'srfkey', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfmajortext: new FormItemModel({ caption: '示例名称', detailType: 'FORMITEM', name: 'srfmajortext', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srftempmode: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srftempmode', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfuf: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfuf', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfdeid: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfdeid', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
srfsourcekey: new FormItemModel({ caption: '', detailType: 'FORMITEM', name: 'srfsourcekey', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
exampleid: new FormItemModel({ caption: '示例标识', detailType: 'FORMITEM', name: 'exampleid', visible: true, isShowCaption: true, form: this, disabled: false,validateStatus:"",error:"",required:false,enableCond: 3 })
,
form: new FormTabPanelModel({ caption: 'form', detailType: 'TABPANEL', name: 'form', visible: true, isShowCaption: true, form: this, tabPages: [] }),
},
/**
* 代码表模型
*
*/
codelistModel:{
},
/**
* 表单值规则
*
*/
formRules:{
},
/**
* 默认值规则
*
*/
rules:{
srfupdatedate: [
{ type: 'string', message: '更新时间 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '更新时间 值不能为空', trigger: 'blur' },
],
srforikey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfkey: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
srfmajortext: [
{ type: 'string', message: '示例名称 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例名称 值不能为空', trigger: 'blur' },
],
srftempmode: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfuf: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfdeid: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
srfsourcekey: [
{ type: 'string', message: ' 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: ' 值不能为空', trigger: 'blur' },
],
exampleid: [
{ type: 'string', message: '示例标识 值必须为字符串类型', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'change' },
{ required: false, type: 'string', message: '示例标识 值不能为空', trigger: 'blur' },
],
}
};
},
created(){
this.initForm();
this.initlangu();
},
methods: {
/**
* 初始化表单
*
*/
initForm(){
if(Object.keys(this.data).length >0){
Object.keys(this.data).forEach((item) =>{
this.formItemChange(item,this.data[item],true);
})
}
},
/**
* 初始化语言
*
*/
initlangu(){
if (Object.is(window.localStorage.getItem("curLang"), "zh")) {
this.local ="zh_CN";
} else {
this.local ="en_GB";
}
AppService.getInstance().subject.subscribe(res => {
if (Object.is(res, "zh")) {
this.local ="zh_CN";
} else {
this.local ="en_GB";
}
});
},
/**
* 分页选中
*
*/
formPageSelected(key){
console.log("表单选中了"+key);
},
/**
* 按钮点击事件
*
*/
button_click($event,caption){
this.$message.success("点击了"+caption);
},
/**
* 表单项值变化
*
*/
formItemChange(name,value,isFirst){
this.formLogic(name,value);
if(!isFirst){
this.validateItem(name, value);
this.$emit('formItemChange',{name:name,value:value});
}
},
/**
* 校验单个表单项
* @param item
* @param value
*/
validateItem(item, value) {
// 做校验
// 1.获取数值和规则
const rule = this.rules[item];
// 2.创建校验规则
const schema = new Schema({ [item]: rule })
// 校验返回Promise
return schema.validate({ [item]: value },undefined,errors => {
if (errors) {
// 有错
this.detailsModel[item].setError(errors[0].message);
} else {
this.detailsModel[item].setError('');
}
})
},
/**
* 校验表单
*
* @memberof Main
*/
validateForm(callback) {
let tasks;
if (Object.keys(this.data).length > 0) {
tasks = Object.keys(this.data).map((item) => {
this.validateItem(item, this.data[item]);
})
}
Promise.all(tasks)
.then(() => callback(true))
.catch(() => callback(false))
},
/**
* 表单逻辑
*
*/
formLogic( name, newVal, oldVal) {
},
onFormDataChanged(val,oldVal){
if(val && val !== oldVal){
Object.keys(this.data).forEach(item =>{
this.data[item] = null;
})
Object.assign(this.data,val);
}
}
}
}
</script>
<style scoped>
</style>
<template>
<div>
<Main6form :formData="formData" @formItemChange="formItemChange"></Main6form></div>
</template>
<script>
import Main6form from '@forms/example/main6/main6.vue';
export default {
name: "ExampleMain6EditView",
components: {
Main6form
},
data(){
return {
formData:{
"bookname":"test1",
"input":"文本test",
"label":"标签test",
"group1":"书籍基本信息test",
"formpage1":"基本信息test",
"createman":"建立人test",
"createdate":"建立时间test",
"updateman":"更新人test",
"updatedate":"更新时间test",
"group2":"操作信息test",
"formpage2":"其它test"
}
}
},
methods:{
formItemChange(value){
console.log(value);
}
}
}
</script>
<style scoped>
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册