diff --git a/template/admin/src/api/system.js b/template/admin/src/api/system.js
index a9af9fcff..931b3b91c 100644
--- a/template/admin/src/api/system.js
+++ b/template/admin/src/api/system.js
@@ -406,11 +406,11 @@ export function delFolder(params) {
/**
* 文件备注
- * @param {*} id
- * @param {*} params
- * @returns
+ * @param {*} id
+ * @param {*} params
+ * @returns
*/
- export function fileMark(params) {
+export function fileMark(params) {
return request({
url: `system/file/mark`,
method: 'get',
@@ -803,6 +803,18 @@ export function updateMark(data) {
data,
});
}
+/**
+ * 文件管理 更新备注
+ * @param {*} data
+ * @returns
+ */
+export function markSave(fileToken, data) {
+ return request({
+ url: `system/file/mark/save?fileToken=${fileToken}`,
+ method: 'post',
+ data,
+ });
+}
/**
* 定时任务名称及标识
diff --git a/template/admin/src/api/systemCodeGeneration.js b/template/admin/src/api/systemCodeGeneration.js
index 3748aeb71..1bef0ea59 100644
--- a/template/admin/src/api/systemCodeGeneration.js
+++ b/template/admin/src/api/systemCodeGeneration.js
@@ -68,3 +68,13 @@ export function crudDownload(id) {
method: 'get',
});
}
+/**
+ * @description 代码生成 - 文件编辑
+ */
+export function crudSaveFile(id,data) {
+ return request({
+ url: `/system/crud/save_file/${id}`,
+ method: 'post',
+ data
+ });
+}
diff --git a/template/admin/src/libs/util.js b/template/admin/src/libs/util.js
index f19d208e4..5a6c95926 100644
--- a/template/admin/src/libs/util.js
+++ b/template/admin/src/libs/util.js
@@ -68,7 +68,7 @@ export const getMenuByRouter = (list, access) => {
* @returns {Array}
*/
export const getBreadCrumbList = (route, homeRoute) => {
- let homeItem = { ...homeRoute, icon: homeRoute.meta.icon };
+ let homeItem = { ...homeRoute, icon: homeRoute.meta?.icon };
let routeMetched = route.matched;
if (routeMetched.some((item) => item.name === homeRoute.name)) return [homeItem];
let res = routeMetched
diff --git a/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue b/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue
index 8355d8ff4..f14223645 100644
--- a/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue
+++ b/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue
@@ -45,17 +45,12 @@
模块名称为中文或者英文,用在接口名称前缀、表单头部标题
-
+
用于生成CRUD指定的表名,不需要携带表前缀;对于生成过的表将不能在进行生成;或者可以删除对应的文件重新生成!对应系统中重要的数据表将不允许生成!
-
+
+
@@ -268,78 +263,6 @@ export default {
this.$set(this.tableField[i], 'comment', '添加和修改时间');
}
},
- changeRadio(status) {
- this.tableField = [];
- if (status) {
- this.addRow();
- }
- },
- initTableName() {
- this.tableField = [];
- },
- addRow() {
- if (!this.foundation.tableName) return this.$Message.warning('请先填写表名');
- if (!this.tableField.length) {
- let data = {
- menuName: this.foundation.menuName,
- tableName: this.foundation.tableName,
- isTable: this.foundation.isTable,
- fromField: [],
- columnField: [],
- };
- this.loading = true;
- crudFilePath(data)
- .then((res) => {
- this.tableField = res.data.tableField.length ? res.data.tableField : [];
- this.$emit('storageData', res.data.makePath);
- this.loading = false;
- if (!this.tableField.length) {
- this.tableField.push({
- field: '',
- field_type: '',
- default: '',
- comment: '',
- required: false,
- is_table: true,
- table_name: '',
- limit: '',
- from_type: '0',
- });
- }
- })
- .catch((err) => {
- this.$Message.warning(err.msg);
- this.loading = false;
- });
- }
- if (this.foundation.isTable) {
- } else {
- console.log(this.tableField);
- for (let i = 0; i < this.tableField.length; i++) {
- const el = this.tableField[i];
- if (
- (!el.field || !el.field_type || !el.comment) &&
- !['addTimestamps', 'addSoftDelete'].includes(el.field_type)
- ) {
- return this.$Message.warning('请先完善上一条数据');
- }
- if (el.is_table && !el.table_name && !['addTimestamps', 'addSoftDelete'].includes(el.field_type)) {
- return this.$Message.warning('请输入列表名');
- }
- }
- this.tableField.push({
- field: '',
- field_type: '',
- default: '',
- comment: '',
- required: false,
- is_table: true,
- table_name: '',
- limit: '',
- from_type: '0',
- });
- }
- },
getCrudMenus() {
crudMenus().then((res) => {
console.log(res);
diff --git a/template/admin/src/pages/system/codeGeneration/components/TableForm.vue b/template/admin/src/pages/system/codeGeneration/components/TableForm.vue
new file mode 100644
index 000000000..2d091e216
--- /dev/null
+++ b/template/admin/src/pages/system/codeGeneration/components/TableForm.vue
@@ -0,0 +1,306 @@
+
+
+
+
+
+
diff --git a/template/admin/src/pages/system/codeGeneration/index.vue b/template/admin/src/pages/system/codeGeneration/index.vue
index c7eaf2db1..56ea9b117 100644
--- a/template/admin/src/pages/system/codeGeneration/index.vue
+++ b/template/admin/src/pages/system/codeGeneration/index.vue
@@ -27,32 +27,47 @@
+
-
+
@@ -436,4 +457,20 @@ export default {
diff --git a/template/admin/src/pages/system/maintain/systemFile/login.vue b/template/admin/src/pages/system/maintain/systemFile/login.vue
index aa6baec2c..496463b69 100644
--- a/template/admin/src/pages/system/maintain/systemFile/login.vue
+++ b/template/admin/src/pages/system/maintain/systemFile/login.vue
@@ -113,7 +113,7 @@ export default {
align-items: center;
}
.trip{
- width: 400px;
+ width: 450px;
text-align: left;
color: #aaa;
}
diff --git a/template/admin/src/pages/system/maintain/systemFile/opendir.vue b/template/admin/src/pages/system/maintain/systemFile/opendir.vue
index 17158da7f..2f277379f 100644
--- a/template/admin/src/pages/system/maintain/systemFile/opendir.vue
+++ b/template/admin/src/pages/system/maintain/systemFile/opendir.vue
@@ -11,24 +11,30 @@
:data="tabList"
:loading="loading"
no-data-text="暂无数据"
- highlight-row
class="mt20"
- @on-current-change="currentChange"
no-filtered-data-text="暂无筛选结果"
>
-
-
- {{ row.filename }}
+
+
+
+ {{ row.filename }}
+
+
+
+
打开
编辑
-
- 备注
+
@@ -147,6 +153,7 @@ import {
delFolder,
rename,
fileMark,
+ markSave,
} from '@/api/system';
import CodeMirror from 'codemirror/lib/codemirror';
import loginFrom from './components/loginFrom';
@@ -210,7 +217,7 @@ export default {
},
{
title: '备注',
- key: 'mark',
+ slot: 'mark',
minWidth: 150,
},
{
@@ -781,6 +788,30 @@ export default {
this.code = this.editorList[index].oldCode; //设置文件打开时的代码
this.editor = this.editorList[index].editor; //设置编辑器实例
},
+ isEditMark(row) {
+ try {
+ row.is_edit = true;
+ this.$nextTick((e) => {
+ this.$refs.mark.focus();
+ });
+ } catch (error) {
+ console.log(error);
+ }
+ },
+ isEditBlur(row) {
+ row.is_edit = false;
+ let data = {
+ full_path: '/app',
+ mark: row.mark,
+ };
+ markSave(this.fileToken, data)
+ .then((res) => {
+ // this.$Message.success(res.msg);
+ })
+ .catch((err) => {
+ this.$Message.error(err.msg);
+ });
+ },
handleTabRemove(index) {
let that = this;
@@ -977,7 +1008,21 @@ export default {
margin: auto;
background: rgba(0, 0, 0, 0.3);
}
-
+.table-mark{
+ cursor: text;
+}
+.table-mark:hover{
+ border:1px solid #c2c2c2;
+ padding: 3px 5px
+}
+.mark /deep/ .ivu-input{
+ background: #fff;
+ border-radius: .39rem;
+}
+.mark /deep/ .ivu-input, .ivu-input:hover, .ivu-input:focus {
+ border: transparent;
+ box-shadow: none;
+}
.diy-from-header {
height: 30px;
line-height: 30px;