mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-09 01:36:57 +08:00
refactor: dashboard preview
This commit is contained in:
Vendored
-1
@@ -39,7 +39,6 @@ declare module '@vue/runtime-core' {
|
||||
ElRow: typeof import('element-plus-secondary/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus-secondary/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus-secondary/es')['ElSelect']
|
||||
ElSlider: typeof import('element-plus-secondary/es')['ElSlider']
|
||||
ElStep: typeof import('element-plus-secondary/es')['ElStep']
|
||||
ElSteps: typeof import('element-plus-secondary/es')['ElSteps']
|
||||
ElSwitch: typeof import('element-plus-secondary/es')['ElSwitch']
|
||||
|
||||
@@ -40,10 +40,12 @@ const getResourceNewName = (cmd: string) => {
|
||||
}
|
||||
|
||||
const optInit = (params: any) => {
|
||||
// @ts-ignore
|
||||
state.dialogTitle = getTitle(params.cmd)
|
||||
state.showParentSelected = params.parentSelect
|
||||
state.targetInfo = params.data
|
||||
resourceDialogShow.value = true
|
||||
// @ts-ignore
|
||||
resourceForm.name = getResourceNewName(params.cmd)
|
||||
}
|
||||
|
||||
@@ -52,8 +54,6 @@ const loading = ref(false)
|
||||
const pid = ref()
|
||||
const id = ref()
|
||||
const cmd = ref('')
|
||||
const treeRef = ref()
|
||||
const filterText = ref('')
|
||||
const resourceForm = reactive({
|
||||
pid: '',
|
||||
pName: '',
|
||||
@@ -105,6 +105,7 @@ const editeInit = (param: SQTreeNode) => {
|
||||
const propsTree = {
|
||||
label: 'name',
|
||||
children: 'children',
|
||||
// @ts-ignore
|
||||
isLeaf: node => !node.children?.length
|
||||
}
|
||||
|
||||
@@ -118,6 +119,7 @@ const saveResource = () => {
|
||||
name: resourceForm.name,
|
||||
type: 'dashboard'
|
||||
}
|
||||
// @ts-ignore
|
||||
dashboardApi.addResource(params).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
@@ -133,7 +135,8 @@ const nodeClick = (data: SQTreeNode) => {
|
||||
resourceForm.pName = data.name as string
|
||||
}
|
||||
|
||||
const filterMethod = value => {
|
||||
const filterMethod = (value:any) => {
|
||||
// @ts-ignore
|
||||
state.tData = [...tData].filter(item => item.name.includes(value))
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ const addOperation = (params: any) => {
|
||||
const newCanvasUrl = '#/canvas?opt=create' + params.data?.id ? `&pid=${params.data?.id}` : ''
|
||||
window.open(newCanvasUrl, '_blank')
|
||||
} else {
|
||||
// @ts-ignore
|
||||
resourceGroupOptRef.value?.optInit(params)
|
||||
}
|
||||
}
|
||||
@@ -309,8 +310,7 @@ defineExpose({
|
||||
<Icon><icon_edit_outlined class="svg-icon"/></Icon>
|
||||
</el-icon>
|
||||
<HandleMore
|
||||
@handle-command="
|
||||
cmd => addOperation(cmd, data, cmd === 'newFolder' ? 'folder' : 'leaf')
|
||||
@handle-command=" (cmd:string) => addOperation({cmd})
|
||||
"
|
||||
:menu-list="resourceTypeList"
|
||||
:icon-name="icon_add_outlined"
|
||||
|
||||
Reference in New Issue
Block a user