fix:修改分类分级
Showing
4 changed files
with
12 additions
and
8 deletions
| ... | @@ -31,6 +31,7 @@ import { TableColumnWidth } from "@/utils/enum"; | ... | @@ -31,6 +31,7 @@ import { TableColumnWidth } from "@/utils/enum"; |
| 31 | import router from "@/router"; | 31 | import router from "@/router"; |
| 32 | import { download } from "@/utils/common"; | 32 | import { download } from "@/utils/common"; |
| 33 | import { getLabelList } from "@/api/modules/dataLabel"; | 33 | import { getLabelList } from "@/api/modules/dataLabel"; |
| 34 | import { de } from "element-plus/es/locale"; | ||
| 34 | 35 | ||
| 35 | const currentPath = ref<string[]>([]); | 36 | const currentPath = ref<string[]>([]); |
| 36 | const currentDatabasePath = ref<string[]>([]); | 37 | const currentDatabasePath = ref<string[]>([]); |
| ... | @@ -531,7 +532,7 @@ const dataBaseTableInfo = ref({ | ... | @@ -531,7 +532,7 @@ const dataBaseTableInfo = ref({ |
| 531 | }, | 532 | }, |
| 532 | { | 533 | { |
| 533 | label: "编辑表结构", value: "edit", click: (scope) => { | 534 | label: "编辑表结构", value: "edit", click: (scope) => { |
| 534 | console.log('复制', scope); | 535 | console.log('编辑表结构', scope); |
| 535 | // foundMode 1 已有表新建 2 根据文件新建 | 536 | // foundMode 1 已有表新建 2 根据文件新建 |
| 536 | if (scope.row.foundMode === 1) { | 537 | if (scope.row.foundMode === 1) { |
| 537 | // 已有表新建编辑 editOpt 代表时编辑 | 538 | // 已有表新建编辑 editOpt 代表时编辑 | ... | ... |
| ... | @@ -156,13 +156,15 @@ const batchDelete = () => { | ... | @@ -156,13 +156,15 @@ const batchDelete = () => { |
| 156 | }; | 156 | }; |
| 157 | 157 | ||
| 158 | // 暂存编辑的行数据 | 158 | // 暂存编辑的行数据 |
| 159 | const tempRowData = ref<any>(); | 159 | const tempRowData = ref<any>([]); |
| 160 | 160 | ||
| 161 | // 编辑行 | 161 | // 编辑行 |
| 162 | const editRow = (row) => { | 162 | const editRow = (row) => { |
| 163 | console.log('编辑:', row); | 163 | console.log('编辑:', row); |
| 164 | // 暂存编辑前的数据 | 164 | // 暂存编辑前的数据 用于取消编辑时恢复原始数据,先判断是否已经暂存过tempRowData通过fieldGuid |
| 165 | tempRowData.value = { ...row }; | 165 | if (!tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid)) { |
| 166 | tempRowData.value.push({ ...row }); | ||
| 167 | } | ||
| 166 | if (row.fieldLengthCondition) { | 168 | if (row.fieldLengthCondition) { |
| 167 | const arr = row.fieldLengthCondition.split('#') | 169 | const arr = row.fieldLengthCondition.split('#') |
| 168 | row.lengthSymbol = arr[0] | 170 | row.lengthSymbol = arr[0] |
| ... | @@ -280,13 +282,13 @@ const saveData = async () => { | ... | @@ -280,13 +282,13 @@ const saveData = async () => { |
| 280 | fieldPrecision: item.fieldPrecision, | 282 | fieldPrecision: item.fieldPrecision, |
| 281 | dictionaryGuid: item.dictionaryGuid, | 283 | dictionaryGuid: item.dictionaryGuid, |
| 282 | isUnique: item.isUnique, | 284 | isUnique: item.isUnique, |
| 283 | isNotNull: item.isRequired, | 285 | notNull: item.notNull, |
| 284 | fieldValueRange: item.fieldValueRange | 286 | fieldValueRange: item.fieldValueRange |
| 285 | } | 287 | } |
| 286 | inParams.push(obj) | 288 | inParams.push(obj) |
| 287 | }) | 289 | }) |
| 288 | 290 | ||
| 289 | console.log('finalParams', inParams) | 291 | // console.log('finalParams', inParams) |
| 290 | const res: any = await saveBizRuleConfig(inParams) | 292 | const res: any = await saveBizRuleConfig(inParams) |
| 291 | if (res.code === proxy.$passCode) { | 293 | if (res.code === proxy.$passCode) { |
| 292 | loading.value = false | 294 | loading.value = false |
| ... | @@ -316,8 +318,9 @@ const cancel = () => { | ... | @@ -316,8 +318,9 @@ const cancel = () => { |
| 316 | // 点击取消 | 318 | // 点击取消 |
| 317 | const cancelEdit = (row) => { | 319 | const cancelEdit = (row) => { |
| 318 | console.log('取消编辑:', row); | 320 | console.log('取消编辑:', row); |
| 319 | // 可在此恢复原始数据逻辑,如果需要 | 321 | // 可在此恢复原始数据逻辑,要查找暂存的数据 tempRowData 中 fieldGuid 与当前行的 fieldGuid 相同的数据 |
| 320 | Object.assign(row, tempRowData.value); | 322 | const tempRow = tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid); |
| 323 | Object.assign(row, tempRow); | ||
| 321 | 324 | ||
| 322 | row.isEdit = false; // 退出编辑状态 | 325 | row.isEdit = false; // 退出编辑状态 |
| 323 | } | 326 | } | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment