diff --git a/src/views/processManagement/bathRefine/workCenterDevice.vue b/src/views/processManagement/bathRefine/workCenterDevice.vue index 8be0be0..4a8697f 100644 --- a/src/views/processManagement/bathRefine/workCenterDevice.vue +++ b/src/views/processManagement/bathRefine/workCenterDevice.vue @@ -82,7 +82,7 @@ export default { searchSpan: 6, searchMenuPosition: 'right', align: 'center', - span:24, + span: 24, column: [ { label: '作业中心', @@ -109,19 +109,34 @@ export default { value: 'id', }, }, - + // craftManName { label: '工艺员', prop: 'craftManName', type: 'select', filterable: true, clearable: true, - span:24, - // multiple: true, + span: 24, + search: false, + sortable: true, + overHidden: true, + headerAlign: 'center', + align: 'center', + display: false, + }, + + { + label: '工艺员', + prop: 'craftManId', + type: 'select', + filterable: true, + clearable: true, + span: 24, search: false, sortable: true, overHidden: true, headerAlign: 'center', + hide: true, align: 'center', dicUrl: '/blade-system/user/page?current=1&&size=99999', props: { @@ -129,6 +144,9 @@ export default { value: 'id', res: 'data.records', }, + change: (val, row) => { + this.onChangeData(val, row, 'craftManId'); + }, rules: [ { required: true, @@ -161,6 +179,11 @@ export default { }, mounted() {}, methods: { + onChangeData(value, row, type) { + if (value.value && type == 'craftManId') { + this.form.craftManName = value.item.realName; + } + }, rowDel(row) { this.$confirm('确定将选择数据删除?', { confirmButtonText: '确定', diff --git a/src/views/processManagement/components/inPlantMaintenance.vue b/src/views/processManagement/components/inPlantMaintenance.vue index a458fb0..74faeab 100644 --- a/src/views/processManagement/components/inPlantMaintenance.vue +++ b/src/views/processManagement/components/inPlantMaintenance.vue @@ -262,7 +262,7 @@ export default { }, { label: '工艺员', - prop: 'proMan', + prop: 'proManName', search: false, sortable: true, filter: true, @@ -272,12 +272,6 @@ export default { type: 'select', filterable: true, clearable: true, - dicUrl: '/blade-system/user/page?current=1&&size=99999', - props: { - label: 'realName', - value: 'id', - res: 'data.records', - }, rules: [ { required: true, diff --git a/src/views/processManagement/components/processMainte/partDetails.vue b/src/views/processManagement/components/processMainte/partDetails.vue index 9389644..15357d6 100644 --- a/src/views/processManagement/components/processMainte/partDetails.vue +++ b/src/views/processManagement/components/processMainte/partDetails.vue @@ -35,8 +35,8 @@ @@ -83,7 +83,7 @@ - + {{ formData.productApplicationArea }} @@ -186,12 +186,12 @@ - + {{ formData.expirationPeriod }} - + {{ formData.advanceRemind }} @@ -326,18 +326,18 @@ {{ formData.formingThickness }} - - + + {{ formData.productApplicationArea }} - + {{ formData.blbDiameter }} - + {{ formData.externalDiameter }} @@ -1194,4 +1194,8 @@ export default { height: 36px !important; /* 设置你想要的高度 */ line-height: 36px !important; } +:deep(.el-form-item__label) { + font-weight: 550 !important; + // color: #333; +} diff --git a/src/views/processManagement/inPlantProcess.vue b/src/views/processManagement/inPlantProcess.vue index fabeded..b6a2e96 100644 --- a/src/views/processManagement/inPlantProcess.vue +++ b/src/views/processManagement/inPlantProcess.vue @@ -183,7 +183,7 @@ export default { }, { label: '工艺员', - prop: 'proMan', + prop: 'proManName', search: false, sortable: true, filter: true, @@ -191,12 +191,6 @@ export default { headerAlign: 'center', align: 'center', searchLabelWidth: 60, - dicUrl: '/blade-system/user/page?current=1&&size=99999', - props: { - label: 'name', - value: 'id', - res: 'data.records', - }, }, { label: '备注', diff --git a/src/views/processManagement/procepssPlanning.vue b/src/views/processManagement/procepssPlanning.vue index e12cffd..c016558 100644 --- a/src/views/processManagement/procepssPlanning.vue +++ b/src/views/processManagement/procepssPlanning.vue @@ -185,7 +185,7 @@ export default { }, { label: '热表零件', - value: '2', + value: '0', }, ], }, diff --git a/src/views/processManagement/sinTer/index.vue b/src/views/processManagement/sinTer/index.vue index 2acdb8f..a1246e8 100644 --- a/src/views/processManagement/sinTer/index.vue +++ b/src/views/processManagement/sinTer/index.vue @@ -212,105 +212,129 @@ export default { this.isSubOpen = false; this.isComponentOpen = false; }, - getTextWidth(text, fontSize = 14) { + getTextWidth(text, fontSize = 12) { // 中文字符宽度≈fontSize,英文字符≈fontSize/2,加额外内边距 const cnChar = text.replace(/[a-zA-Z0-9]/g, '').length; const enChar = text.length - cnChar; - return cnChar * fontSize + enChar * (fontSize / 2) + 20; // +20 内边距 + return cnChar * fontSize + enChar * (fontSize / 2) + 10; // +20 内边距 }, // 图表 createBarChart(value) { - const mapBoxEchart = this.$echarts.init(this.$refs.lineChart); - const option = { - series: [ - { - roam: true, - type: 'tree', - data: value || [], - top: '20%', - left: '7%', - bottom: '20%', - right: '20%', - expandAndCollapse: false, - animationDuration: 550, - animationDurationUpdate: 750, - orient: 'vertical', - symbol: 'roundRect', - itemStyle: { - color: '#284c89', - borderWidth: 2, - borderColor: '#fff', - borderRadius: 4, // 圆角半径,值越大圆角越明显 - paddingLeft: 10, - }, - // 动态计算节点大小:宽度=最长文本宽度,高度=行数*行高+内边距 - symbolSize: (val, params) => { - // 容错:params为空/无name时给默认值 - const nodeName = params?.name || '未知节点'; - const childCount = params?.children?.length || 0; - const childText = `${childCount}个子件`; - const nodeQuota = nodeData?.quota !== undefined ? nodeData.quota : ''; + // 销毁旧的 ECharts 实例 + if (this.mapBoxEchart) { + this.mapBoxEchart.dispose(); + this.mapBoxEchart = null; + } - // 计算文本宽度 - const textWidth = Math.max(nodeName.length * 12, childText.length * 12) + 30; - // 动态计算行数 - let lineCount = 2; // 默认 2 行(partCode + name) - if (nodeQuota !== '' && nodeQuota !== null) { - lineCount = 3; // 有 quota 时 3 行 - } - // 计算高度:每行 20px + 上下内边距 20px - const height = lineCount * 20 + 10; - return [Math.max(textWidth, 100), height]; // 高度设为60px(适配两行文本) - }, + this.$nextTick(() => { + if (!this.$refs.lineChart) return; + + const mapBoxEchart = this.$echarts.init(this.$refs.lineChart); + this.mapBoxEchart = mapBoxEchart; + + const option = { + tooltip: { + trigger: 'item', + triggerOn: 'mousemove', + }, + series: [ + { + roam: true, + type: 'tree', + data: value || [], + top: '10%', + left: '5%', + bottom: '10%', + right: '10%', + expandAndCollapse: false, // 允许展开收起 + initialTreeDepth: 2, // 初始展开层级 + animationDuration: 550, + animationDurationUpdate: 750, + orient: 'vertical', + symbol: 'roundRect', + itemStyle: { + color: '#284c89', + borderWidth: 2, + borderColor: '#fff', + borderRadius: 2, + }, + // 节点间距配置(关键) + // nodePadding: [30, 100], // [上下间距,左右间距] + // layerPadding: 80, // 层级间距 + // 动态计算节点大小 + symbolSize: (val, params) => { + const nodeData = params?.data || params; + const nodeName = nodeData?.name || '未知节点'; + const nodePartCode = nodeData?.partCode || ''; + const nodeQuota = nodeData?.quota !== undefined ? nodeData.quota : ''; + + // 计算文本宽度 + const nameWidth = this.getTextWidth(nodeName); + const codeWidth = this.getTextWidth(nodePartCode); + const quotaWidth = nodeQuota ? this.getTextWidth(`${nodeQuota}个`) : 0; + + const maxWidth = Math.max(nameWidth, codeWidth, quotaWidth, 60); + + // 动态计算行数 + let lineCount = 2; + if (nodeQuota !== '' && nodeQuota !== null) { + lineCount = 3; + } + const height = lineCount * 20 + 10; - label: { - position: 'inside', - show: true, - align: 'center', - verticalAlign: 'middle', - fontSize: 12, - lineHeight: 20, - color: '#fff', - formatter: params => { - const childText = params.data.quota >= 0 ? `${params.data.quota}个` : ''; - // 去掉模板字符串缩进,用\n换行,避免多余空白 - return `${params.data.partCode}\n${params.name}${ - childText ? '\n' + childText : '' - }`; + return [Math.max(maxWidth, 60), height]; + }, + label: { + position: 'inside', + show: true, + align: 'center', + verticalAlign: 'middle', + fontSize: 12, + lineHeight: 18, + color: '#fff', + formatter: params => { + const nodeData = params.data || params; + const quotaText = nodeData.quota >= 0 ? `${nodeData.quota}个` : ''; + let result = `${nodeData.partCode}\n${nodeData.name}`; + if (quotaText) { + result += '\n' + quotaText; + } + return result; + }, + }, + // 连线样式 + lineStyle: { + color: '#ccc', + width: 1.5, + curveness: 0.5, }, }, - }, - ], - }; - // 使用制定的配置项和数据显示图表 - mapBoxEchart.setOption(option, true); - // // 窗口大小改变时,重新渲染图表 - window.addEventListener( - 'resize', - function () { - mapBoxEchart.resize(); - }, - 200 - ); - // 4. 核心:监听点击事件,实现label跳转 - mapBoxEchart.on('click', params => { - // 过滤条件:仅点击节点(label/text)时触发,排除连接线等 - if (params.componentType === 'series' && params.seriesType === 'tree' && params.data) { - window.open(`${params.data.docLink}`, '_blank'); - } + ], + }; + + mapBoxEchart.setOption(option, true); + + window.addEventListener('resize', () => { + if (this.mapBoxEchart) { + this.mapBoxEchart.resize(); + } + }); + + mapBoxEchart.on('dblclick', params => { + if (params.componentType === 'series' && params.seriesType === 'tree' && params.data) { + window.open(`${params.data.docLink}`, '_blank'); + } + }); }); }, }, }; diff --git a/src/views/processManagement/taskProcessing.vue b/src/views/processManagement/taskProcessing.vue index 6eb5434..9ecabf3 100644 --- a/src/views/processManagement/taskProcessing.vue +++ b/src/views/processManagement/taskProcessing.vue @@ -284,7 +284,7 @@ export default { }, { label: '返工原因', - prop: 'craftMan', + prop: 'reworkReason', sortable: true, search: false, overHidden: true,