diff --git a/src/views/liswork/xtwh/antibioticBreakpoint/index.vue b/src/views/liswork/xtwh/antibioticBreakpoint/index.vue
index eaa8414..96bb4a5 100644
--- a/src/views/liswork/xtwh/antibioticBreakpoint/index.vue
+++ b/src/views/liswork/xtwh/antibioticBreakpoint/index.vue
@@ -41,7 +41,7 @@
-
+
@@ -64,7 +65,11 @@
-
+
+
+
+
+
@@ -75,7 +80,11 @@
-
+
+
+
+
+
@@ -167,41 +176,26 @@ const calcMicRef = (mic1, mic2) => {
const s = mic1 != null && mic1 !== '' ? Number(mic1) : null
const r = mic2 != null && mic2 !== '' ? Number(mic2) : null
if (s == null && r == null) return ''
- if (s != null && r != null) {
- const mid = buildMicMiddle(s, r)
- return `<=${s}${mid ? ', ' + mid : ''}, >=${r}`
- }
- return s != null ? `<=${s}` : `>=${r}`
+ if (s != null && r == null) return `<=${s}`
+ if (s == null && r != null) return `>=${r}`
+ const sDouble = s * 2
+ const rHalf = r / 2
+ if (sDouble > rHalf) return `<=${s},,>=${r}`
+ if (sDouble === rHalf) return `<=${s},${sDouble},>=${r}`
+ return `<=${s},${sDouble}-${rHalf},>=${r}`
}
const calcRadRef = (rad1, rad2) => {
const s = rad1 != null && rad1 !== '' ? Number(rad1) : null
const r = rad2 != null && rad2 !== '' ? Number(rad2) : null
if (s == null && r == null) return ''
- if (s != null && r != null) {
- const mid = buildRadMiddle(s, r)
- return `>=${r}${mid ? ', ' + mid : ''}, <=${s}`
- }
- return r != null ? `>=${r}` : `<=${s}`
-}
-
-const buildMicMiddle = (s, r) => {
- if (r - s <= 1) return ''
- if (Number.isInteger(s) && Number.isInteger(r)) {
- return `${s + 1}-${r - 1}`
- }
- const vals = []
- let v = s + 1
- while (v < r) {
- vals.push(Number.isInteger(v) ? v.toString() : v.toFixed(1))
- v = Math.round((v + 1) * 10) / 10
- }
- return vals.join(',')
-}
-
-const buildRadMiddle = (s, r) => {
- if (r - s <= 1) return ''
- return `${s + 1}-${r - 1}`
+ if (s != null && r == null) return `,,<=${s}`
+ if (s == null && r != null) return `>=${r},,`
+ const sPlus1 = s + 1
+ const rMinus1 = r - 1
+ if (sPlus1 >= r) return `>=${r},,<=${s}`
+ if (sPlus1 === rMinus1) return `>=${r},${sPlus1},<=${s}`
+ return `>=${r},${sPlus1}-${rMinus1},<=${s}`
}
const setupBreakpointWatchers = (row) => {
@@ -213,6 +207,26 @@ const setupBreakpointWatchers = (row) => {
]
}
+const snapshotRow = (row) => ({
+ mic1: row.mic1, mic2: row.mic2, rad1: row.rad1, rad2: row.rad2,
+ micref: row.micref, radref: row.radref, sddfalg: row.sddfalg, xh: row.xh
+})
+
+const isRowModified = (row) => {
+ if (row._isNew || !row._original) return false
+ const o = row._original
+ return o.mic1 !== row.mic1 || o.mic2 !== row.mic2 ||
+ o.rad1 !== row.rad1 || o.rad2 !== row.rad2 ||
+ o.micref !== row.micref || o.radref !== row.radref ||
+ o.sddfalg !== row.sddfalg || o.xh !== row.xh
+}
+
+const getRowClassName = ({ row }) => {
+ if (row._isNew) return 'row-new'
+ if (isRowModified(row)) return 'row-modified'
+ return ''
+}
+
watch(treeFilter, val => {
treeRef.value?.filter(val)
})
@@ -244,7 +258,11 @@ const loadBreakpoints = () => {
getBreakpointList({ germClassCode: currentGermClass.value.zddh }).then(res => {
rowWatchers.forEach(stop => stop())
rowWatchers = []
- breakpointList.value = res.data || []
+ breakpointList.value = (res.data || []).map(row => {
+ row._isNew = false
+ row._original = snapshotRow(row)
+ return row
+ })
breakpointList.value.forEach(row => {
rowWatchers.push(...setupBreakpointWatchers(row))
})
@@ -279,7 +297,9 @@ const handleAddBreakpoint = (row) => {
radref: '',
xh: maxXh + 10,
sddfalg: null,
- bz: null
+ bz: null,
+ _isNew: true,
+ _original: null
}
breakpointList.value.push(newRow)
rowWatchers.push(...setupBreakpointWatchers(newRow))
@@ -352,9 +372,7 @@ onMounted(() => {
.unified-panel {
background: #e6f7fa;
- border-right: 1px solid #d9e8fb;
border-bottom: 1px solid #d9e8fb;
- border-left: 1px solid #d9e8fb;
border-radius: 0 0 8px 8px;
box-sizing: border-box;
overflow: hidden;
@@ -370,7 +388,7 @@ onMounted(() => {
display: flex;
flex: 1;
gap: 5px;
- padding: 10px;
+ padding: 10px 0 0 0;
overflow: hidden;
min-height: 0;
}
@@ -404,6 +422,8 @@ onMounted(() => {
.left-panel {
width: 220px;
flex-shrink: 0;
+ border-left: none;
+ border-bottom-left-radius: 0;
}
.middle-panel {
@@ -414,6 +434,8 @@ onMounted(() => {
.right-panel {
width: 560px;
flex-shrink: 0;
+ border-right: none;
+ border-bottom-right-radius: 0;
}
.right-content {
@@ -546,4 +568,12 @@ onMounted(() => {
.right-panel :deep(.el-table__row) {
cursor: pointer;
}
+
+.middle-panel :deep(.el-table__row.row-new) td {
+ color: #c0392b;
+}
+
+.middle-panel :deep(.el-table__row.row-modified) td {
+ color: #2471a3;
+}