add 标准化活动
This commit is contained in:
+16
-13
@@ -72,7 +72,7 @@ export default {
|
||||
nodeWidth: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 300
|
||||
default: 400
|
||||
},
|
||||
// 节点高度
|
||||
nodeHeight: {
|
||||
@@ -99,7 +99,6 @@ export default {
|
||||
watch: {
|
||||
mapData: {
|
||||
handler () {
|
||||
console.log(this.mapData)
|
||||
this.data = JSON.parse(JSON.stringify(this.mapData))
|
||||
if (this.loadEnd && this.data.id) {
|
||||
this.initMindMap()
|
||||
@@ -126,7 +125,6 @@ export default {
|
||||
}
|
||||
G6.registerNode('tree-node', {
|
||||
drawShape: (cfg, group) => {
|
||||
console.log('自定义节点了',cfg)
|
||||
const nodeColorIndex = cfg.depth % NODE_COLOR.length
|
||||
const nodeStyle = NODE_COLOR[nodeColorIndex]
|
||||
// 节点整体的内容
|
||||
@@ -155,12 +153,12 @@ export default {
|
||||
})
|
||||
|
||||
// 文本的部分
|
||||
let textContent = cfg.name || ''
|
||||
if (textContent.length > 40) {
|
||||
textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40)
|
||||
} else if (textContent.length > 20) {
|
||||
textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20)
|
||||
}
|
||||
let textContent = (cfg.num || '') + ' ' + (cfg.name || '')
|
||||
// if (textContent.length > 40) {
|
||||
// textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40)
|
||||
// } else if (textContent.length > 20) {
|
||||
// textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20)
|
||||
// }
|
||||
group.addShape('text', {
|
||||
attrs: {
|
||||
text: textContent,
|
||||
@@ -199,7 +197,6 @@ export default {
|
||||
return nodeContainer
|
||||
},
|
||||
setState (name, value, item) {
|
||||
console.log(name, value)
|
||||
const group = item.getContainer()
|
||||
const nodeDom = group.get('children')
|
||||
const nodeBox = nodeDom[1]
|
||||
@@ -255,9 +252,9 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
G6.Util.traverseTree(this.data, (item) => {
|
||||
item.id = item[this.mapDataKeyField]
|
||||
})
|
||||
// G6.Util.traverseTree(this.data, (item) => {
|
||||
// item.id = item[this.mapDataKeyField]
|
||||
// })
|
||||
this.graph.data(this.data)
|
||||
this.graph.render()
|
||||
this.graph.fitView()
|
||||
@@ -288,6 +285,12 @@ export default {
|
||||
this.selectedNodeId = item._cfg.id
|
||||
this.graph.refreshItem(item._cfg.id)
|
||||
this.graph.layout()
|
||||
// 选中抛出节点信息,取消选中抛出一个空对象
|
||||
if (item.getModel().selected) {
|
||||
this.$emit('select', item._cfg.model)
|
||||
} else {
|
||||
this.$emit('select', {})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 查询,定位高亮
|
||||
|
||||
@@ -475,7 +475,6 @@ export default {
|
||||
rules[res.dbFieldName] = rule
|
||||
}
|
||||
})
|
||||
console.log(rules)
|
||||
this.rules = rules
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
|
||||
@@ -310,6 +310,7 @@ export default {
|
||||
}
|
||||
this.$emit('nameChange', this.dataSourceRight.map(item => item.realname + '(' + item.username + ')').join(','))
|
||||
this.$emit('change', this.selectedRowKeys.join(','))
|
||||
this.$emit('listChange', this.dataSourceRight)
|
||||
this.close()
|
||||
},
|
||||
handleCancel () {
|
||||
|
||||
@@ -17,7 +17,12 @@
|
||||
{{ $t('userSelect.select') }}
|
||||
</a-button>
|
||||
</div>
|
||||
<user-select-modal v-bind="$attrs" :nameStr="nameStr" ref="selectModal" @change="selectChange" @nameChange="nameChange"></user-select-modal>
|
||||
<user-select-modal v-bind="$attrs"
|
||||
:nameStr="nameStr"
|
||||
ref="selectModal"
|
||||
@change="selectChange"
|
||||
@nameChange="nameChange"
|
||||
@listChange="listChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -82,6 +87,9 @@ export default {
|
||||
nameChange (value) {
|
||||
this.checkedValue = value
|
||||
this.$emit('nameChange', value, this.filedName)
|
||||
},
|
||||
listChange (list) {
|
||||
this.$emit('listChange', list)
|
||||
}
|
||||
},
|
||||
model: {
|
||||
@@ -103,6 +111,7 @@ export default {
|
||||
resize: none;
|
||||
width: calc(100% - 70px);
|
||||
}
|
||||
|
||||
// 因为需要加title,所以不能把鼠标事件去掉
|
||||
/deep/ .ant-input-disabled {
|
||||
background: #fff;
|
||||
|
||||
Reference in New Issue
Block a user