mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: Terminology / SQL Sample Management add enabled control
This commit is contained in:
@@ -5,7 +5,9 @@ export const professionalApi = {
|
||||
request.get(`/system/terminology/page/${pageNum}/${pageSize}`, {
|
||||
params,
|
||||
}),
|
||||
|
||||
updateEmbedded: (data: any) => request.put('/system/terminology', data),
|
||||
deleteEmbedded: (params: any) => request.delete('/system/terminology', { data: params }),
|
||||
getOne: (id: any) => request.get(`/system/terminology/${id}`),
|
||||
enable: (id: any, enabled: any) => request.get(`/system/data-training/${id}/enable/${enabled}`),
|
||||
}
|
||||
|
||||
@@ -321,6 +321,20 @@ const onRowFormClose = () => {
|
||||
const deleteHandlerItem = (idx: number) => {
|
||||
pageForm.value.other_words = pageForm.value.other_words!.filter((_, index) => index !== idx)
|
||||
}
|
||||
|
||||
const changeStatus = (id: any, val: any) => {
|
||||
professionalApi
|
||||
.enable(id, val + '')
|
||||
.then(() => {
|
||||
ElMessage({
|
||||
message: t('common.save_success'),
|
||||
type: 'success',
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
search()
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -407,6 +421,17 @@ const deleteHandlerItem = (idx: number) => {
|
||||
<div v-else>{{ t('training.all_data_sources') }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('ds.status')" width="180">
|
||||
<template #default="scope">
|
||||
<div @click.stop style="display: flex; align-items: center">
|
||||
<el-switch
|
||||
v-model="scope.row.enabled"
|
||||
size="small"
|
||||
@change="(val: any) => changeStatus(scope.row.id, val)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="create_time"
|
||||
sortable
|
||||
|
||||
Reference in New Issue
Block a user