2323 step-strictly
2424 />
2525 <span class =" ml-4" >{{
26- $t('views.applicationOverview.appInfo.LimitDialog.timesDays')
27- }}</span >
26+ $t('views.applicationOverview.appInfo.LimitDialog.timesDays')
27+ }}</span >
2828 </el-form-item >
2929 <!-- 身份验证 -->
3030 <el-form-item :label =" $t('views.applicationOverview.appInfo.LimitDialog.authentication')" >
31- <el-switch size =" small" v-model =" form.authentication" @change = " firstGeneration " ></el-switch >
31+ <el-switch size =" small" v-model =" form.authentication" ></el-switch >
3232 </el-form-item >
3333 <el-radio-group
3434 v-if =" form.authentication"
3535 v-model =" form.authentication_value.type"
3636 class =" card__radio"
37- @change =" (val: string) => val === 'password' "
37+ @change =" firstGeneration "
3838 >
3939 <el-card
4040 shadow =" never"
7171 text
7272 style =" margin : 0 4px 0 0 !important "
7373 >
74- <el-icon ><RefreshRight /></el-icon >
74+ <el-icon >
75+ <RefreshRight />
76+ </el-icon >
7577 </el-button >
7678 </el-tooltip >
7779 </template >
107109 >
108110 <el-checkbox-group v-model =" form.authentication_value.login_value" >
109111 <template v-for =" t in auth_list " :key =" t .value " >
110- <el-checkbox :label =" t.label" :value =" t.value" />
112+ <el-checkbox :label =" t.label" :value =" t.value" />
111113 </template >
112114 </el-checkbox-group >
113115 </el-form-item >
131133 </el-form >
132134 <template #footer >
133135 <div >
134- <el-button @click.prevent =" dialogVisible = false" >{{ $t('common.cancel') }} </el-button >
136+ <el-button @click.prevent =" dialogVisible = false" >{{ $t('common.cancel') }}</el-button >
135137 <el-button type =" primary" @click =" submit(limitFormRef)" :loading =" loading" >
136138 {{ $t('common.save') }}
137139 </el-button >
140142 </el-drawer >
141143</template >
142144<script setup lang="ts">
143- import { ref , watch } from ' vue'
144- import { useRoute , useRouter } from ' vue-router'
145- import type { FormInstance , FormRules } from ' element-plus'
145+ import {ref , watch } from ' vue'
146+ import {useRoute , useRouter } from ' vue-router'
147+ import type {FormInstance , FormRules } from ' element-plus'
146148import applicationApi from ' @/api/application/application'
147- import { MsgSuccess } from ' @/utils/message'
148- import { t } from ' @/locales'
149- import { copyClick } from ' @/utils/clipboard'
149+ import {MsgSuccess } from ' @/utils/message'
150+ import {t } from ' @/locales'
151+ import {copyClick } from ' @/utils/clipboard'
150152
151153const router = useRouter ()
152154const route = useRoute ()
153155const {
154- params : { id },
156+ params : {id },
155157} = route
156158
157159const emit = defineEmits ([' refresh' ])
@@ -226,6 +228,7 @@ const submit = async (formEl: FormInstance | undefined) => {
226228 }
227229 })
228230}
231+
229232function generateAuthenticationValue(length : number = 10 ) {
230233 const chars = ' ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
231234 const randomValues = new Uint8Array (length )
@@ -234,18 +237,18 @@ function generateAuthenticationValue(length: number = 10) {
234237 .map ((value ) => chars [value % chars .length ])
235238 .join (' ' )
236239}
240+
237241function refreshAuthentication() {
238242 form .value .authentication_value .password_value = generateAuthenticationValue ()
239243}
240244
241245function firstGeneration() {
242- console .log (' firstGeneration' )
243- if (form .value .authentication && ! form .value .authentication_value ) {
244- form .value .authentication_value = generateAuthenticationValue ()
246+ if (form .value .authentication && form .value .authentication_value .type === ' password' && ! form .value .authentication_value .password_value ) {
247+ form .value .authentication_value .password_value = generateAuthenticationValue ()
245248 }
246249}
247250
248- defineExpose ({ open })
251+ defineExpose ({open })
249252 </script >
250253<style lang="scss" scoped>
251254.authentication-append-input {
0 commit comments