mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-10 18:26:55 +08:00
Merge branch 'main' of https://github.com/dataease/SQLBot
This commit is contained in:
@@ -158,7 +158,7 @@ const afterTreeInit = () => {
|
||||
}
|
||||
|
||||
const copyLoading = ref(false)
|
||||
const emit = defineEmits(['nodeClick'])
|
||||
const emit = defineEmits(['nodeClick', 'deleteCurResource'])
|
||||
|
||||
function createNewObject() {
|
||||
addOperation({ opt: 'newLeaf' })
|
||||
@@ -230,7 +230,8 @@ const operation = (opt: string, data: SQTreeNode) => {
|
||||
dashboardApi.delete_resource({ id: data.id }).then(() => {
|
||||
ElMessage.success(t('dashboard.delete_success'))
|
||||
getTree()
|
||||
dashboardStore.setCurComponent(null)
|
||||
dashboardStore.canvasDataInit()
|
||||
emit('deleteCurResource')
|
||||
})
|
||||
})
|
||||
} else if (opt === 'rename') {
|
||||
|
||||
@@ -48,6 +48,13 @@ const mounted = computed(() => {
|
||||
function createNew() {
|
||||
resourceTreeRef.value?.createNewObject()
|
||||
}
|
||||
|
||||
const stateInit = () => {
|
||||
state.canvasDataPreview = []
|
||||
state.canvasStylePreview = {}
|
||||
state.canvasViewInfoPreview = {}
|
||||
state.dashboardInfo = {}
|
||||
}
|
||||
const loadCanvasData = (params: any) => {
|
||||
dataInitState.value = false
|
||||
load_resource_prepare(
|
||||
@@ -100,6 +107,7 @@ defineExpose({
|
||||
:cur-canvas-type="'dashboard'"
|
||||
:show-position="showPosition"
|
||||
@node-click="resourceNodeClick"
|
||||
@delete-cur-resource="stateInit"
|
||||
/>
|
||||
</el-aside>
|
||||
<el-container
|
||||
|
||||
@@ -95,16 +95,12 @@ const handleEditDatasource = (res: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
const handleQuestion = (ele: any) => {
|
||||
datasourceApi.check(ele).then((res: any) => {
|
||||
if (res) {
|
||||
router.push({
|
||||
path: '/chat/index',
|
||||
query: {
|
||||
start_chat: ele.id,
|
||||
},
|
||||
})
|
||||
}
|
||||
const handleQuestion = (id: string) => {
|
||||
router.push({
|
||||
path: '/chat/index',
|
||||
query: {
|
||||
start_chat: id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -294,7 +290,7 @@ const back = () => {
|
||||
:type-name="ele.type_name"
|
||||
:num="ele.num"
|
||||
:description="ele.description"
|
||||
@question="handleQuestion(ele)"
|
||||
@question="handleQuestion"
|
||||
@edit="handleEditDatasource(ele)"
|
||||
@del="deleteHandler(ele)"
|
||||
@data-table-detail="dataTableDetail(ele)"
|
||||
|
||||
Reference in New Issue
Block a user