feat: 优化bug
This commit is contained in:
parent
feb0ba3cfb
commit
fac8ace35a
@ -41,8 +41,13 @@
|
|||||||
<div class="flex-between w-full">
|
<div class="flex-between w-full">
|
||||||
<el-input class="code-input" v-model="resetPasswordForm.code" placeholder="请输入验证码">
|
<el-input class="code-input" v-model="resetPasswordForm.code" placeholder="请输入验证码">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button class="send-email-button ml-8" @click="sendEmail" :loading="loading"
|
<el-button
|
||||||
>获取验证码</el-button
|
:disabled="isDisabled"
|
||||||
|
class="send-email-button ml-8"
|
||||||
|
@click="sendEmail"
|
||||||
|
:loading="loading"
|
||||||
|
>
|
||||||
|
{{ isDisabled ? `重新发送(${time}s)` : '获取验证码' }}</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -77,6 +82,8 @@ const resetPasswordForm = ref<ResetCurrentUserPasswordRequest>({
|
|||||||
const resetPasswordFormRef = ref<FormInstance>()
|
const resetPasswordFormRef = ref<FormInstance>()
|
||||||
|
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
|
const isDisabled = ref<boolean>(false)
|
||||||
|
const time = ref<number>(60)
|
||||||
|
|
||||||
const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
|
const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
|
||||||
code: [{ required: true, message: '请输入验证码' }],
|
code: [{ required: true, message: '请输入验证码' }],
|
||||||
@ -123,9 +130,23 @@ const rules = ref<FormRules<ResetCurrentUserPasswordRequest>>({
|
|||||||
const sendEmail = () => {
|
const sendEmail = () => {
|
||||||
UserApi.sendEmailToCurrent(loading).then(() => {
|
UserApi.sendEmailToCurrent(loading).then(() => {
|
||||||
MsgSuccess('发送验证码成功')
|
MsgSuccess('发送验证码成功')
|
||||||
|
isDisabled.value = true
|
||||||
|
handleTimeChange()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleTimeChange = () => {
|
||||||
|
if (time.value <= 0) {
|
||||||
|
isDisabled.value = false
|
||||||
|
time.value = 60
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
time.value--
|
||||||
|
handleTimeChange()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
resetPasswordForm.value = {
|
resetPasswordForm.value = {
|
||||||
code: '',
|
code: '',
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
{{ datetimeFormat(row.create_time) }}
|
{{ datetimeFormat(row.create_time) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="80">
|
<el-table-column label="操作" align="left" width="80">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tooltip effect="dark" content="删除" placement="top">
|
<el-tooltip effect="dark" content="删除" placement="top">
|
||||||
<el-button type="primary" text @click="deleteApiKey(row)">
|
<el-button type="primary" text @click="deleteApiKey(row)">
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
<el-button @click.prevent="dialogVisible = false"> 取消 </el-button>
|
||||||
<el-button type="primary" @click="submit" :loading="loading"> 确定 </el-button>
|
<el-button type="primary" @click="submit(webFormRef)" :loading="loading"> 确定 </el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -42,6 +42,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue'
|
import { ref, reactive, watch } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import documentApi from '@/api/document'
|
import documentApi from '@/api/document'
|
||||||
import { MsgSuccess } from '@/utils/message'
|
import { MsgSuccess } from '@/utils/message'
|
||||||
|
|
||||||
@ -51,6 +52,7 @@ const {
|
|||||||
} = route as any
|
} = route as any
|
||||||
|
|
||||||
const emit = defineEmits(['refresh'])
|
const emit = defineEmits(['refresh'])
|
||||||
|
const webFormRef = ref()
|
||||||
const loading = ref<boolean>(false)
|
const loading = ref<boolean>(false)
|
||||||
const isImport = ref<boolean>(false)
|
const isImport = ref<boolean>(false)
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
@ -86,27 +88,34 @@ const open = (row: any) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const submit = () => {
|
const submit = async (formEl: FormInstance | undefined) => {
|
||||||
if (isImport.value) {
|
if (!formEl) return
|
||||||
const obj = {
|
await formEl.validate((valid, fields) => {
|
||||||
source_url_list: form.value.source_url.split('\n'),
|
if (valid) {
|
||||||
selector: form.value.selector
|
if (isImport.value) {
|
||||||
|
const obj = {
|
||||||
|
source_url_list: form.value.source_url.split('\n'),
|
||||||
|
selector: form.value.selector
|
||||||
|
}
|
||||||
|
documentApi.postWebDocument(id, obj, loading).then((res: any) => {
|
||||||
|
MsgSuccess('导入成功')
|
||||||
|
emit('refresh')
|
||||||
|
dialogVisible.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
const obj = {
|
||||||
|
meta: form.value
|
||||||
|
}
|
||||||
|
documentApi.putDocument(id, documentId.value, obj, loading).then((res) => {
|
||||||
|
MsgSuccess('设置成功')
|
||||||
|
emit('refresh')
|
||||||
|
dialogVisible.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('error submit!', fields)
|
||||||
}
|
}
|
||||||
documentApi.postWebDocument(id, obj, loading).then((res: any) => {
|
})
|
||||||
MsgSuccess('导入成功')
|
|
||||||
emit('refresh')
|
|
||||||
dialogVisible.value = false
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const obj = {
|
|
||||||
meta: form.value
|
|
||||||
}
|
|
||||||
documentApi.putDocument(id, documentId.value, obj, loading).then((res) => {
|
|
||||||
MsgSuccess('设置成功')
|
|
||||||
emit('refresh')
|
|
||||||
dialogVisible.value = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
{{ datetimeFormat(row.update_time) }}
|
{{ datetimeFormat(row.update_time) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="left">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div v-if="datasetDetail.type === '0'">
|
<div v-if="datasetDetail.type === '0'">
|
||||||
<span v-if="row.status === '2'" class="mr-4">
|
<span v-if="row.status === '2'" class="mr-4">
|
||||||
|
|||||||
@ -93,7 +93,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-16">
|
<div class="mb-16">
|
||||||
<div class="title mb-8">返回分段数 Top</div>
|
<div class="title mb-8">返回分段数 TOP</div>
|
||||||
|
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="cloneForm.top_number"
|
v-model="cloneForm.top_number"
|
||||||
|
|||||||
@ -33,12 +33,12 @@
|
|||||||
<el-table-column prop="chat_record_count" label="对话提问数" align="right" />
|
<el-table-column prop="chat_record_count" label="对话提问数" align="right" />
|
||||||
<el-table-column prop="star_num" align="right">
|
<el-table-column prop="star_num" align="right">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex align-center">
|
<div>
|
||||||
<span>用户反馈</span>
|
<span>用户反馈</span>
|
||||||
<el-popover :width="160" trigger="click" :visible="popoverVisible">
|
<el-popover :width="160" trigger="click" :visible="popoverVisible">
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button
|
<el-button
|
||||||
style="margin-top: -2px;"
|
style="margin-top: -2px"
|
||||||
:type="filter.min_star || filter.min_trample ? 'primary' : ''"
|
:type="filter.min_star || filter.min_trample ? 'primary' : ''"
|
||||||
link
|
link
|
||||||
@click="popoverVisible = !popoverVisible"
|
@click="popoverVisible = !popoverVisible"
|
||||||
@ -102,7 +102,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" width="70" align="center">
|
<el-table-column label="操作" width="70" align="left">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tooltip effect="dark" content="删除" placement="top">
|
<el-tooltip effect="dark" content="删除" placement="top">
|
||||||
<el-button type="primary" text @click.stop="deleteLog(row)">
|
<el-button type="primary" text @click.stop="deleteLog(row)">
|
||||||
|
|||||||
@ -109,6 +109,8 @@ const sendEmail = () => {
|
|||||||
if (v) {
|
if (v) {
|
||||||
UserApi.sendEmit(CheckEmailForm.value.email, 'reset_password', loading).then(() => {
|
UserApi.sendEmit(CheckEmailForm.value.email, 'reset_password', loading).then(() => {
|
||||||
MsgSuccess('发送验证码成功')
|
MsgSuccess('发送验证码成功')
|
||||||
|
isDisabled.value = true
|
||||||
|
handleTimeChange()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user