|
24 | 24 | </a-card> |
25 | 25 | <a-table |
26 | 26 | bordered |
| 27 | + :scroll="{ x: 500 }" |
27 | 28 | :dataSource="ipRanges" |
28 | 29 | :columns="columns" |
29 | 30 | :pagination="false" |
30 | | - style="margin-bottom: 24px;" > |
| 31 | + style="margin-bottom: 24px; width: 100%" > |
31 | 32 | <template slot="actions" slot-scope="text, record"> |
32 | 33 | <a-button type="danger" shape="circle" icon="delete" @click="onDelete(record.key)" /> |
33 | 34 | </template> |
34 | 35 | <template slot="footer"> |
35 | 36 | <a-form |
36 | | - layout="inline" |
| 37 | + :layout="isMobile() ? 'horizontal': 'inline'" |
37 | 38 | :form="form" |
38 | 39 | @submit="handleAddRange"> |
39 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
40 | | - <a-input |
41 | | - v-decorator="[ 'gateway', { |
42 | | - rules: [{ required: true, message: $t('message.error.gateway') }] |
43 | | - }]" |
44 | | - :placeholder="$t('label.gateway')" |
45 | | - autoFocus |
46 | | - /> |
47 | | - </a-form-item> |
48 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
49 | | - <a-input |
50 | | - v-decorator="[ 'netmask', { |
51 | | - rules: [{ required: true, message: $t('message.error.netmask') }] |
52 | | - }]" |
53 | | - :placeholder="$t('label.netmask')" |
54 | | - /> |
55 | | - </a-form-item> |
56 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
57 | | - <a-input |
58 | | - v-decorator="[ 'vlan', { rules: [{ required: false }] }]" |
59 | | - :placeholder="$t('label.vlan')" |
60 | | - /> |
61 | | - </a-form-item> |
62 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
63 | | - <a-input |
64 | | - v-decorator="[ 'startIp', { |
65 | | - rules: [ |
66 | | - { |
67 | | - required: true, |
68 | | - message: $t('message.error.startip') |
69 | | - }, |
70 | | - { |
71 | | - validator: checkIpFormat, |
72 | | - ipV4: true, |
73 | | - message: $t('message.error.ipv4.address') |
74 | | - } |
75 | | - ] |
76 | | - }]" |
77 | | - :placeholder="$t('label.start.ip')" |
78 | | - /> |
79 | | - </a-form-item> |
80 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
81 | | - <a-input |
82 | | - v-decorator="[ 'endIp', { |
83 | | - rules: [ |
84 | | - { |
85 | | - required: true, |
86 | | - message: $t('message.error.endip') |
87 | | - }, |
88 | | - { |
89 | | - validator: checkIpFormat, |
90 | | - ipV4: true, |
91 | | - message: $t('message.error.ipv4.address') |
92 | | - }] |
93 | | - }]" |
94 | | - :placeholder="$t('label.end.ip')" |
95 | | - /> |
96 | | - </a-form-item> |
97 | | - <a-form-item :style="{ display: 'inline-block', width: '14%' }"> |
98 | | - <a-button type="primary" html-type="submit">{{ $t('label.add') }}</a-button> |
99 | | - </a-form-item> |
| 40 | + <a-row :gutter="12"> |
| 41 | + <a-col :md="4" :lg="4"> |
| 42 | + <a-form-item> |
| 43 | + <a-input |
| 44 | + v-decorator="[ 'gateway', { |
| 45 | + rules: [{ required: true, message: $t('message.error.gateway') }] |
| 46 | + }]" |
| 47 | + :placeholder="$t('label.gateway')" |
| 48 | + autoFocus |
| 49 | + /> |
| 50 | + </a-form-item> |
| 51 | + </a-col> |
| 52 | + <a-col :md="4" :lg="4"> |
| 53 | + <a-form-item> |
| 54 | + <a-input |
| 55 | + v-decorator="[ 'netmask', { |
| 56 | + rules: [{ required: true, message: $t('message.error.netmask') }] |
| 57 | + }]" |
| 58 | + :placeholder="$t('label.netmask')" |
| 59 | + /> |
| 60 | + </a-form-item> |
| 61 | + </a-col> |
| 62 | + <a-col :md="4" :lg="4"> |
| 63 | + <a-form-item> |
| 64 | + <a-input |
| 65 | + v-decorator="[ 'vlan', { rules: [{ required: false }] }]" |
| 66 | + :placeholder="$t('label.vlan')" |
| 67 | + /> |
| 68 | + </a-form-item> |
| 69 | + </a-col> |
| 70 | + <a-col :md="4" :lg="4"> |
| 71 | + <a-form-item> |
| 72 | + <a-input |
| 73 | + v-decorator="[ 'startIp', { |
| 74 | + rules: [ |
| 75 | + { |
| 76 | + required: true, |
| 77 | + message: $t('message.error.startip') |
| 78 | + }, |
| 79 | + { |
| 80 | + validator: checkIpFormat, |
| 81 | + ipV4: true, |
| 82 | + message: $t('message.error.ipv4.address') |
| 83 | + } |
| 84 | + ] |
| 85 | + }]" |
| 86 | + :placeholder="$t('label.start.ip')" |
| 87 | + /> |
| 88 | + </a-form-item> |
| 89 | + </a-col> |
| 90 | + <a-col :md="4" :lg="4"> |
| 91 | + <a-form-item> |
| 92 | + <a-input |
| 93 | + v-decorator="[ 'endIp', { |
| 94 | + rules: [ |
| 95 | + { |
| 96 | + required: true, |
| 97 | + message: $t('message.error.endip') |
| 98 | + }, |
| 99 | + { |
| 100 | + validator: checkIpFormat, |
| 101 | + ipV4: true, |
| 102 | + message: $t('message.error.ipv4.address') |
| 103 | + }] |
| 104 | + }]" |
| 105 | + :placeholder="$t('label.end.ip')" |
| 106 | + /> |
| 107 | + </a-form-item> |
| 108 | + </a-col> |
| 109 | + <a-col :md="4" :lg="4"> |
| 110 | + <a-form-item :style="{ display: 'inline-block', float: 'right' }"> |
| 111 | + <a-button type="primary" html-type="submit">{{ $t('label.add') }}</a-button> |
| 112 | + </a-form-item> |
| 113 | + </a-col> |
| 114 | + </a-row> |
100 | 115 | </a-form> |
101 | 116 | </template> |
102 | 117 | </a-table> |
|
126 | 141 | </div> |
127 | 142 | </template> |
128 | 143 | <script> |
| 144 | +import { mixinDevice } from '@/utils/mixin.js' |
| 145 | +
|
129 | 146 | export default { |
| 147 | + mixins: [mixinDevice], |
130 | 148 | props: { |
131 | 149 | traffic: { |
132 | 150 | type: String, |
@@ -183,7 +201,7 @@ export default { |
183 | 201 | title: '', |
184 | 202 | dataIndex: 'actions', |
185 | 203 | scopedSlots: { customRender: 'actions' }, |
186 | | - width: 50 |
| 204 | + width: 70 |
187 | 205 | } |
188 | 206 | ], |
189 | 207 | showError: false, |
|
0 commit comments