|
@@ -532,13 +532,20 @@
|
|
<el-button type="primary" plain size="small" class="customize-btn">定制面试间</el-button>
|
|
<el-button type="primary" plain size="small" class="customize-btn">定制面试间</el-button>
|
|
</div> -->
|
|
</div> -->
|
|
<div class="interview-content">
|
|
<div class="interview-content">
|
|
- <div class="interview-questions-container">
|
|
|
|
- <div class="no-questions" v-if="chatQuestions.length === 0">
|
|
|
|
- <p>暂无题目</p>
|
|
|
|
- <p class="ai-tip">点击"AI自动组题"按钮</p>
|
|
|
|
- <p class="ai-tip">可根据您选择的能力类型一键组题</p>
|
|
|
|
- <el-button type="success" class="auto-generate-btn" @click="handleAutoGenerate">AI自动组题</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="interview-questions-container" :loading="autoGenerateLoading">
|
|
|
|
+ <div class="no-questions" v-if="chatQuestions.length === 0">
|
|
|
|
+ <p>暂无题目</p>
|
|
|
|
+ <p class="ai-tip">点击"AI自动组题"按钮</p>
|
|
|
|
+ <p class="ai-tip">可根据您选择的能力类型一键组题</p>
|
|
|
|
+ <el-button
|
|
|
|
+ type="success"
|
|
|
|
+ class="auto-generate-btn"
|
|
|
|
+
|
|
|
|
+ @click="handleAutoGenerate"
|
|
|
|
+ >
|
|
|
|
+ AI自动组题
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
<!-- :component-data="{
|
|
<!-- :component-data="{
|
|
tag: 'transition-group',
|
|
tag: 'transition-group',
|
|
name: !drag ? 'flip-list' : null
|
|
name: !drag ? 'flip-list' : null
|
|
@@ -1069,12 +1076,12 @@
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
</span>
|
|
</span>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
- :content="field.required ? '必填项不可隐藏' : '切换显示/隐藏'"
|
|
|
|
|
|
+ content="切换显示/隐藏"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-switch
|
|
<el-switch
|
|
v-model="field.visible"
|
|
v-model="field.visible"
|
|
- :disabled="field.required"
|
|
|
|
|
|
+
|
|
class="custom-switch"
|
|
class="custom-switch"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -1103,12 +1110,11 @@
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
</span>
|
|
</span>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
- :content="field.required ? '必填项不可隐藏' : '切换显示/隐藏'"
|
|
|
|
|
|
+ content="切换显示/隐藏"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-switch
|
|
<el-switch
|
|
v-model="field.visible"
|
|
v-model="field.visible"
|
|
- :disabled="field.required"
|
|
|
|
class="custom-switch"
|
|
class="custom-switch"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -1137,12 +1143,12 @@
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
</span>
|
|
</span>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
- :content="field.required ? '必填项不可隐藏' : '切换显示/隐藏'"
|
|
|
|
|
|
+ content="切换显示/隐藏"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-switch
|
|
<el-switch
|
|
v-model="field.visible"
|
|
v-model="field.visible"
|
|
- :disabled="field.required"
|
|
|
|
|
|
+
|
|
class="custom-switch"
|
|
class="custom-switch"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -1160,12 +1166,12 @@
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
</span>
|
|
</span>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
- :content="field.required ? '必填项不可隐藏' : '切换显示/隐藏'"
|
|
|
|
|
|
+ content="切换显示/隐藏"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-switch
|
|
<el-switch
|
|
v-model="field.visible"
|
|
v-model="field.visible"
|
|
- :disabled="field.required"
|
|
|
|
|
|
+
|
|
class="custom-switch"
|
|
class="custom-switch"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -1194,12 +1200,12 @@
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
<!-- <el-tag v-if="field.required" size="small" type="danger" class="required-tag">必填</el-tag> -->
|
|
</span>
|
|
</span>
|
|
<el-tooltip
|
|
<el-tooltip
|
|
- :content="field.required ? '必填项不可隐藏' : '切换显示/隐藏'"
|
|
|
|
|
|
+ content="切换显示/隐藏"
|
|
placement="top"
|
|
placement="top"
|
|
>
|
|
>
|
|
<el-switch
|
|
<el-switch
|
|
v-model="field.visible"
|
|
v-model="field.visible"
|
|
- :disabled="field.required"
|
|
|
|
|
|
+
|
|
class="custom-switch"
|
|
class="custom-switch"
|
|
/>
|
|
/>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -1751,6 +1757,9 @@ const confirmResumeCollection = () => {
|
|
cancelResumeCollection();
|
|
cancelResumeCollection();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+// AI自动组题loading状态
|
|
|
|
+const autoGenerateLoading = ref(false);
|
|
|
|
+
|
|
// 获取职位详情
|
|
// 获取职位详情
|
|
const getPositionDetail = async () => {
|
|
const getPositionDetail = async () => {
|
|
try {
|
|
try {
|
|
@@ -1768,7 +1777,7 @@ const getPositionDetail = async () => {
|
|
if (response && response.data) {
|
|
if (response && response.data) {
|
|
Object.assign(positionData, response.data);
|
|
Object.assign(positionData, response.data);
|
|
// 设置职位状态
|
|
// 设置职位状态
|
|
- positionStatus.value = positionData.job_type === 1;
|
|
|
|
|
|
+ positionStatus.value = positionData.status === 1;
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取职位详情失败:', error);
|
|
console.error('获取职位详情失败:', error);
|
|
@@ -1798,9 +1807,9 @@ const handleStatusChange = async (value: boolean) => {
|
|
const newStatus = value ? 1 : 0;
|
|
const newStatus = value ? 1 : 0;
|
|
await api.UpdateObj({
|
|
await api.UpdateObj({
|
|
id: id,
|
|
id: id,
|
|
- job_type: newStatus
|
|
|
|
|
|
+ status: newStatus
|
|
});
|
|
});
|
|
- positionData.job_type = newStatus;
|
|
|
|
|
|
+ positionData.status = newStatus;
|
|
ElMessage.success(`职位已${value ? '开启' : '关闭'}`);
|
|
ElMessage.success(`职位已${value ? '开启' : '关闭'}`);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('修改状态失败:', error);
|
|
console.error('修改状态失败:', error);
|
|
@@ -3228,6 +3237,10 @@ console.log(selectedQuestions.value);
|
|
/* AI自动组题 */
|
|
/* AI自动组题 */
|
|
const handleAutoGenerate = async () => {
|
|
const handleAutoGenerate = async () => {
|
|
console.log('AI自动组题');
|
|
console.log('AI自动组题');
|
|
|
|
+
|
|
|
|
+ // 设置loading状态
|
|
|
|
+ autoGenerateLoading.value = true;
|
|
|
|
+
|
|
try {
|
|
try {
|
|
// 从已选择的能力标签中获取ID列表
|
|
// 从已选择的能力标签中获取ID列表
|
|
const competencyTagIds = selectedDimensions.value.map(dimension => {
|
|
const competencyTagIds = selectedDimensions.value.map(dimension => {
|
|
@@ -3237,6 +3250,7 @@ const handleAutoGenerate = async () => {
|
|
|
|
|
|
if (competencyTagIds.length === 0) {
|
|
if (competencyTagIds.length === 0) {
|
|
ElMessage.warning('请至少选择一个能力标签');
|
|
ElMessage.warning('请至少选择一个能力标签');
|
|
|
|
+ autoGenerateLoading.value = false; // 如果验证失败,需要手动关闭loading
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3258,7 +3272,7 @@ const handleAutoGenerate = async () => {
|
|
tenant_id: 1,
|
|
tenant_id: 1,
|
|
position_id: route.query.id as string
|
|
position_id: route.query.id as string
|
|
});
|
|
});
|
|
-console.log(draftResponse);
|
|
|
|
|
|
+ console.log(draftResponse);
|
|
if (draftResponse && draftResponse.data) {
|
|
if (draftResponse && draftResponse.data) {
|
|
// 将获取到的题目格式化并添加到 chatQuestions 列表中
|
|
// 将获取到的题目格式化并添加到 chatQuestions 列表中
|
|
const formattedQuestions = draftResponse.data.dataList.map((question: any) => ({
|
|
const formattedQuestions = draftResponse.data.dataList.map((question: any) => ({
|
|
@@ -3284,6 +3298,9 @@ console.log(draftResponse);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('AI自动组题失败:', error);
|
|
console.error('AI自动组题失败:', error);
|
|
ElMessage.error('AI自动组题失败,请重试');
|
|
ElMessage.error('AI自动组题失败,请重试');
|
|
|
|
+ } finally {
|
|
|
|
+ // 无论成功或失败都要关闭loading状态
|
|
|
|
+ autoGenerateLoading.value = false;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|