From 2b87e297c97887931e9385bb53a88e44867bce94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=9C=84?= Date: Tue, 7 Nov 2023 16:10:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=87=E5=87=86=E5=8C=96=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileEcho.vue | 12 ++++--- src/components/MindMap.vue | 34 +++++++++++++------ .../StandardizationActivityPage.vue | 2 +- .../modules/GroupModal.vue | 14 ++++---- .../modules/MeetingModal.vue | 21 ++++++++++-- .../modules/StandardizationActivityDrawer.vue | 4 +-- .../tables/MeetingTable.vue | 11 +++++- 7 files changed, 70 insertions(+), 28 deletions(-) diff --git a/src/components/FileEcho.vue b/src/components/FileEcho.vue index 0f0b90f7..83b40f43 100644 --- a/src/components/FileEcho.vue +++ b/src/components/FileEcho.vue @@ -53,10 +53,14 @@ export default { } }, watch: { - fileIds (value) { - if (value) { - this.getFileList() - } + fileIds: { + handler (value) { + if (value) { + this.getFileList() + } + }, + immediate: true, + deep: true } }, data () { diff --git a/src/components/MindMap.vue b/src/components/MindMap.vue index 5ecd6d3f..7dcbc356 100644 --- a/src/components/MindMap.vue +++ b/src/components/MindMap.vue @@ -93,7 +93,7 @@ export default { graph: null, loadEnd: false, selectedNodeId: null, - lastQueryId: null + lastQueryId: null // 记录上次查询的节点id } }, watch: { @@ -115,6 +115,12 @@ export default { mounted () { this.$nextTick(() => { this.loadEnd = true + window.onresize = () => { + const width = document.getElementById(this.domId).clientWidth + const height = document.getElementById(this.domId).clientHeight + this.graph.changeSize(width, height) + this.graph.fitCenter() + } }) }, methods: { @@ -153,7 +159,7 @@ export default { }) // 文本的部分 - let textContent = (cfg.num || '') + ' ' + (cfg.name || '') + 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) { @@ -302,6 +308,12 @@ export default { if (this.lastQueryId) { this.graph.setItemState(this.lastQueryId, 'selected', false) } + if (this.selectedNodeId) { + this.graph.setItemState(this.selectedNodeId, 'selected', false) + } + const node = this.graph.findById(nodeId) + this.selectedNodeId = nodeId + this.$emit('select', node._cfg.model) this.lastQueryId = nodeId const matrix = item.get('group').getMatrix() const point = { @@ -311,19 +323,19 @@ export default { const width = this.graph.get('width') const height = this.graph.get('height') // 找到视口中心 - var viewCenter = { + const viewCenter = { x: width / 2, y: height / 2 } - var modelCenter = this.graph.getPointByCanvas(viewCenter.x, viewCenter.y) - var viewportMatrix = this.graph.get('group').getMatrix() + const modelCenter = this.graph.getPointByCanvas(viewCenter.x, viewCenter.y) + const viewportMatrix = this.graph.get('group').getMatrix() // 画布平移的目标位置,最终目标是graph.translate(dx, dy); - var dx = (modelCenter.x - point.x) * viewportMatrix[0] - var dy = (modelCenter.y - point.y) * viewportMatrix[4] - var lastX = 0 - var lastY = 0 - var newX = void 0 - var newY = void 0 + const dx = (modelCenter.x - point.x) * viewportMatrix[0] + const dy = (modelCenter.y - point.y) * viewportMatrix[4] + let lastX = 0 + let lastY = 0 + let newX = void 0 + let newY = void 0 // 动画每次平移一点,直到目标位置 this.graph.get('canvas').animate({ onFrame: (ratio) => { diff --git a/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue b/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue index 2d6d5ebb..322e92a3 100644 --- a/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue +++ b/src/views/businessSupport/standardizationActivity/StandardizationActivityPage.vue @@ -210,7 +210,7 @@ export default { this.$message.warning(this.$t('businessSupport.standardizationActivity.addUpToFourLevels')) return } - this.$refs.modalForm.add({ pid: this.selectedNodeId, pName: this.selectedNode.name, level: this.selectedNode.level + 1 }) + this.$refs.modalForm.add({ pid: this.selectedNodeId, supperName: this.selectedNode.name, level: this.selectedNode.level + 1 }) }, handleEdit () { // 需要先选中一个节点 diff --git a/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue b/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue index ac4c817e..c7d7dbd5 100644 --- a/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue +++ b/src/views/businessSupport/standardizationActivity/modules/GroupModal.vue @@ -26,8 +26,8 @@ + :name-str="model.personnel" + @listChange="handleUserChange" /> { if (!errors) { + console.log(JSON.parse(JSON.stringify(this.model))) + console.log(JSON.parse(JSON.stringify(values))) const formData = Object.assign(this.model, values) + console.log(formData) this.$emit('ok', formData) this.close() } @@ -191,13 +194,12 @@ export default { jobNum: data.username, // 工号 mailbox: data.email, // 邮箱 department: data.orgCodeTxt, // 部门 - phone: data.phone // 电话 + phone: data.phone, // 电话 + personnel: data.realname } + this.model = Object.assign(this.model, obj) this.form.setFieldsValue(obj) }, - handleUserNameChange (name) { - this.model.personnel = name - }, /** * 校验电话 * @param rule diff --git a/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue b/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue index 0ffb8a9e..28f18679 100644 --- a/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue +++ b/src/views/businessSupport/standardizationActivity/modules/MeetingModal.vue @@ -17,6 +17,7 @@ @@ -26,6 +27,7 @@ @@ -33,7 +35,16 @@ :wrapperCol="wrapperCol" :label="$t('workCenter.enStandardRevision.conferee')"> + :disabled="disabled" + :name-str="model.personnel" + v-decorator="['personnelId', validatorRules.personnelId]" @nameChange="handleUserNameChange" /> + + + + @@ -41,10 +52,11 @@