app-form-view 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,14 +12,14 @@
12
12
  }
13
13
 
14
14
  .flex-row {
15
- -webkit-box-orient: vertical;
15
+ -webkit-box-orient: horizontal;
16
16
  -ms-flex-direction: row;
17
17
  -webkit-flex-direction: row;
18
18
  flex-direction: row;
19
19
  }
20
20
 
21
21
  .flex-row-reverse {
22
- -webkit-box-orient: vertical;
22
+ -webkit-box-orient: horizontal;
23
23
  -ms-flex-direction: row-reverse;
24
24
  -webkit-flex-direction: row-reverse;
25
25
  flex-direction: row-reverse;
@@ -61,8 +61,8 @@
61
61
  }
62
62
 
63
63
  .justify-content-space-around {
64
- -webkit-box-pack: justify;
65
- -ms-flex-pack: justify;
64
+ -webkit-box-pack: space-around;
65
+ -ms-flex-pack: space-around;
66
66
  -webkit-justify-content: space-around;
67
67
  justify-content: space-around;
68
68
  }
@@ -96,66 +96,63 @@
96
96
  }
97
97
 
98
98
  .flex-wrap-nowrap {
99
- -webkit-box-wrap: nowrap;
100
99
  -ms-flex-wrap: nowrap;
101
100
  -webkit-flex-wrap: nowrap;
102
101
  flex-wrap: nowrap;
103
102
  }
104
103
 
105
104
  .flex-wrap-wrap {
106
- -webkit-box-wrap: wrap;
107
105
  -ms-flex-wrap: wrap;
108
106
  -webkit-flex-wrap: wrap;
109
107
  flex-wrap: wrap;
110
108
  }
111
109
 
112
110
  .flex-wrap-reverse {
113
- -webkit-box-wrap: reverse;
114
- -ms-flex-wrap: reverse;
115
- -webkit-flex-wrap: reverse;
116
- flex-wrap: reverse;
111
+ -ms-flex-wrap: wrap-reverse;
112
+ -webkit-flex-wrap: wrap-reverse;
113
+ flex-wrap: wrap-reverse;
117
114
  }
118
115
 
119
116
  .align-content-start {
120
- -webkit-box-align: flex-start;
121
- -ms-flex-align: flex-start;
122
- -webkit-align-conten: flex-start;
123
- justify-content: flex-start;
117
+ -webkit-box-lines: start;
118
+ -ms-flex-line-pack: start;
119
+ -webkit-align-content: flex-start;
120
+ align-content: flex-start;
124
121
  }
125
122
 
126
123
  .align-content-end {
127
- -webkit-box-align: flex-end;
128
- -ms-flex-align: flex-end;
129
- -webkit-align-conten: flex-end;
130
- justify-content: flex-end;
124
+ -webkit-box-lines: end;
125
+ -ms-flex-line-pack: end;
126
+ -webkit-align-content: flex-end;
127
+ align-content: flex-end;
131
128
  }
132
129
 
133
130
  .align-content-center {
134
- -webkit-box-align: center;
135
- -ms-flex-align: center;
136
- -webkit-align-conten: center;
137
- justify-content: center;
131
+ -webkit-box-lines: center;
132
+ -ms-flex-line-pack: center;
133
+ -webkit-align-content: center;
134
+ align-content: center;
138
135
  }
139
136
 
140
137
  .align-content-between {
141
- -webkit-box-align: space-between;
142
- -ms-flex-align: space-between;
143
- -webkit-align-conten: space-between;
144
- justify-content: space-between;
138
+ -webkit-box-lines: justify;
139
+ -ms-flex-line-pack: justify;
140
+ -webkit-align-content: space-between;
141
+ align-content: space-between;
145
142
  }
146
143
 
147
144
  .align-content-around {
148
- -webkit-box-align: space-around;
149
- -ms-flex-align: space-around;
150
- -webkit-align-conten: space-around;
151
- justify-content: space-around;
145
+ -webkit-box-lines: space-around;
146
+ -ms-flex-line-pack: space-around;
147
+ -webkit-align-content: space-around;
148
+ align-content: space-around;
152
149
  }
153
150
 
