File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
dbm-ui/frontend/src/views
ticket-center/common/ticket-detail/components/task-info/com-factory/redis Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 170
170
:is-append =" isAppend"
171
171
:max-memory =" maxMemory"
172
172
:port =" formData.details.port"
173
+ :port-type =" portType"
173
174
@host-change =" handleHostChange" />
174
175
</BkFormItem >
175
176
<BkFormItem :label =" t('备注')" >
315
316
316
317
const isAppend = computed (() => formData .details .appendApply === ' append' );
317
318
const machineCount = computed (() => formData .details .cluster_count / formData .details .group_count );
319
+ const portType = computed (() => {
320
+ if (formData .details .cluster_count % formData .details .group_count !== 0 ) {
321
+ return ' ' ;
322
+ }
323
+ if (formData .details .cluster_count === formData .details .group_count ) {
324
+ return ' increment' ; // 递增端口号
325
+ }
326
+ if (formData .details .group_count === 1 ) {
327
+ return ' same' ; // 端口号相同
328
+ }
329
+ const ports = Array (formData .details .group_count )
330
+ .fill (0 )
331
+ .map ((_ , index ) => formData .details .port + index );
332
+ const groups = formData .details .cluster_count / formData .details .group_count ;
333
+ return _ .flatMap (
334
+ Array (groups )
335
+ .fill (0 )
336
+ .map (() => ports ),
337
+ );
338
+ });
318
339
319
340
watch (
320
341
() => formData .details .city_code ,
Original file line number Diff line number Diff line change 75
75
cityCode: string ,
76
76
cityName: string
77
77
}
78
+ portType: string | number [];
78
79
}
79
80
80
81
interface Emits {
156
157
const columns = computed (() => {
157
158
const baseColums: Column [] = [
158
159
{
159
- type: ' index ' ,
160
+ type: ' seq ' ,
160
161
label: t (' 序号' ),
161
162
width: 60 ,
162
163
},
194
195
onChange = { (value : string ) => handleChangeCellValue (value , index , ' cluster_name' )}
195
196
/>
196
197
</bk-form-item >
197
- <div class = " ml-4" >.{ props .appAbbr } .db{ props .isAppend ? ' ' : ` #${props .port + index } ` } </div >
198
+ {
199
+ typeof props .portType === ' string' ?
200
+ <div class = " ml-4" >.{ props .appAbbr } .db{ props .isAppend ? ' ' : ` #${props .portType === ' increment' ? props .port + index : props .port } ` } </div >
201
+ :
202
+ <div class = " ml-4" >.{ props .appAbbr } .db{ props .isAppend ? ' ' : ` #${props .portType .length === tableData .value .length ? props .portType [index ] : ' ' } ` } </div >
203
+ }
198
204
</div >
199
205
),
200
206
},
Original file line number Diff line number Diff line change 31
31
<div class =" ticket-details-info-title mt-20" >{{ t('地域要求') }}</div >
32
32
<InfoList >
33
33
<InfoItem :label =" t('数据库部署地域')" >
34
- {{ ticketDetails?.details.city_name || '--' }}
34
+ {{ ticketDetails?.details.city_code || '--' }}
35
35
</InfoItem >
36
36
</InfoList >
37
37
<div class =" ticket-details-info-title mt-20" >{{ t('数据库部署信息') }}</div >
You can’t perform that action at this time.
0 commit comments