入表功能调整
Showing
1 changed file
with
7 additions
and
3 deletions
| ... | @@ -748,9 +748,12 @@ const setTableFields = (info) => { | ... | @@ -748,9 +748,12 @@ const setTableFields = (info) => { |
| 748 | costFileds.value = row; | 748 | costFileds.value = row; |
| 749 | const date = new Date(info.baseDate); | 749 | const date = new Date(info.baseDate); |
| 750 | const currDay = date.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long' }); | 750 | const currDay = date.toLocaleDateString('zh-CN', { year: 'numeric', month: 'long' }); |
| 751 | const modifiedStr = currDay.replace(/(\d+)年(\d+)月/, (_, year, month) => { | ||
| 752 | return `${year}年1-${month}月`; | ||
| 753 | }); | ||
| 751 | tableField.value.at(-1).visible = true; | 754 | tableField.value.at(-1).visible = true; |
| 752 | tableField.value = tableField.value.filter(item => item.field.indexOf('name') > -1 || item.field == 'total'); | 755 | tableField.value = tableField.value.filter(item => item.field.indexOf('name') > -1 || item.field == 'total'); |
| 753 | tableField.value.splice(-1, 0, ...fields, { label: currDay, field: 'baseNum', type: 'input', width: 120, align: 'right', columClass: 'edit_cell' }); | 756 | tableField.value.splice(-1, 0, ...fields, { label: modifiedStr, field: 'baseNum', type: 'input', width: 120, align: 'right', columClass: 'edit_cell' }); |
| 754 | // 设置table数据 | 757 | // 设置table数据 |
| 755 | let datas: any = []; | 758 | let datas: any = []; |
| 756 | tableData.value.map(t => { | 759 | tableData.value.map(t => { |
| ... | @@ -1238,7 +1241,7 @@ const exportBookToExcel = async () => { | ... | @@ -1238,7 +1241,7 @@ const exportBookToExcel = async () => { |
| 1238 | border: borderStyle // 添加边框样式 | 1241 | border: borderStyle // 添加边框样式 |
| 1239 | } | 1242 | } |
| 1240 | 1243 | ||
| 1241 | // 判断当前列是否为数值列 | 1244 | // 判断当前列是否为数值列 |
| 1242 | const isNumeric = isNumericColumn[C]; | 1245 | const isNumeric = isNumericColumn[C]; |
| 1243 | // 数值列的对齐方式 | 1246 | // 数值列的对齐方式 |
| 1244 | const alignment = { | 1247 | const alignment = { |
| ... | @@ -1384,7 +1387,7 @@ onUpdated(() => { | ... | @@ -1384,7 +1387,7 @@ onUpdated(() => { |
| 1384 | show-overflow-tooltip> | 1387 | show-overflow-tooltip> |
| 1385 | <template #default="scope"> | 1388 | <template #default="scope"> |
| 1386 | <div class="input_cell" v-if="item.type == 'input'"> | 1389 | <div class="input_cell" v-if="item.type == 'input'"> |
| 1387 | <el-input v-model.trim="scope.row[item.field]" :placeholder="scope.row.edit?'':'--'" | 1390 | <el-input v-model.trim="scope.row[item.field]" :placeholder="scope.row.edit ? '' : '--'" |
| 1388 | :maxlength="item.maxlength ?? ''" @change="(val) => inputChange(val, scope, item.field)" | 1391 | :maxlength="item.maxlength ?? ''" @change="(val) => inputChange(val, scope, item.field)" |
| 1389 | @input="(val) => inputEventChange(val, scope, item.field)" | 1392 | @input="(val) => inputEventChange(val, scope, item.field)" |
| 1390 | :disabled="scope.row.edit ? false : true" clearable></el-input> | 1393 | :disabled="scope.row.edit ? false : true" clearable></el-input> |
| ... | @@ -1827,6 +1830,7 @@ onUpdated(() => { | ... | @@ -1827,6 +1830,7 @@ onUpdated(() => { |
| 1827 | 1830 | ||
| 1828 | .input_cell { | 1831 | .input_cell { |
| 1829 | position: relative; | 1832 | position: relative; |
| 1833 | |||
| 1830 | .el-input .el-input__inner { | 1834 | .el-input .el-input__inner { |
| 1831 | text-align: right; | 1835 | text-align: right; |
| 1832 | height: 24px; | 1836 | height: 24px; | ... | ... |
-
Please register or sign in to post a comment