154
151
  .align-content-stretch {
155
- -webkit-box-align: stretch;
156
- -ms-flex-align: stretch;
157
- -webkit-align-conten: stretch;
158
- justify-content: stretch;
152
+ -webkit-box-lines: stretch;
153
+ -ms-flex-line-pack: stretch;
154
+ -webkit-align-content: stretch;
155
+ align-content: stretch;
159
156
  }
160
157
 
161
158
  .flex-item-auto {
@@ -1,4 +1,182 @@
1
- @import '_flex.scss';
1
+ .flex {
2
+ display: -webkit-box;
3
+ display: -ms-flexbox;
4
+ display: flex;
5
+ }
6
+
7
+ .inline-flex {
8
+ display: -webkit-inline-box;
9
+ display: -ms-inline-flexbox;
10
+ display: -webkit-inline-flex;
11
+ display: inline-flex;
12
+ }
13
+
14
+ .flex-row {
15
+ -webkit-box-orient: horizontal;
16
+ -ms-flex-direction: row;
17
+ -webkit-flex-direction: row;
18
+ flex-direction: row;
19
+ }
20
+
21
+ .flex-row-reverse {
22
+ -webkit-box-orient: horizontal;
23
+ -ms-flex-direction: row-reverse;
24
+ -webkit-flex-direction: row-reverse;
25
+ flex-direction: row-reverse;
26
+ }
27
+
28
+ .flex-column {
29
+ -webkit-box-orient: vertical;
30
+ -ms-flex-direction: column;
31
+ -webkit-flex-direction: column;
32
+ flex-direction: column;
33
+ }
34
+
35
+ .flex-column-reverse {
36
+ -webkit-box-orient: vertical;
37
+ -ms-flex-direction: column-reverse;
38
+ -webkit-flex-direction: column-reverse;
39
+ flex-direction: column-reverse;
40
+ }
41
+
42
+ .justify-content-center {
43
+ -webkit-box-pack: center;
44
+ -ms-flex-pack: center;
45
+ -webkit-justify-content: center;
46
+ justify-content: center;
47
+ }
48
+
49
+ .justify-content-end {
50
+ -webkit-box-pack: end;
51
+ -ms-flex-pack: end;
52
+ -webkit-justify-content: flex-end;
53
+ justify-content: flex-end;
54
+ }
55
+
56
+ .justify-content-space-between {
57
+ -webkit-box-pack: justify;
58
+ -ms-flex-pack: justify;
59
+ -webkit-justify-content: space-between;
60
+ justify-content: space-between;
61
+ }
62
+
63
+ .justify-content-space-around {
64
+ -webkit-box-pack: space-around;
65
+ -ms-flex-pack: space-around;
66
+ -webkit-justify-content: space-around;
67
+ justify-content: space-around;
68
+ }
69
+
70
+ .align-items-start {
71
+ -webkit-box-align: start;
72
+ -ms-flex-align: start;
73
+ -webkit-align-items: flex-start;
74
+ align-items: flex-start;
75
+ }
76
+
77
+ .align-items-end {
78
+ -webkit-box-align: end;
79
+ -ms-flex-align: end;
80
+ -webkit-align-items: flex-end;
81
+ align-items: flex-end;
82
+ }
83
+
84
+ .align-items-center {
85
+ -webkit-box-align: center;
86
+ -ms-flex-align: center;
87
+ -webkit-align-items: center;
88
+ align-items: center;
89
+ }
90
+
91
+ .align-items-baseline {
92
+ -webkit-box-align: baseline;
93
+ -ms-flex-align: baseline;
94
+ -webkit-align-items: baseline;
95
+ align-items: baseline;
96
+ }
97
+
98
+ .flex-wrap-nowrap {
99
+ -ms-flex-wrap: nowrap;
100
+ -webkit-flex-wrap: nowrap;
101
+ flex-wrap: nowrap;
102
+ }
103
+
104
+ .flex-wrap-wrap {
105
+ -ms-flex-wrap: wrap;
106
+ -webkit-flex-wrap: wrap;
107
+ flex-wrap: wrap;
108
+ }
109
+
110
+ .flex-wrap-reverse {
111
+ -ms-flex-wrap: wrap-reverse;
112
+ -webkit-flex-wrap: wrap-reverse;
113
+ flex-wrap: wrap-reverse;
114
+ }
115
+
116
+ .align-content-start {
117
+ -webkit-box-lines: start;
118
+ -ms-flex-line-pack: start;
119
+ -webkit-align-content: flex-start;
120
+ align-content: flex-start;
121
+ }
122
+
123
+ .align-content-end {
124
+ -webkit-box-lines: end;
125
+ -ms-flex-line-pack: end;
126
+ -webkit-align-content: flex-end;
127
+ align-content: flex-end;
128
+ }
129
+
130
+ .align-content-center {
131
+ -webkit-box-lines: center;
132
+ -ms-flex-line-pack: center;
133
+ -webkit-align-content: center;
134
+ align-content: center;
135
+ }
136
+
137
+ .align-content-between {
138
+ -webkit-box-lines: justify;
139
+ -ms-flex-line-pack: justify;
140
+ -webkit-align-content: space-between;
141
+ align-content: space-between;
142
+ }
143
+
144
+ .align-content-around {
145
+ -webkit-box-lines: space-around;
146
+ -ms-flex-line-pack: space-around;
147
+ -webkit-align-content: space-around;
148
+ align-content: space-around;
149
+ }
150
+
151
+ .align-content-stretch {
152
+ -webkit-box-lines: stretch;
153
+ -ms-flex-line-pack: stretch;
154
+ -webkit-align-content: stretch;
155
+ align-content: stretch;
156
+ }
157
+
158
+ .flex-item-auto {
159
+ flex: auto;
160
+ }
161
+
162
+ .flex-item {
163
+ flex: 1;
164
+ overflow: hidden;
165
+ }
166
+
167
+ .flex-item-overflowX {
168
+ flex: 1;
169
+ overflow: hidden;
170
+ width: 0;
171
+ min-width: 0;
172
+ }
173
+
174
+ .flex-item-overflowY {
175
+ flex: 1;
176
+ overflow: hidden;
177
+ height: 0;
178
+ min-height: 0;
179
+ }
2
180
  :root {
3
181
  /* 主色调 */
4
182
  --primary-color: #1989fa;
@@ -81,9 +259,13 @@ button[disabled]{
81
259
  height:100%;
82
260
  overflow:hidden;
83
261
  .bottom-btns{
262
+ gap:15px;
263
+ padding-left: 10px;
264
+ padding-right: 10px;
84
265
  .widget-button{
85
266
  display:flex;
86
267
  margin:0;
268
+
87
269
  flex-direction: column;
88
270
  align-items: center;
89
271
  color: #646566;
@@ -101,6 +283,7 @@ button[disabled]{
101
283
  height: 40px;
102
284
  font-size: 14px;
103
285
  margin-right: 5px;
286
+ flex:1;
104
287
  background: linear-gradient(to right, var(--primary-color-60), var(--primary-color));
105
288
  .icon{color:#fff;margin:0 5px 0 0;}
106
289
  }
@@ -1,4 +1,182 @@
1
- @import './_flex.scss';
1
+ .flex {
2
+ display: -webkit-box;
3
+ display: -ms-flexbox;
4
+ display: flex;
5
+ }
6
+
7
+ .inline-flex {
8
+ display: -webkit-inline-box;
9
+ display: -ms-inline-flexbox;
10
+ display: -webkit-inline-flex;
11
+ display: inline-flex;
12
+ }
13
+
14
+ .flex-row {
15
+ -webkit-box-orient: horizontal;
16
+ -ms-flex-direction: row;
17
+ -webkit-flex-direction: row;
18
+ flex-direction: row;
19
+ }
20
+
21
+ .flex-row-reverse {
22
+ -webkit-box-orient: horizontal;
23
+ -ms-flex-direction: row-reverse;
24
+ -webkit-flex-direction: row-reverse;
25
+ flex-direction: row-reverse;
26
+ }
27
+
28
+ .flex-column {
29
+ -webkit-box-orient: vertical;
30
+ -ms-flex-direction: column;
31
+ -webkit-flex-direction: column;
32
+ flex-direction: column;
33
+ }
34
+
35
+ .flex-column-reverse {
36
+ -webkit-box-orient: vertical;
37
+ -ms-flex-direction: column-reverse;
38
+ -webkit-flex-direction: column-reverse;
39
+ flex-direction: column-reverse;
40
+ }
41
+
42
+ .justify-content-center {
43
+ -webkit-box-pack: center;
44
+ -ms-flex-pack: center;
45
+ -webkit-justify-content: center;
46
+ justify-content: center;
47
+ }
48
+
49
+ .justify-content-end {
50
+ -webkit-box-pack: end;
51
+ -ms-flex-pack: end;
52
+ -webkit-justify-content: flex-end;
53
+ justify-content: flex-end;
54
+ }
55
+
56
+ .justify-content-space-between {
57
+ -webkit-box-pack: justify;
58
+ -ms-flex-pack: justify;
59
+ -webkit-justify-content: space-between;
60
+ justify-content: space-between;
61
+ }
62
+
63
+ .justify-content-space-around {
64
+ -webkit-box-pack: space-around;
65
+ -ms-flex-pack: space-around;
66
+ -webkit-justify-content: space-around;
67
+ justify-content: space-around;
68
+ }
69
+
70
+ .align-items-start {
71
+ -webkit-box-align: start;
72
+ -ms-flex-align: start;
73
+ -webkit-align-items: flex-start;
74
+ align-items: flex-start;
75
+ }
76
+
77
+ .align-items-end {
78
+ -webkit-box-align: end;
79
+ -ms-flex-align: end;
80
+ -webkit-align-items: flex-end;
81
+ align-items: flex-end;
82
+ }
83
+
84
+ .align-items-center {
85
+ -webkit-box-align: center;
86
+ -ms-flex-align: center;
87
+ -webkit-align-items: center;
88
+ align-items: center;
89
+ }
90
+
91
+ .align-items-baseline {
92
+ -webkit-box-align: baseline;
93
+ -ms-flex-align: baseline;
94
+ -webkit-align-items: baseline;
95
+ align-items: baseline;
96
+ }
97
+
98
+ .flex-wrap-nowrap {
99
+ -ms-flex-wrap: nowrap;
100
+ -webkit-flex-wrap: nowrap;
101
+ flex-wrap: nowrap;
102
+ }
103
+
104
+ .flex-wrap-wrap {
105
+ -ms-flex-wrap: wrap;
106
+ -webkit-flex-wrap: wrap;
107
+ flex-wrap: wrap;
108
+ }
109
+
110
+ .flex-wrap-reverse {
111
+ -ms-flex-wrap: wrap-reverse;
112
+ -webkit-flex-wrap: wrap-reverse;
113
+ flex-wrap: wrap-reverse;
114
+ }
115
+
116
+ .align-content-start {
117
+ -webkit-box-lines: start;
118
+ -ms-flex-line-pack: start;
119
+ -webkit-align-content: flex-start;
120
+ align-content: flex-start;
121
+ }
122
+
123
+ .align-content-end {
124
+ -webkit-box-lines: end;
125
+ -ms-flex-line-pack: end;
126
+ -webkit-align-content: flex-end;
127
+ align-content: flex-end;
128
+ }
129
+
130
+ .align-content-center {
131
+ -webkit-box-lines: center;
132
+ -ms-flex-line-pack: center;
133
+ -webkit-align-content: center;
134
+ align-content: center;
135
+ }
136
+
137
+ .align-content-between {
138
+ -webkit-box-lines: justify;
139
+ -ms-flex-line-pack: justify;
140
+ -webkit-align-content: space-between;
141
+ align-content: space-between;
142
+ }
143
+
144
+ .align-content-around {
145
+ -webkit-box-lines: space-around;
146
+ -ms-flex-line-pack: space-around;
147
+ -webkit-align-content: space-around;
148
+ align-content: space-around;
149
+ }
150
+
151
+ .align-content-stretch {
152
+ -webkit-box-lines: stretch;
153
+ -ms-flex-line-pack: stretch;
154
+ -webkit-align-content: stretch;
155
+ align-content: stretch;
156
+ }
157
+
158
+ .flex-item-auto {
159
+ flex: auto;
160
+ }
161
+
162
+ .flex-item {
163
+ flex: 1;
164
+ overflow: hidden;
165
+ }
166
+
167
+ .flex-item-overflowX {
168
+ flex: 1;
169
+ overflow: hidden;
170
+ width: 0;
171
+ min-width: 0;
172
+ }
173
+
174
+ .flex-item-overflowY {
175
+ flex: 1;
176
+ overflow: hidden;
177
+ height: 0;
178
+ min-height: 0;
179
+ }
2
180
  body,
3
181
  html {
4
182
  width: 100%;
@@ -70,3 +70,8 @@ export default {
70
70
  }
71
71
  }
72
72
  </script>
73
+ <style scoped>
74
+ .van-checkbox--horizontal {
75
+ margin-bottom: 15px;
76
+ }
77
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <van-field v-model="innerValue" :label="conf.hideLabel ? '' : conf.label" v-bind="filterAttrs" :rules="rules"
3
- @input="handleChange" @clear="handleClear" />
2
+ <van-field v-model="innerValue" :label="conf.hideLabel ? '' : conf.label" v-bind="filterAttrs"
3
+ :rules="mode == 'view' ? [] : rules" @input="handleChange" @clear="handleClear" />
4
4
  </template>
5
5
 
6
6
  <script>
@@ -31,7 +31,7 @@ export default {
31
31
  const { ...rest } = this.attrs;
32
32
  const { widget } = this.conf;
33
33
  rest.type = widget == 'password' ? 'password' : widget == 'inputNumber' ? 'number' : widget == 'textarea' ? 'textarea' : 'text'
34
- if (this.mode == 'view') { rest.readonly = true; rest.disabled = true; rest.clearable = false }
34
+ if (this.mode == 'view') { rest.readonly = true; rest.clearable = false }
35
35
  if (rest.class == 'form-control') rest.class = ''
36
36
  return rest;
37
37
  }
@@ -139,14 +139,32 @@ export default {
139
139
  },
140
140
  onConfirm(rows) {
141
141
  this.showRPicker = false
142
- this.tableData = [...rows.map(item => {
142
+ let rowArray = Array.isArray(rows) ? rows : [rows],
143
+ data = []
144
+ rowArray.forEach((row) => {
145
+ const emptyRow = {}
146
+ this.conf.columnsData.forEach((col) => {
147
+ if (
148
+ this.conf.referenceAddApi &&
149
+ this.conf.referenceAddApi.mappings &&
150
+ this.conf.referenceAddApi.mappings.filter((item) => item.name == col.name).length > 0
151
+ ) {
152
+ emptyRow[col.name] =
153
+ row[this.conf.referenceAddApi.mappings.filter((item) => item.name == col.name)[0].field]
154
+ } else {
155
+ emptyRow[col.name] = col.defaultValue || ''
156
+ }
157
+ })
158
+ JSON.stringify(emptyRow) !== '{}' && data.push(emptyRow)
159
+ })
160
+ this.innerValue = JSON.stringify(data)
161
+ this.tableData = [...data.map(item => {
143
162
  return {
144
163
  ...item,
145
164
  checked: false
146
165
  }
147
166
  })]
148
- console.log(rows)
149
- this.innerValue = JSON.stringify(this.tableData)
167
+ console.log(rows, 'onConfirm', this.tableData, this.tableColumns)
150
168
  this.$emit('input', this.innerValue)
151
169
  //this.updateCallback(rows)
152
170
  //this.$emit('input', this.innerValue);
@@ -6,10 +6,10 @@
6
6
  <van-field v-model="innerValueLabel" :label="conf.hideLabel ? '' : conf.label" v-bind="filterAttrs"
7
7
  :rules="rules" @click-right-icon="showPicker = true" right-icon="arrow"></van-field>
8
8
  <van-popup v-model="showPicker" position="bottom" get-container="#myForm" class="select-popup" closeable
9
- :style="{ height: '40%' }">
10
- <div class="custom-picker-container">
11
- <van-sticky>
12
- <van-nav-bar title="选择" :border="false" />
9
+ :style="{ height: attrs.multiple ? '40%' : 'auto' }">
10
+ <div class="custom-picker-container flex flex-column h100">
11
+ <van-sticky class="w100">
12
+ <van-nav-bar :title="'选择' + conf.label" :border="false" />
13
13
  </van-sticky>
14
14
 
15
15
  <div class="popup-body scroll-wrap" v-if="attrs.multiple">
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  </div>
25
25
 
26
- <van-picker :columns="selectOptions" value-key="label" class="flex-item" ref="myPicker" v-else>
26
+ <van-picker :columns="selectOptions" value-key="label" ref="myPicker" v-else>
27
27
  </van-picker>
28
28
  <div class="bottom-btn">
29
29
  <van-button type="primary" round block @click="onConfirm" icon="checked">确认</van-button>
@@ -145,16 +145,16 @@ export default {
145
145
  </script>
146
146
 
147
147
  <style scoped>
148
- /deep/ .bs-suggest-ul {
148
+ .bs-suggest-ul {
149
149
  max-height: 300px;
150
150
  overflow-y: auto;
151
151
  }
152
152
 
153
- /deep/ .bs-suggest-ul li {
153
+ .bs-suggest-ul li {
154
154
  padding: 6px 12px;
155
155
  }
156
156
 
157
- /deep/ .bs-suggest-ul li.active {
157
+ .bs-suggest-ul li.active {
158
158
  background-color: #337ab7;
159
159
  color: #fff;
160
160
  }
@@ -260,7 +260,7 @@ export default {
260
260
  if (data && data.length > 0 && this.uploadColumns.length > 0) {
261
261
  data = this.convertFiles(data)
262
262
  }
263
-
263
+ console.log(columns, 'columns')
264
264
  this.tableOptions = {
265
265
  id: this.tableId,
266
266
  sidePagination: 'client',
package/src/index.js CHANGED
@@ -16,7 +16,7 @@ import createStore from './store/index'
16
16
  import ElementUI from 'element-ui';
17
17
  import 'element-ui/lib/theme-chalk/index.css';
18
18
  import Build from './views/build/index.vue'
19
- //import Build from './views/build/viewAppForm.vue'
19
+ //import Build from './views/build/viewForm.vue'
20
20
  import FormItem from '@/components/form/FormItem.vue'
21
21
  import Form from '@/components/form/Form.vue'
22
22
  import SubRow from '@/components/form/SubRow.vue'
@@ -178,8 +178,6 @@ export default {
178
178
  </script>
179
179
 
180
180
  <style scoped>
181
- .dialog-footer {}
182
-
183
181
  .el-select {
184
182
  margin: 0 auto;
185
183
  }
@@ -197,11 +195,6 @@ export default {
197
195
  color: #409eff;
198
196
  }
199
197
 
200
- .flex {
201
- display: flex;
202
- align-items: center;
203
- }
204
-
205
198
  .align-center {
206
199
  align-items: center;
207
200
  }
@@ -1076,7 +1076,6 @@ export default {
1076
1076
  this.changeActiveData('allowedFileType')
1077
1077
  },
1078
1078
  changeActiveData(key) {
1079
- console.log(this.activeDataOptions[key])
1080
1079
  if (this.activeDataOptions[key] !== undefined && this.currentData[key] !== this.activeData[key]) {
1081
1080
  this.$emit('update', key, this.activeData[key])
1082
1081
  }
@@ -1797,19 +1797,4 @@ $lighterBlue: #1e88e5;
1797
1797
  }
1798
1798
 
1799
1799
  }
1800
-
1801
- /* 全局美化滚动条(窄滚动条) */
1802
- /deep/ ::-webkit-scrollbar {
1803
- width: 3px !important;
1804
- height: 3px !important;
1805
- }
1806
-
1807
- /deep/ ::-webkit-scrollbar-thumb {
1808
- background: #ccc !important;
1809
- border-radius: 3px !important;
1810
- }
1811
-
1812
- /deep/ ::-webkit-scrollbar-track {
1813
- background: transparent !important;
1814
- }
1815
1800
  </style>