Skip to content

Commit 153d496

Browse files
committed
fix: 关闭语音开关后清除模型id
--bug=1047571 --user=刘瑞斌 【github#1376】【应用】在应用处关闭语音模型开关,去模型处删除模型,提示关联了一个应用,无法删除该模型。 https://www.tapd.cn/57709429/s/1601917
1 parent a377ce6 commit 153d496

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

ui/src/views/application/ApplicationSetting.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
327327
</el-tooltip> -->
328328
</div>
329-
<el-switch size="small" v-model="applicationForm.stt_model_enable" />
329+
<el-switch size="small" v-model="applicationForm.stt_model_enable" @change="sttModelEnableChange"/>
330330
</div>
331331
</template>
332332
<el-select
@@ -406,7 +406,7 @@
406406
<el-icon class="mr-4"><Setting /></el-icon>
407407
设置
408408
</el-button>
409-
<el-switch size="small" v-model="applicationForm.tts_model_enable" />
409+
<el-switch size="small" v-model="applicationForm.tts_model_enable" @change="ttsModelEnableChange"/>
410410
</div>
411411
</div>
412412
</template>
@@ -820,6 +820,19 @@ function ttsModelChange() {
820820
}
821821
}
822822
823+
function ttsModelEnableChange() {
824+
if (!applicationForm.value.tts_model_enable) {
825+
applicationForm.value.tts_model_id = ''
826+
applicationForm.value.tts_type = 'BROWSER'
827+
}
828+
}
829+
830+
function sttModelEnableChange() {
831+
if (!applicationForm.value.stt_model_enable) {
832+
applicationForm.value.stt_model_id = ''
833+
}
834+
}
835+
823836
function getProvider() {
824837
loading.value = true
825838
model

ui/src/workflow/nodes/base-node/index.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
6161
</el-tooltip> -->
6262
</div>
63-
<el-switch size="small" v-model="form_data.stt_model_enable" />
63+
<el-switch size="small" v-model="form_data.stt_model_enable" @change="sttModelEnableChange"/>
6464
</div>
6565
</template>
6666

@@ -141,7 +141,7 @@
141141
</el-icon>
142142
设置
143143
</el-button>
144-
<el-switch size="small" v-model="form_data.tts_model_enable" />
144+
<el-switch size="small" v-model="form_data.tts_model_enable" @change="ttsModelEnableChange"/>
145145
</div>
146146
</div>
147147
</template>
@@ -323,6 +323,20 @@ function ttsModelChange() {
323323
}
324324
}
325325
326+
function ttsModelEnableChange() {
327+
if (!form_data.value.tts_model_enable) {
328+
form_data.value.tts_model_id = ''
329+
form_data.value.tts_type = 'BROWSER'
330+
}
331+
}
332+
333+
function sttModelEnableChange() {
334+
if (!form_data.value.stt_model_enable) {
335+
form_data.value.stt_model_id = ''
336+
}
337+
}
338+
339+
326340
const openTTSParamSettingDialog = () => {
327341
const model_id = form_data.value.tts_model_id
328342
if (!model_id) {

0 commit comments

Comments
 (0)