diff --git a/mayfly_go_web/package.json b/mayfly_go_web/package.json index 9dd62029..a7293ac3 100644 --- a/mayfly_go_web/package.json +++ b/mayfly_go_web/package.json @@ -17,7 +17,7 @@ "cropperjs": "^1.6.1", "dayjs": "^1.11.11", "echarts": "^5.5.1", - "element-plus": "^2.7.6", + "element-plus": "^2.7.7", "js-base64": "^3.7.7", "jsencrypt": "^3.3.2", "lodash": "^4.17.21", @@ -34,7 +34,7 @@ "sql-formatter": "^15.0.2", "trzsz": "^1.1.5", "uuid": "^9.0.1", - "vue": "^3.4.31", + "vue": "^3.4.32", "vue-router": "^4.4.0", "xterm": "^5.3.0", "xterm-addon-fit": "^0.8.0", @@ -49,15 +49,15 @@ "@typescript-eslint/eslint-plugin": "^6.7.4", "@typescript-eslint/parser": "^6.7.4", "@vitejs/plugin-vue": "^5.0.5", - "@vue/compiler-sfc": "^3.4.31", + "@vue/compiler-sfc": "^3.4.32", "code-inspector-plugin": "^0.4.5", "dotenv": "^16.3.1", "eslint": "^8.35.0", "eslint-plugin-vue": "^9.25.0", "prettier": "^3.2.5", - "sass": "^1.77.6", + "sass": "^1.77.8", "typescript": "^5.5.3", - "vite": "^5.3.3", + "vite": "^5.3.4", "vue-eslint-parser": "^9.4.2" }, "browserslist": [ diff --git a/mayfly_go_web/src/views/ops/db/component/table/ColumnFormItem.vue b/mayfly_go_web/src/views/ops/db/component/table/ColumnFormItem.vue index a73d2c81..30ea2a86 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/ColumnFormItem.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/ColumnFormItem.vue @@ -25,7 +25,7 @@ :clearable="false" type="Date" value-format="YYYY-MM-DD" - placeholder="选择日期" + :placeholder="`选择日期-${placeholder}`" /> diff --git a/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue b/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue index 31a3e0ff..7b61fd5e 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/DbTableData.vue @@ -258,12 +258,10 @@ const cmDataDel = new ContextmenuItem('deleteData', '删除') return state.table == ''; }); -const cmDataEdit = new ContextmenuItem('editData', '编辑行') - .withIcon('edit') - .withOnClick(() => onEditRowData()) - .withHideFunc(() => { - return state.table == ''; - }); +const cmFormView = new ContextmenuItem('formView', '表单视图').withIcon('Document').withOnClick(() => onEditRowData()); +// .withHideFunc(() => { +// return state.table == ''; +// }); const cmDataGenInsertSql = new ContextmenuItem('genInsertSql', 'Insert SQL') .withIcon('tickets') @@ -595,7 +593,7 @@ const dataContextmenuClick = (event: any, rowIndex: number, column: any, data: a const { clientX, clientY } = event; state.contextmenu.dropdown.x = clientX; state.contextmenu.dropdown.y = clientY; - state.contextmenu.items = [cmDataCopyCell, cmDataDel, cmDataEdit, cmDataGenInsertSql, cmDataGenJson, cmDataExportCsv, cmDataExportSql]; + state.contextmenu.items = [cmDataCopyCell, cmDataDel, cmFormView, cmDataGenInsertSql, cmDataGenJson, cmDataExportCsv, cmDataExportSql]; contextmenuRef.value.openContextmenu({ column, rowData: data }); }; @@ -627,12 +625,12 @@ const onDeleteData = async () => { const onEditRowData = () => { const selectionDatas = Array.from(selectionRowsMap.values()); if (selectionDatas.length > 1) { - ElMessage.warning('只能编辑一行数据'); + ElMessage.warning('只能选择一行数据'); return; } const data = selectionDatas[0]; state.tableDataFormDialog.data = { ...data }; - state.tableDataFormDialog.title = `编辑表'${props.table}'数据`; + state.tableDataFormDialog.title = state.table ? `'${props.table}'表单数据` : '表单视图'; state.tableDataFormDialog.visible = true; }; @@ -648,7 +646,7 @@ const onGenerateJson = async () => { // 按列字段重新排序对象key const jsonObj = []; for (let selectionData of selectionDatas) { - let obj = {}; + let obj: any = {}; for (let column of state.columns) { if (column.show) { obj[column.title] = selectionData[column.dataKey]; @@ -752,7 +750,7 @@ const submitUpdateFields = async () => { for (let updateRow of cellUpdateMap.values()) { const rowData = { ...updateRow.rowData }; - let updateColumnValue = {}; + let updateColumnValue: any = {}; for (let k of updateRow.columnsMap.keys()) { const v = updateRow.columnsMap.get(k); diff --git a/mayfly_go_web/src/views/ops/db/component/table/DbTableDataForm.vue b/mayfly_go_web/src/views/ops/db/component/table/DbTableDataForm.vue index aa8bfbef..306f5756 100644 --- a/mayfly_go_web/src/views/ops/db/component/table/DbTableDataForm.vue +++ b/mayfly_go_web/src/views/ops/db/component/table/DbTableDataForm.vue @@ -6,10 +6,10 @@ :key="column.columnName" class="w100 mb5" :prop="column.columnName" - :required="!column.nullable && !column.isPrimaryKey && !column.isIdentity" + :required="props.tableName != '' && !column.nullable && !column.isPrimaryKey && !column.isIdentity" > @@ -17,13 +17,13 @@ -