Commit 827549d4 authored by 罗超's avatar 罗超

关联图相关

parent 8e62c1ed
...@@ -267,4 +267,18 @@ export function deleteKRRule(data){ ...@@ -267,4 +267,18 @@ export function deleteKRRule(data){
method: 'post', method: 'post',
data data
}) })
}
export function queryUserOKRAlignView(data){
return request({
url: '/OKRPeriod/GetOKRMyAlignView',
method: 'post',
data
})
}
export function queryUserOKRNextAlignView(data){
return request({
url: '/OKRPeriod/GetOKRMyAlignViewNext',
method: 'post',
data
})
} }
\ No newline at end of file
<template>
<div :style="{'margin-topd':(graphSetting.viewSize.height-height)+'px', height: height+'px', 'margin-top': -height+'px' }" class="c-rg-bottom-panel">
<slot name="bottomPanel" />
</div>
</template>
<script>
// import SeeksRGStore from './core4vue/SeeksRGStore'
// import { mapState } from 'vuex'
// var _parent = this.$parent
// console.log('GraphSettingPanel.vue:', _parent)
export default {
name: 'GraphBottomPanel',
props: {
graphSetting: {
mustUseProp: true,
default: () => { return {} },
type: Object
}
},
data() {
return {
height: 50,
search_text: ''
}
},
mounted() {
this.$nextTick(() => {
this.height = this.$slots['bottomPanel'][0].elm.offsetHeight
if (window.SeeksGraphDebug) console.log('SeeksGraph bootomPanel height:', this.height)
})
},
methods: {
}
}
</script>
<style scoped>
.c-rg-bottom-panel{
width:100%;
margin-left:0px;
font-size: 12px;
color: #1890ff;
padding:0px;
overflow: hidden;
border-radius: 0px;
position: absolute;
z-index: 99;
opacity: 1;
}
.c-fixedLayout{
position: fixed;
bottom:0px;
}
</style>
<template>
<div :style="{'margin-left':(graphSetting.viewELSize.width-350)+'px'}" class="c-mini-namefilter">
<!-- <el-autocomplete-->
<!-- v-model="$parent.search_text"-->
<!-- :fetch-suggestions="$parent.querySearchAsync"-->
<!-- :trigger-on-focus="false"-->
<!-- :label="'xxxx'"-->
<!-- size="small"-->
<!-- placeholder="图谱节点定位,请输入节点名称"-->
<!-- clearable-->
<!-- style="width: 320px;box-shadow: 0px 0px 8px #cccccc;"-->
<!-- @select="$parent.handleSelect"-->
<!-- >-->
<!-- <template slot-scope="{ item }">-->
<!-- <div class="c-suggestion-name">{{ item.text }}</div>-->
<!-- </template>-->
<!-- <el-button slot="append" style="color: #2E4E8F;" icon="el-icon-search" />-->
<!-- </el-autocomplete>-->
</div>
</template>
<script>
export default {
name: 'GraphMiniNameFilter',
props: {
graphSetting: {
mustUseProp: true,
default: () => { return {} },
type: Object
}
},
data() {
return {
}
},
mounted() {
},
methods: {
}
}
</script>
<style scoped>
.c-mini-namefilter{
height:60px;
position: absolute;
margin-top:10px;
z-index: 999;
}
.c-fixedLayout{
position: fixed;
top:145px;
}
</style>
This diff is collapsed.
<template>
<div ref="miniView" class="c-mini-graph">
<div :style="{width:(100 * zoom) + 'px',height:(graphSetting.canvasNVInfo.height * 100/graphSetting.canvasNVInfo.width * zoom)+'px'}" class="c-mini-canvas">
<template v-for="thisNode in $parent.nodeViewList">
<div v-if="isAllowShowNode(thisNode)" :key="thisNode.id" :style="{'margin-left':(thisNode.x * 100/graphSetting.canvasSize.width * zoom)+'px','margin-top':(thisNode.y * 100/graphSetting.canvasSize.width * zoom)+'px'}" class="c-mini-node" />
</template>
</div>
<div :style="getPositionData()" class="c-mini-view">
<i class="el-icon-view" />
</div>
</div>
</template>
<script>
import SeeksGraphMath from './core4vue/SeeksGraphMath'
export default {
name: 'GraphMiniView',
props: {
graphSetting: {
mustUseProp: true,
default: () => { return {} },
type: Object
}
},
data() {
return {
zoom: 1
}
},
mounted() {
},
methods: {
getPositionData() {
var _c_width = 100
var _r = _c_width / this.graphSetting.canvasNVInfo.width
var _width = this.graphSetting.viewNVInfo.width * _r
var _height = this.graphSetting.viewNVInfo.height * _r
var _view_x = (this.graphSetting.viewNVInfo.x - this.graphSetting.canvasNVInfo.x) * _r
var _view_y = (this.graphSetting.viewNVInfo.y - this.graphSetting.canvasNVInfo.y) * _r
if (_width > 100) {
_height = _height * 100 / _width
_view_x = _view_x * 100 / _width
_view_y = _view_y * 100 / _width
this.zoom = 100 / _width
_width = 100
} else {
this.zoom = 1
}
// console.log('Mini View style:', _view_center_x, _canvas_center_x)
var style = {
width: _width + 'px',
height: _height + 'px',
'margin-left': _view_x + 'px',
'margin-top': _view_y + 'px'
}
return style
},
isAllowShowNode(nodeData) {
return SeeksGraphMath.isAllowShowNode(nodeData)
}
}
}
</script>
<style scoped>
.c-mini-graph{
height:100px;
width:100px;
position: absolute;
margin-left: 60px;
margin-top:100px;
z-index: 999;
}
.c-fixedLayout{
position: fixed;
top:100px;
}
.c-mini-canvas{
background-color: #AACBFF;
border: #7BA8FF solid 1px;
opacity: 0.8;
position: absolute;
}
.c-mini-view{
background-color: #F5A565;
border: #C03639 solid 1px;
opacity: 0.5;
color: #ffffff;
font-size: 14px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
}
.c-mini-node{
position: absolute;
width:2px;
height:2px;
background-color: #000000;
border-radius: 1px;
}
</style>
<template>
<div>
<div :class="[$parent.isNeedFixedTools?'c-fixedLayout':'']" class="c-setting-panel-button" @click="toggleSettingPanel">
<i class="el-icon-setting" />
</div>
<div v-if="showSettingPanel" :class="[$parent.isNeedFixedTools?'c-fixedLayout':'']" class="c-setting-panel">
<!-- <div style="padding:3px;">-->
<!-- 搜索节点:-->
<!-- <el-autocomplete-->
<!-- v-model="$parent.search_text"-->
<!-- :fetch-suggestions="$parent.querySearchAsync"-->
<!-- :trigger-on-focus="true"-->
<!-- :label="'xxxx'"-->
<!-- size="small"-->
<!-- placeholder="输入节点名称"-->
<!-- clearable-->
<!-- style="width: 220px;"-->
<!-- @select="$parent.handleSelect">-->
<!-- <template slot-scope="{ item }">-->
<!-- <div class="c-suggestion-name">{{ item.text }}</div>-->
<!-- </template>-->
<!-- </el-autocomplete>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 布局方式:-->
<!-- <el-radio-group v-model="currentlayoutName" size="mini" @change="switchLayout">-->
<!-- <el-radio-button label="center">中心</el-radio-button>-->
<!-- <el-radio-button label="circle">环形</el-radio-button>-->
<!-- <el-radio-button label="tree">树状(L)</el-radio-button>-->
<!-- <el-radio-button label="tree-plus-r">树状(R)</el-radio-button>-->
<!-- <el-radio-button label="tree-plus-t">树状(T)</el-radio-button>-->
<!-- <el-radio-button label="tree-plus-b">树状(B)</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 线条样式:-->
<!-- <el-radio-group v-model="graphSetting.defaultLineShape" size="small">-->
<!-- <el-radio-button :label="1">直线</el-radio-button>-->
<!-- <el-radio-button :label="2">简洁</el-radio-button>-->
<!-- <el-radio-button :label="3">生动</el-radio-button>-->
<!-- <el-radio-button :label="5">鱼尾</el-radio-button>-->
<!-- <el-radio-button :label="4">折线</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 节点样式:-->
<!-- <el-radio-group v-model="graphSetting.defaultNodeShape" size="small">-->
<!-- <el-radio-button :label="0">圆形</el-radio-button>-->
<!-- <el-radio-button :label="1">长方形</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 图像缩放:-->
<!-- <el-input-number v-model="graphSetting.canvasZoom" :max="500" :min="10" :step="20" size="small"/>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 连线标签:-->
<!-- <el-switch-->
<!-- v-model="graphSetting.defaultShowLineLabel"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"/>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 联动拖拽:-->
<!-- <el-switch-->
<!-- v-model="graphSetting.isMoveByParentNode"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"/>-->
<!-- 拖动父节点后子节点跟随-->
<!-- </div>-->
<!-- <div style="padding:3px;display: none;">-->
<!-- 最大层级:-->
<!-- <el-radio-group v-model="graphSetting.maxLevel" size="small">-->
<!-- <el-radio-button :label="1">1级</el-radio-button>-->
<!-- <el-radio-button :label="2">2级</el-radio-button>-->
<!-- <el-radio-button :label="3">3级</el-radio-button>-->
<!-- <el-radio-button :label="4">4级</el-radio-button>-->
<!-- <el-radio-button :label="5">5级</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 自动布局:-->
<!-- <el-switch-->
<!-- v-model="graphSetting.autoLayouting"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"-->
<!-- @change="toggleAutoLayout" />-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 全屏展示:-->
<!-- <el-switch-->
<!-- v-model="graphSetting.fullscreen"-->
<!-- active-color="#13ce66"-->
<!-- inactive-color="#ff4949"/>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 刷新布局:-->
<!-- <el-button size="small" type="primary" icon="el-icon-refresh" @click="refresh">刷新</el-button>-->
<!-- </div>-->
<!-- <div style="padding:3px;">-->
<!-- 图片下载:-->
<!-- <el-button size="small" type="primary" icon="el-icon-download" @click="$parent.downloadAsImage('png')">下载png</el-button>-->
<!-- <el-button size="small" type="primary" icon="el-icon-download" @click="$parent.downloadAsImage('jpg')">下载jpg</el-button>-->
<!-- </div>-->
<!-- <slot :setting="graphSetting" name="settingPanelPlus"/>-->
</div>
</div>
</template>
<script>
import SeeksRGLayouters from './core4vue/SeeksRGLayouters'
// import SeeksRGStore from './core4vue/SeeksRGStore'
// import { mapState } from 'vuex'
// var _parent = this.$parent
// console.log('GraphSettingPanel.vue:', _parent)
export default {
name: 'GraphSettingPanel',
props: {
graphSetting: {
mustUseProp: true,
default: () => { return {} },
type: Object
}
},
data() {
return {
search_text: '',
showSettingPanel: false,
currentLayoutName: ''
}
},
// computed: mapState({
// graphSetting: () => _parent.graphSetting
// }),
// watch: {
// 'graphSetting.layoutName': function(newV, oldV) {
// console.log('change layout:', newV, oldV)
// SeeksRGLayouters.switchLayout(newV, this.graphSetting)
// this.$parent.refresh()
// }
// },
methods: {
toggleSettingPanel() {
this.showSettingPanel = !this.showSettingPanel
},
toggleAutoLayout() {
if (this.graphSetting.autoLayouting) {
if (!this.graphSetting.layouter.autoLayout) {
console.log('当前布局不支持自动布局!')
} else {
this.graphSetting.layouter.autoLayout(true)
}
} else {
if (!this.graphSetting.layouter.stop) {
console.log('当前布局不支持自动布局stop!')
} else {
this.graphSetting.layouter.stop()
}
}
},
switchLayout() {
if (window.SeeksGraphDebug) console.log('change layout:', this.currentLayoutName)
SeeksRGLayouters.switchLayout(this.currentLayoutName, this.graphSetting)
this.refresh()
},
refresh() {
this.$parent.refresh()
}
}
}
</script>
<style scoped>
.c-setting-panel{
--height:500px;
--width:500px;
width:500px;
height:500px;
position: absolute;
margin-left:10px;
margin-top:5px;
font-size: 12px;
color: rgb(58, 91, 178);
padding:10px;
overflow: hidden;
box-shadow: 0px 0px 5px rgb(58, 91, 178);
border-radius: 5px;
z-index: 1000;
background-color: #ffffff;
border: rgb(58, 91, 178) solid 1px;
padding-top:60px;
}
.c-setting-panel-button{
height:45px;
width:45px;
font-size: 20px;
line-height: 45px;
text-align: center;
border-radius: 50%;
position: absolute;
margin-left:25px;
margin-top:20px;
background-color: rgb(58, 91, 178);
color: #ffffff;
cursor: pointer;
z-index: 1001;
box-shadow: 0px 0px 8px rgb(46, 78, 143);
}
.c-setting-panel-button:hover{
box-shadow: 0px 0px 20px #FFA20A;
border:#ffffff solid 1px;
color: #FFA20A;
-moz-transform: rotate(-89deg) translateX(-190px);
animation-timing-function:linear;
animation: flashButton 2s infinite;
}
.c-fixedLayout{
position: fixed;
top: 125px
}
@keyframes flashButton {
from {
box-shadow: 0px 0px 8px rgb(46, 78, 143);
}
30% {
box-shadow: 0px 0px 20px #FFA20A;
}
to {
box-shadow: 0px 0px 8px rgb(46, 78, 143);
}
}
</style>
This diff is collapsed.
This diff is collapsed.
import SeeksBidirectionalTreeLayouter from './layouters/SeeksBidirectionalTreeLayouter'
import SeeksCenterLayouter from './layouters/SeeksCenterLayouter'
import SeeksCircleLayouter from './layouters/SeeksCircleLayouter'
import SeeksAutoLayouter from './layouters/SeeksAutoLayouter'
import SeeksFixedLayouter from './layouters/SeeksFixedLayouter'
var SeeksRGLayouters = {
createLayout(layoutSetting, _graphSetting) {
_graphSetting.canvasZoom = 100
_graphSetting.layoutClassName = layoutSetting.layoutClassName
_graphSetting.layoutLabel = layoutSetting.label
_graphSetting.layoutName = layoutSetting.layoutName
_graphSetting.layoutDirection = layoutSetting.layoutDirection
if (layoutSetting.useLayoutStyleOptions === true) {
_graphSetting.defaultExpandHolderPosition = layoutSetting.defaultExpandHolderPosition
_graphSetting.defaultJunctionPoint = layoutSetting.defaultJunctionPoint
_graphSetting.defaultNodeColor = layoutSetting.defaultNodeColor
_graphSetting.defaultNodeFontColor = layoutSetting.defaultNodeFontColor
_graphSetting.defaultNodeBorderColor = layoutSetting.defaultNodeBorderColor
_graphSetting.defaultNodeBorderWidth = layoutSetting.defaultNodeBorderWidth
_graphSetting.defaultLineColor = layoutSetting.defaultLineColor
_graphSetting.defaultLineWidth = layoutSetting.defaultLineWidth
_graphSetting.defaultLineShape = layoutSetting.defaultLineShape
_graphSetting.defaultNodeShape = layoutSetting.defaultNodeShape
_graphSetting.defaultNodeWidth = layoutSetting.defaultNodeWidth
_graphSetting.defaultNodeHeight = layoutSetting.defaultNodeHeight
_graphSetting.defaultLineMarker = layoutSetting.defaultLineMarker
_graphSetting.defaultShowLineLabel = layoutSetting.defaultShowLineLabel
}
var _layout = null
if (layoutSetting.layoutName === 'SeeksBidirectionalTreeLayouter' || layoutSetting.layoutName === 'tree') {
_layout = new SeeksBidirectionalTreeLayouter(layoutSetting, _graphSetting)
} else if (layoutSetting.layoutName === 'SeeksCenterLayouter' || layoutSetting.layoutName === 'center') {
_layout = new SeeksCenterLayouter(layoutSetting, _graphSetting)
} else if (layoutSetting.layoutName === 'SeeksCircleLayouter' || layoutSetting.layoutName === 'circle') {
_layout = new SeeksCircleLayouter(layoutSetting, _graphSetting)
} else if (layoutSetting.layoutName === 'SeeksAutoLayouter' || layoutSetting.layoutName === 'force') {
_layout = new SeeksAutoLayouter(layoutSetting, _graphSetting)
} else if (layoutSetting.layoutName === 'SeeksFixedLayouter' || layoutSetting.layoutName === 'fixed') {
_layout = new SeeksFixedLayouter(layoutSetting, _graphSetting)
}
_graphSetting.isNeedShowAutoLayoutButton = layoutSetting.allowAutoLayoutIfSupport !== false && _layout.autoLayout !== undefined
return _layout
},
switchLayout(layoutLabelOrSetting, _graphSetting) {
const __origin_nodes = _graphSetting.layouter ? _graphSetting.layouter.__origin_nodes : []
const __rootNode = _graphSetting.layouter ? _graphSetting.layouter.rootNode : null
if ((typeof layoutLabelOrSetting) === 'string') {
for (var thisLayoutSetting in _graphSetting.layouts) {
if (thisLayoutSetting.label === layoutLabelOrSetting) {
layoutLabelOrSetting = thisLayoutSetting
break
}
}
}
_graphSetting.layouter = SeeksRGLayouters.createLayout(layoutLabelOrSetting, _graphSetting)
_graphSetting.layouter.__origin_nodes = __origin_nodes
_graphSetting.layouter.rootNode = __rootNode
}
}
export default SeeksRGLayouters
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
var __tmp_basePosition = { x: 0, y: 0 }
var __tmp_positionModel = { x: 0, y: 0 }
var __ondraged
var __start_info = { x: 0, y: 0 }
var SeeksRGUtils = {
startDrag(e, positionModel, ondraged) {
__ondraged = ondraged
// console.log('startDrag:', __tmp_basePosition, e.clientX, e.clientY)
__tmp_positionModel = positionModel
__start_info.x = __tmp_positionModel.x
__start_info.y = __tmp_positionModel.y
__tmp_basePosition.x = parseInt(__tmp_positionModel.x) - e.clientX
__tmp_basePosition.y = parseInt(__tmp_positionModel.y) - e.clientY
document.body.addEventListener('mousemove', SeeksRGUtils.onNodeMove)
document.body.addEventListener('mouseup', SeeksRGUtils.onNodeDragend)
},
onNodeMove(e) {
// console.log('move', __tmp_basePosition, e.clientX, e.clientY)
__tmp_positionModel.x = e.clientX + __tmp_basePosition.x
__tmp_positionModel.y = e.clientY + __tmp_basePosition.y
},
onNodeDragend() {
// console.log('onNodeDragend', __tmp_positionModel.x - __start_info.x, __tmp_positionModel.y - __start_info.y)
document.body.removeEventListener('mousemove', SeeksRGUtils.onNodeMove)
document.body.removeEventListener('mouseup', SeeksRGUtils.onNodeDragend)
if (__ondraged) {
__ondraged(__tmp_positionModel.x - __start_info.x, __tmp_positionModel.y - __start_info.y)
}
},
transName4Circle(name) {
var _thisLevel = 0
var _thisLevelCharsArr = []
var result = []
for (var i = 0; i < name.length; i++) {
_thisLevelCharsArr.push(name[i])
if (_thisLevelCharsArr.length === circle_node_text_set[_thisLevel]) {
result.push(_thisLevelCharsArr.join(''))
_thisLevel++
_thisLevelCharsArr = []
}
}
if (_thisLevelCharsArr.length > 0) {
result.push(_thisLevelCharsArr.join(''))
}
// if (result.length < 3) {
// result.unshift('')
// if (result.length < 3) {
// result.unshift('')
// if (result.length < 3) {
// result.unshift('')
// }
// }
// }
return result.join('<br>')
},
getColorId(color) {
color = color.replace('#', '')
color = color.replace('(', '')
color = color.replace(')', '')
color = color.replace(/,/, '-')
return color
}
}
SeeksRGUtils.json2Node = function(originData) {
if (originData.id === undefined) throw Error('node must has option[id]:', originData)
originData.text = originData.text || originData.name || originData.id
var jsonData = {
id: originData.id,
text: originData.text !== undefined ? originData.text : '',
type: originData.type !== undefined ? originData.type : 'node',
isShow: originData.isShow !== undefined ? originData.isShow : true,
isHide: originData.isHide !== undefined ? originData.isHide : false,
expanded: originData.expanded !== undefined ? originData.expanded : true,
selected: originData.selected !== undefined ? originData.selected : false,
styleClass: originData.styleClass !== undefined ? originData.styleClass : '',
targetNodes: originData.targetNodes !== undefined ? originData.targetNodes : [],
targetFrom: originData.targetFrom !== undefined ? originData.targetFrom : [],
targetTo: originData.targetTo !== undefined ? originData.targetTo : [],
nodeShape: originData.nodeShape !== undefined ? originData.nodeShape : undefined,
borderWidth: originData.borderWidth !== undefined ? originData.borderWidth : undefined,
borderColor: originData.borderColor !== undefined ? originData.borderColor : undefined,
fontColor: originData.fontColor !== undefined ? originData.fontColor : undefined,
color: originData.color !== undefined ? originData.color : undefined,
opacity: originData.opacity !== undefined ? originData.opacity : 1,
fixed: originData.fixed !== undefined ? originData.fixed : false,
width: originData.width !== undefined ? originData.width : undefined,
height: originData.height !== undefined ? originData.height : undefined,
x: originData.x !== undefined ? originData.x : 0,
y: originData.y !== undefined ? originData.y : 0,
Fx: originData.Fx !== undefined ? originData.Fx : 0,
Fy: originData.Fy !== undefined ? originData.Fy : 0,
offset_x: originData.offset_x !== undefined ? originData.offset_x : 0,
offset_y: originData.offset_y !== undefined ? originData.offset_y : 0,
expandHolderPosition: originData.expandHolderPosition !== undefined ? originData.expandHolderPosition : undefined,
innerHTML: originData.innerHTML !== undefined ? originData.innerHTML : undefined,
html: originData.html !== undefined ? originData.html : undefined,
disableDefaultClickEffect: originData.disableDefaultClickEffect !== undefined ? originData.disableDefaultClickEffect : undefined,
disableDrag: originData.disableDrag !== undefined ? originData.disableDrag : false,
data: originData.data !== undefined ? originData.data : {},
childNum:originData.childNum !==undefined?originData.childNum:0,
nodeParent:originData.nodeParent!==undefined?originData.nodeParent:false
}
if(jsonData.lot === undefined) jsonData.lot = { childs: [], parent: undefined, eached: false, strength: 0 }
if(jsonData.lot.childs === undefined) jsonData.lot.childs = []
if(jsonData.lot.parent === undefined) jsonData.lot.parent = undefined
if(jsonData.lot.eached === undefined) jsonData.lot.eached = false
if(jsonData.lot.strength === undefined) jsonData.lot.strength = 0
if(jsonData.el === undefined) jsonData.el = { offsetWidth: 50, offsetHeight: 50 }
if(jsonData.width !== undefined) jsonData.el.offsetWidth = jsonData.width
if(jsonData.height !== undefined) jsonData.el.offsetHeight = jsonData.height
return jsonData
}
SeeksRGUtils.json2Link = function(originData) {
if (originData.from === undefined) throw Error('error,link must has option[from]:', originData)
if (originData.to === undefined) throw Error('error,link must has option[to]:', originData)
if (typeof originData.from !== 'string') throw Error('error link from, must be string:', originData)
if (typeof originData.to !== 'string') throw Error('error link to, must be string:', originData)
var jsonData = {
text: originData.text !== undefined ? originData.text : '',
color: originData.color !== undefined ? originData.color : undefined,
fontColor: originData.fontColor !== undefined ? originData.fontColor : undefined,
lineWidth: originData.lineWidth !== undefined ? originData.lineWidth : undefined,
lineShape: originData.lineShape !== undefined ? originData.lineShape : undefined,
styleClass: originData.styleClass !== undefined ? originData.styleClass : undefined,
isHide: originData.isHide !== undefined ? originData.isHide : false,
arrow: originData.arrow !== undefined ? originData.arrow : undefined,
isHideArrow: originData.isHideArrow !== undefined ? originData.isHideArrow : undefined,
hidden: originData.hidden !== undefined ? originData.hidden : false,
lineDirection: originData.lineDirection !== undefined ? originData.lineDirection : undefined,
reverseText: originData.reverseText !== undefined ? originData.reverseText : undefined,
data: originData.data !== undefined ? originData.data : {},
}
return jsonData
}
SeeksRGUtils.getPosition = function(el) {
if (el.parentElement) {
return SeeksRGUtils.getPosition(el.parentElement) + el.offsetTop
}
return el.offsetTop
}
var _ignore_node_keys = [ 'Fx', 'Fy', 'appended', 'el', 'targetFrom', 'targetNodes', 'targetTo', 'type', 'lot', 'seeks_id' ]
SeeksRGUtils.transNodeToJson = function(node, nodes) {
if (!node) return
var _node_json = {}
Object.keys(node).forEach(thisKey => {
if (_ignore_node_keys.indexOf(thisKey) === -1) {
if (node[thisKey] !== undefined) {
_node_json[thisKey] = node[thisKey]
}
}
})
nodes.push(_node_json)
}
var _ignore_link_keys = [ 'arrow', 'id', 'reverseText', 'isReverse' ]
SeeksRGUtils.transLineToJson = function(line, links) {
if (!line) return
line.relations.forEach(thisRelation => {
var _link_json = {}
Object.keys(thisRelation).forEach(thisKey => {
if (_ignore_link_keys.indexOf(thisKey) === -1) {
if (thisRelation[thisKey] !== undefined) {
_link_json[thisKey] = thisRelation[thisKey]
}
}
})
links.push(_link_json)
})
}
var circle_node_text_set = [4, 5, 6, 4, 2, 100]
export default SeeksRGUtils
import SeeksGraphMath from '../SeeksGraphMath'
function SeeksFixedLayouter(layoutSetting, graphSetting) {
this.graphSetting = graphSetting
this.config = layoutSetting || {}
this.rootNode = null
this.allNodes = []
this.__origin_nodes = []
this.refresh = function() {
this.placeNodes(this.__origin_nodes, this.rootNode)
}
this.placeNodes = function(allNodes, rootNode) {
if (!rootNode) {
console.log('root is null:', rootNode)
return
} else {
if (window.SeeksGraphDebug) console.log('layout by root:', rootNode)
}
this.__origin_nodes = allNodes
this.rootNode = rootNode
allNodes.forEach(thisNode => {
// thisNode.lot = { eached: false }
thisNode.lot.eached = false
thisNode.lot.notLeafNode = false
thisNode.lot.childs = []
// thisNode.lot.parent = undefined
thisNode.lot.index_of_parent = 0
thisNode.lot.strength = 0
thisNode.lot.prevNode = undefined
thisNode.lot.nextNode = undefined
thisNode.lot.placed = false
})
this.allNodes = []
var analyticResult = {
max_deep: 1,
max_length: 1
}
SeeksGraphMath.analysisNodes4Didirectional(this.allNodes, [this.rootNode], 0, analyticResult, 0)
if (window.SeeksGraphDebug) console.log('[layout canvasOffset]', this.graphSetting.viewSize, this.graphSetting.canvasSize)
}
}
export default SeeksFixedLayouter
This diff is collapsed.
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<q-btn @click="changeMenu(1)" flat :color="chosenMenu==1?'primary':'blue-grey-14'" :class="[chosenMenu==1?'text-weight-bold':'']" label="OKR 工作区"> <q-btn @click="changeMenu(1)" flat :color="chosenMenu==1?'primary':'blue-grey-14'" :class="[chosenMenu==1?'text-weight-bold':'']" label="OKR 工作区">
<q-menu v-if="chosenMenu==1"> <q-menu v-if="chosenMenu==1">
<q-list> <q-list>
<q-item clickable> <q-item clickable @click="okrMenu=1">
<q-item-section q-item-section avatar> <q-item-section q-item-section avatar>
<inline-svg class="svg-icon svg-icon-secondary" src="icons/svg/Text/Edit-text.svg"></inline-svg> <inline-svg class="svg-icon svg-icon-secondary" src="icons/svg/Text/Edit-text.svg"></inline-svg>
</q-item-section> </q-item-section>
<q-item-section>OKR</q-item-section> <q-item-section>OKR</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />
<q-item clickable> <q-item clickable @click="okrMenu=2">
<q-item-section q-item-section avatar> <q-item-section q-item-section avatar>
<inline-svg class="svg-icon svg-icon-secondary" src="icons/svg/General/Visible.svg"></inline-svg> <inline-svg class="svg-icon svg-icon-secondary" src="icons/svg/General/Visible.svg"></inline-svg>
</q-item-section> </q-item-section>
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
</div> </div>
<div v-if="chosenMenu==1" class="flex col" style="flex: 1"> <div v-if="chosenMenu==1" class="flex col" style="flex: 1">
<okr v-if="okrMenu==1"></okr> <okr v-if="okrMenu==1"></okr>
<align-view v-if="okrMenu==2"></align-view>
</div> </div>
<div v-if="chosenMenu==2" class="col" style="height: 750px;overflow: auto"> <div v-if="chosenMenu==2" class="col" style="height: 750px;overflow: auto">
<teachplan></teachplan> <teachplan></teachplan>
...@@ -51,7 +52,8 @@ ...@@ -51,7 +52,8 @@
export default { export default {
components:{ components:{
teachplan, teachplan,
okr okr,
alignView
}, },
name: 'PageIndex', name: 'PageIndex',
data(){ data(){
...@@ -64,7 +66,7 @@ ...@@ -64,7 +66,7 @@
AccountType:1, AccountType:1,
ispower:false,//是否显示备课管理 ispower:false,//是否显示备课管理
chosenMenu:1, chosenMenu:1,
okrMenu:0 okrMenu:1
} }
}, },
created() { created() {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment