diff --git a/template/admin/src/api/systemCodeGeneration.js b/template/admin/src/api/systemCodeGeneration.js new file mode 100644 index 000000000..0a4208071 --- /dev/null +++ b/template/admin/src/api/systemCodeGeneration.js @@ -0,0 +1,83 @@ +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- + +import request from '@/libs/request'; + +/** + * @description 代码生成 - 菜单选择列表 + */ +export function crudMenus() { + return request({ + url: '/system/crud/menus', + method: 'get', + }); +} +/** + * @description 代码生成 - sql表选择列表 + */ +export function crudColumnType() { + return request({ + url: '/system/crud/column_type', + method: 'get', + }); +} +/** + * @description 代码生成 - 第一步提交 获取CRUD文件存放 + */ +export function crudFilePath(data) { + return request({ + url: '/system/crud/file_path', + method: 'post', + data, + }); +} + +/** + * @description 管理员添加表单 + */ +export function adminFromApi() { + return request({ + url: '/setting/admin/create', + method: 'get', + }); +} + +/** + * @description 管理员编辑表单 + * @param {Number} param id {Number} 管理员id + */ +export function adminEditFromApi(id) { + return request({ + url: `/setting/admin/${id}/edit`, + method: 'get', + }); +} + +/** + * @description 管理员删除 + * @param {Number} param id {Number} 管理员id + */ +export function adminDelFromApi(id) { + return request({ + url: `/setting/admin/${id}`, + method: 'DELETE', + }); +} + +/** + * @description 管理员 修改状态 + * @param {Object} param data {Object} 传值 + */ +export function setShowApi(data) { + return request({ + url: `setting/set_status/${data.id}/${data.status}`, + method: 'PUT', + }); +} diff --git a/template/admin/src/pages/system/codeGeneration/components/FormItem.vue b/template/admin/src/pages/system/codeGeneration/components/FormItem.vue index bd10f8ceb..7cb5c551d 100644 --- a/template/admin/src/pages/system/codeGeneration/components/FormItem.vue +++ b/template/admin/src/pages/system/codeGeneration/components/FormItem.vue @@ -2,7 +2,6 @@
-
diff --git a/template/admin/src/pages/system/codeGeneration/components/FoundationForm.vue b/template/admin/src/pages/system/codeGeneration/components/FoundationForm.vue index 6aeca2d54..4d5a1cd9e 100644 --- a/template/admin/src/pages/system/codeGeneration/components/FoundationForm.vue +++ b/template/admin/src/pages/system/codeGeneration/components/FoundationForm.vue @@ -2,35 +2,60 @@
- - - 是 + 否 + 是 - +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
diff --git a/template/admin/src/pages/system/codeGeneration/index.vue b/template/admin/src/pages/system/codeGeneration/index.vue index 2d6d8b28b..62777f41b 100644 --- a/template/admin/src/pages/system/codeGeneration/index.vue +++ b/template/admin/src/pages/system/codeGeneration/index.vue @@ -2,31 +2,35 @@
- - - + + +
-
+
- +
-
+
-
+
-
+
+ + + +
@@ -36,12 +40,13 @@ import FoundationForm from './components/FoundationForm.vue'; import StorageLoc from './components/StorageLoc.vue'; import Field from './components/Field.vue'; import FormItem from './components/FormItem.vue'; +import { crudFilePath } from '@/api/systemCodeGeneration'; export default { name: 'system_code_generation', components: { FoundationForm, StorageLoc, Field, FormItem }, data() { return { - currentTab: 'formItem', + currentTab: 0, headerList: [ { label: '基础信息', value: 'foundation' }, { label: '存放位置', value: 'storage' }, @@ -52,8 +57,8 @@ export default { foundation: { pid: '', tableName: '', - required: 0, - sql: '', + isTable: 0, + menuName: '', }, storage: {}, field: {}, @@ -62,15 +67,47 @@ export default { ruleValidate: { foundation: {}, }, + dataList: [ + { + type: '', + limit: 0, + default: '', + field: '', + }, + ], }; }, created() {}, mounted: function () {}, methods: { - changeTab(data) { - this.currentTab = data; + addRow() { + this.dataList.push({ + type: '', + limit: 0, + default: '', + field: '', + }); + }, + beforeTab() { + this.currentTab--; + }, + nextTab() { + if (this.currentTab == 0) { + console.log(this.formItem); + let data = { + menuName: this.formItem.foundation.menuName, + tableName: this.formItem.foundation.tableName, + isTable: this.formItem.foundation.isTable, + fromField: [], + columnField: '', + }; + crudFilePath(data).then((res) => { + console.log(res); + }); + } + this.currentTab++; }, }, }; - +