Browse Source

bug修复/知识图谱demo

master
xuhuajiao 4 months ago
parent
commit
6eb486d7c9
  1. 2
      .env.development
  2. 1
      .env.production
  3. 1
      package.json
  4. 19
      src/views/AIAssistant/AIDigitalHuman/index.vue
  5. 6
      src/views/AIAssistant/AIknowledgeGraph/index.vue
  6. 16
      src/views/archivesManage/managementLibrary/anjuan/tableList.vue
  7. 16
      src/views/archivesManage/managementLibrary/file/index.vue
  8. 16
      src/views/archivesManage/managementLibrary/juannei/index.vue
  9. 16
      src/views/archivesManage/managementLibrary/project/index.vue
  10. 7
      src/views/archivesStatistics/ureport/designer/index.vue
  11. 16
      src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue
  12. 16
      src/views/collectReorganizi/collectionLibrary/file/index.vue
  13. 16
      src/views/collectReorganizi/collectionLibrary/juannei/index.vue
  14. 1
      src/views/collectReorganizi/collectionLibrary/mixins/index.js
  15. 16
      src/views/collectReorganizi/collectionLibrary/project/index.vue
  16. 1744
      src/views/components/echarts/data.json
  17. 150
      src/views/components/echarts/graph-relation.vue
  18. 252
      src/views/components/echarts/graph.vue
  19. 160
      src/views/components/echarts/graph1.vue
  20. 85
      src/views/components/echarts/graph2.vue
  21. 253
      src/views/components/echarts/graph4.vue
  22. 217
      src/views/components/echarts/graph5.vue
  23. 219
      src/views/components/echarts/graph6.vue
  24. 6
      src/views/system/archivesCategory/index.vue
  25. 28
      src/views/system/role/index.vue

2
.env.development

@ -6,7 +6,7 @@ ENV = 'development'
VUE_APP_BASE_API = 'http://192.168.99.72:11100' VUE_APP_BASE_API = 'http://192.168.99.72:11100'
VUE_APP_WS_API = 'ws://192.168.99.72:11100' VUE_APP_WS_API = 'ws://192.168.99.72:11100'
#VUE_APP_BASE_API = 'http://192.168.99.107:11100'
# VUE_APP_BASE_API = 'http://192.168.99.107:11100'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

1
.env.production

@ -2,7 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
# VUE_APP_BASE_API = 'https://openapitest.aiyxlib.com'
VUE_APP_BASE_API = 'http://192.168.99.107:11100' VUE_APP_BASE_API = 'http://192.168.99.107:11100'
# VUE_APP_BASE_API = 'http://27.19.215.77:11100' # VUE_APP_BASE_API = 'http://27.19.215.77:11100'
# VUE_APP_BASE_API = 'http://27.16.212.58:11100' # VUE_APP_BASE_API = 'http://27.16.212.58:11100'

1
package.json

@ -77,6 +77,7 @@
"qs": "^6.10.1", "qs": "^6.10.1",
"quill": "^1.3.7", "quill": "^1.3.7",
"quill-image-resize-module": "^3.0.0", "quill-image-resize-module": "^3.0.0",
"relation-graph": "^2.2.10",
"screenfull": "4.2.0", "screenfull": "4.2.0",
"sm-crypto": "^0.3.2", "sm-crypto": "^0.3.2",
"sortablejs": "1.8.4", "sortablejs": "1.8.4",

19
src/views/AIAssistant/AIDigitalHuman/index.vue

