|
@@ -60,87 +60,79 @@
|
|
|
<div v-if="contentEditForm.templateType == '2'">
|
|
<div v-if="contentEditForm.templateType == '2'">
|
|
|
<div class="table-edit-container">
|
|
<div class="table-edit-container">
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="contentEditForm.fixedTable.fixedTables"
|
|
|
|
|
|
|
+ :data="fixedTableDisplayData"
|
|
|
border
|
|
border
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
|
+ :row-class-name="getFixedPreviewRowClass"
|
|
|
>
|
|
>
|
|
|
- <el-table-column
|
|
|
|
|
- label="序号"
|
|
|
|
|
- width="100"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="orderNum"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-table-column label="序号" width="80" align="center">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{
|
|
|
|
|
- (scope.row.fixedValues && scope.row.fixedValues['序号']) ||
|
|
|
|
|
- scope.row.orderNum ||
|
|
|
|
|
- scope.row.orderText ||
|
|
|
|
|
- ''
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ {{ scope.row._displaySeq || '-' }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="父子节点关系" align="center" width="120">
|
|
|
|
|
|
|
+ <el-table-column label="项目" min-width="200" align="left">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-tag
|
|
|
|
|
- v-if="
|
|
|
|
|
- scope.row.isChild ||
|
|
|
|
|
- scope.row.isSubItem ||
|
|
|
|
|
- (scope.row.parentid &&
|
|
|
|
|
- scope.row.parentid != -1 &&
|
|
|
|
|
- scope.row.parentid != '-1')
|
|
|
|
|
- "
|
|
|
|
|
- type="success"
|
|
|
|
|
- size="small"
|
|
|
|
|
- >
|
|
|
|
|
- 子项
|
|
|
|
|
- </el-tag>
|
|
|
|
|
- <el-tag
|
|
|
|
|
- v-else-if="
|
|
|
|
|
- scope.row.parentid === -1 ||
|
|
|
|
|
- scope.row.parentid === '-1' ||
|
|
|
|
|
- !scope.row.parentid
|
|
|
|
|
- "
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="small"
|
|
|
|
|
|
|
+ <span
|
|
|
|
|
+ :class="[
|
|
|
|
|
+ 'table-item-text',
|
|
|
|
|
+ scope.row._isCategory ? 'category-name' : '',
|
|
|
|
|
+ ]"
|
|
|
|
|
+ :style="{ paddingLeft: `${scope.row._indentLevel * 20}px` }"
|
|
|
>
|
|
>
|
|
|
- 父项
|
|
|
|
|
- </el-tag>
|
|
|
|
|
- <el-tag v-else type="info" size="small">无</el-tag>
|
|
|
|
|
|
|
+ {{ scope.row._displayName || '-' }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="单位" width="100" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="!scope.row._isCategory">
|
|
|
|
|
+ {{ scope.row._displayUnit || '-' }}
|
|
|
|
|
+ </span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
- v-for="(item, index) in contentEditForm.fixedTable
|
|
|
|
|
- .fixedTableHeaders"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :label="item.rkey"
|
|
|
|
|
|
|
+ v-for="column in fixedTableValueColumns"
|
|
|
|
|
+ :key="column.key"
|
|
|
|
|
+ :label="column.label"
|
|
|
|
|
+ min-width="120"
|
|
|
align="center"
|
|
align="center"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- {{
|
|
|
|
|
- scope.row.fixedValues
|
|
|
|
|
- ? scope.row.fixedValues[item.rkey]
|
|
|
|
|
- : ''
|
|
|
|
|
- }}
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="!scope.row._isCategory"
|
|
|
|
|
+ :value="scope.row._displayValues[column.key] || ''"
|
|
|
|
|
+ :placeholder="column.placeholder"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
|
|
- label="指标编号"
|
|
|
|
|
- width="100"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="cellCode"
|
|
|
|
|
- ></el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="计算公式"
|
|
|
|
|
- width="100"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="calculationFormula"
|
|
|
|
|
- ></el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- label="单位"
|
|
|
|
|
- width="100"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="unit"
|
|
|
|
|
- ></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="备注" min-width="160" align="left">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <!-- <span v-if="!scope.row._isCategory">
|
|
|
|
|
+ {{ scope.row._displayRemark || '-' }}
|
|
|
|
|
+ </span> -->
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-if="!scope.row._isCategory"
|
|
|
|
|
+ :value="scope.row._displayRemark || ''"
|
|
|
|
|
+ placeholder="请输入备注"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <!-- <el-table-column label="指标编号" width="120" align="center">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="!scope.row._isCategory">
|
|
|
|
|
+ {{ scope.row.cellCode || '-' }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="计算公式" min-width="150" align="left">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="!scope.row._isCategory">
|
|
|
|
|
+ {{ scope.row.calculationFormula || '-' }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column> -->
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -203,6 +195,11 @@
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false,
|
|
default: false,
|
|
|
},
|
|
},
|
|
|
|
|
+ // 父组件传入的监审期间(字符串、数组或范围)
|
|
|
|
|
+ auditPeriodFromParent: {
|
|
|
|
|
+ type: [String, Array],
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
// 弹窗标题
|
|
// 弹窗标题
|
|
|
dialogTitle: {
|
|
dialogTitle: {
|
|
|
type: String,
|
|
type: String,
|
|
@@ -273,6 +270,361 @@
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ auditPeriodYears() {
|
|
|
|
|
+ const collectedYears = []
|
|
|
|
|
+ const pushYear = (year) => {
|
|
|
|
|
+ if (!year) return
|
|
|
|
|
+ const str = String(year).trim()
|
|
|
|
|
+ if (!str) return
|
|
|
|
|
+ const matchList = str.match(/(19|20)\d{2}/g)
|
|
|
|
|
+ if (matchList && matchList.length > 0) {
|
|
|
|
|
+ matchList.forEach((match) => {
|
|
|
|
|
+ if (!collectedYears.includes(match)) {
|
|
|
|
|
+ collectedYears.push(match)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (/^\d{4}$/.test(str)) {
|
|
|
|
|
+ if (!collectedYears.includes(str)) {
|
|
|
|
|
+ collectedYears.push(str)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const parseMaybeString = (value) => {
|
|
|
|
|
+ if (!value) return
|
|
|
|
|
+ if (Array.isArray(value)) {
|
|
|
|
|
+ value.forEach((item) => parseMaybeString(item))
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof value === 'object') {
|
|
|
|
|
+ if (value.value !== undefined) {
|
|
|
|
|
+ parseMaybeString(value.value)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (value.label !== undefined) {
|
|
|
|
|
+ parseMaybeString(value.label)
|
|
|
|
|
+ }
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof value === 'number') {
|
|
|
|
|
+ pushYear(value)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof value === 'string') {
|
|
|
|
|
+ if (value.includes(',')) {
|
|
|
|
|
+ value
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((item) => item.trim())
|
|
|
|
|
+ .forEach((item) => parseMaybeString(item))
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (value.includes('-')) {
|
|
|
|
|
+ const parts = value.split('-')
|
|
|
|
|
+ if (parts.length === 2) {
|
|
|
|
|
+ const start = parseInt(parts[0].trim(), 10)
|
|
|
|
|
+ const end = parseInt(parts[1].trim(), 10)
|
|
|
|
|
+ if (!isNaN(start) && !isNaN(end) && start <= end) {
|
|
|
|
|
+ for (let year = start; year <= end; year++) {
|
|
|
|
|
+ pushYear(year)
|
|
|
|
|
+ }
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ pushYear(value)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const form = this.contentEditForm || {}
|
|
|
|
|
+ const data = form.data || {}
|
|
|
|
|
+ const candidateSources = [
|
|
|
|
|
+ this.auditPeriodFromParent,
|
|
|
|
|
+ form.auditPeriod,
|
|
|
|
|
+ form.auditPeriods,
|
|
|
|
|
+ form.auditPeriodList,
|
|
|
|
|
+ form.auditPeriodArray,
|
|
|
|
|
+ form.auditPeriodStr,
|
|
|
|
|
+ data.auditPeriod,
|
|
|
|
|
+ data.auditPeriods,
|
|
|
|
|
+ data.auditPeriodList,
|
|
|
|
|
+ data.auditPeriodArray,
|
|
|
|
|
+ data.auditPeriodStr,
|
|
|
|
|
+ data.basicInfo && data.basicInfo.auditPeriod,
|
|
|
|
|
+ data.basicInfo && data.basicInfo.auditPeriodArray,
|
|
|
|
|
+ data.projectInfo && data.projectInfo.auditPeriod,
|
|
|
|
|
+ data.project && data.project.auditPeriod,
|
|
|
|
|
+ ]
|
|
|
|
|
+ candidateSources.forEach((source) => parseMaybeString(source))
|
|
|
|
|
+
|
|
|
|
|
+ if (collectedYears.length === 0) {
|
|
|
|
|
+ const candidateLabels = this.fixedTableColumnCandidates
|
|
|
|
|
+ candidateLabels
|
|
|
|
|
+ .map((label) => {
|
|
|
|
|
+ const match = String(label).match(/(19|20)\d{2}/)
|
|
|
|
|
+ return match ? match[0] : null
|
|
|
|
|
+ })
|
|
|
|
|
+ .filter(Boolean)
|
|
|
|
|
+ .forEach((year) => {
|
|
|
|
|
+ if (!collectedYears.includes(year)) {
|
|
|
|
|
+ collectedYears.push(year)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ return collectedYears
|
|
|
|
|
+ },
|
|
|
|
|
+ fixedTableColumnCandidates() {
|
|
|
|
|
+ const labels = new Set()
|
|
|
|
|
+ const addLabel = (value) => {
|
|
|
|
|
+ if (value === undefined || value === null) return
|
|
|
|
|
+ const str = String(value).trim()
|
|
|
|
|
+ if (!str) return
|
|
|
|
|
+ labels.add(str)
|
|
|
|
|
+ }
|
|
|
|
|
+ const fixedTable =
|
|
|
|
|
+ (this.contentEditForm && this.contentEditForm.fixedTable) || {}
|
|
|
|
|
+ const potentialSources = [
|
|
|
|
|
+ fixedTable.fixedTablesTitle,
|
|
|
|
|
+ fixedTable.fixedTableHeaders,
|
|
|
|
|
+ fixedTable.tableHeaders,
|
|
|
|
|
+ ]
|
|
|
|
|
+ potentialSources.forEach((source) => {
|
|
|
|
|
+ if (!Array.isArray(source)) return
|
|
|
|
|
+ source.forEach((item) => {
|
|
|
|
|
+ if (item && typeof item === 'object') {
|
|
|
|
|
+ addLabel(item.rkey || item.label || item.fieldName || item.name)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ addLabel(item)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ const rows = fixedTable.fixedTables
|
|
|
|
|
+ if (Array.isArray(rows)) {
|
|
|
|
|
+ rows.forEach((row) => {
|
|
|
|
|
+ if (row && typeof row === 'object' && row.fixedValues) {
|
|
|
|
|
+ Object.keys(row.fixedValues).forEach((key) => addLabel(key))
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ return Array.from(labels)
|
|
|
|
|
+ },
|
|
|
|
|
+ fixedTableValueColumns() {
|
|
|
|
|
+ const auditYears = this.auditPeriodYears
|
|
|
|
|
+ const candidateLabels = this.fixedTableColumnCandidates
|
|
|
|
|
+ const usedLabels = new Set()
|
|
|
|
|
+ const resultColumns = []
|
|
|
|
|
+ const extractYear = (label) => {
|
|
|
|
|
+ if (!label) return ''
|
|
|
|
|
+ const match = String(label).match(/(19|20)\d{2}/)
|
|
|
|
|
+ return match ? match[0] : ''
|
|
|
|
|
+ }
|
|
|
|
|
+ const buildColumn = ({ key, label, placeholder, candidates }) => ({
|
|
|
|
|
+ key,
|
|
|
|
|
+ label,
|
|
|
|
|
+ placeholder,
|
|
|
|
|
+ candidates,
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ auditYears.forEach((year) => {
|
|
|
|
|
+ const matchLabel =
|
|
|
|
|
+ candidateLabels.find((label) => {
|
|
|
|
|
+ const normalized = extractYear(label)
|
|
|
|
|
+ return normalized && normalized === String(year)
|
|
|
|
|
+ }) || ''
|
|
|
|
|
+ const displayLabel = matchLabel || `${year}年`
|
|
|
|
|
+ const columnKey = `year-${year}`
|
|
|
|
|
+ usedLabels.add(matchLabel)
|
|
|
|
|
+ resultColumns.push(
|
|
|
|
|
+ buildColumn({
|
|
|
|
|
+ key: columnKey,
|
|
|
|
|
+ label: displayLabel,
|
|
|
|
|
+ placeholder: `请输入${displayLabel}数据`,
|
|
|
|
|
+ candidates: [
|
|
|
|
|
+ matchLabel,
|
|
|
|
|
+ displayLabel,
|
|
|
|
|
+ `${year}年`,
|
|
|
|
|
+ `${year}年度`,
|
|
|
|
|
+ `${year}`,
|
|
|
|
|
+ `year_${year}`,
|
|
|
|
|
+ ].filter(Boolean),
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ candidateLabels.forEach((label) => {
|
|
|
|
|
+ if (!label || usedLabels.has(label)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ ['序号', '项目', '指标编号', '计算公式', '单位', '备注'].includes(
|
|
|
|
|
+ label
|
|
|
|
|
+ )
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ resultColumns.push(
|
|
|
|
|
+ buildColumn({
|
|
|
|
|
+ key: `col-${label}`,
|
|
|
|
|
+ label,
|
|
|
|
|
+ placeholder: `请输入${label}`,
|
|
|
|
|
+ candidates: [label],
|
|
|
|
|
+ })
|
|
|
|
|
+ )
|
|
|
|
|
+ usedLabels.add(label)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ return resultColumns
|
|
|
|
|
+ },
|
|
|
|
|
+ fixedTableDisplayData() {
|
|
|
|
|
+ const rows =
|
|
|
|
|
+ (this.contentEditForm &&
|
|
|
|
|
+ this.contentEditForm.fixedTable &&
|
|
|
|
|
+ this.contentEditForm.fixedTable.fixedTables) ||
|
|
|
|
|
+ []
|
|
|
|
|
+ if (!Array.isArray(rows) || rows.length === 0) {
|
|
|
|
|
+ return []
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const normalizeId = (val) => {
|
|
|
|
|
+ if (val === undefined || val === null) return ''
|
|
|
|
|
+ return String(val)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const parentMap = {}
|
|
|
|
|
+ rows.forEach((row, index) => {
|
|
|
|
|
+ const rowId = normalizeId(row.rowid || row.itemId || index)
|
|
|
|
|
+ const parentId = row.parentid
|
|
|
|
|
+ if (
|
|
|
|
|
+ parentId !== undefined &&
|
|
|
|
|
+ parentId !== null &&
|
|
|
|
|
+ parentId !== '' &&
|
|
|
|
|
+ parentId !== '-1' &&
|
|
|
|
|
+ parentId !== -1
|
|
|
|
|
+ ) {
|
|
|
|
|
+ parentMap[rowId] = normalizeId(parentId)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ parentMap[rowId] = ''
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const childMap = {}
|
|
|
|
|
+ Object.keys(parentMap).forEach((rowId) => {
|
|
|
|
|
+ const parentId = parentMap[rowId]
|
|
|
|
|
+ if (parentId) {
|
|
|
|
|
+ if (!childMap[parentId]) {
|
|
|
|
|
+ childMap[parentId] = []
|
|
|
|
|
+ }
|
|
|
|
|
+ childMap[parentId].push(rowId)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const computedLevels = {}
|
|
|
|
|
+ const getLevel = (rowId, depth = 0) => {
|
|
|
|
|
+ if (!rowId) return 0
|
|
|
|
|
+ if (computedLevels[rowId] !== undefined) {
|
|
|
|
|
+ return computedLevels[rowId]
|
|
|
|
|
+ }
|
|
|
|
|
+ if (depth > rows.length) {
|
|
|
|
|
+ return 0
|
|
|
|
|
+ }
|
|
|
|
|
+ const parentId = parentMap[rowId]
|
|
|
|
|
+ if (!parentId) {
|
|
|
|
|
+ computedLevels[rowId] = 0
|
|
|
|
|
+ return 0
|
|
|
|
|
+ }
|
|
|
|
|
+ const level = 1 + getLevel(parentId, depth + 1)
|
|
|
|
|
+ computedLevels[rowId] = level
|
|
|
|
|
+ return level
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const columnDefs = this.fixedTableValueColumns || []
|
|
|
|
|
+
|
|
|
|
|
+ return rows.map((row, index) => {
|
|
|
|
|
+ const rowId = normalizeId(row.rowid || row.itemId || index)
|
|
|
|
|
+ const fixedValues = row.fixedValues || {}
|
|
|
|
|
+ const displaySeq =
|
|
|
|
|
+ fixedValues['序号'] ||
|
|
|
|
|
+ row.orderText ||
|
|
|
|
|
+ row.orderNum ||
|
|
|
|
|
+ row.seq ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ const displayName =
|
|
|
|
|
+ fixedValues['项目'] ||
|
|
|
|
|
+ fixedValues['项目名称'] ||
|
|
|
|
|
+ row.itemName ||
|
|
|
|
|
+ row.projectName ||
|
|
|
|
|
+ ''
|
|
|
|
|
+ const displayUnit = fixedValues['单位'] || row.unit || ''
|
|
|
|
|
+ const displayRemark = fixedValues['备注'] || row.remark || ''
|
|
|
|
|
+ const hasChildren = !!childMap[rowId]
|
|
|
|
|
+ const isChild =
|
|
|
|
|
+ row.isChild ||
|
|
|
|
|
+ row.isSubItem ||
|
|
|
|
|
+ (row.parentid !== undefined &&
|
|
|
|
|
+ row.parentid !== null &&
|
|
|
|
|
+ row.parentid !== '' &&
|
|
|
|
|
+ row.parentid !== '-1' &&
|
|
|
|
|
+ row.parentid !== -1)
|
|
|
|
|
+ const isCategory =
|
|
|
|
|
+ row.isCategory === true || (!isChild && hasChildren)
|
|
|
|
|
+
|
|
|
|
|
+ const displayValues = {}
|
|
|
|
|
+ columnDefs.forEach((column) => {
|
|
|
|
|
+ let value = ''
|
|
|
|
|
+ const candidates = column.candidates || []
|
|
|
|
|
+ for (let i = 0; i < candidates.length; i += 1) {
|
|
|
|
|
+ const candidate = candidates[i]
|
|
|
|
|
+ if (!candidate) continue
|
|
|
|
|
+ if (
|
|
|
|
|
+ fixedValues[candidate] !== undefined &&
|
|
|
|
|
+ fixedValues[candidate] !== null &&
|
|
|
|
|
+ fixedValues[candidate] !== ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ value = fixedValues[candidate]
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ row[candidate] !== undefined &&
|
|
|
|
|
+ row[candidate] !== null &&
|
|
|
|
|
+ row[candidate] !== ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ value = row[candidate]
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ const altKey = String(candidate).replace(/年|年度/g, '')
|
|
|
|
|
+ if (
|
|
|
|
|
+ altKey &&
|
|
|
|
|
+ fixedValues[altKey] !== undefined &&
|
|
|
|
|
+ fixedValues[altKey] !== null &&
|
|
|
|
|
+ fixedValues[altKey] !== ''
|
|
|
|
|
+ ) {
|
|
|
|
|
+ value = fixedValues[altKey]
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ displayValues[column.key] = value
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ const remarkValue =
|
|
|
|
|
+ fixedValues['备注'] !== undefined && fixedValues['备注'] !== null
|
|
|
|
|
+ ? fixedValues['备注']
|
|
|
|
|
+ : displayRemark
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...row,
|
|
|
|
|
+ _rowId: rowId,
|
|
|
|
|
+ _displaySeq: displaySeq,
|
|
|
|
|
+ _displayName: displayName,
|
|
|
|
|
+ _displayUnit: displayUnit,
|
|
|
|
|
+ _displayRemark: remarkValue,
|
|
|
|
|
+ _hasChildren: hasChildren,
|
|
|
|
|
+ _isCategory: isCategory,
|
|
|
|
|
+ _indentLevel: getLevel(rowId),
|
|
|
|
|
+ _displayValues: displayValues,
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
watch: {
|
|
watch: {
|
|
|
// 监听弹窗可见状态变化
|
|
// 监听弹窗可见状态变化
|
|
|
dialogVisible: {
|
|
dialogVisible: {
|
|
@@ -444,6 +796,10 @@
|
|
|
|
|
|
|
|
this.contentEditForm.fixedTable.fixedTables = sortedArray
|
|
this.contentEditForm.fixedTable.fixedTables = sortedArray
|
|
|
},
|
|
},
|
|
|
|
|
+ getFixedPreviewRowClass({ row }) {
|
|
|
|
|
+ if (!row) return ''
|
|
|
|
|
+ return row._isCategory ? 'category-row' : ''
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* 解析并回显动态表项目数据
|
|
* 解析并回显动态表项目数据
|
|
|
* @param {Object} responseData - listByCurrentTemplateId接口返回的数据
|
|
* @param {Object} responseData - listByCurrentTemplateId接口返回的数据
|
|
@@ -716,6 +1072,22 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ ::v-deep .category-row {
|
|
|
|
|
+ background-color: #f5f7fa !important;
|
|
|
|
|
+ td {
|
|
|
|
|
+ background-color: #f5f7fa !important;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+ .category-name {
|
|
|
|
|
+ color: #409eff;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .table-item-text {
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ color: #303133;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|