Merge remote-tracking branch 'origin/main'

This commit is contained in:
lideqin
2023-11-07 16:12:34 +08:00
7 changed files with 70 additions and 28 deletions
+8 -4
View File
@@ -53,10 +53,14 @@ export default {
} }
}, },
watch: { watch: {
fileIds (value) { fileIds: {
if (value) { handler (value) {
this.getFileList() if (value) {
} this.getFileList()
}
},
immediate: true,
deep: true
} }
}, },
data () { data () {
+23 -11
View File
@@ -93,7 +93,7 @@ export default {
graph: null, graph: null,
loadEnd: false, loadEnd: false,
selectedNodeId: null, selectedNodeId: null,
lastQueryId: null lastQueryId: null // 记录上次查询的节点id
} }
}, },
watch: { watch: {
@@ -115,6 +115,12 @@ export default {
mounted () { mounted () {
this.$nextTick(() => { this.$nextTick(() => {
this.loadEnd = true 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: { methods: {
@@ -153,7 +159,7 @@ export default {
}) })
// 文本的部分 // 文本的部分
let textContent = (cfg.num || '') + ' ' + (cfg.name || '') let textContent = (cfg.num || '') + ' ' + (cfg.name || '')
// if (textContent.length > 40) { // if (textContent.length > 40) {
// textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40) // textContent = textContent.slice(0, 20) + '\n' + textContent.slice(20, 40) + '\n' + textContent.slice(40)
// } else if (textContent.length > 20) { // } else if (textContent.length > 20) {
@@ -302,6 +308,12 @@ export default {
if (this.lastQueryId) { if (this.lastQueryId) {
this.graph.setItemState(this.lastQueryId, 'selected', false) 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 this.lastQueryId = nodeId
const matrix = item.get('group').getMatrix() const matrix = item.get('group').getMatrix()
const point = { const point = {
@@ -311,19 +323,19 @@ export default {
const width = this.graph.get('width') const width = this.graph.get('width')
const height = this.graph.get('height') const height = this.graph.get('height')
// 找到视口中心 // 找到视口中心
var viewCenter = { const viewCenter = {
x: width / 2, x: width / 2,
y: height / 2 y: height / 2
} }
var modelCenter = this.graph.getPointByCanvas(viewCenter.x, viewCenter.y) const modelCenter = this.graph.getPointByCanvas(viewCenter.x, viewCenter.y)
var viewportMatrix = this.graph.get('group').getMatrix() const viewportMatrix = this.graph.get('group').getMatrix()
// 画布平移的目标位置,最终目标是graph.translate(dx, dy); // 画布平移的目标位置,最终目标是graph.translate(dx, dy);
var dx = (modelCenter.x - point.x) * viewportMatrix[0] const dx = (modelCenter.x - point.x) * viewportMatrix[0]
var dy = (modelCenter.y - point.y) * viewportMatrix[4] const dy = (modelCenter.y - point.y) * viewportMatrix[4]
var lastX = 0 let lastX = 0
var lastY = 0 let lastY = 0
var newX = void 0 let newX = void 0
var newY = void 0 let newY = void 0
// 动画每次平移一点,直到目标位置 // 动画每次平移一点,直到目标位置
this.graph.get('canvas').animate({ this.graph.get('canvas').animate({
onFrame: (ratio) => { onFrame: (ratio) => {
@@ -210,7 +210,7 @@ export default {
this.$message.warning(this.$t('businessSupport.standardizationActivity.addUpToFourLevels')) this.$message.warning(this.$t('businessSupport.standardizationActivity.addUpToFourLevels'))
return 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 () { handleEdit () {
// 需要先选中一个节点 // 需要先选中一个节点
@@ -26,8 +26,8 @@
<user-selection :placeholder="$t('pleaseSelect') + $t('businessSupport.standardizationActivity.ourPersonnel')" <user-selection :placeholder="$t('pleaseSelect') + $t('businessSupport.standardizationActivity.ourPersonnel')"
type="radio" type="radio"
v-decorator="['personnelId', validatorRules.personnelId]" v-decorator="['personnelId', validatorRules.personnelId]"
@listChange="handleUserChange" :name-str="model.personnel"
@nameChange="handleUserNameChange" /> @listChange="handleUserChange" />
</a-form-item> </a-form-item>
<!--工号--> <!--工号-->
<a-form-item :labelCol="labelCol" <a-form-item :labelCol="labelCol"
@@ -171,7 +171,10 @@ export default {
handleOk () { handleOk () {
this.form.validateFields((errors, values) => { this.form.validateFields((errors, values) => {
if (!errors) { if (!errors) {
console.log(JSON.parse(JSON.stringify(this.model)))
console.log(JSON.parse(JSON.stringify(values)))
const formData = Object.assign(this.model, values) const formData = Object.assign(this.model, values)
console.log(formData)
this.$emit('ok', formData) this.$emit('ok', formData)
this.close() this.close()
} }
@@ -191,13 +194,12 @@ export default {
jobNum: data.username, // 工号 jobNum: data.username, // 工号
mailbox: data.email, // 邮箱 mailbox: data.email, // 邮箱
department: data.orgCodeTxt, // 部门 department: data.orgCodeTxt, // 部门
phone: data.phone // 电话 phone: data.phone, // 电话
personnel: data.realname
} }
this.model = Object.assign(this.model, obj)
this.form.setFieldsValue(obj) this.form.setFieldsValue(obj)
}, },
handleUserNameChange (name) {
this.model.personnel = name
},
/** /**
* 校验电话 * 校验电话
* @param rule * @param rule
@@ -17,6 +17,7 @@
<j-date :placeholder="$t('pleaseSelect') + $t('workCenter.postMeetingManageProcess.attendanceDate')" <j-date :placeholder="$t('pleaseSelect') + $t('workCenter.postMeetingManageProcess.attendanceDate')"
show-type="day" show-type="day"
date-format="YYYY-MM-DD" date-format="YYYY-MM-DD"
:disabled="disabled"
v-decorator="['participationTime', validatorRules.participationTime]" /> v-decorator="['participationTime', validatorRules.participationTime]" />
</a-form-item> </a-form-item>
<!--会议名称--> <!--会议名称-->
@@ -26,6 +27,7 @@
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.postMeetingManageProcess.meetingName')" <a-input :placeholder="$t('pleaseEnter') + $t('workCenter.postMeetingManageProcess.meetingName')"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="50" :maxLength="50"
:disabled="disabled"
v-decorator="['name', validatorRules.name]" /> v-decorator="['name', validatorRules.name]" />
</a-form-item> </a-form-item>
<!--参会人员--> <!--参会人员-->
@@ -33,7 +35,16 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
:label="$t('workCenter.enStandardRevision.conferee')"> :label="$t('workCenter.enStandardRevision.conferee')">
<user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enStandardRevision.conferee')" <user-selection :placeholder="$t('pleaseSelect') + $t('workCenter.enStandardRevision.conferee')"
v-decorator="['personnelId', validatorRules.personnelId]" @nameChange="handleUserNameChange"/> :disabled="disabled"
:name-str="model.personnel"
v-decorator="['personnelId', validatorRules.personnelId]" @nameChange="handleUserNameChange" />
</a-form-item>
<!--会议资料-->
<a-form-item :labelCol="labelCol"
:wrapperCol="wrapperCol"
:label="$t('businessSupport.standardizationActivity.meetingMaterial')"
v-if="disabled">
<file-echo :file-ids="model.meetingData" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</j-modal> </j-modal>
@@ -41,10 +52,11 @@
<script> <script>
import UserSelection from '../../../../components/selection/UserSelection' import UserSelection from '../../../../components/selection/UserSelection'
import FileEcho from '../../../../components/FileEcho'
export default { export default {
name: 'MeetingModal', name: 'MeetingModal',
components: { UserSelection }, components: { FileEcho, UserSelection },
data () { data () {
return { return {
title: this.$t('businessSupport.standardizationActivity.attendanceRecord'), title: this.$t('businessSupport.standardizationActivity.attendanceRecord'),
@@ -86,12 +98,15 @@ export default {
}], }],
validateTrigger: 'change' validateTrigger: 'change'
} }
} },
disabled: false
} }
}, },
methods: { methods: {
add () { add () {
this.disabled = false
this.visible = true this.visible = true
this.model.source = '1'
}, },
view (record) { view (record) {
this.visible = true this.visible = true
@@ -23,7 +23,7 @@
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
:maxLength="50" :maxLength="50"
disabled disabled
v-decorator="['pName', validatorRules.pName]" /> v-decorator="['supperName', validatorRules.supperName]" />
</a-form-item> </a-form-item>
<!--节点类型--> <!--节点类型-->
<a-form-item :labelCol="labelCol" <a-form-item :labelCol="labelCol"
@@ -145,7 +145,7 @@ export default {
}, },
validatorRules: { validatorRules: {
// 上级节点 // 上级节点
pName: { supperName: {
rules: [{ rules: [{
required: false, required: false,
message: this.$t('pleaseEnter') + this.$t('businessSupport.standardizationActivity.parentNode') message: this.$t('pleaseEnter') + this.$t('businessSupport.standardizationActivity.parentNode')
@@ -16,13 +16,19 @@
:row-selection="needRowSelection ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null"> :row-selection="needRowSelection ? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange } : null">
<template v-slot:file="{text, record, index}"> <template v-slot:file="{text, record, index}">
<!--会后资料如果数据从流程来就是查看如果是新增的就正常显示上传-->
<a-button type="primary" <a-button type="primary"
class="button-text" class="button-text"
@click="clickButtonToUpload(text, index, 'meetingData')"> @click="clickButtonToUpload(text, index, 'meetingData')" v-if="record.source !== '2'">
{{ {{
(text === 'null' || text === '' || text === null || text === undefined) ? $t('uploadFile.clickUpload') : $t('uploadFile.viewUploadedFiles') (text === 'null' || text === '' || text === null || text === undefined) ? $t('uploadFile.clickUpload') : $t('uploadFile.viewUploadedFiles')
}} }}
<a></a>
</a-button> </a-button>
<div class="action-span-cell" v-else>
<a @click="handleView(record)">{{ $t('view') }}</a>
</div>
</template> </template>
</j-table> </j-table>
@@ -151,6 +157,9 @@ export default {
/** 赋值给当前对应的表单文件 */ /** 赋值给当前对应的表单文件 */
this.$set(this.realDataSource[this.uploadTable.index], this.uploadTable.dbFieldName, attIdList.join(',')) this.$set(this.realDataSource[this.uploadTable.index], this.uploadTable.dbFieldName, attIdList.join(','))
this.$emit('ok', this.realDataSource) this.$emit('ok', this.realDataSource)
},
handleView (record) {
this.$refs.formModal.view(record)
} }
} }
} }