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 170170 :is-append =" isAppend"
171171 :max-memory =" maxMemory"
172172 :port =" formData.details.port"
173+ :port-type =" portType"
173174 @host-change =" handleHostChange" />
174175 </BkFormItem >
175176 <BkFormItem :label =" t('备注')" >
315316
316317 const isAppend = computed (() => formData .details .appendApply === ' append' );
317318 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+ });
318339
319340 watch (
320341 () => formData .details .city_code ,
Original file line number Diff line number Diff line change 7575 cityCode: string ,
7676 cityName: string
7777 }
78+ portType: string | number [];
7879 }
7980
8081 interface Emits {
156157 const columns = computed (() => {
157158 const baseColums: Column [] = [
158159 {
159- type: ' index ' ,
160+ type: ' seq ' ,
160161 label: t (' 序号' ),
161162 width: 60 ,
162163 },
194195 onChange = { (value : string ) => handleChangeCellValue (value , index , ' cluster_name' )}
195196 />
196197 </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+ }
198204 </div >
199205 ),
200206 },
Original file line number Diff line number Diff line change 3131 <div class =" ticket-details-info-title mt-20" >{{ t('地域要求') }}</div >
3232 <InfoList >
3333 <InfoItem :label =" t('数据库部署地域')" >
34- {{ ticketDetails?.details.city_name || '--' }}
34+ {{ ticketDetails?.details.city_code || '--' }}
3535 </InfoItem >
3636 </InfoList >
3737 <div class =" ticket-details-info-title mt-20" >{{ t('数据库部署信息') }}</div >
You can’t perform that action at this time.
0 commit comments