| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 选项配置对话框 --> |
| | | <el-dialog |
| | | title="选项异常状态配置" |
| | | :visible.sync="optionDialogVisible" |
| | | width="700px" |
| | | center |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div v-if="editingQuestion" class="option-config-wrapper"> |
| | | <div class="dialog-header"> |
| | | <h4>{{ editingQuestion.scriptTopic || '无主题' }}</h4> |
| | | <p class="dialog-subtitle">{{ editingQuestion.scriptContent }}</p> |
| | | </div> |
| | | <!-- 选项配置对话框 --> |
| | | <el-dialog |
| | | title="选项异常状态配置" |
| | | :visible.sync="optionDialogVisible" |
| | | width="700px" |
| | | center |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div v-if="editingQuestion" class="option-config-wrapper"> |
| | | <div class="dialog-header"> |
| | | <h4>{{ editingQuestion.scriptTopic || "无主题" }}</h4> |
| | | <p class="dialog-subtitle">{{ editingQuestion.scriptContent }}</p> |
| | | </div> |
| | | |
| | | <div class="option-list"> |
| | | <el-alert |
| | | v-if="!currentOptions.some(opt => opt.isabnormal === 1)" |
| | | title="请至少设置一个异常选项(标记为异常)" |
| | | type="warning" |
| | | :closable="false" |
| | | show-icon |
| | | style="margin-bottom: 20px;" |
| | | /> |
| | | <div class="option-list"> |
| | | <el-alert |
| | | v-if="!currentOptions.some((opt) => opt.isabnormal === 1)" |
| | | title="请至少设置一个异常选项(标记为异常)" |
| | | type="warning" |
| | | :closable="false" |
| | | show-icon |
| | | style="margin-bottom: 20px" |
| | | /> |
| | | |
| | | <div v-for="(option, index) in currentOptions" :key="index" class="option-item"> |
| | | <el-form |
| | | :model="option" |
| | | :rules="optionRules" |
| | | ref="optionForm" |
| | | size="small" |
| | | class="option-form" |
| | | > |
| | | <el-row :gutter="12" align="middle"> |
| | | <el-col :span="2"> |
| | | <div class="option-index">#{{ index + 1 }}</div> |
| | | </el-col> |
| | | <div |
| | | v-for="(option, index) in currentOptions" |
| | | :key="index" |
| | | class="option-item" |
| | | > |
| | | <el-form |
| | | :model="option" |
| | | :rules="optionRules" |
| | | ref="optionForm" |
| | | size="small" |
| | | class="option-form" |
| | | > |
| | | <el-row :gutter="12" align="middle"> |
| | | <el-col :span="2"> |
| | | <div class="option-index">#{{ index + 1 }}</div> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item prop="targetvalue"> |
| | | <el-input |
| | | v-model="option.targetvalue" |
| | | placeholder="请输入选项内容" |
| | | clearable |
| | | maxlength="200" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item prop="targetvalue"> |
| | | <el-input |
| | | v-model="option.targetvalue" |
| | | placeholder="请输入选项内容" |
| | | clearable |
| | | maxlength="200" |
| | | show-word-limit |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="6"> |
| | | <el-form-item prop="isabnormal"> |
| | | <el-select |
| | | v-model="option.isabnormal" |
| | | placeholder="选择状态" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="status in abnormalOptions" |
| | | :key="status.value" |
| | | :label="status.label" |
| | | :value="status.value" |
| | | > |
| | | <el-tag :type="status.type" size="small">{{ status.label }}</el-tag> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="isabnormal"> |
| | | <el-select |
| | | v-model="option.isabnormal" |
| | | placeholder="选择状态" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="status in abnormalOptions" |
| | | :key="status.value" |
| | | :label="status.label" |
| | | :value="status.value" |
| | | > |
| | | <el-tag :type="status.type" size="small">{{ |
| | | status.label |
| | | }}</el-tag> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="4"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | @click="removeOption(index)" |
| | | size="small" |
| | | circle |
| | | plain |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | <el-col :span="4"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | @click="removeOption(index)" |
| | | size="small" |
| | | circle |
| | | plain |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <!-- <el-button |
| | | <!-- <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | @click="addNewOption" |
| | |
| | | > |
| | | 添加选项 |
| | | </el-button> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="optionDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="saveOptions" :loading="savingOptions"> |
| | | 保存配置 |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="optionDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="saveOptions" :loading="savingOptions"> |
| | | 保存配置 |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!-- 题目预览对话框 --> |
| | | <el-dialog |
| | | title="题目预览" |
| | |
| | | this.voiceCategories.includes(q.scriptAssortid) |
| | | ).length; |
| | | } |
| | | return 0; |
| | | }, |
| | | // 检查题目是否有异常选项 |
| | | hasAbnormalOption(question) { |
| | | return (question) => { |
| | | if (!question) return false; |
| | | |
| | | // 问卷模板 |
| | | if (this.templateForm.templateType === 1) { |
| | | const options = question.svyLibTemplateTargetoptions || []; |
| | | return options.some((opt) => opt.isabnormal === 1); |
| | | } |
| | | // 语音模板 |
| | | else if (this.templateForm.templateType === 2) { |
| | | const options = question.ivrLibaScriptTargetoptionList || []; |
| | | return options.some((opt) => opt.isabnormal === 1); |
| | | } |
| | | |
| | | return false; |
| | | }; |
| | | }, |
| | | // 筛选后的题目列表 |
| | | filteredQuestionList() { |
| | | let filtered = this.questionList; |
| | | console.log(this.questionnaireCategorys); |
| | | |
| | | // 筛选满意度题目 |
| | | if (this.templateForm.templateType === 1) { |
| | |
| | | if (this.queryParams.scriptTopic) { |
| | | const keyword = this.queryParams.scriptTopic.toLowerCase(); |
| | | filtered = filtered.filter( |
| | | (q) => q.scriptTopic && q.scriptTopic.toLowerCase().includes(keyword) |
| | | (q) => q.scriptTopic && q.criptTopic.toLowerCase().includes(keyword) |
| | | ); |
| | | } |
| | | |
| | |
| | | /** 配置变更处理 */ |
| | | handleConfigChange(question) { |
| | | this.$nextTick(() => { |
| | | const index = this.filteredQuestionList.findIndex( |
| | | (q) => q.id === question.id |
| | | ); |
| | | const index = this.filteredQuestionList.findIndex((q) => q.id === question.id); |
| | | console.log(index,'index'); |
| | | |
| | | if (index !== -1) { |
| | | const formRef = this.$refs.configForm && this.$refs.configForm[index]; |
| | | if (formRef) { |
| | |
| | | const changedItems = this.questionList.filter((q) => q.hasChanges); |
| | | this.changedCount = changedItems.length; |
| | | this.hasChanges = changedItems.length > 0; |
| | | |
| | | // 强制更新视图 |
| | | this.$forceUpdate(); |
| | | }, |
| | | |
| | | /** 检查题目是否有异常选项 */ |
| | | checkHasAbnormalOptions(question) { |
| | | if (this.templateForm.templateType === 1) { |
| | | return (question.svyLibTemplateTargetoptions || []).some( |
| | | (opt) => opt.isabnormal === 1 |
| | | ); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | return (question.ivrLibaScriptTargetoptionList || []).some( |
| | | (opt) => opt.isabnormal === 1 |
| | | ); |
| | | } |
| | | return false; |
| | | }, |
| | | |
| | | /** 保存单个题目配置 */ |
| | | async saveSingleConfig(question) { |
| | | if (!question.hasChanges) return; |
| | | async saveSingleConfig(question, skipAbnormalCheck = false) { |
| | | // 检查是否有变更 |
| | | if (!question.hasChanges && !skipAbnormalCheck) { |
| | | this.$message.info("当前配置无变化"); |
| | | return; |
| | | } |
| | | |
| | | const index = this.filteredQuestionList.findIndex( |
| | | (q) => q.id === question.id |
| | | ); |
| | | console.log(index, "filteredQuestionList"); |
| | | // 检查是否有异常选项 |
| | | if (!skipAbnormalCheck && !this.checkHasAbnormalOptions(question)) { |
| | | this.$confirm( |
| | | "该题目没有设置异常选项,必须先配置异常选项才能保存。是否立即配置?", |
| | | "提示", |
| | | { |
| | | confirmButtonText: "去配置", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | this.openOptionDialog(question); |
| | | }) |
| | | .catch(() => {}); |
| | | return; |
| | | } |
| | | |
| | | const index = this.questionList.findIndex((q) => q.id === question.id); |
| | | if (index === -1) return; |
| | | |
| | | const formRef = this.$refs.configForm && this.$refs.configForm[index]; |
| | | if (!formRef) return; |
| | | |
| | | const valid = await formRef.validate(); |
| | | if (!valid) { |
| | | // 验证表单 |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (error) { |
| | | this.$message.warning("请先完成必填项"); |
| | | return; |
| | | } |
| | |
| | | reportDeptName: reportDeptNames.join(","), |
| | | }; |
| | | |
| | | // 如果需要,也更新选项数据 |
| | | if (question.hasChanges && this.templateForm.templateType === 1) { |
| | | questions[questionIndex].svyLibTemplateTargetoptions = |
| | | question.svyLibTemplateTargetoptions || []; |
| | | } else if ( |
| | | question.hasChanges && |
| | | this.templateForm.templateType === 2 |
| | | ) { |
| | | questions[questionIndex].ivrLibaScriptTargetoptionList = |
| | | question.ivrLibaScriptTargetoptionList || []; |
| | | } |
| | | |
| | | // 更新模板 |
| | | updatedTemplateDetail[questionsField] = questions; |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | /** 处理保存成功 */ |
| | | /** 处理保存成功 */ |
| | | handleSaveSuccess(question) { |
| | | // 同时更新题目顶层字段 |
| | |
| | | async handleBatchSave() { |
| | | if (!this.hasChanges || this.batchSaving) return; |
| | | |
| | | // 获取有变更的题目 |
| | | const changedQuestions = this.questionList.filter((q) => q.hasChanges); |
| | | if (changedQuestions.length === 0) { |
| | | this.$message.info("没有需要保存的配置变更"); |
| | | return; |
| | | } |
| | | |
| | | // 检查是否有题目缺少异常选项 |
| | | const questionsWithoutAbnormal = changedQuestions.filter( |
| | | (q) => !this.checkHasAbnormalOptions(q) |
| | | ); |
| | | |
| | | if (questionsWithoutAbnormal.length > 0) { |
| | | this.$confirm( |
| | | `有 ${questionsWithoutAbnormal.length} 个题目没有设置异常选项,必须配置异常选项后才能保存。是否先去配置?`, |
| | | "提示", |
| | | { |
| | | confirmButtonText: "去配置", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // 打开第一个没有异常选项的题目的配置对话框 |
| | | this.openOptionDialog(questionsWithoutAbnormal[0]); |
| | | }) |
| | | .catch(() => {}); |
| | | return; |
| | | } |
| | | |
| | | this.$confirm("确定要保存所有修改过的配置吗?", "批量保存", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | |
| | | .then(async () => { |
| | | this.batchSaving = true; |
| | | |
| | | const changedQuestions = this.questionList.filter( |
| | | (q) => q.hasChanges |
| | | ); |
| | | const results = []; |
| | | |
| | | for (const question of changedQuestions) { |
| | | try { |
| | | await this.saveSingleConfig(question); |
| | | // 跳过异常检查,因为在上面已经检查过了 |
| | | await this.saveSingleConfig(question, true); |
| | | results.push({ |
| | | id: question.id, |
| | | success: |
| | | !question.hasChanges && |
| | | question.saveStatus?.type === "success", |
| | | success: !question.hasChanges, |
| | | }); |
| | | } catch (error) { |
| | | results.push({ |
| | | id: question.id, |
| | | success: false, |
| | | error: error.message, |
| | | }); |
| | | } |
| | | } |
| | |
| | | this.$message.warning( |
| | | `成功保存 ${successCount} 个,失败 ${failCount} 个` |
| | | ); |
| | | // 可以显示具体哪些失败了 |
| | | const failedQuestions = results |
| | | .filter((r) => !r.success) |
| | | .map((r) => r.id); |
| | | console.error("保存失败的题目ID:", failedQuestions); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | |
| | | this.previewAnswer = ""; |
| | | this.previewVisible = true; |
| | | }, |
| | | /** 检查题目是否有异常选项 */ |
| | | checkHasAbnormalOptions(question) { |
| | | if (this.templateForm.templateType === 1) { |
| | | return (question.svyLibTemplateTargetoptions || []).some( |
| | | (opt) => opt.isabnormal === 1 |
| | | ); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | return (question.ivrLibaScriptTargetoptionList || []).some( |
| | | (opt) => opt.isabnormal === 1 |
| | | ); |
| | | } |
| | | return false; |
| | | }, |
| | | |
| | | /** 打开选项管理对话框 */ |
| | | /** 修改选项管理对话框的打开方法,保存原始选项 */ |
| | | openOptionDialog(question) { |
| | | this.editingQuestion = question; |
| | | |
| | | // 保存原始选项的快照 |
| | | if (this.templateForm.templateType === 1) { |
| | | this.editingQuestion.originalOptions = JSON.parse( |
| | | JSON.stringify(question.svyLibTemplateTargetoptions || []) |
| | | ); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | this.editingQuestion.originalOptions = JSON.parse( |
| | | JSON.stringify(question.ivrLibaScriptTargetoptionList || []) |
| | | ); |
| | | } |
| | | |
| | | // 复制选项数据 |
| | | if (this.templateForm.templateType === 1) { |
| | | this.currentOptions = JSON.parse( |
| | | JSON.stringify(question.svyLibTemplateTargetoptions || []) |
| | | ).map((opt) => ({ |
| | | ).map((opt, index) => ({ |
| | | ...opt, |
| | | id: opt.id, |
| | | id: opt.id || `temp_${Date.now()}_${index}`, |
| | | targetvalue: opt.optioncontent || "", |
| | | isabnormal: opt.isabnormal || 0, |
| | | })); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | this.currentOptions = JSON.parse( |
| | | JSON.stringify(question.ivrLibaScriptTargetoptionList || []) |
| | | ).map((opt) => ({ |
| | | ).map((opt, index) => ({ |
| | | ...opt, |
| | | id: opt.id || `temp_${Date.now()}_${index}`, |
| | | targetvalue: opt.targetvalue || "", |
| | | isabnormal: opt.isabnormal || 0, |
| | | })); |
| | |
| | | /** 添加新选项 */ |
| | | addNewOption() { |
| | | this.currentOptions.push({ |
| | | id: Date.now(), // 临时ID |
| | | id: `temp_${Date.now()}_${this.currentOptions.length}`, |
| | | targetvalue: "", |
| | | isabnormal: 0, |
| | | isNew: true, |
| | |
| | | |
| | | /** 删除选项 */ |
| | | removeOption(index) { |
| | | this.currentOptions.splice(index, 1); |
| | | this.$confirm("确定要删除这个选项吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | this.currentOptions.splice(index, 1); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | /** 保存选项配置 */ |
| | | async saveOptions() { |
| | | try { |
| | | // 验证必填项 |
| | | for (const option of this.currentOptions) { |
| | | for (let i = 0; i < this.currentOptions.length; i++) { |
| | | const option = this.currentOptions[i]; |
| | | if (!option.targetvalue || option.targetvalue.trim() === "") { |
| | | this.$message.warning("请填写所有选项内容"); |
| | | this.$message.warning(`第 ${i + 1} 个选项内容不能为空`); |
| | | return; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | // 判断选项是否发生变化 |
| | | let isOptionsChanged = false; |
| | | |
| | | if (this.templateForm.templateType === 1) { |
| | | const originalOptions = |
| | | this.editingQuestion.svyLibTemplateTargetoptions || []; |
| | | isOptionsChanged = this.checkOptionsChanged( |
| | | originalOptions, |
| | | this.currentOptions, |
| | | "questionnaire" |
| | | ); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | const originalOptions = |
| | | this.editingQuestion.ivrLibaScriptTargetoptionList || []; |
| | | isOptionsChanged = this.checkOptionsChanged( |
| | | originalOptions, |
| | | this.currentOptions, |
| | | "voice" |
| | | ); |
| | | } |
| | | |
| | | // 保存逻辑 - 更新题目对象的选项数据 |
| | | if (this.templateForm.templateType === 1) { |
| | | this.editingQuestion.svyLibTemplateTargetoptions = |
| | |
| | | ...opt, |
| | | optioncontent: opt.targetvalue, |
| | | isabnormal: opt.isabnormal, |
| | | // 清除临时字段 |
| | | targetvalue: undefined, |
| | | isNew: undefined, |
| | | })); |
| | | } else if (this.templateForm.templateType === 2) { |
| | | this.editingQuestion.ivrLibaScriptTargetoptionList = |
| | | this.currentOptions; |
| | | this.currentOptions.map((opt) => ({ |
| | | ...opt, |
| | | // 清除临时字段 |
| | | isNew: undefined, |
| | | })); |
| | | } |
| | | |
| | | // 触发配置变更检查 |
| | | this.handleConfigChange(this.editingQuestion); |
| | | // 如果选项有变化,则设置题目为有变更状态 |
| | | if (isOptionsChanged) { |
| | | this.editingQuestion.hasChanges = true; |
| | | this.updateChangedStatus(); |
| | | } |
| | | |
| | | this.$message.success("选项配置保存成功"); |
| | | this.optionDialogVisible = false; |
| | |
| | | this.$message.error("保存选项失败"); |
| | | } |
| | | }, |
| | | |
| | | /** 修改保存单个题目配置方法,添加异常选项检查 */ |
| | | async saveSingleConfig(question) { |
| | | // 检查是否有异常选项 |
| | | if (!this.checkHasAbnormalOptions(question)) { |
| | | this.$confirm("该题目没有设置异常选项,是否先配置选项?", "提示", { |
| | | confirmButtonText: "去配置", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | this.openOptionDialog(question); |
| | | }) |
| | | .catch(() => {}); |
| | | return; |
| | | /** 检查选项是否发生变化 */ |
| | | checkOptionsChanged(originalOptions, newOptions, templateType) { |
| | | // 如果数量不同,则一定变化了 |
| | | if (originalOptions.length !== newOptions.length) { |
| | | return true; |
| | | } |
| | | |
| | | // 原有的保存逻辑... |
| | | if (!question.hasChanges) return; |
| | | // 比较每个选项的内容和异常状态 |
| | | for (let i = 0; i < originalOptions.length; i++) { |
| | | const original = originalOptions[i]; |
| | | const current = newOptions[i]; |
| | | |
| | | const index = this.filteredQuestionList.findIndex( |
| | | (q) => q.id === question.id |
| | | ); |
| | | |
| | | if (index === -1) return; |
| | | |
| | | const formRef = this.$refs.configForm && this.$refs.configForm[index]; |
| | | if (!formRef) return; |
| | | |
| | | const valid = await formRef.validate(); |
| | | if (!valid) { |
| | | this.$message.warning("请先完成必填项"); |
| | | return; |
| | | } |
| | | |
| | | // 继续原有的保存逻辑... |
| | | question.saving = true; |
| | | question.saveStatus = null; |
| | | |
| | | try { |
| | | // ... 原有的保存逻辑不变 |
| | | } catch (error) { |
| | | // ... 错误处理不变 |
| | | } finally { |
| | | question.saving = false; |
| | | } |
| | | }, |
| | | |
| | | /** 批量保存时也要检查 */ |
| | | async handleBatchSave() { |
| | | if (!this.hasChanges || this.batchSaving) return; |
| | | |
| | | // 检查所有有变更的题目是否都有异常选项 |
| | | const changedQuestions = this.questionList.filter((q) => q.hasChanges); |
| | | const questionsWithoutAbnormal = changedQuestions.filter( |
| | | (q) => !this.checkHasAbnormalOptions(q) |
| | | ); |
| | | |
| | | if (questionsWithoutAbnormal.length > 0) { |
| | | this.$confirm( |
| | | `有 ${questionsWithoutAbnormal.length} 个题目没有设置异常选项,请先配置选项。是否继续?`, |
| | | "提示", |
| | | { |
| | | confirmButtonText: "继续", |
| | | cancelButtonText: "去配置", |
| | | type: "warning", |
| | | if (templateType === "questionnaire") { |
| | | // 问卷模板比较 |
| | | if ( |
| | | original.optioncontent !== current.targetvalue || |
| | | original.isabnormal !== current.isabnormal |
| | | ) { |
| | | return true; |
| | | } |
| | | ) |
| | | .then(() => { |
| | | // 继续执行批量保存 |
| | | this.executeBatchSave(changedQuestions); |
| | | }) |
| | | .catch(() => { |
| | | // 可以在这里跳转到第一个没有异常选项的题目 |
| | | if (questionsWithoutAbnormal.length > 0) { |
| | | this.openOptionDialog(questionsWithoutAbnormal[0]); |
| | | } |
| | | }); |
| | | } else { |
| | | this.executeBatchSave(changedQuestions); |
| | | } |
| | | }, |
| | | |
| | | /** 执行批量保存 */ |
| | | async executeBatchSave(changedQuestions) { |
| | | this.$confirm("确定要保存所有修改过的配置吗?", "批量保存", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | this.batchSaving = true; |
| | | |
| | | const results = []; |
| | | for (const question of changedQuestions) { |
| | | try { |
| | | // 这里调用修改后的saveSingleConfig方法 |
| | | await this.saveSingleConfig(question); |
| | | results.push({ |
| | | id: question.id, |
| | | success: |
| | | !question.hasChanges && |
| | | question.saveStatus?.type === "success", |
| | | }); |
| | | } catch (error) { |
| | | results.push({ |
| | | id: question.id, |
| | | success: false, |
| | | }); |
| | | } |
| | | } else if (templateType === "voice") { |
| | | // 语音模板比较 |
| | | if ( |
| | | original.targetvalue !== current.targetvalue || |
| | | original.isabnormal !== current.isabnormal |
| | | ) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.batchSaving = false; |
| | | // ... 后续处理不变 |
| | | }) |
| | | .catch(() => { |
| | | this.batchSaving = false; |
| | | }); |
| | | return false; |
| | | }, |
| | | |
| | | /** 获取异常选项统计 */ |
| | | getAbnormalStats(question) { |
| | | if (this.templateForm.templateType === 1) { |
| | |
| | | } |
| | | return { total: 0, abnormal: 0, warning: 0, normal: 0 }; |
| | | }, |
| | | |
| | | /** 搜索 */ |
| | | handleQuery() { |
| | | // 仅筛选显示,不需要重新加载 |