This commit is contained in:
zyl
2025-12-22 17:28:40 +08:00
parent 8a9560bb17
commit cf113a0137
4 changed files with 42 additions and 8 deletions

View File

@ -1,7 +1,7 @@
server: server:
host: 127.0.0.1 host: 127.0.0.1
port: 8848 port: 8848
path: C:\Users\MSI\AppData\Roaming\dzsp_shijingjun_offline_Y_save path: C:\Users\Administrator\AppData\Roaming\dzsp_shijingjun_offline_Y_save
poi: poi:
global: global:
enabled: false enabled: false

View File

@ -106,6 +106,18 @@ const initTreeCallBack = () => {
TsApi.queryTsSource(formData).then(async res => { TsApi.queryTsSource(formData).then(async res => {
console.log('queryTsSource', res) console.log('queryTsSource', res)
if (res.code == 200) { if (res.code == 200) {
res.data.sort((a: any, b: any) => {
if ((a.treeIndex || a.treeIndex == 0) && (b.treeIndex || b.treeIndex == 0)) {
return a.treeIndex - b.treeIndex
}
if (a.treeIndex) {
return -1;
}
if (b.treeIndex) {
return 1;
}
return 0;
});
for (let i = res.data.length - 1; i >= 0; i--) { for (let i = res.data.length - 1; i >= 0; i--) {
res.data[i].svg = await cusNodeIcon(res.data[i]); res.data[i].svg = await cusNodeIcon(res.data[i]);

View File

@ -217,14 +217,24 @@ const lists = ref([])
const elementList = ref([]) const elementList = ref([])
let input2 = ref('') let input2 = ref('')
watch(input2, (val) => { watch(input2, (val) => {
console.log("activIndex", activIndex.value)
console.log("input2", val) console.log("input2", val)
console.log("lists", lists) console.log("lists", lists)
console.log("lists", lists.value.filter(item => item.name.includes(val))) console.log("lists", lists.value.filter(item => item.name.includes(val)))
if (dataType.value == 'tree') {
if (activIndex.value == 0) {
getModelTypeList(input2.value)
} else if (activIndex.value == 1) {
getGraphTypeList(input2.value)
}
} else {
if (val == '') { if (val == '') {
handleTabClick(tabs[activIndex.value], activIndex.value) handleTabClick(tabs[activIndex.value], activIndex.value)
} else { } else {
lists.value = lists.value.filter(item => item.name.includes(val)) lists.value = lists.value.filter(item => item.name.includes(val))
} }
}
treeRef.value && treeRef.value!.filter(val) treeRef.value && treeRef.value!.filter(val)
}) })
// 当前选择类型的Id // 当前选择类型的Id
@ -240,6 +250,7 @@ const filterNode = (value: string, data: Tree) => {
const handleTabClick = (item, index) => { const handleTabClick = (item, index) => {
activIndex.value = index activIndex.value = index
currentTypeId.value = "" currentTypeId.value = ""
input2.value = ""
elementList.value = [] elementList.value = []
console.log(item) console.log(item)
@ -290,14 +301,21 @@ const getModelListByType = (id) => {
} }
} }
// 获取模型类型列表 // 获取模型类型列表
let getModelTypeList = async () => { let getModelTypeList = async (modelName = null) => {
let res = await ModelApi.modelTypeList() let Obj = {modelName}
if (modelName == null)
delete Obj.modelName
let res = await ModelApi.modelTypeList(Obj)
if (res.code == 200) { if (res.code == 200) {
modelTypes.value = res.data modelTypes.value = res.data
treeData.value = modelTypes.value
} }
} }
let getGraphTypeList = async () => { let getGraphTypeList = async (militaryName = null) => {
let res = await GraphApi.modelTypeList() let Obj = {militaryName}
if (militaryName == null)
delete Obj.militaryName
let res = await GraphApi.modelTypeList(Obj)
if (res.code == 200) { if (res.code == 200) {
graphTypes.value = res.data graphTypes.value = res.data
} }

View File

@ -219,8 +219,12 @@ const handleNodeClick = (data: Tree, node, TreeNode, event) => {
form.name = data.name + '-' + zNode.value.sourceName form.name = data.name + '-' + zNode.value.sourceName
} }
const drawLine = () => { const drawLine = () => {
$(".newEvent")[0].style.display = "none"
let draw = new YJ.Draw.DrawPolyline(window['earth_ts']) let draw = new YJ.Draw.DrawPolyline(window['earth_ts'])
draw.start((error, p) => { draw.start((error, p) => {
if (p != undefined) {
$(".newEvent")[0].style.display = "block"
}
positions.value = p positions.value = p
}) })
} }