|
28 | 28 | </el-button> |
29 | 29 | </span> |
30 | 30 | </el-descriptions-item> |
31 | | - <el-descriptions-item v-for="(param, key) in params" :label="getLabel(param)" :key="key"> |
32 | | - <span class="break-all whitespace-normal"> |
| 31 | + <el-descriptions-item |
| 32 | + label-class-name="system-label" |
| 33 | + v-for="(param, key) in params" |
| 34 | + :label="getLabel(param)" |
| 35 | + :key="key" |
| 36 | + > |
| 37 | + <span v-if="param.type === 'password' && !param.showPassword">********</span> |
| 38 | + <span v-else class="break-all whitespace-normal"> |
33 | 39 | {{ param.showValue && param.showValue != '' ? param.showValue : param.value }} |
34 | 40 | </span> |
35 | | - <CopyButton v-if="showCopyButton(param.key)" :content="param.value" /> |
| 41 | + <template v-if="param.type === 'password'"> |
| 42 | + <el-button |
| 43 | + v-if="!param.showPassword" |
| 44 | + link |
| 45 | + @click="param.showPassword = true" |
| 46 | + icon="View" |
| 47 | + class="-mt-1 ml-3" |
| 48 | + ></el-button> |
| 49 | + <el-button |
| 50 | + v-if="param.showPassword" |
| 51 | + link |
| 52 | + @click="param.showPassword = false" |
| 53 | + icon="Hide" |
| 54 | + class="-mt-1 ml-3" |
| 55 | + ></el-button> |
| 56 | + </template> |
| 57 | + <CopyButton class="-mt-1" v-if="showCopyButton(param.key)" :content="param.value" /> |
36 | 58 | </el-descriptions-item> |
37 | 59 | </el-descriptions> |
38 | 60 | </div> |
|
47 | 69 | v-model.number="paramModel.params[p.key]" |
48 | 70 | :disabled="!p.edit" |
49 | 71 | ></el-input> |
| 72 | + <el-input |
| 73 | + v-else-if="p.type == 'password'" |
| 74 | + :type="p.showPassword ? 'text' : 'password'" |
| 75 | + v-model="paramModel.params[p.key]" |
| 76 | + :disabled="!p.edit" |
| 77 | + > |
| 78 | + <template #append> |
| 79 | + <el-button |
| 80 | + :icon="p.showPassword ? 'Hide' : 'View'" |
| 81 | + @click="p.showPassword = !p.showPassword" |
| 82 | + /> |
| 83 | + </template> |
| 84 | + </el-input> |
50 | 85 | <el-select |
51 | 86 | v-model="paramModel.params[p.key]" |
52 | 87 | v-else-if="p.type == 'select'" |
@@ -258,6 +293,7 @@ const acceptParams = async (props: ParamProps) => { |
258 | 293 | await get(); |
259 | 294 | open.value = true; |
260 | 295 | openConfig.value = false; |
| 296 | + console.log('params', params.value); |
261 | 297 | }; |
262 | 298 |
|
263 | 299 | const handleClose = () => { |
@@ -304,6 +340,7 @@ const get = async () => { |
304 | 340 | multiple: d.multiple, |
305 | 341 | label: d.label, |
306 | 342 | required: d.required, |
| 343 | + showPassword: false, |
307 | 344 | }); |
308 | 345 | if (d.required) { |
309 | 346 | rules.params[d.key] = [Rules.requiredInput]; |
@@ -437,4 +474,8 @@ defineExpose({ acceptParams }); |
437 | 474 | .change-button { |
438 | 475 | margin-top: 5px; |
439 | 476 | } |
| 477 | +.system-label { |
| 478 | + width: 40% !important; |
| 479 | + white-space: nowrap !important; |
| 480 | +} |
440 | 481 | </style> |
0 commit comments