@ -1,6 +1,8 @@
<template> <template>
<div class="app-container category-container" style="position: relative; height: calc(100vh - 140px);"> <div class="app-container category-container" style="position: relative; height: calc(100vh - 140px);">
<iframe id="myIframe" style="position: absolute; top: 0; left: -34%; border: none; z-index: 9;" width="100%" height="100%" src="https://f.3dman.cn/art/sDpbYwwJ/fbx/CdYqVH95/index.html" />
<iframe id="myIframe" style="position: absolute; top: 0; left: -34%; border: none; z-index: 9;" width="100%" height="100%" :src="frameUrl" />
<!-- http://27.16.218.195:17001/art/sDpbYwwJ/fbx/CdYqVH95/index.html -->
<!-- https://f.3dman.cn/art/sDpbYwwJ/fbx/CdYqVH95/index.html -->
<div class="chat-wrapper"> <div class="chat-wrapper">
<div ref="chatContent" class="chat-content"> <div ref="chatContent" class="chat-content">
<Message <Message
@ -37,6 +39,7 @@ export default {
}, },
data() { data() {
return { return {
frameUrl: '',
message: '', message: '',
isSendButtonDisabled: true, isSendButtonDisabled: true,
isBotReplying: false, isBotReplying: false,
@ -54,6 +57,20 @@ export default {
created() { created() {
}, },
mounted() { mounted() {
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
console.log('linkSrc', linkSrc)
const lastColonIndex = linkSrc.lastIndexOf(':')
const firstSlashIndex = linkSrc.indexOf('/', lastColonIndex)
let newUrl
if (firstSlashIndex === -1) {
newUrl = linkSrc.slice(0, lastColonIndex)
} else {
newUrl = linkSrc.slice(0, lastColonIndex) + linkSrc.slice(firstSlashIndex)
}
console.log(newUrl)
this.frameUrl = newUrl + ':17001/art/sDpbYwwJ/fbx/CdYqVH95/index.html'
this.sendWelcomeMessage() this.sendWelcomeMessage()
this.updateSendButtonState() this.updateSendButtonState()
}, },

6
src/views/AIAssistant/AIknowledgeGraph/index.vue

@ -35,7 +35,8 @@
<div v-if="selectedCategory.isType === 2" class="container-right"> <div v-if="selectedCategory.isType === 2" class="container-right">
<span class="right-top-line" /> <span class="right-top-line" />
<span class="left-bottom-line" /> <span class="left-bottom-line" />
<img style="display: block; height: calc(100vh - 184px);" src="@/assets/images/graph-img.png" alt=" ">
<!-- <img style="display: block; height: calc(100vh - 184px);" src="@/assets/images/graph-img.png" alt=" "> -->
<graph />
</div> </div>
</div> </div>
</div> </div>
@ -44,10 +45,11 @@
<script> <script>
import crudCategory from '@/api/system/category/category' import crudCategory from '@/api/system/category/category'
import CRUD, { presenter, header } from '@crud/crud' import CRUD, { presenter, header } from '@crud/crud'
import graph from '@/views/components/echarts/graph.vue'
export default { export default {
name: 'AIknowledgeGraph', name: 'AIknowledgeGraph',
components: { },
components: { graph },
cruds() { cruds() {
return [ return [
CRUD({ CRUD({

16
src/views/archivesManage/managementLibrary/anjuan/tableList.vue

@ -253,14 +253,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

16
src/views/archivesManage/managementLibrary/file/index.vue

@ -194,14 +194,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
this.selections = this.crud.selections this.selections = this.crud.selections
}, },
// //

16
src/views/archivesManage/managementLibrary/juannei/index.vue

@ -242,14 +242,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

16
src/views/archivesManage/managementLibrary/project/index.vue

@ -167,14 +167,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

7
src/views/archivesStatistics/ureport/designer/index.vue

@ -8,7 +8,7 @@ export default {
name: 'Ureport', name: 'Ureport',
data() { data() {
return { return {
src: '/ureport/designer',
src: '',
height: document.documentElement.clientHeight - 94.5 + 'px;', height: document.documentElement.clientHeight - 94.5 + 'px;',
loading: true loading: true
} }
@ -18,10 +18,13 @@ export default {
this.loading = false this.loading = false
}, 230) }, 230)
const that = this const that = this
const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
this.src = linkSrc + '/ureport/designer'
// this.src = '/ureport/designer'
window.onresize = function temp() { window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 94.5 + 'px;' that.height = document.documentElement.clientHeight - 94.5 + 'px;'
} }
console.log('8888888')
} }
} }
</script> </script>

16
src/views/collectReorganizi/collectionLibrary/anjuan/tableList.vue

@ -222,14 +222,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

16
src/views/collectReorganizi/collectionLibrary/file/index.vue

@ -200,14 +200,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
this.selections = this.crud.selections this.selections = this.crud.selections
}, },
// //

16
src/views/collectReorganizi/collectionLibrary/juannei/index.vue

@ -184,14 +184,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

1
src/views/collectReorganizi/collectionLibrary/mixins/index.js

@ -41,6 +41,7 @@ export const collectionLibraryCrud = {
}, },
handleSearch(categoryLevel) { handleSearch(categoryLevel) {
this.parentsData.$refs.classifyTree.setCurrentKey(null) this.parentsData.$refs.classifyTree.setCurrentKey(null)
console.log('this.parentsData', this.parentsData)
console.log(this.parentsData.smartQuery) console.log(this.parentsData.smartQuery)
// this.smartQuery = { // this.smartQuery = {
// 'retention': null, // 'retention': null,

16
src/views/collectReorganizi/collectionLibrary/project/index.vue

@ -165,14 +165,14 @@ export default {
}, },
// table - row // table - row
clickRowHandler(row) { clickRowHandler(row) {
this.parentsData.smartQuery = {
'retention': null,
'security_class': null,
'doc_type': null,
'medium_type': null,
'archive_year': null,
'fonds_no': null
}
// this.parentsData.smartQuery = {
// 'retention': null,
// 'security_class': null,
// 'doc_type': null,
// 'medium_type': null,
// 'archive_year': null,
// 'fonds_no': null
// }
if (this.timer) { if (this.timer) {
clearTimeout(this.timer) clearTimeout(this.timer)
} }

1744
src/views/components/echarts/data.json
File diff suppressed because it is too large
View File

150
src/views/components/echarts/graph-relation.vue

@ -0,0 +1,150 @@
<template>
<div>
<div ref="myPage" style="height:calc(100vh);">
<RelationGraph
ref="graphRef"
:options="graphOptions"
:on-node-click="onNodeClick"
:on-line-click="onLineClick"
>
<template #node="{node}">
<div @mouseover="showNodeTips(node, $event)" @mouseout="hideNodeTips(node, $event)">
<div class="c-my-rg-node">
<i style="font-size: 30px;" :class="node.data.myicon" />
</div>
<div style="color: forestgreen;font-size: 16px;position: absolute;width: 160px;height:25px;line-height: 25px;margin-top:5px;margin-left:-48px;text-align: center;background-color: rgba(66,187,66,0.2);">
{{ node.text }}
</div>
</div>
</template>
</RelationGraph>
<div v-if="isShowNodeTipsPanel" :style="{left: nodeMenuPanelPosition.x + 'px', top: nodeMenuPanelPosition.y + 'px' }" style="z-index: 999;padding:10px;background-color: #ffffff;border:#eeeeee solid 1px;box-shadow: 0px 0px 8px #cccccc;position: absolute;">
<div style="line-height: 25px;padding-left: 10px;color: #888888;font-size: 12px;">节点名称{{ currentNode.text }}</div>
<div class="c-node-menu-item">id:{{ currentNode.text }}</div>
<div class="c-node-menu-item">图标:{{ currentNode.data.myicon }}</div>
</div>
</div>
</div>
</template>
<script>
// main.js使Vue.use(RelationGraph); 使relation-graph
import RelationGraph from 'relation-graph'
export default {
name: 'Demo',
components: { RelationGraph },
data() {
return {
isShowCodePanel: false,
isShowNodeTipsPanel: false,
nodeMenuPanelPosition: { x: 0, y: 0 },
currentNode: {},
graphOptions: {
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultNodeColor: 'rgba(66,187,66,1)',
defaultJunctionPoint: 'border'
// "Graph "
}
}
},
mounted() {
this.showGraph()
},
methods: {
// https://relation-graph.com/#/docs/start
showGraph() {
const __graph_json_data = {
rootId: '1',
nodes: [
// data
{ id: '1', text: '文书档案', data: { myicon: 'el-icon-star-on' }},
{ id: '2', text: '档案分类', data: { myicon: 'el-icon-star-on' }},
{ id: '21', text: '行政管理', data: { myicon: 'el-icon-setting' }},
{ id: '22', text: '党群工作', data: { myicon: 'el-icon-setting' }},
{ id: '23', text: '经营管理', data: { myicon: 'el-icon-setting' }},
{ id: '24', text: '生成管理', data: { myicon: 'el-icon-setting' }},
{ id: '3', text: '保管期限', data: { myicon: 'el-icon-star-on' }},
{ id: '31', text: '永久', data: { myicon: 'el-icon-setting' }},
{ id: '32', text: '定期30年', data: { myicon: 'el-icon-setting' }},
{ id: '33', text: '定期10年', data: { myicon: 'el-icon-setting' }},
{ id: '4', text: '年度', data: { myicon: 'el-icon-star-on' }},
{ id: '41', text: '2022', data: { myicon: 'el-icon-s-promotion' }},
{ id: '42', text: '2023', data: { myicon: 'el-icon-s-promotion' }},
{ id: '43', text: '2024', data: { myicon: 'el-icon-s-promotion' }},
{ id: '5', text: '密级', data: { myicon: 'el-icon-star-on' }},
{ id: '51', text: '公开', data: { myicon: 'el-icon-sunny' }},
{ id: '52', text: '限制', data: { myicon: 'el-icon-sunny' }},
{ id: '53', text: '秘密', data: { myicon: 'el-icon-sunny' }},
{ id: '54', text: '机密', data: { myicon: 'el-icon-sunny' }},
{ id: '55', text: '绝密', data: { myicon: 'el-icon-sunny' }}
],
lines: [
{ from: '1', to: '2', text: 'class' },
{ from: '1', to: '3', text: 'retention' },
{ from: '1', to: '4', text: 'year' },
{ from: '1', to: '5', text: 'classification' },
{ from: '2', to: '21', text: 'class_01' },
{ from: '2', to: '22', text: 'class_02' },
{ from: '2', to: '23', text: 'class_03' },
{ from: '2', to: '24', text: 'class_04' },
{ from: '3', to: '31', text: 'retention_01' },
{ from: '3', to: '32', text: 'retention_02' },
{ from: '3', to: '33', text: 'retention_03' },
{ from: '4', to: '41', text: 'year_01' },
{ from: '4', to: '42', text: 'year_02' },
{ from: '4', to: '43', text: 'year_03' },
{ from: '5', to: '51', text: 'classification_01' },
{ from: '5', to: '52', text: 'classification_02' },
{ from: '5', to: '53', text: 'classification_03' },
{ from: '5', to: '54', text: 'classification_04' },
{ from: '5', to: '55', text: 'classification_05' }
]
}
this.$refs.graphRef.setJsonData(__graph_json_data, (graphInstance) => {
//
})
},
onNodeClick(nodeObject, $event) {
console.log('onNodeClick:', nodeObject)
},
onLineClick(lineObject, linkObject, $event) {
console.log('onLineClick:', lineObject)
},
showNodeTips(nodeObject, $event) {
this.currentNode = nodeObject
const _base_position = this.$refs.myPage.getBoundingClientRect()
console.log('showNodeMenus:', $event.clientX, $event.clientY, _base_position)
this.isShowNodeTipsPanel = true
this.nodeMenuPanelPosition.x = $event.clientX - _base_position.x + 10
this.nodeMenuPanelPosition.y = $event.clientY - _base_position.y + 10
},
hideNodeTips(nodeObject, $event) {
this.isShowNodeTipsPanel = false
}
}
}
</script>
<style lang="scss">
</style>
<style lang="scss" scoped>
.c-my-rg-node {
height:80px;line-height: 80px;border-radius: 50%;cursor: pointer;
display: flex;
place-items: center;
justify-content: center;
}
.c-node-menu-item{
line-height: 30px;padding-left: 10px;cursor: pointer;color: #444444;font-size: 14px;border-top:#efefef solid 1px;
}
.c-node-menu-item:hover{
background-color: rgba(66,187,66,0.2);
}
</style>

252
src/views/components/echarts/graph.vue

@ -0,0 +1,252 @@
<template>
<div>
<div ref="myPage" class="my-graph" style="height: calc(100vh - 184px);">
<RelationGraph
ref="graphRef"
:options="graphOptions"
:on-node-click="onNodeClick"
:on-line-click="onLineClick"
:on-canvas-click="onCanvasClick"
>
<template #node="{node}">
<div @mouseover="showNodeTips(node, $event)" @mouseout="hideNodeTips(node, $event)">
<div :class="node.id === 1 ? 'c-my-rg-node c-big-style': 'c-my-rg-node '" :style="{'height': node.width + 'px', 'line-height': node.width + 'px'}">
{{ node.size }}
</div>
</div>
</template>
<template #graph-plug>
<!-- <div
style="position:absolute;z-index:700;left:20px;top:20px;height:70px;padding: 20px;border: #efefef solid 1px;color: #555555;border-radius: 10px;background-color: rgba(255,255,255,0.79);font-size: 12px;"
/> -->
<div v-if="isShowNodeTipsPanel" :style="{left: nodeMenuPanelPosition.x + 'px', top: nodeMenuPanelPosition.y + 'px' }" style="z-index: 999;padding:10px;background-color: #ffffff;border:#eeeeee solid 1px;box-shadow: 0px 0px 8px #cccccc;position: absolute;">
<div style="line-height: 25px;padding-left: 10px;color: #888888;font-size: 12px;">节点名称{{ currentNode.text }}</div>
<div class="c-node-menu-item">id:{{ currentNode.id }}</div>
</div>
</template>
</RelationGraph>
</div>
</div>
</template>
<script>
import RelationGraph from 'relation-graph'
const __graph_json_data_small = {
'rootId': '1',
'nodes': [
{ id: '1', text: '文书档案', force_weight: 10000, color: '#ec6941', borderColor: '#ff875e', width: 150, height: 150 },
{ id: '2', text: '档案分类' },
{ id: '21', text: '行政管理' },
{ id: '22', text: '党群工作' },
{ id: '23', text: '经营管理' },
{ id: '24', text: '生成管理' },
{ id: '3', text: '保管期限' },
{ id: '31', text: '永久' },
{ id: '32', text: '定期30年' },
{ id: '33', text: '定期10年' },
{ id: '4', text: '年度' },
{ id: '41', text: '2022' },
{ id: '42', text: '2023' },
{ id: '43', text: '2024' },
{ id: '5', text: '密级' },
{ id: '51', text: '公开' },
{ id: '52', text: '限制' },
{ id: '53', text: '秘密' },
{ id: '54', text: '机密' },
{ id: '55', text: '绝密' }
],
'lines': [
{ from: '1', to: '2', text: 'class', dashType: 1 },
{ from: '1', to: '3', text: 'retention', dashType: 2 },
{ from: '1', to: '4', text: 'year', dashType: 3 },
{ from: '1', to: '5', text: 'classification', dashType: 4 },
{ from: '2', to: '21', text: 'class_01' },
{ from: '2', to: '22', text: 'class_02' },
{ from: '2', to: '23', text: 'class_03' },
{ from: '2', to: '24', text: 'class_04' },
{ from: '3', to: '31', text: 'retention_01' },
{ from: '3', to: '32', text: 'retention_02' },
{ from: '3', to: '33', text: 'retention_03' },
{ from: '4', to: '41', text: 'year_01' },
{ from: '4', to: '42', text: 'year_02' },
{ from: '4', to: '43', text: 'year_03' },
{ from: '5', to: '51', text: 'classification_01' },
{ from: '5', to: '52', text: 'classification_02' },
{ from: '5', to: '53', text: 'classification_03' },
{ from: '5', to: '54', text: 'classification_04' },
{ from: '5', to: '55', text: 'classification_05' }
]
}
export default {
name: 'Demo',
components: { RelationGraph },
data() {
return {
allData: __graph_json_data_small,
isShowCodePanel: false,
isShowNodeTipsPanel: false,
nodeMenuPanelPosition: { x: 0, y: 0 },
currentNode: {},
graphOptions: {
defaultNodeBorderWidth: 0,
allowSwitchLineShape: true,
allowSwitchJunctionPoint: true,
defaultLineShape: 1,
disableNodeclickEffect: true,
layout: {
label: '自动布局',
layoutName: 'force',
layoutClassName: 'seeks-layout-force'
},
// defaultJunctionPoint: 'border',
defaultLineColor: 'rgba(0,0,0,0.8)'
}
}
},
mounted() {
this.showGraph()
this.resizeTimer = setInterval(async() => {
// const graphInstance = this.$refs.graphRef.getInstance();
// await graphInstance.zoomToFit();
}, 3000)
},
beforeDestroy() {
console.log('beforeDestroy:clear timer')
clearInterval(this.resizeTimer)
},
methods: {
async showGraph() {
// const data = __graph_json_data_small
const graphInstance = this.$refs.graphRef.getInstance()
await this.stopForceIfNeed()
await graphInstance.setJsonData(this.allData)
// if (this.useBigData) {
// await graphInstance.setZoom(30)
// } else {
// await graphInstance.setZoom(80)
// }
},
async stopForceIfNeed() {
const graphInstance = this.$refs.graphRef.getInstance()
await graphInstance.stopAutoLayout()
},
async updateLayouterOptions() {
await this.stopForceIfNeed()
const graphInstance = this.$refs.graphRef.getInstance()
graphInstance.layouter.maxLayoutTimes = this.graphOptions.layout.maxLayoutTimes
graphInstance.layouter.force_node_repulsion = this.graphOptions.layout.force_node_repulsion
graphInstance.layouter.force_line_elastic = this.graphOptions.layout.force_line_elastic
setTimeout(async() => {
await graphInstance.startAutoLayout()
}, 500)
},
onNodeClick(nodeObject, $event) {
console.log('onNodeClick:', nodeObject)
const allChildIds = this.deepGeAlltChildIds(nodeObject)
const graphInstance = this.$refs.graphRef.getInstance()
for (const node of graphInstance.getNodes()) {
if (allChildIds.includes(node.id)) {
node.opacity = 1
node.color = 'rgb(116,2,173)'
} else {
node.opacity = 0.1
node.color = undefined
}
}
for (const link of graphInstance.getLinks()) {
if (allChildIds.includes(link.fromNode.id) && allChildIds.includes(link.toNode.id)) {
link.relations.forEach(line => {
line.color = 'rgb(116,2,173)'
})
} else {
link.relations.forEach(line => {
line.color = ''
})
}
}
},
deepGeAlltChildIds(node, ids = []) {
if (ids.includes(node.id)) return
ids.push(node.id)
for (const cNode of node.lot.childs) {
this.deepGeAlltChildIds(cNode, ids)
}
return ids
},
onCanvasClick($event) {
console.log('onCanvasClick:')
const graphInstance = this.$refs.graphRef.getInstance()
for (const node of graphInstance.getNodes()) {
console.log('node', node)
node.opacity = 1
this.allData.nodes.forEach((item, index) => {
if (item.id === node.id) {
node.color = item.color
}
})
}
for (const link of graphInstance.getLinks()) {
link.relations.forEach(line => {
line.color = undefined
})
}
},
onLineClick(lineObject, linkObject, $event) {
console.log('onLineClick:', lineObject)
},
showNodeTips(nodeObject, $event) {
this.currentNode = nodeObject
const _base_position = this.$refs.graphRef.getInstance().options.fullscreen ? { x: 0, y: 0 } : this.$refs.myPage.getBoundingClientRect()
console.log('showNodeMenus:', this.$refs.graphRef.getInstance().options.fullscreen, $event.clientX, $event.clientY, _base_position)
this.isShowNodeTipsPanel = true
this.nodeMenuPanelPosition.x = $event.clientX - _base_position.x + 10
this.nodeMenuPanelPosition.y = $event.clientY - _base_position.y + 10
},
hideNodeTips(nodeObject, $event) {
this.isShowNodeTipsPanel = false
}
}
}
</script>
<style>
</style>
<style lang="scss" scoped>
::v-deep .rel-toolbar{
color: #000;
.c-current-zoom{
color: #000;
}
}
// .my-graph{
// // background: linear-gradient(to right, rgb(16, 185, 129), rgb(101, 163, 13));
// }
.c-my-rg-node {
border-radius: 50%;
cursor: pointer;
height: 80px;
line-height: 80px;
display: flex;
place-items: center;
justify-content: center;
align-items: center;
}
.c-node-menu-item{
line-height: 30px;padding-left: 10px;cursor: pointer;color: #444444;font-size: 14px;border-top:#efefef solid 1px;
}
.c-node-menu-item:hover{
background-color: rgba(66,187,66,0.2);
}
.c-big-style{
font-size: 30px;
}
</style>

160
src/views/components/echarts/graph1.vue

@ -0,0 +1,160 @@
<template>
<div id="atlasChart" style="width:100%; height: calc(100vh - 184px);" />
</template>
<script>
// import * as echarts from 'echarts'
import echarts from 'echarts'
export default {
data() {
return {
categories: [],
types: ['未作答', '较好', '一般', '较差'],
datas: [
{ id: '1', name: '集合与逻辑用语', category: 1, url: 'knowMath' },
{ id: '2', name: '等式与不等式', category: 1, url: 'knowMath' },
{ id: '3', name: '基本初等函数', category: 1, url: 'knowMath' },
{ id: '4', name: '三角函数', category: 1, url: 'knowMath' },
{ id: '5', name: '平面向量', category: 1, url: 'knowMath' },
{ id: '6', name: '复数', category: 1, url: 'knowMath' },
{ id: '7', name: '空间向量与立体几何', category: 1, url: 'knowMath' },
{ id: '8', name: '直线与圆', category: 1, url: 'knowMath' },
{ id: '9', name: '平面解析几何', category: 1, url: 'knowMath' },
{ id: '10', name: '数列', category: 1, url: 'knowMath' },
{ id: '11', name: '导数', category: 1, url: 'knowMath' },
{ id: '12', name: '计数原理与概率统计', category: 1, url: 'knowMath' }
],
links: [
{ target: '1', name: 'link02', des: 'link02des' },
{ target: '2', name: 'link03', des: 'link03des' },
{ target: '3', name: 'link04', des: 'link05des' },
{ target: '4', name: 'link04', des: 'link05des' },
{ target: '5', name: 'link04', des: 'link05des' },
{ target: '6', name: 'link04', des: 'link05des' },
{ target: '7', name: 'link04', des: 'link05des' },
{ target: '8', name: 'link04', des: 'link05des' },
{ target: '9', name: 'link04', des: 'link05des' },
{ target: '10', name: 'link04', des: 'link05des' },
{ target: '11', name: 'link04', des: 'link05des' },
{ target: '12', name: 'link04', des: 'link05des' }
]
}
},
created() {
this.$nextTick(function() {
this.montheahcrt()
})
},
methods: {
montheahcrt() {
var myChart = echarts.init(document.getElementById('atlasChart'))
for (var i = 0; i < this.types.length; i++) {
this.categories[i] = {
name: this.types[i]
}
}
var option = {
animationDurationUpdate: 1500, //
animationEasingUpdate: 'quinticInOut', //
color: ['#008000', '#cc6633', '#c00', '#ccc'],
title: {
text: '掌握情况:', //
bottom: '20px', //
left: '20px', //
textStyle: { //
fontSize: 16,
fontWeight: 550,
color: '#666'
}
},
grid: {
top: 0,
bottom: 0,
left: 0,
right: 0
},
legend: [{
// selectedMode: 'single',
//
bottom: '20px',
left: '120px',
textStyle: { //
fontSize: 16,
fontWeight: 550,
color: '#666'
},
icon: 'circle', // 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'
itemGap: 35, //
data: this.categories.map(function(a) {
return a.name
})
}],
series: [{
type: 'graph', // :
layout: 'force', //
focusNodeAdjacency: true, //
draggable: true, //
symbolSize: 23, //
roam: 'scale', // , 'scale' 'move' true
edgeSymbol: ['circle', 'arrow'], // edgeSymbol: ['circle', 'arrow']
edgeSymbolSize: [2, 10], //
edgeLabel: {
normal: {
show: false,
formatter: function(x) {
return x.data.name
},
textStyle: {
fontSize: 14,
color: '#000'
}
}
},
force: { //
layoutAnimation: true,
// xAxisIndex : 0, //x
// yAxisIndex : 0, //y
gravity: 0.02, //
edgeLength: 30, // repulsion[10, 50]
repulsion: 300 //
// repulsion: 3000, //
// edgeLength: 80 // repulsion[10, 50]
},
lineStyle: {
normal: {
width: 1,
color: '#4b565b',
// color: 'target', //
curveness: 0.1,
type: 'dashed' // 'dotted'线 'solid'线 'dashed'线线
}
},
label: {
show: true,
position: 'top',
formatter: '{b}',
textStyle: {
fontSize: 16,
fontWeight: 600,
color: '#666'
}
},
//
data: this.datas,
links: this.links,
categories: this.categories
}]
}
myChart.setOption(option)
window.addEventListener('resize', function() {
myChart.resize()
})
}
}
}
</script>
<style scoped>
</style>

85
src/views/components/echarts/graph2.vue

@ -0,0 +1,85 @@
<template>
<div id="atlasChart" style="width:100%; height: calc(100vh - 184px);" />
</template>
<script>
// import * as echarts from 'echarts'
import echarts from 'echarts'
require('echarts/theme/macarons')
import data from './data.json'
export default {
data() {
return {
datas: data
}
},
created() {
this.$nextTick(function() {
this.montheahcrt()
})
},
methods: {
montheahcrt() {
var myChart = echarts.init(document.getElementById('atlasChart'))
this.datas.nodes.forEach(function(node) {
node.label = {
show: node.symbolSize > 30
}
})
var option = {
title: {
text: '',
subtext: '',
top: 'bottom',
left: 'right'
},
tooltip: {},
legend: [
{
// selectedMode: 'single',
data: this.datas.categories.map(function(a) {
return a.name
})
}
],
animationDuration: 1500,
animationEasingUpdate: 'quinticInOut',
series: [
{
name: 'Les Miserables',
type: 'graph',
legendHoverLink: false,
layout: 'none',
data: this.datas.nodes,
links: this.datas.links,
categories: this.datas.categories,
roam: true,
label: {
position: 'right',
formatter: '{b}'
},
lineStyle: {
color: 'source',
curveness: 0.3
},
emphasis: {
focus: 'adjacency',
lineStyle: {
width: 10
}
}
}
]
}
myChart.setOption(option)
window.addEventListener('resize', function() {
myChart.resize()
})
}
}
}
</script>
<style scoped>
</style>

253
src/views/components/echarts/graph4.vue

@ -0,0 +1,253 @@
<template>
<div id="chart" class="chart" />
</template>
<script>
// import { expendNodes } from './mock'
var echarts = require('echarts/lib/echarts')
require('echarts/lib/chart/graph')
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
const data = [
{
id: 1,
name: '测试节点',
categary: '1',
symbolSize: 60
},
{
id: 2,
name: '测试节点',
categary: '1',
symbolSize: 40
},
{
id: 3,
name: '测试节点',
categary: '2'
},
{
id: 4,
name: '测试节点',
categary: ''
},
{
id: 5,
name: '测试节点测试节点',
categary: ''
},
{
id: 6,
name: '测试节点',
categary: '2'
},
{
id: 7,
name: '测试节点',
categary: ''
},
{
id: 8,
name: '测试节点',
categary: ''
},
{
id: 9,
name: '测试节点',
categary: ''
},
{
id: 10,
name: '测试节点',
categary: ''
}
]
// 线
const linkData = [
{ source: '2', target: '3', name: '' },
{ source: '3', target: '4', name: '' },
{ source: '3', target: '5', name: '' },
{ source: '5', target: '6', name: '' },
{ source: '5', target: '7', name: '' },
{ source: '5', target: '8', name: '' },
{ source: '9', target: '10', name: '' },
{ source: '10', target: '9', name: '' },
{ source: '1', target: '2', name: '' },
{ source: '1', target: '10', name: '' }
]
export default {
name: 'Charts',
props: {
// chartList: {
// type: Object,
// required: true
// }
},
data() {
return {
myChart: '',
seriesData: data,
seriesLinks: linkData,
categories: [],
lastClickId: '',
colors: ['#a3d2ca', '#056676', '#ea2c62', '#16a596', '#03c4a1', '#f5a25d',
'#8CD282', '#32e0c4', '#00FAE1', '#f05454']
}
},
watch: {
// chartList: {
// handler(val) {
// this.formatData(val || [], true)
// }
// }
},
beforeDestroy() {},
methods: {
/**
* 节点点击事件
*/
async nodeClick(params) {
const index = this.seriesData.findIndex(
(item) => item.id === params.data.id
)
console.log('点了节点:' + index + 1, 'clicked')
},
/**
* 设置echarts配置项,重绘画布
*/
initCharts() {
// const that = this
if (!this.myChart) {
this.myChart = echarts.init(document.getElementById('chart'))
this.myChart.on('click', (params) => {
if (params.dataType === 'node') {
//
this.nodeClick(params)
}
})
}
//
const option = {
//
animationDurationUpdate: 500,
animationEasingUpdate: 'quinticInOut',
tooltip: {
show: false
},
series: [
{
type: 'graph',
layout: 'force',
legendHoverLink: true, // hover()
hoverAnimation: true, //
focusNodeAdjacency: true,
edgeLabel: {
position: 'middle', //
normal: {
show: true,
textStyle: {
fontSize: 12
},
position: 'middle',
formatter: function(x) {
return x.data.name
}
}
},
edgeSymbol: ['', 'arrow'],
force: {
edgeLength: 15,
repulsion: 200
},
roam: true,
draggable: true, //
itemStyle: {
normal: {
color: '#00FAE1',
cursor: 'pointer',
// color:Math.floor(Math.random()*16777215).toString(16),
// color: ['#fc853e','#28cad8','#9564bf','#bd407e','#28cad8','#fc853e','#e5a214'],
label: {
show: true,
position: [-10, -15],
textStyle: {
//
color: '#fff', //
fontStyle: 'normal', // 'normal' 'italic' 'oblique'
fontWeight: 'bold', // 'normal''bold''bolder''lighter'100 | 200 | 300 | 400...
fontFamily: 'sans-serif', //
fontSize: 12 //
}
},
nodeStyle: {
brushType: 'both',
borderColor: 'rgba(255,215,0,0.4)',
borderWidth: 1
}
},
//
emphasis: {
shadowColor: '#00FAE1',
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 40
}
},
lineStyle: {
width: 2
},
label: {
fontSize: 18
},
symbolSize: 24, //
links: this.seriesLinks,
data: this.seriesData,
categories: this.categories,
cursor: 'pointer'
}
]
}
// 使
this.myChart.setOption(option)
},
/**
* 格式化数据到表格需要的数据
*/
formatData(list, reset = false) {
const that = this
const nodes = list.seriesData
this.seriesData = []
this.seriesLinks = []
let colorIndex = 0
const data = []
const loadedCat = []
nodes.forEach((item, index) => {
if (item.categary && loadedCat.indexOf(item.categary) === -1) {
colorIndex = Math.floor((Math.random() * that.colors.length))
loadedCat.push(item.categary)
this.categories.push({ name: item.categary })
}
item.itemStyle = {
color: that.colors[colorIndex],
borderColor: '#ffffff'
}
data.push(item)
})
this.seriesData.push(...data)
this.seriesLinks.push(...list.linksData)
this.initCharts()
}
}
}
</script>
<style scoped>
.chart {
height: 100%;
}
</style>

217
src/views/components/echarts/graph5.vue

@ -0,0 +1,217 @@
<template>
<div id="knowledge-graph" style="width: 100%; height: calc(100vh - 184px);" />
</template>
<script>
import echarts from 'echarts'
export default {
name: 'KnowledgeGraph',
mounted() {
this.initChart()
},
methods: {
initChart() {
// echarts
const chart = echarts.init(document.getElementById('knowledge-graph'))
//
// const data = [
// { name: '', itemStyle: { color: '#cc6633' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#cc3399' }},
// { name: '', itemStyle: { color: '#cc3399' }},
// { name: '30', itemStyle: { color: '#cc3399' }},
// { name: '10', itemStyle: { color: '#cc3399' }},
// { name: '', itemStyle: { color: '#6699cc' }},
// { name: '2022', itemStyle: { color: '#6699cc' }},
// { name: '2023', itemStyle: { color: '#6699cc' }},
// { name: '2024', itemStyle: { color: '#6699cc' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }}
// ]
const data = [
{ name: '文书档案' },
{ name: '档案分类' },
{ name: '行政管理' },
{ name: '党群工作' },
{ name: '经营管理' },
{ name: '生成管理' },
{ name: '保管期限' },
{ name: '永久' },
{ name: '定期30年' },
{ name: '定期10年' },
{ name: '年度' },
{ name: '2022' },
{ name: '2023' },
{ name: '2024' },
{ name: '密级' },
{ name: '公开' },
{ name: '限制' },
{ name: '秘密' },
{ name: '机密' },
{ name: '绝密' }
]
const links = [
{ source: '文书档案', target: '档案分类' },
{ source: '文书档案', target: '年度' },
{ source: '文书档案', target: '保管期限' },
{ source: '文书档案', target: '密级' },
{ source: '保管期限', target: '永久' },
{ source: '保管期限', target: '定期30年' },
{ source: '保管期限', target: '定期10年' },
{ source: '年度', target: '2022' },
{ source: '年度', target: '2023' },
{ source: '年度', target: '2024' },
{ source: '密级', target: '公开' },
{ source: '密级', target: '限制' },
{ source: '密级', target: '秘密' },
{ source: '密级', target: '机密' },
{ source: '密级', target: '绝密' },
{ source: '档案分类', target: '行政管理' },
{ source: '档案分类', target: '党群工作' },
{ source: '档案分类', target: '经营管理' },
{ source: '档案分类', target: '生成管理' }
]
//
const option = {
tooltip: {},
series: [
{
type: 'graph',
layout: 'force',
data: data,
links: links,
cursor: 'pointer',
color: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(255, 149, 0, 0.1)' // 0%
}, {
offset: 1,
color: 'rgba(255, 149, 0, 1)' // 100%
}],
global: false // false
},
legendHoverLink: true, // hover()
hoverAnimation: true, //
focusNodeAdjacency: true, //
draggable: true, //
symbolSize: 60, //
roam: 'scale', // , 'scale' 'move' true
edgeSymbol: ['', 'arrow'], // edgeSymbol: ['circle', 'arrow']
edgeSymbolSize: [2, 6], //
edgeLabel: {
// position: 'middle', //
// normal: {
// show: true,
// textStyle: {
// fontSize: 12
// },
// position: 'middle',
// formatter: function(x) {
// return x.data.name
// }
// }
},
itemStyle: {
normal: {
// color: '#00FAE1',
cursor: 'pointer',
// color:Math.floor(Math.random()*16777215).toString(16),
label: {
show: true,
// position: [-10, -15],
textStyle: {
//
color: '#000', //
fontStyle: 'normal', // 'normal' 'italic' 'oblique'
fontWeight: 'bold',
fontFamily: 'sans-serif', //
fontSize: 14 //
}
},
nodeStyle: {
brushType: 'both',
borderColor: 'rgba(255,215,0,0.4)',
borderWidth: 1
}
}
//
// emphasis: {
// shadowColor: '#00FAE1',
// shadowOffsetX: 0,
// shadowOffsetY: 0,
// shadowBlur: 40
// }
},
label: {
show: true,
position: 'top',
formatter: '{b}',
textStyle: {
fontSize: 20,
fontWeight: 600,
color: '#000'
}
},
lineStyle: {
width: 2,
color: {
type: 'linear',
x: 0,
y: 0,
x2: 1,
y2: 1,
colorStops: [{
offset: 0, color: 'rgba(0, 255, 244, 0.01)' // 0%
}, {
offset: 1, color: 'rgba(0, 255, 244, 1)' // 100%
}],
global: false
},
curveness: 0.2//
},
force: { //
layoutAnimation: true,
xAxisIndex: 0, // x
yAxisIndex: 0, // y
gravity: 0.1, //
edgeLength: 100, // repulsion[10, 50]
repulsion: 500 //
}
}
]
}
// 使
chart.setOption(option)
//
window.addEventListener('resize', () => {
chart.resize()
})
}
}
}
</script>
<style scoped>
/* 可以在这里添加样式 */
</style>

219
src/views/components/echarts/graph6.vue

@ -0,0 +1,219 @@
<template>
<div id="knowledge-graph" style="width: 100%; height: calc(100vh - 184px);" />
</template>
<script>
import echarts from 'echarts'
export default {
name: 'KnowledgeGraph',
mounted() {
this.initChart()
},
methods: {
// https://relation-graph.com/#/docs/start
initChart() {
// echarts
const chart = echarts.init(document.getElementById('knowledge-graph'))
//
// const data = [
// { name: '', itemStyle: { color: '#cc6633' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#66cc33' }},
// { name: '', itemStyle: { color: '#cc3399' }},
// { name: '', itemStyle: { color: '#cc3399' }},
// { name: '30', itemStyle: { color: '#cc3399' }},
// { name: '10', itemStyle: { color: '#cc3399' }},
// { name: '', itemStyle: { color: '#6699cc' }},
// { name: '2022', itemStyle: { color: '#6699cc' }},
// { name: '2023', itemStyle: { color: '#6699cc' }},
// { name: '2024', itemStyle: { color: '#6699cc' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }},
// { name: '', itemStyle: { color: '#cc9966' }}
// ]
const data = [
{ name: '文书档案' },
{ name: '档案分类' },
{ name: '行政管理' },
{ name: '党群工作' },
{ name: '经营管理' },
{ name: '生成管理' },
{ name: '保管期限' },
{ name: '永久' },
{ name: '定期30年' },
{ name: '定期10年' },
{ name: '年度' },
{ name: '2022' },
{ name: '2023' },
{ name: '2024' },
{ name: '密级' },
{ name: '公开' },
{ name: '限制' },
{ name: '秘密' },
{ name: '机密' },
{ name: '绝密' }
]
const links = [
{ source: '文书档案', target: '档案分类' },
{ source: '文书档案', target: '年度' },
{ source: '文书档案', target: '保管期限' },
{ source: '文书档案', target: '密级' },
{ source: '保管期限', target: '永久' },
{ source: '保管期限', target: '定期30年' },
{ source: '保管期限', target: '定期10年' },
{ source: '年度', target: '2022' },
{ source: '年度', target: '2023' },
{ source: '年度', target: '2024' },
{ source: '密级', target: '公开' },
{ source: '密级', target: '限制' },
{ source: '密级', target: '秘密' },
{ source: '密级', target: '机密' },
{ source: '密级', target: '绝密' },
{ source: '档案分类', target: '行政管理' },
{ source: '档案分类', target: '党群工作' },
{ source: '档案分类', target: '经营管理' },
{ source: '档案分类', target: '生成管理' }
]
//
const option = {
tooltip: {},
series: [
{
type: 'graph',
layout: 'force',
data: data,
links: links,
cursor: 'pointer',
// color: {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 1,
// y2: 1,
// colorStops: [{
// offset: 0,
// color: 'rgba(255, 149, 0, 0.1)' // 0%
// }, {
// offset: 1,
// color: 'rgba(255, 149, 0, 1)' // 100%
// }],
// global: false // false
// },
legendHoverLink: true, // hover()
hoverAnimation: true, //
focusNodeAdjacency: true, //
draggable: true, //
symbolSize: 60, //
roam: 'scale', // , 'scale' 'move' true
edgeSymbol: ['', 'arrow'], // edgeSymbol: ['circle', 'arrow']
edgeSymbolSize: [2, 6], //
edgeLabel: {
// position: 'middle', //
// normal: {
// show: true,
// textStyle: {
// fontSize: 12
// },
// position: 'middle',
// formatter: function(x) {
// return x.data.name
// }
// }
},
itemStyle: {
normal: {
// color: '#00FAE1',
cursor: 'pointer',
// color:Math.floor(Math.random()*16777215).toString(16),
label: {
show: true,
// position: [-10, -15],
textStyle: {
//
color: '#000', //
fontStyle: 'normal', // 'normal' 'italic' 'oblique'
fontWeight: 'bold',
fontFamily: 'sans-serif', //
fontSize: 14 //
}
},
nodeStyle: {
brushType: 'both',
borderColor: 'rgba(255,215,0,0.4)',
borderWidth: 1
}
}
//
// emphasis: {
// shadowColor: '#00FAE1',
// shadowOffsetX: 0,
// shadowOffsetY: 0,
// shadowBlur: 40
// }
},
label: {
show: true,
position: 'top',
formatter: '{b}',
textStyle: {
fontSize: 20,
fontWeight: 600,
color: '#000'
}
},
lineStyle: {
width: 2,
color: '#999'
// color: {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 1,
// y2: 1,
// colorStops: [{
// offset: 0, color: 'rgba(0, 255, 244, 0.01)' // 0%
// }, {
// offset: 1, color: 'rgba(0, 255, 244, 1)' // 100%
// }],
// global: false
// }
// curveness: 0.2//
},
force: { //
layoutAnimation: true,
xAxisIndex: 0, // x
yAxisIndex: 0, // y
gravity: 0.1, //
edgeLength: 100, // repulsion[10, 50]
repulsion: 500 //
}
}
]
}
// 使
chart.setOption(option)
//
window.addEventListener('resize', () => {
chart.resize()
})
}
}
}
</script>
<style scoped>
/* 可以在这里添加样式 */
</style>

6
src/views/system/archivesCategory/index.vue

@ -260,6 +260,12 @@ export default {
}, },
// - / // - /
[CRUD.HOOK.beforeToAdd](crud, form, btn) { [CRUD.HOOK.beforeToAdd](crud, form, btn) {
if (this.selectedCategory.isType === 1) {
Vue.set(this.selectedCategory, 'parentName', this.selectedCategory.cnName)
} else {
Vue.set(this.selectedCategory, 'parentName', this.$refs.tree.getNode(this.selectedCategory.pid).data.cnName)
}
const isCanAddKey = JSON.parse(localStorage.getItem('currentCategoryKey')) const isCanAddKey = JSON.parse(localStorage.getItem('currentCategoryKey'))
if (isCanAddKey.isType === 4 || isCanAddKey.isType === 5) { if (isCanAddKey.isType === 4 || isCanAddKey.isType === 5) {
this.$message({ message: '此门类下不可新建门类', type: 'error', offset: 8 }) this.$message({ message: '此门类下不可新建门类', type: 'error', offset: 8 })

28
src/views/system/role/index.vue

@ -238,6 +238,7 @@ export default {
[CRUD.HOOK.afterRefresh]() { [CRUD.HOOK.afterRefresh]() {
this.$refs.menu.setCheckedKeys([]) this.$refs.menu.setCheckedKeys([])
this.$refs.fonds.setCheckedKeys([]) this.$refs.fonds.setCheckedKeys([])
console.log('this.crud.data-afterRefresh', this.crud.data)
}, },
// //
[CRUD.HOOK.beforeToAdd](crud, form) { [CRUD.HOOK.beforeToAdd](crud, form) {
@ -394,15 +395,32 @@ export default {
} }
}, },
// //
// update() {
// //
// console.log('this.currentId', this.currentId)
// console.log('this.crud.data-update-before', this.crud.data)
// crudRoles.get(this.currentId).then(res => {
// console.log('res', res)
// console.log('this.crud.data-update', this.crud.data)
// for (let i = 0; i < this.crud.data.length; i++) {
// if (res.menus[i].id === this.crud.data[i].menus.id) {
// this.crud.data[i] = res
// break
// }
// if (res.fonds.id === this.crud.data[i].fonds.id) {
// this.crud.data[i] = res
// break
// }
// console.log('2a', this.crud.data)
// }
// })
// }
update() { update() {
// //
crudRoles.get(this.currentId).then(res => { crudRoles.get(this.currentId).then(res => {
for (let i = 0; i < this.crud.data.length; i++) { for (let i = 0; i < this.crud.data.length; i++) {
if (res.menus[i].id === this.crud.data[i].menus.id) {
this.crud.data[i] = res
break
}
if (res.fonds.id === this.crud.data[i].fonds.id) {
if (res.id === this.crud.data[i].id) {
this.crud.data[i] = res this.crud.data[i] = res
break break
} }

Loading…
Cancel
Save