Commit 7d0bbda6810ff1fb2e19f9f403483ce2ddc9b9a9

Authored by 刘汉宸
1 parent 118332c6

feat: 优化Schema默认值

packages/schema-filter/index.vue
... ... @@ -21,6 +21,7 @@ export default {
21 21 props: {
22 22 value: Object,
23 23 schema: {
  24 + required: true,
24 25 type: Object,
25 26 default() {
26 27 return {};
... ...
packages/schema-form/index.vue
... ... @@ -66,8 +66,11 @@ export default {
66 66 },
67 67 },
68 68 schema: {
69   - type: Object,
70 69 required: true,
  70 + type: Object,
  71 + default() {
  72 + return {};
  73 + },
71 74 },
72 75 size: String,
73 76 },
... ...
packages/schema-page/index.scss
1   -.z-schema-page {
2   - &__header {
3   - margin-bottom: 10px;
  1 +.z-schema-page__header {
  2 + margin-bottom: 10px;
  3 +}
  4 +.z-schema-page__filter {
  5 + border: 1px solid #ebeef5;
  6 + padding-top: 10px;
  7 + padding-right: 10px;
  8 + border-radius: 4px;
  9 + margin-bottom: 10px;
  10 +}
  11 +.z-schema-page__action {
  12 + display: flex;
  13 + flex-wrap: wrap;
  14 + align-items: center;
  15 + justify-content: flex-start;
  16 + line-height: 1;
  17 + .el-button + .el-button {
  18 + margin-left: 0;
4 19 }
5   - &__filter {
6   - border: 1px solid #ebeef5;
7   - padding-top: 10px;
8   - padding-right: 10px;
9   - border-radius: 4px;
  20 + .el-button {
  21 + margin-right: 10px;
10 22 margin-bottom: 10px;
11 23 }
12   - &__action {
13   - display: flex;
14   - flex-wrap: wrap;
15   - align-items: center;
16   - justify-content: flex-start;
17   - line-height: 1;
18   - .el-button + .el-button {
19   - margin-left: 0;
20   - }
21   - .el-button {
22   - margin-right: 10px;
23   - margin-bottom: 10px;
24   - }
  24 +}
  25 +.z-schema-page__table-operation {
  26 + display: flex;
  27 + flex-wrap: wrap;
  28 + align-items: center;
  29 + justify-content: center;
  30 + .el-button + .el-button {
  31 + margin-left: 0;
25 32 }
26   - &__table {
27   - &-operation {
28   - display: flex;
29   - flex-wrap: wrap;
30   - align-items: center;
31   - justify-content: center;
32   - .el-button + .el-button {
33   - margin-left: 0;
34   - }
35   - .el-button {
36   - margin-right: 8px;
37   - padding-top: 6px;
38   - padding-bottom: 6px;
39   - }
40   - }
  33 + .el-button {
  34 + margin-right: 8px;
  35 + padding-top: 6px;
  36 + padding-bottom: 6px;
41 37 }
42   - &__footer {
43   - margin-top: 10px;
44   - text-align: right;
45   - display: flex;
46   - justify-content: space-between;
47   - align-items: center;
48   - .selection-info {
49   - word-break: break-all;
50   - white-space: nowrap;
51   - font-size: 12px;
52   - color: #606266;
53   - .num {
54   - color: #333;
55   - font-weight: bold;
56   - padding: 0 5px;
57   - font-size: 16px;
58   - }
59   - .el-button {
60   - margin-left: 5px;
61   - }
  38 +}
  39 +.z-schema-page__footer {
  40 + margin-top: 10px;
  41 + text-align: right;
  42 + display: flex;
  43 + justify-content: space-between;
  44 + align-items: center;
  45 + .selection-info {
  46 + word-break: break-all;
  47 + white-space: nowrap;
  48 + font-size: 12px;
  49 + color: #606266;
  50 + .num {
  51 + color: #333;
  52 + font-weight: bold;
  53 + padding: 0 5px;
  54 + font-size: 16px;
62 55 }
63   - .el-pagination {
64   - flex: auto;
  56 + .el-button {
  57 + margin-left: 5px;
65 58 }
66 59 }
  60 + .el-pagination {
  61 + flex: auto;
  62 + }
67 63 }
68   -
69 64 .z-loading-toast {
70 65 $toast-color: #fff;
71 66 $toast-bg-color: #000;
... ...
packages/schema-page/index.vue
... ... @@ -168,8 +168,11 @@ export default {
168 168 props: {
169 169 ...propsMap,
170 170 schema: {
171   - type: Object,
172 171 required: true,
  172 + type: Object,
  173 + default() {
  174 + return {};
  175 + },
173 176 },
174 177 },
175 178 data() {
... ...
packages/schema-table/index.vue
... ... @@ -9,8 +9,11 @@ export default {
9 9 },
10 10 },
11 11 schema: {
12   - type: Object,
13 12 required: true,
  13 + type: Object,
  14 + default() {
  15 + return {};
  16 + },
14 17 },
15 18 size: String,
16 19 },
... ...