el-table 组件实现 “合并单元格 + N行数据小计” 功能

目录

  • 需求 - 要实现的效果
  • 初始代码
  • 代码升级(可供多个表格使用)
    • `CommonTable.vue 子组件 `
    • 使用子组件1 - `父组件 - 图1~图3使用`
      • 效果展示
    • 使用子组件2 - `父组件 - 图4使用`
      • 效果展示
  • 注意
  • 【代码优化 - 解决bug】

需求 - 要实现的效果

在这里插入图片描述

父组件中 info 数据示例

const info = {itemMap: {警告: [{total: 28,cfzl: '1',cfzlView: '警告',wfxl: '12',wfxlView: '超速行驶',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 3,cfzl: '1',cfzlView: '警告',wfxl: '17',wfxlView: '未低速通过',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 6,cfzl: '1',cfzlView: '警告',wfxl: '26',wfxlView: '违法停车',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 21,cfzl: '1',cfzlView: '警告',wfxl: '28',wfxlView: '违法装载',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 3,cfzl: '1',cfzlView: '警告',wfxl: '49',wfxlView: '其他影响安全行为',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 1,cfzl: '1',cfzlView: '警告',wfxl: '28',wfxlView: '违法装载',jtfs: 'B21',jtfsView: '中型栏板半挂车'}],罚款: [{total: 56,cfzl: '2',cfzlView: '罚款',wfxl: '12',wfxlView: '超速行驶',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 6,cfzl: '2',cfzlView: '罚款',wfxl: '17',wfxlView: '未低速通过',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 12,cfzl: '2',cfzlView: '罚款',wfxl: '26',wfxlView: '违法停车',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 42,cfzl: '2',cfzlView: '罚款',wfxl: '28',wfxlView: '违法装载',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 6,cfzl: '2',cfzlView: '罚款',wfxl: '49',wfxlView: '其他影响安全行为',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{total: 2,cfzl: '2',cfzlView: '罚款',wfxl: '28',wfxlView: '违法装载',jtfs: 'B21',jtfsView: '中型栏板半挂车'}]},columns: [{// total: 28,// cfzl: '1',// cfzlView: '警告',// wfxl: '12',// wfxlView: '超速行驶',jtfs: 'B11',jtfsView: '重型栏板半挂车'},{// total: 1,// cfzl: '1',// cfzlView: '警告',// wfxl: '28',// wfxlView: '违法装载',jtfs: 'B21',jtfsView: '中型栏板半挂车'}]
}

初始代码

父组件

<!-- info 数据来源 → info 数据示例 -->
<CommonTable :info="info"/>

CommonTable.vue 子组件

<template><el-table:data="tableData"borderstripemax-height="400"size="mini":span-method="firstColMergeSpan"><el-table-column align="center" prop="cfzl" label="处罚种类" /><el-table-column align="center" prop="wfxwfl" label="违法行为分类" /><el-table-columnv-for="(item, index) in columns":key="index"align="center":prop="item.jtfs":label="item.jtfsView || '-'"><template slot-scope="{ row, $index }"><span>{{ row[item.jtfs] | noDataFilter }}</span></template></el-table-column><el-table-column align="center" prop="xj" label="小计" /></el-table>
</template><script>
export default {name: 'CommonTable',components: {},props: {info: {type: Object,required: true}},data() {return {spanArr: []}},computed: {tableData() {const list = []Object.entries(this.info?.itemMap || {}).forEach((i) => {i[1]?.forEach((ii) => {list.push({// cfzl: ii.cfzlView,cfzl: i[0],wfxwfl: ii.wfxlView,[ii.jtfs]: ii.total,jtfs: ii.jtfs})})})return list.map((item) => {return {...item,xj: this.columnKeyList.reduce((a, b) => {return a + (item[b] || 0)}, 0)}})},columns() {return this.info.columns || []},columnKeyList() {return this.columns.map((item) => item.jtfs)}},watch: {info() {this.xjPosition()this.firstColMergeCount()}},created() {},methods: {// 计算小计行插入位置xjPosition(Human = this.tableData) {const doctorMap = {}for (let i = 0; i < Human.length; i++) {// 找出相同名称的行数const doctorName = Human[i].cfzlif (doctorMap[doctorName] !== undefined) {doctorMap[doctorName].push(i)} else {doctorMap[doctorName] = [i]}}const keyArr = []for (const k in doctorMap) {// 取出key并倒序,防止正序插入会影响行下标keyArr.unshift(k)}keyArr.forEach((ele, index) => {const lastIndex = doctorMap[ele][doctorMap[ele].length - 1] // 找出相同名称最后一行插入合计数据const obj = this.xjRowDataCalc(Human, ele) // 计算出小计行数据Human.splice(lastIndex + 1, 0, obj) // 插入})},// 小计行计算xjRowDataCalc(data, name) {const obj = {cfzl: name, // 第一列用于合并单元格wfxwfl: '小计'}this.columnKeyList.forEach((key) => {obj[key] = 0})data.forEach((item) => {// “处罚种类” 相同的加起来if (item.cfzl === name) {this.columnKeyList.forEach((key) => {obj[key] += Number(item[key] || 0)})}})obj.xj = this.columnKeyList.reduce((a, b) => {return a + (obj[b] || 0)}, 0)return obj},// 合并单元格firstColMergeSpan({ row, column, rowIndex, columnIndex }) {if (columnIndex === 0) {const _row = this.spanArr[rowIndex]const _col = _row > 0 ? 1 : 0return {rowspan: _row,colspan: _col}}},// 计算要合并的单元格firstColMergeCount() {let contactDot = 0this.spanArr = []this.tableData.forEach((item, index) => {item.index = indexif (index === 0) {this.spanArr.push(1)} else {// 根据相同 “处罚种类” 来合并if (item.cfzl === this.tableData[index - 1].cfzl) {this.spanArr[contactDot] += 1this.spanArr.push(0)} else {contactDot = indexthis.spanArr.push(1)}}})}}
}
</script><style lang='scss' scoped>
</style>

代码升级(可供多个表格使用)

图1
在这里插入图片描述
图2
在这里插入图片描述
图3
在这里插入图片描述
图4
在这里插入图片描述

根据接口返回数据不同(数据格式一致,只是部分字段名不一致),向子组件传入不同的字段名。

CommonTable.vue 子组件

<template><el-table:data="tableData"borderstripemax-height="400"size="mini":span-method="firstColMergeSpan"><!-- 第一列 --><el-table-column align="center" :prop="oneColPropField" :label="oneColLabelField" /><!-- 第二列 --><el-table-column align="center" :prop="twoColPropField" :label="twoColLabelField" /><!-- 其他数量列 --><el-table-columnv-for="(item, index) in columns":key="index"align="center":prop="item[countColPropsField]":label="item[countColLabelField] || '-'"><template slot-scope="{ row, $index }"><span>{{ row[item[countColPropsField]] | noDataFilter }}</span></template></el-table-column><!-- “小计”列 --><el-table-column align="center" prop="xj" label="小计" /></el-table>
</template><script>
export default {name: 'CommonTable',components: {},props: {info: {type: Object,required: true},// 自定义表格列selfColumns: {type: Array,default: () => []},// 表格列非自定义时(接口获取)列字段名columnKeyField: {type: String,default: 'jtfs'},// 第一列字段名oneColPropField: {type: String,required: true},// 第一列展示header文本oneColLabelField: {type: String,required: true},// 第一列数据来源字段名oneColDataField: {type: String,required: true},// 第二列字段名twoColPropField: {type: String,required: true},// 第二列展示header文本twoColLabelField: {type: String,required: true},// 第二列数据来源字段名twoColDataField: {type: String,required: true},// 其他数量 列 字段名countColPropsField: {type: String,default: 'jtfs'},// 其他数量 列 展示header文本字段名countColLabelField: {type: String,default: 'jtfsView'},// 其他数量 列 数据来源字段名countColDataField: {type: String,default: 'total'}},data() {return {spanArr: []}},computed: {// 表格数据处理tableData() {const list = []Object.entries(this.info?.itemMap || {}).forEach((i) => {i[1]?.forEach((ii) => {list.push({// [this.oneColPropField]: ii[this.oneColDataField] // 第一列数据(第一列数据部分表格 ii 中无第一列数据,所以使用↓↓↓下一行代码 i[0] 取第一列数据)[this.oneColPropField]: i[0], // 第一列数据[this.twoColPropField]: ii[this.twoColDataField], // 第二列数据[ii[this.countColPropsField]]: ii[this.countColDataField] // 其他数量列数据// jtfs: ii.jtfs})})})return list.map((item) => {return {...item,// 计算小计数量xj: this.columnKeyList.reduce((a, b) => {return a + (item[b] || 0)}, 0)}})},columns() {/*** 表格列获取*    父组件有传表格列 selfColumns 就用 selfColumns*    否则用接口获的表格列*/return (this.selfColumns.length && this.selfColumns) || this.info.columns || []},columnKeyList() {// 获取表格每列字段名组成数组return this.columns.map((item) => item[this.columnKeyField])}},watch: {info() {this.xjPosition()this.oneColMergeCount()}},created() {},methods: {// 计算小计行插入位置xjPosition(Human = this.tableData) {const doctorMap = {}for (let i = 0; i < Human.length; i++) {// 找出相同名称的行数const doctorName = Human[i][this.oneColPropField]if (doctorMap[doctorName] !== undefined) {doctorMap[doctorName].push(i)} else {doctorMap[doctorName] = [i]}}const keyArr = []for (const k in doctorMap) {// 取出key并倒序,防止正序插入会影响行下标keyArr.unshift(k)}keyArr.forEach((ele, index) => {const lastIndex = doctorMap[ele][doctorMap[ele].length - 1] // 找出相同名称最后一行插入合计数据const obj = this.xjRowDataCalc(Human, ele) // 计算出小计行数据Human.splice(lastIndex + 1, 0, obj) // 插入})},// 小计行数据计算xjRowDataCalc(data, name) {const obj = {[this.oneColPropField]: name, // 第一列用于合并单元格[this.twoColPropField]: '小计' // 第二列数据}this.columnKeyList.forEach((key) => {obj[key] = 0 // 其他书两列数据})data.forEach((item) => {// 第一列 oneColPropField 数据相同的加起来if (item[this.oneColPropField] === name) {this.columnKeyList.forEach((key) => {obj[key] += Number(item[key] || 0)})}})// 小计列数据总和(小计行和小计列交汇处数据)obj.xj = this.columnKeyList.reduce((a, b) => {return a + (obj[b] || 0)}, 0)return obj},// 合并单元格firstColMergeSpan({ row, column, rowIndex, columnIndex }) {if (columnIndex === 0) {const _row = this.spanArr[rowIndex]const _col = _row > 0 ? 1 : 0return {rowspan: _row,colspan: _col}}},// 计算要合并的单元格oneColMergeCount() {let contactDot = 0this.spanArr = []this.tableData.forEach((item, index) => {item.index = indexif (index === 0) {this.spanArr.push(1)} else {// 第一列相同的合并if (item[this.oneColPropField] === this.tableData[index - 1][this.oneColPropField]) {this.spanArr[contactDot] += 1this.spanArr.push(0)} else {contactDot = indexthis.spanArr.push(1)}}})}}
}
</script><style lang='scss' scoped>
</style>

使用子组件1 - 父组件 - 图1~图3使用

<!-- info 数据来源 → info 数据示例 -->
<CommonTable:info="info"one-col-prop-field="cfzl"one-col-label-field="处罚种类"one-col-data-field="cfzlView"two-col-prop-field="wfxwfl"two-col-label-field="违法行为分类"two-col-data-field="wfxlView"
/>

效果展示

在这里插入图片描述

使用子组件2 - 父组件 - 图4使用

<CommonTable:info="info"one-col-prop-field="cfzl"one-col-label-field="处罚种类"one-col-data-field="cfzlView"two-col-prop-field="wfxwfl"two-col-label-field="违法行为分类"two-col-data-field="wfxlView"column-key-field="timenum"count-col-props-field="timenum"count-col-label-field="label":self-columns="columns"
/><script>export default {data() {return {columns: [...Array(24).keys()].map((item) => {return {timenum: `${item}`,label: `${item}-${item + 1}`}}),info: {itemMap: {警告: [{timenum: 17,total: 9,cfzl: '1',cfzlView: '警告',wfxl: '69',wfxlView: '其他影响安全行为',jtfs: null,jtfsView: null},{timenum: 17,total: 3,cfzl: '1',cfzlView: '警告',wfxl: '58',wfxlView: '违法上道路行驶',jtfs: null,jtfsView: null}]},columns: []}}}}
</script>

效果展示

在这里插入图片描述

注意

  • 使用子组件1 和 使用子组件2 中 info 数据不同

【代码优化 - 解决bug】

解决数据重复问题
在这里插入图片描述

在这里插入图片描述

<template><el-table:data="tableData"borderstripemax-height="400"size="mini":span-method="firstColMergeSpan"><!-- 第一列 --><el-table-column align="center" :prop="oneColPropField" :label="oneColLabelField" /><!-- 第二列 --><el-table-column align="center" :prop="twoColPropField" :label="twoColLabelField" /><!-- 其他数量列 --><el-table-columnv-for="(item, index) in columns":key="index"align="center":prop="item[countColPropsField]":label="item[countColLabelField] || '-'"><template slot-scope="{ row, $index }"><span>{{ row[item[countColPropsField]] | noDataFilter }}</span></template></el-table-column><!-- “小计”列 --><el-table-column align="center" prop="xj" label="小计" /></el-table>
</template><script>
export default {name: 'CommonTable',components: {},props: {info: {type: Object,required: true},// 自定义表格列selfColumns: {type: Array,default: () => []},// 表格列非自定义时(接口获取)列字段名columnKeyField: {type: String,default: 'jtfs'},// 第一列字段名oneColPropField: {type: String,required: true},// 第一列展示header文本oneColLabelField: {type: String,required: true},// 第一列数据来源字段名oneColDataField: {type: String,required: true},// 第二列字段名twoColPropField: {type: String,required: true},// 第二列展示header文本twoColLabelField: {type: String,required: true},// 第二列数据来源字段名twoColDataField: {type: String,required: true},// 其他数量 列 字段名countColPropsField: {type: String,default: 'jtfs'},// 其他数量 列 展示header文本字段名countColLabelField: {type: String,default: 'jtfsView'},// 其他数量 列 数据来源字段名countColDataField: {type: String,default: 'total'}},data() {return {spanArr: []}},computed: {// 表格数据处理tableData() {const list = []Object.entries(this.info?.itemMap || {}).forEach((i) => {i[1]?.forEach((ii) => {/** ** 解决数据重复问题 start ****/const listDataIndex = list.findIndex((listItem) => listItem[this.twoColPropField] === ii[this.twoColDataField] )// 判断即将要 push 进 list 的数据 是否与 list 中已有数据的第二列数据有重复,有重复的话,就在 list 中重复的第二列数据的行数据中只添加当前数据为“其他数量列数据”if (listDataIndex !== -1) {list[listDataIndex][ii[this.countColPropsField]] = ii[this.countColDataField]return}/** ** 解决数据重复问题 end ****/list.push({// [this.oneColPropField]: ii[this.oneColDataField] // 第一列数据(第一列数据部分表格 ii 中无第一列数据,所以使用↓↓↓下一行代码 i[0] 取第一列数据)[this.oneColPropField]: i[0], // 第一列数据[this.twoColPropField]: ii[this.twoColDataField], // 第二列数据[ii[this.countColPropsField]]: ii[this.countColDataField] // 其他数量列数据// jtfs: ii.jtfs})})})return list.map((item) => {return {...item,// 计算小计数量xj: this.columnKeyList.reduce((a, b) => {return a + (item[b] || 0)}, 0)}})},columns() {/*** 表格列获取*    父组件有传表格列 selfColumns 就用 selfColumns*    否则用接口获的表格列*/return (this.selfColumns.length && this.selfColumns) || this.info.columns || []},columnKeyList() {// 获取表格每列字段名组成数组return this.columns.map((item) => item[this.columnKeyField])}},watch: {info() {this.xjPosition()this.oneColMergeCount()}},created() {},methods: {// 计算小计行插入位置xjPosition(Human = this.tableData) {const doctorMap = {}for (let i = 0; i < Human.length; i++) {// 找出相同名称的行数const doctorName = Human[i][this.oneColPropField]if (doctorMap[doctorName] !== undefined) {doctorMap[doctorName].push(i)} else {doctorMap[doctorName] = [i]}}const keyArr = []for (const k in doctorMap) {// 取出key并倒序,防止正序插入会影响行下标keyArr.unshift(k)}keyArr.forEach((ele, index) => {const lastIndex = doctorMap[ele][doctorMap[ele].length - 1] // 找出相同名称最后一行插入合计数据const obj = this.xjRowDataCalc(Human, ele) // 计算出小计行数据Human.splice(lastIndex + 1, 0, obj) // 插入})},// 小计行数据计算xjRowDataCalc(data, name) {const obj = {[this.oneColPropField]: name, // 第一列用于合并单元格[this.twoColPropField]: '小计' // 第二列数据}this.columnKeyList.forEach((key) => {obj[key] = 0 // 其他书两列数据})data.forEach((item) => {// 第一列 oneColPropField 数据相同的加起来if (item[this.oneColPropField] === name) {this.columnKeyList.forEach((key) => {obj[key] += Number(item[key] || 0)})}})// 小计列数据总和(小计行和小计列交汇处数据)obj.xj = this.columnKeyList.reduce((a, b) => {return a + (obj[b] || 0)}, 0)return obj},// 合并单元格firstColMergeSpan({ row, column, rowIndex, columnIndex }) {if (columnIndex === 0) {const _row = this.spanArr[rowIndex]const _col = _row > 0 ? 1 : 0return {rowspan: _row,colspan: _col}}},// 计算要合并的单元格oneColMergeCount() {let contactDot = 0this.spanArr = []this.tableData.forEach((item, index) => {item.index = indexif (index === 0) {this.spanArr.push(1)} else {// 第一列相同的合并if (item[this.oneColPropField] === this.tableData[index - 1][this.oneColPropField]) {this.spanArr[contactDot] += 1this.spanArr.push(0)} else {contactDot = indexthis.spanArr.push(1)}}})}}
}
</script><style lang='scss' scoped>
</style>

【注】计算小计插入位置等部分方法参考文章 https://blog.csdn.net/seeeeeeeeeee/article/details/133122424

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/14511.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

内网安全之证书服务基础知识

PKI公钥基础设施 PKI(Public Key Infrastructure)公钥基础设施&#xff0c;是提供公钥加密和数字签名服务的系统或平台&#xff0c;是一个包括硬件、软件、人员、策略和规程的集合&#xff0c;用来实现基于公钥密码体制的密钥和证书的产生、管理、存储、分发和撤销等功能。企业…

element-plus:踩坑日记

el-table Q&#xff1a;有fixed属性时&#xff0c;无数据时&#xff0c;可能出现底部边框消失的bug 现象&#xff1a; 解决方法&#xff1a; .el-table__empty-block {border-bottom: 1px solid var(--el-table-border-color); } el-collapse 折叠面板 Q&#xff1a;标题上…

云平台的安全能力提升解决方案

提升云平台的安全能力是确保数据和服务安全的关键步骤。针对大型云平台所面临的云上安全建设问题&#xff0c;安全狗提供完整的一站式云安全解决方案&#xff0c;充分匹配云平台安全管理方的需求和云租户的安全需求。协助大型云平台建设全网安全态势感知、统一风险管理、统一资…

PCIE协议-4-物理层逻辑模块

4.1 简介 物理层将事务层和数据链路层与用于链路数据交换的信令技术隔离开来。物理层被划分为逻辑物理层和电气物理层子模块&#xff08;见图4-1&#xff09;。 4.2 逻辑物理层子模块 逻辑子模块有两个主要部分&#xff1a;一个发送部分&#xff0c;它准备从数据链路层传递过…

v-md-editor和SSE实现ChatGPT的打字机式输出

概述 不论是GPT还是文心一言&#xff0c;在回答的时候类似于打字机式的将答案呈现给我们&#xff0c;这样的交互一方面比较友好&#xff0c;另一方面&#xff0c;当答案比较多、生成比较慢的时候也能争取一些答案的生成时间。本文后端使用express和stream&#xff0c;使用SSE将…

Boosting Cache Performance by Access Time Measurements——论文泛读

TOC 2023 Paper 论文阅读笔记整理 问题 大多数现代系统利用缓存来减少平均数据访问时间并优化其性能。当缓存未命中的访问时间不同时&#xff0c;最大化缓存命中率与最小化平均访问时间不同。例如&#xff1a;系统使用多种不同存储介质时&#xff0c;不同存储介质访问时间不同…

【C++初阶】—— 类和对象 (上)

&#x1f4dd;个人主页&#x1f339;&#xff1a;EterNity_TiMe_ ⏩收录专栏⏪&#xff1a;C “ 登神长阶 ” &#x1f339;&#x1f339;期待您的关注 &#x1f339;&#x1f339; 类和对象 1. 初步认识C2. 类的引入3. 类的定义声明和定义全部放在类体中声明和定义分开存放 4.…

8个实用网站和软件,收藏起来一定不后悔~

整理了8个日常生活中经常能用得到的网站和软件&#xff0c;收藏起来一定不会后悔~ 1.ZLibrary zh.zlibrary-be.se/这个网站收录了超千万的书籍和文章资源&#xff0c;国内外的各种电子书资源都可以在这里搜索&#xff0c;98%以上都可以在网站内找到&#xff0c;并且支持免费下…

linux中ansible整理笔记

一、工作模式 1. adhoc临时命令 语法&#xff1a; ansible 主机或者组列表 -m 模块 -a “参数” 2. playbook 语法&#xff1a; ansible-playbook xxx.yml 二、模块 1. ping 2.command:默认模块&#xff08;不支持重定向&#xff0c;管道&#xff09; 3.shell:类似com…

IP地址显示“不安全”怎么办|已解决

解决IP地址显示“不安全”的问题&#xff0c;通常需要确保网站或服务使用HTTPS协议进行加密通信&#xff0c;可以通过部署SSL证书来解决&#xff0c;以下是具体的解决步骤&#xff1a; 1 申请IP地址SSL证书&#xff1a;网站管理员应向证书颁发机构&#xff08;CA&#xff09;申…

网络拓扑—WEB-IIS服务搭建

文章目录 WEB-IIS服务搭建网络拓扑配置网络IISPC 安装IIS服务配置IIS服务&#xff08;默认站点&#xff09;PC机访问网页 配置IIS服务&#xff08;新建站点&#xff09;PC机访问网页 WEB-IIS服务搭建 网络拓扑 //交换机忽略不计 IIS服务IP&#xff1a;192.168.1.1 PC机IP&…

人类交互2 听觉处理和语言中枢

人类听觉概述 人类听觉是指通过耳朵接收声音并将其转化为神经信号&#xff0c;从而使我们能够感知和理解声音信息的能力。听觉是人类五种感觉之一&#xff0c;对我们的日常生活和交流至关重要。 听觉是人类交流和沟通的重要工具。通过听觉&#xff0c;我们能够听到他人的语言…

安装错误提示Please run MaterialLibrary2018.msi first或者其他MaterialLibrary版本

打开autoremove&#xff0c;系统检查&#xff0c;点击开始检查。检查完成修复。 可以解决部分该问题&#xff0c;如果没解决的请咨询

Linux中的文件描述符

1.系统调用接口和库函数的关系 函数&#xff1a;fopen fclose fread fwrite 都是c标准库当中的函数&#xff0c;也就是用户操作接口中ibc系统调用&#xff1a;open close read write 都是系统调用提供的接口 c语言中接口底层封装的都是系统调用接口 FILE* stdin stdout stderr…

Python模块、包和异常处理

大家好&#xff0c;在当今软件开发领域&#xff0c;Python作为一种简洁、易读且功能强大的编程语言&#xff0c;被广泛应用于各种领域。作为一名测试开发工程师&#xff0c;熟练掌握Python的模块、包和异常处理是提高代码可维护性和错误处理能力的关键。本文将和大家一起探讨Py…

SAP-MRP和采购申请

1、如果采购申请是手工创建的,跑MRP会不会被覆盖? 创建一个采购申请18089476,然后运行MRP-MD03,再用MD04查看下 从上图看,手工创建的采购申请被打上*号,没有被覆盖掉。 2、如果采购申请被审批了,会不会被覆盖掉? 首先创建一个独立需求MD61 然后库存消耗掉为0,运行M…

普源精电收购耐数电子——用“钞能力”拿下“量子”?

「量子市界」聚焦量子前沿&#xff0c;揭秘市场动态┃2024年4月30日&#xff0c;普源精电新增“量子科技”概念。 似乎一夜之间&#xff0c;新增“量子科技”概念的上市企业如雨后春笋般登场——普源精电就是其一。普源精电本就持有耐数电子32.26%股权&#xff0c;于4月2日发布…

c4d云渲染是工程文件会暴露吗?

在数字创意产业飞速发展的今天&#xff0c;C4D云渲染因其高效便捷而备受欢迎。然而&#xff0c;随着技术应用的深入&#xff0c;人们开始关注一个核心问题&#xff1a;在享受云渲染带来的便利的同时&#xff0c;C4D工程文件安全吗&#xff1f;是否会有暴露的风险&#xff1f;下…

【如何让论文中摘要后面的内容不出现在目录中】

首先选择摘要二字&#xff0c;设置为一级标题&#xff0c;然后选择摘要后面的内容设置为正文样式&#xff0c;再选择这一部分看一下是不是都是正文大纲级别&#xff0c;如果是那就可以了。 具体流程如下 1、选择摘要二字&#xff0c;设置为一级标题样式 2、选择摘要后面的文…

x264 码率控制原理:rate_estimate_qscale 函数

rate_estimate_qscale 函数 原理 函数功能:根据目前使用的实际比特数更新一帧的qscale;是一个复杂的决策过程,需要考虑多种因素,如帧类型、编码的复杂度、目标比特率、缓冲区大小等,以确保视频质量和文件大小之间的平衡。函数参数分析:x264_t *h :编码器上下文信息结构…