提交 2f1fad64 编写于 作者: ibizdev's avatar ibizdev

SYSTEM 发布系统代码

上级 53281f2e
......@@ -27,26 +27,30 @@
</a-menu-item>
<a-menu-item key="5">
<a-icon type="upload" />
<span>实体4编辑视图</span>
<span>表单5</span>
</a-menu-item>
<a-menu-item key="6">
<a-icon type="user" />
<span>实体5编辑视图</span>
<span>实体4编辑视图</span>
</a-menu-item>
<a-menu-item key="7">
<a-icon type="video-camera" />
<span>表单项动态逻辑示例</span>
<span>实体5编辑视图</span>
</a-menu-item>
<a-menu-item key="8">
<a-icon type="upload" />
<span>实体2编辑视图</span>
<span>表单项动态逻辑示例</span>
</a-menu-item>
<a-menu-item key="9">
<a-icon type="user" />
<span>DemoForm</span>
<span>实体2编辑视图</span>
</a-menu-item>
<a-menu-item key="10">
<a-icon type="video-camera" />
<span>DemoForm</span>
</a-menu-item>
<a-menu-item key="11">
<a-icon type="upload" />
<span>表单3</span>
</a-menu-item>
</a-menu>
......@@ -58,12 +62,13 @@
<ExampleEditorType v-show="curSelected == '2'"/>
<ExampleEditView v-show="curSelected == '3'"/>
<Entity3EditView v-show="curSelected == '4'"/>
<Entity4EditView v-show="curSelected == '5'"/>
<Entity5EditView v-show="curSelected == '6'"/>
<ExampleDLFEditView v-show="curSelected == '7'"/>
<Entity2EditView v-show="curSelected == '8'"/>
<ExampleMain2EditView v-show="curSelected == '9'"/>
<ExampleMain3EditView v-show="curSelected == '10'"/>
<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'"/>
</a-layout-content>
</a-layout>
</a-layout>
......@@ -81,6 +86,7 @@ import EntityEditView from '@pages/module/entity-edit-view/entity-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';
import ExampleMain5EditView from '@pages/exapmple/example-main5-edit-view/example-main5-edit-view.vue';
import Entity4EditView from '@pages/module4/entity4-edit-view/entity4-edit-view.vue';
import Entity5EditView from '@pages/module5/entity5-edit-view/entity5-edit-view.vue';
import ExampleDLFEditView from '@pages/exapmple/example-dlfedit-view/example-dlfedit-view.vue';
......@@ -96,6 +102,7 @@ export default {
ExampleEditorType,
ExampleEditView,
Entity3EditView,
ExampleMain5EditView,
Entity4EditView,
Entity5EditView,
ExampleDLFEditView,
......
<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: "Main5form",
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>
<Main5form :formData="formData" @formItemChange="formItemChange"></Main5form></div>
</template>
<script>
import Main5form from '@forms/example/main5/main5.vue';
export default {
name: "ExampleMain5EditView",
components: {
Main5form
},
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册