mini-form-render 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +15 -15
- package/package.json +43 -43
- package/src/app.mpx +27 -27
- package/src/components/basic-input.mpx +35 -35
- package/src/components/basic-picker.mpx +79 -79
- package/src/components/form.mpx +141 -136
- package/src/pages/form-render.mpx +47 -47
- package/src/pages/index.mpx +51 -51
- package/src/pages/js-logic-render.mpx +59 -59
- package/src/pages/server-scheme.mpx +75 -75
- package/src/test/paint-form.js +43 -43
- package/src/test/scheme1.js +22 -22
- package/src/test/server-relation-scheme.js +33 -33
- package/static/wx/project.config.json +61 -61
- package/vue.config.js +16 -16
package/.eslintrc.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
module.exports = {
|
2
|
-
extends: ['@mpxjs'],
|
3
|
-
rules: {
|
4
|
-
// .mpx文件规则 https://mpx-ecology.github.io/eslint-plugin-mpx/rules/
|
5
|
-
'mpx/valid-wx-model': 0
|
6
|
-
},
|
7
|
-
overrides: [
|
8
|
-
{
|
9
|
-
files: ['**/*.js'],
|
10
|
-
rules: {
|
11
|
-
// .js文件规则 https://eslint.bootcss.com/docs/rules/
|
12
|
-
}
|
13
|
-
}
|
14
|
-
]
|
15
|
-
}
|
1
|
+
module.exports = {
|
2
|
+
extends: ['@mpxjs'],
|
3
|
+
rules: {
|
4
|
+
// .mpx文件规则 https://mpx-ecology.github.io/eslint-plugin-mpx/rules/
|
5
|
+
'mpx/valid-wx-model': 0
|
6
|
+
},
|
7
|
+
overrides: [
|
8
|
+
{
|
9
|
+
files: ['**/*.js'],
|
10
|
+
rules: {
|
11
|
+
// .js文件规则 https://eslint.bootcss.com/docs/rules/
|
12
|
+
}
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
package/package.json
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
{
|
2
|
-
"name": "mini-form-render",
|
3
|
-
"version": "0.0.
|
4
|
-
"private": false,
|
5
|
-
"scripts": {
|
6
|
-
"serve": "mpx-cli-service serve:mp",
|
7
|
-
"build": "mpx-cli-service build:mp",
|
8
|
-
"lint": "eslint --ext .js,.ts,.mpx src/"
|
9
|
-
},
|
10
|
-
"dependencies": {
|
11
|
-
"@mpxjs/api-proxy": "^2.8.0",
|
12
|
-
"@mpxjs/core": "^2.8.0",
|
13
|
-
"@mpxjs/fetch": "^2.8.0",
|
14
|
-
"@mpxjs/pinia": "^2.8.0",
|
15
|
-
"@mpxjs/store": "^2.8.0",
|
16
|
-
"@mpxjs/utils": "^2.8.0",
|
17
|
-
"pinia": "^2.0.14",
|
18
|
-
"vue": "^2.6.14"
|
19
|
-
},
|
20
|
-
"devDependencies": {
|
21
|
-
"@babel/core": "^7.10.4",
|
22
|
-
"@babel/plugin-transform-runtime": "^7.10.4",
|
23
|
-
"@babel/preset-env": "^7.10.4",
|
24
|
-
"@babel/runtime-corejs3": "^7.10.4",
|
25
|
-
"@mpxjs/babel-plugin-inject-page-events": "^2.8.0",
|
26
|
-
"@mpxjs/eslint-config": "^1.0.5",
|
27
|
-
"@mpxjs/mpx-cli-service": "^1.0.0",
|
28
|
-
"@mpxjs/size-report": "^2.8.0",
|
29
|
-
"@mpxjs/vue-cli-plugin-mpx": "^1.0.0",
|
30
|
-
"@mpxjs/vue-cli-plugin-mpx-eslint": "^1.0.0",
|
31
|
-
"@mpxjs/vue-cli-plugin-mpx-mp": "^1.0.0",
|
32
|
-
"@vue/cli-service": "~5.0.0",
|
33
|
-
"autoprefixer": "*",
|
34
|
-
"eslint": "^7.0.0",
|
35
|
-
"stylus": "^0.55.0",
|
36
|
-
"stylus-loader": "^6.1.0",
|
37
|
-
"vue-template-compiler": "^2.6.14"
|
38
|
-
},
|
39
|
-
"publishConfig": {
|
40
|
-
"registry": "https://registry.npmjs.org"
|
41
|
-
},
|
42
|
-
"browserslist": "ios >= 9, chrome >= 47"
|
43
|
-
}
|
1
|
+
{
|
2
|
+
"name": "mini-form-render",
|
3
|
+
"version": "0.0.7",
|
4
|
+
"private": false,
|
5
|
+
"scripts": {
|
6
|
+
"serve": "mpx-cli-service serve:mp",
|
7
|
+
"build": "mpx-cli-service build:mp",
|
8
|
+
"lint": "eslint --ext .js,.ts,.mpx src/"
|
9
|
+
},
|
10
|
+
"dependencies": {
|
11
|
+
"@mpxjs/api-proxy": "^2.8.0",
|
12
|
+
"@mpxjs/core": "^2.8.0",
|
13
|
+
"@mpxjs/fetch": "^2.8.0",
|
14
|
+
"@mpxjs/pinia": "^2.8.0",
|
15
|
+
"@mpxjs/store": "^2.8.0",
|
16
|
+
"@mpxjs/utils": "^2.8.0",
|
17
|
+
"pinia": "^2.0.14",
|
18
|
+
"vue": "^2.6.14"
|
19
|
+
},
|
20
|
+
"devDependencies": {
|
21
|
+
"@babel/core": "^7.10.4",
|
22
|
+
"@babel/plugin-transform-runtime": "^7.10.4",
|
23
|
+
"@babel/preset-env": "^7.10.4",
|
24
|
+
"@babel/runtime-corejs3": "^7.10.4",
|
25
|
+
"@mpxjs/babel-plugin-inject-page-events": "^2.8.0",
|
26
|
+
"@mpxjs/eslint-config": "^1.0.5",
|
27
|
+
"@mpxjs/mpx-cli-service": "^1.0.0",
|
28
|
+
"@mpxjs/size-report": "^2.8.0",
|
29
|
+
"@mpxjs/vue-cli-plugin-mpx": "^1.0.0",
|
30
|
+
"@mpxjs/vue-cli-plugin-mpx-eslint": "^1.0.0",
|
31
|
+
"@mpxjs/vue-cli-plugin-mpx-mp": "^1.0.0",
|
32
|
+
"@vue/cli-service": "~5.0.0",
|
33
|
+
"autoprefixer": "*",
|
34
|
+
"eslint": "^7.0.0",
|
35
|
+
"stylus": "^0.55.0",
|
36
|
+
"stylus-loader": "^6.1.0",
|
37
|
+
"vue-template-compiler": "^2.6.14"
|
38
|
+
},
|
39
|
+
"publishConfig": {
|
40
|
+
"registry": "https://registry.npmjs.org"
|
41
|
+
},
|
42
|
+
"browserslist": "ios >= 9, chrome >= 47"
|
43
|
+
}
|
package/src/app.mpx
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
<script>
|
2
|
-
import mpx, { createApp } from '@mpxjs/core'
|
3
|
-
import apiProxy from '@mpxjs/api-proxy'
|
4
|
-
|
5
|
-
mpx.use(apiProxy, { usePromise: true })
|
6
|
-
|
7
|
-
createApp({
|
8
|
-
onLaunch() {
|
9
|
-
//
|
10
|
-
}
|
11
|
-
})
|
12
|
-
</script>
|
13
|
-
|
14
|
-
<style>
|
15
|
-
/*此处编写全局样式*/
|
16
|
-
</style>
|
17
|
-
|
18
|
-
<script type="application/json">
|
19
|
-
{
|
20
|
-
"pages": [
|
21
|
-
"./pages/index",
|
22
|
-
"./pages/form-render",
|
23
|
-
"./pages/js-logic-render",
|
24
|
-
"./pages/server-scheme"
|
25
|
-
]
|
26
|
-
}
|
27
|
-
</script>
|
1
|
+
<script>
|
2
|
+
import mpx, { createApp } from '@mpxjs/core'
|
3
|
+
import apiProxy from '@mpxjs/api-proxy'
|
4
|
+
|
5
|
+
mpx.use(apiProxy, { usePromise: true })
|
6
|
+
|
7
|
+
createApp({
|
8
|
+
onLaunch() {
|
9
|
+
//
|
10
|
+
}
|
11
|
+
})
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<style>
|
15
|
+
/*此处编写全局样式*/
|
16
|
+
</style>
|
17
|
+
|
18
|
+
<script type="application/json">
|
19
|
+
{
|
20
|
+
"pages": [
|
21
|
+
"./pages/index",
|
22
|
+
"./pages/form-render",
|
23
|
+
"./pages/js-logic-render",
|
24
|
+
"./pages/server-scheme"
|
25
|
+
]
|
26
|
+
}
|
27
|
+
</script>
|
@@ -1,35 +1,35 @@
|
|
1
|
-
<template>
|
2
|
-
<view class="basic-input">
|
3
|
-
<view class="^form-item-title">{{item.title}}</view>
|
4
|
-
<input type="text" wx:model="{{inputData}}" />
|
5
|
-
</view>
|
6
|
-
</template>
|
7
|
-
|
8
|
-
<script>
|
9
|
-
import { createComponent } from '@mpxjs/core'
|
10
|
-
|
11
|
-
createComponent({
|
12
|
-
props: {
|
13
|
-
item: Object
|
14
|
-
},
|
15
|
-
data: {
|
16
|
-
inputData: ''
|
17
|
-
},
|
18
|
-
watch: {
|
19
|
-
inputData(val) {
|
20
|
-
this.triggerEvent('input', { value: val })
|
21
|
-
}
|
22
|
-
}
|
23
|
-
})
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<style lang="stylus">
|
27
|
-
.basic-input
|
28
|
-
display flex
|
29
|
-
</style>
|
30
|
-
|
31
|
-
<script type="application/json">
|
32
|
-
{
|
33
|
-
"component": true
|
34
|
-
}
|
35
|
-
</script>
|
1
|
+
<template>
|
2
|
+
<view class="basic-input">
|
3
|
+
<view class="^form-item-title">{{item.title}}</view>
|
4
|
+
<input type="text" wx:model="{{inputData}}" />
|
5
|
+
</view>
|
6
|
+
</template>
|
7
|
+
|
8
|
+
<script>
|
9
|
+
import { createComponent } from '@mpxjs/core'
|
10
|
+
|
11
|
+
createComponent({
|
12
|
+
props: {
|
13
|
+
item: Object
|
14
|
+
},
|
15
|
+
data: {
|
16
|
+
inputData: ''
|
17
|
+
},
|
18
|
+
watch: {
|
19
|
+
inputData(val) {
|
20
|
+
this.triggerEvent('input', { value: val })
|
21
|
+
}
|
22
|
+
}
|
23
|
+
})
|
24
|
+
</script>
|
25
|
+
|
26
|
+
<style lang="stylus">
|
27
|
+
.basic-input
|
28
|
+
display flex
|
29
|
+
</style>
|
30
|
+
|
31
|
+
<script type="application/json">
|
32
|
+
{
|
33
|
+
"component": true
|
34
|
+
}
|
35
|
+
</script>
|
@@ -1,79 +1,79 @@
|
|
1
|
-
<template>
|
2
|
-
<view class="basic-picker">
|
3
|
-
<view class="^form-item-title">{{item.title}}</view>
|
4
|
-
<picker
|
5
|
-
wx:model="{{resultIndex}}"
|
6
|
-
wx:model-event="change"
|
7
|
-
range="{{item.customData.pickerArr}}"
|
8
|
-
>
|
9
|
-
<view class="picker-box">
|
10
|
-
<view class="picker-show-title">
|
11
|
-
{{item.customData.pickerArr[resultIndex]}}
|
12
|
-
</view>
|
13
|
-
<image class="picker-title-arrow" src="https://aipaint.lihuanyu.com/common/caret-right.svg" mode="widthFix"></image>
|
14
|
-
</view>
|
15
|
-
</picker>
|
16
|
-
</view>
|
17
|
-
</template>
|
18
|
-
|
19
|
-
<script>
|
20
|
-
import { createComponent } from '@mpxjs/core'
|
21
|
-
|
22
|
-
createComponent({
|
23
|
-
props: {
|
24
|
-
item: Object
|
25
|
-
},
|
26
|
-
data: {
|
27
|
-
resultIndex: null,
|
28
|
-
resultValue: ''
|
29
|
-
},
|
30
|
-
created() {
|
31
|
-
this.resultIndex = this.item.defaultValue || 0
|
32
|
-
},
|
33
|
-
watch: {
|
34
|
-
resultIndex(val) {
|
35
|
-
if (val !== null) {
|
36
|
-
this.resultValue = this.item.customData.pickerArr[val]
|
37
|
-
}
|
38
|
-
},
|
39
|
-
item(val) {
|
40
|
-
const value = val.customData.pickerArr[this.resultIndex]
|
41
|
-
if (!value) {
|
42
|
-
this.resultIndex = 0
|
43
|
-
}
|
44
|
-
if (value !== this.resultValue) {
|
45
|
-
this.resultValue = value
|
46
|
-
}
|
47
|
-
},
|
48
|
-
resultValue(value) {
|
49
|
-
this.triggerEvent('input', { value })
|
50
|
-
}
|
51
|
-
}
|
52
|
-
})
|
53
|
-
</script>
|
54
|
-
|
55
|
-
<style lang="stylus">
|
56
|
-
.basic-picker
|
57
|
-
display flex
|
58
|
-
justify-content space-between
|
59
|
-
|
60
|
-
.picker-box
|
61
|
-
display flex
|
62
|
-
align-items center
|
63
|
-
.picker-show-title
|
64
|
-
font-size 30rpx
|
65
|
-
padding-left 300rpx
|
66
|
-
color #666
|
67
|
-
|
68
|
-
.picker-title-arrow
|
69
|
-
display inline-block
|
70
|
-
width 28rpx
|
71
|
-
height 28rpx
|
72
|
-
margin-left 20rpx
|
73
|
-
</style>
|
74
|
-
|
75
|
-
<script type="application/json">
|
76
|
-
{
|
77
|
-
"component": true
|
78
|
-
}
|
79
|
-
</script>
|
1
|
+
<template>
|
2
|
+
<view class="basic-picker">
|
3
|
+
<view class="^form-item-title">{{item.title}}</view>
|
4
|
+
<picker
|
5
|
+
wx:model="{{resultIndex}}"
|
6
|
+
wx:model-event="change"
|
7
|
+
range="{{item.customData.pickerArr}}"
|
8
|
+
>
|
9
|
+
<view class="picker-box">
|
10
|
+
<view class="picker-show-title">
|
11
|
+
{{item.customData.pickerArr[resultIndex]}}
|
12
|
+
</view>
|
13
|
+
<image class="picker-title-arrow" src="https://aipaint.lihuanyu.com/common/caret-right.svg" mode="widthFix"></image>
|
14
|
+
</view>
|
15
|
+
</picker>
|
16
|
+
</view>
|
17
|
+
</template>
|
18
|
+
|
19
|
+
<script>
|
20
|
+
import { createComponent } from '@mpxjs/core'
|
21
|
+
|
22
|
+
createComponent({
|
23
|
+
props: {
|
24
|
+
item: Object
|
25
|
+
},
|
26
|
+
data: {
|
27
|
+
resultIndex: null,
|
28
|
+
resultValue: ''
|
29
|
+
},
|
30
|
+
created() {
|
31
|
+
this.resultIndex = this.item.defaultValue || 0
|
32
|
+
},
|
33
|
+
watch: {
|
34
|
+
resultIndex(val) {
|
35
|
+
if (val !== null) {
|
36
|
+
this.resultValue = this.item.customData.pickerArr[val]
|
37
|
+
}
|
38
|
+
},
|
39
|
+
item(val) {
|
40
|
+
const value = val.customData.pickerArr[this.resultIndex]
|
41
|
+
if (!value) {
|
42
|
+
this.resultIndex = 0
|
43
|
+
}
|
44
|
+
if (value !== this.resultValue) {
|
45
|
+
this.resultValue = value
|
46
|
+
}
|
47
|
+
},
|
48
|
+
resultValue(value) {
|
49
|
+
this.triggerEvent('input', { value })
|
50
|
+
}
|
51
|
+
}
|
52
|
+
})
|
53
|
+
</script>
|
54
|
+
|
55
|
+
<style lang="stylus">
|
56
|
+
.basic-picker
|
57
|
+
display flex
|
58
|
+
justify-content space-between
|
59
|
+
|
60
|
+
.picker-box
|
61
|
+
display flex
|
62
|
+
align-items center
|
63
|
+
.picker-show-title
|
64
|
+
font-size 30rpx
|
65
|
+
padding-left 300rpx
|
66
|
+
color #666
|
67
|
+
|
68
|
+
.picker-title-arrow
|
69
|
+
display inline-block
|
70
|
+
width 28rpx
|
71
|
+
height 28rpx
|
72
|
+
margin-left 20rpx
|
73
|
+
</style>
|
74
|
+
|
75
|
+
<script type="application/json">
|
76
|
+
{
|
77
|
+
"component": true
|
78
|
+
}
|
79
|
+
</script>
|