Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Oct 31, 2018
1 parent e652a1e commit 61f5310
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export default {
}
</style>


2 changes: 1 addition & 1 deletion src/views/Archive/person.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="app-container" id="person">

<el-button @click="test()"></el-button>
<el-button @click="test()">测试保存表单</el-button>

<generate-form
:data="jsonData"
Expand Down
11 changes: 8 additions & 3 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</el-form-item>
</el-form>
</div>

</template>

<script>
Expand All @@ -46,8 +47,10 @@ export default {
pwdType: 'password',
loading: false
};
}
},
methods: {
showPwd() {
if (this.pwdType === 'password') {
Expand Down Expand Up @@ -114,12 +117,14 @@ $light_gray:white;
$bg:#2d3a4b;
$dark_gray:#fff;
$light_gray:#fff;
.login-container {
position: fixed;
height: 100%;
width: 100%;
background: url('~@/assets/loginbg.jpg') center center no-repeat;
background-size:100% 100%;
background: url('~@/assets/loginbg.jpg') center center no-repeat;
background-size:100% 100%;
// background-color: $bg;
.login-form {
position: absolute;
Expand Down
81 changes: 77 additions & 4 deletions src/views/system/formdesigner.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="app-container" ref="container" id="formdesigner">
<making-form preview generate-json ref="form" >
<making-form preview generate-json ref="form">
<template slot="action">
<el-button @click="test">保存</el-button>
</template>
Expand All @@ -18,11 +18,84 @@ export default {
}
},
mounted(){
let obj = {
"list": [
{
"type": "input",
"name": "单行文本",
"icon": "regular/keyboard",
"options": {
"width": "100%",
"defaultValue": "",
"required": false,
"dataType": "string",
"pattern": "",
"placeholder": "",
"remoteFunc": "func_1540898325000_60519"
},
"key": "1540898325000_60519",
"model": "input_1540898325000_60519",
"rules": [
{
"type": "string",
"message": "单行文本格式不正确"
}
]
},
{
"type": "textarea",
"name": "多行文本",
"icon": "regular/keyboard",
"options": {
"width": "100%",
"defaultValue": "",
"required": false,
"pattern": "",
"placeholder": "",
"remoteFunc": "func_1540898327000_70367"
},
"key": "1540898327000_70367",
"model": "textarea_1540898327000_70367",
"rules": []
},
{
"type": "time",
"name": "时间选择器",
"icon": "regular/clock",
"options": {
"defaultValue": "",
"readonly": false,
"disabled": false,
"editable": true,
"clearable": true,
"placeholder": "",
"startPlaceholder": "",
"endPlaceholder": "",
"isRange": false,
"arrowControl": true,
"format": "HH:mm:ss",
"required": false,
"width": "",
"remoteFunc": "func_1540898328000_61326"
},
"key": "1540898328000_61326",
"model": "time_1540898328000_61326",
"rules": []
}
],
"config": {
"labelWidth": 100,
"labelPosition": "left",
"size": "small"
}
}
this.$refs.form.setJSON(obj)
},
methods:{
test(){
this.$refs.form.getJSON().then(data=>{
console.log(data)
})
console.log(this.$refs.form.getJSON())
}
},
components:{
Expand Down

0 comments on commit 61f5310

Please sign in to comment.