Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
fb746d0ec2
@ -14,7 +14,7 @@ import {
|
|||||||
import createAxios from '/@/utils/axios'
|
import createAxios from '/@/utils/axios'
|
||||||
|
|
||||||
export const getNodeListReq = () => {
|
export const getNodeListReq = () => {
|
||||||
return createAxios<never, RequestReturnType>({
|
return createAxios<never, RequestReturnType<nodeType[]>>({
|
||||||
url: '/api/node/list',
|
url: '/api/node/list',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
})
|
})
|
||||||
@ -52,7 +52,7 @@ export const submitNodeConfigReq = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getLinkListReq = (data: getLinkType) => {
|
export const getLinkListReq = (data: getLinkType) => {
|
||||||
return createAxios<never, RequestReturnType<linkType>>({
|
return createAxios<never, RequestReturnRowType<linkType[]>>({
|
||||||
url: '/api/node/link/list',
|
url: '/api/node/link/list',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data,
|
data: data,
|
||||||
|
@ -945,7 +945,7 @@ $paginationHeight: 32px;
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 200px;
|
height: 150px;
|
||||||
.el-button {
|
.el-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ $paginationHeight: 32px;
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
height: 200px;
|
height: 150px;
|
||||||
.el-button {
|
.el-button {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #asideMain>
|
<template #asideMain>
|
||||||
<el-tree
|
<el-tree
|
||||||
|
ref="nodeTreeRef"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
:props="replaceTreeProps"
|
:props="replaceTreeProps"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
@node-click="nodeClick"
|
@node-click="nodeClick"
|
||||||
@node-contextmenu="nodeContextMenu"
|
@node-contextmenu="nodeContextMenu"
|
||||||
|
highlight-current
|
||||||
></el-tree>
|
></el-tree>
|
||||||
</template>
|
</template>
|
||||||
<template #mainHeader>
|
<template #mainHeader>
|
||||||
@ -53,7 +55,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #mainMain>
|
<template #mainMain>
|
||||||
<el-table W></el-table>
|
<el-table :data="linkTableData">
|
||||||
|
<el-table-column prop="linkName" label="链路名称" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="protocol" label="协议类型" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="params" label="参数" align="center"></el-table-column>
|
||||||
|
<el-table-column prop="nodeName" label="节点名称" align="center"></el-table-column>
|
||||||
|
<el-table-column fixed="right" label="操作" min-width="80" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="tableOperate">
|
||||||
|
<a>编辑</a>
|
||||||
|
<a>|</a>
|
||||||
|
<el-popconfirm title="确定删除么?">
|
||||||
|
<template #reference>
|
||||||
|
<a>删除</a>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
</template>
|
</template>
|
||||||
</Container>
|
</Container>
|
||||||
<ContextMenu v-model:visible="nodeContextMenuVisible" :pos="nodeContextMenuPos">
|
<ContextMenu v-model:visible="nodeContextMenuVisible" :pos="nodeContextMenuPos">
|
||||||
@ -80,10 +100,10 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ElInput, ElButton, ElTree, ElTable, ElMessage } from 'element-plus'
|
import { ElInput, ElButton, ElTree, ElTable, ElMessage } from 'element-plus'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance, TreeInstance } from 'element-plus'
|
||||||
import { Search, Plus, Upload, Download } from '@element-plus/icons-vue'
|
import { Search, Plus, Upload, Download } from '@element-plus/icons-vue'
|
||||||
import { ref } from 'vue'
|
import { ref, nextTick } from 'vue'
|
||||||
import { nodeType } from '/@/views/backend/node/type'
|
import { nodeType, linkType } from '/@/views/backend/node/type'
|
||||||
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'
|
import ContextMenu from '/@/views/backend/auth/model/contextMenu.vue'
|
||||||
import Container from '/@/components/container/index.vue'
|
import Container from '/@/components/container/index.vue'
|
||||||
import {
|
import {
|
||||||
@ -100,11 +120,11 @@ import {
|
|||||||
submitNodeConfigReq,
|
submitNodeConfigReq,
|
||||||
} from '/@/api/backend/node/request'
|
} from '/@/api/backend/node/request'
|
||||||
import { getInstitutionalTreeListReq } from '/@/api/backend/org/request'
|
import { getInstitutionalTreeListReq } from '/@/api/backend/org/request'
|
||||||
import { getTreeDataReturnType } from '/@/views/backend/auth/org/type'
|
|
||||||
const searchTreeInput = ref('')
|
const searchTreeInput = ref('')
|
||||||
|
|
||||||
const replaceTreeProps = { label: 'nodeName' }
|
const replaceTreeProps = { label: 'nodeName' }
|
||||||
const treeData = ref([])
|
const nodeTreeRef = ref<TreeInstance>()
|
||||||
|
const treeData = ref<nodeType[]>([])
|
||||||
|
|
||||||
const nodeVisible = ref(false)
|
const nodeVisible = ref(false)
|
||||||
const nodeTitle = ref('新增节点')
|
const nodeTitle = ref('新增节点')
|
||||||
@ -272,10 +292,14 @@ const closeNodeForm = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getNodeList = () => {
|
const getNodeList = () => {
|
||||||
getNodeListReq()
|
return getNodeListReq()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
treeData.value = res.data!
|
treeData.value = res.data!
|
||||||
|
clickTreeData.value = res.data![0]
|
||||||
|
nextTick(() => {
|
||||||
|
nodeTreeRef.value?.setCurrentKey(res.data![0].id)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res.msg ?? '查询失败')
|
ElMessage.error(res.msg ?? '查询失败')
|
||||||
}
|
}
|
||||||
@ -284,7 +308,25 @@ const getNodeList = () => {
|
|||||||
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getNodeList()
|
|
||||||
|
const linkTableData = ref<linkType[]>([])
|
||||||
|
|
||||||
|
const getLinkData = (nodeId: string) => {
|
||||||
|
getLinkListReq({ nodeId })
|
||||||
|
.then((res) => {
|
||||||
|
if (res.rows) {
|
||||||
|
linkTableData.value = res.rows
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg ?? '查询失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
ElMessage.error(err?.response?.data?.msg ?? '查询失败')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getNodeList().then(() => {
|
||||||
|
getLinkData(clickTreeData.value!.id!)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -313,6 +355,19 @@ getNodeList()
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
width: 290px;
|
width: 290px;
|
||||||
}
|
}
|
||||||
|
.tableOperate {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
a {
|
||||||
|
margin: 5px;
|
||||||
|
color: #0064aa;
|
||||||
|
font-weight: 600;
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.modelOperate {
|
.modelOperate {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
Loading…
Reference in New Issue
Block a user