This commit is contained in:
dataeaseShu
2025-07-23 16:19:35 +08:00
17 changed files with 232 additions and 317 deletions
@@ -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
+7 -11
View File
@@ -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)"