diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..150d4ef
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,6 @@
+# .env.development
+VITE_NODE_ENV = pre
+
+VITE_OA_BASEURL = https://oa-pre.shiyue.com
+
+VITE_YCODE_BASEURL = https://custom-chart-pre-api.shiyue.com
diff --git a/.env.production b/.env.production
index 563922c..e172bf4 100644
--- a/.env.production
+++ b/.env.production
@@ -1 +1,5 @@
+VITE_NODE_ENV = prod
+
VITE_OA_BASEURL = https://oa.shiyuegame.com
+
+VITE_YCODE_BASEURL = https://custom-chart-api.shiyuegame.com
diff --git a/.env.staging b/.env.staging
index 3ff6516..0b2cd22 100644
--- a/.env.staging
+++ b/.env.staging
@@ -1 +1,5 @@
+VITE_NODE_ENV = pre
+
VITE_OA_BASEURL = https://oa-pre.shiyue.com
+
+VITE_YCODE_BASEURL = https://custom-chart-pre-api.shiyue.com
diff --git a/components.d.ts b/components.d.ts
index 8b50715..5ef46c7 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -9,12 +9,30 @@ declare module 'vue' {
export interface GlobalComponents {
ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb']
ABreadcrumbItem: typeof import('ant-design-vue/es')['BreadcrumbItem']
+ AButton: typeof import('ant-design-vue/es')['Button']
+ ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
+ ACheckboxGroup: typeof import('ant-design-vue/es')['CheckboxGroup']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
+ AEmpty: typeof import('ant-design-vue/es')['Empty']
AFloatButton: typeof import('ant-design-vue/es')['FloatButton']
+ AForm: typeof import('ant-design-vue/es')['Form']
+ AFormItem: typeof import('ant-design-vue/es')['FormItem']
+ AInput: typeof import('ant-design-vue/es')['Input']
+ AInputNumber: typeof import('ant-design-vue/es')['InputNumber']
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
+ AModal: typeof import('ant-design-vue/es')['Modal']
+ APagination: typeof import('ant-design-vue/es')['Pagination']
+ APopconfirm: typeof import('ant-design-vue/es')['Popconfirm']
+ ASelect: typeof import('ant-design-vue/es')['Select']
+ ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
+ ASpace: typeof import('ant-design-vue/es')['Space']
+ ASwitch: typeof import('ant-design-vue/es')['Switch']
+ ATable: typeof import('ant-design-vue/es')['Table']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
+ Table: typeof import('./src/components/common/table.vue')['default']
+ YTable: typeof import('./src/components/common/y-table.vue')['default']
}
}
diff --git a/index.html b/index.html
index a888544..ee89f27 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
-
Vite App
+ 悦码后台
diff --git a/package-lock.json b/package-lock.json
index 3330b53..4653259 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,7 +8,7 @@
"name": "y-code",
"version": "0.0.0",
"dependencies": {
- "@vueuse/core": "^10.9.0",
+ "@vueuse/core": "^10.11.0",
"ant-design-vue": "^4.1.2",
"axios": "^1.6.7",
"pinia": "^2.1.7",
@@ -1944,7 +1944,7 @@
},
"node_modules/@vueuse/core": {
"version": "10.11.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.0.tgz",
+ "resolved": "http://sy-registry.shiyue.com/@vueuse/core/-/core-10.11.0.tgz",
"integrity": "sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==",
"dependencies": {
"@types/web-bluetooth": "^0.0.20",
@@ -6143,7 +6143,7 @@
},
"@vueuse/core": {
"version": "10.11.0",
- "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-10.11.0.tgz",
+ "resolved": "http://sy-registry.shiyue.com/@vueuse/core/-/core-10.11.0.tgz",
"integrity": "sha512-x3sD4Mkm7PJ+pcq3HX8PLPBadXCAlSDR/waK87dz0gQE+qJnaaFhc/dZVfJz+IUYzTMVGum2QlR7ImiJQN4s6g==",
"requires": {
"@types/web-bluetooth": "^0.0.20",
diff --git a/package.json b/package.json
index af7018b..0480935 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},
"dependencies": {
- "@vueuse/core": "^10.9.0",
+ "@vueuse/core": "^10.11.0",
"ant-design-vue": "^4.1.2",
"axios": "^1.6.7",
"pinia": "^2.1.7",
diff --git a/src/api/preview/index.js b/src/api/preview/index.js
new file mode 100644
index 0000000..a46c8c6
--- /dev/null
+++ b/src/api/preview/index.js
@@ -0,0 +1,28 @@
+import { get, post } from "@/utils/request";
+
+// 预览
+export function preview({ modularId, fieldIds, page, perPage, filter }) {
+ return post({
+ url: "api/v1/preview/view",
+ data: {
+ modular_id: modularId,
+ field_ids: fieldIds,
+ page,
+ per_page: perPage,
+ filter,
+ },
+ });
+}
+
+// 查看视图
+export function searchInfo({ previewId, page, perPage, filter }) {
+ return get({
+ url: `/api/v1/preview/info`,
+ params: {
+ preview_id: previewId,
+ page,
+ per_page: perPage,
+ filter,
+ },
+ });
+}
diff --git a/src/components/common/y-table.vue b/src/components/common/y-table.vue
new file mode 100644
index 0000000..e6c0ae3
--- /dev/null
+++ b/src/components/common/y-table.vue
@@ -0,0 +1,136 @@
+
+
+
+
+
{{ item.label }}:
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/layout/components/Header.vue b/src/layout/components/Header.vue
index 407c10e..1e5e422 100644
--- a/src/layout/components/Header.vue
+++ b/src/layout/components/Header.vue
@@ -1,19 +1,21 @@
@@ -31,12 +33,10 @@ const handleLogout = () => {
-
-
+
+
-
{{ userInfoStore.userInfo?.alias || '-' }}
+
{{ userInfoStore.userInfo?.alias || "-" }}
@@ -45,9 +45,7 @@ const handleLogout = () => {
退出登录
-
- 返回OA
-
+ 返回OA
@@ -63,7 +61,7 @@ const handleLogout = () => {
align-items: center;
padding: 0 30px;
background-color: #fff;
- box-shadow: 0 0 12px 0 rgba(0,0,0,.08);
+ box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.08);
.user-area {
display: flex;
align-items: center;
diff --git a/src/layout/index.vue b/src/layout/index.vue
index c9b80ab..e5d7992 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -1,21 +1,25 @@
diff --git a/src/views/config-manage/module-cfg/components/field-modal.vue b/src/views/config-manage/module-cfg/components/field-modal.vue
new file mode 100644
index 0000000..e851e83
--- /dev/null
+++ b/src/views/config-manage/module-cfg/components/field-modal.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+ {{ record[column.dataIndex] }}
+
+
+
+
+
+
+ {{ record.field_type_name }}
+
+
+
+
+
+ {{ record.is_search ? "是" : "否" }}
+
+
+
+
+ 保存
+ 取消
+
+ 修改
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/module-cfg/config.ts b/src/views/config-manage/module-cfg/config.ts
new file mode 100644
index 0000000..56cbbfa
--- /dev/null
+++ b/src/views/config-manage/module-cfg/config.ts
@@ -0,0 +1,20 @@
+export const moduleCfgCols = [
+ { dataIndex: 'modular_id', title: '编号', align: 'center'},
+ { dataIndex: 'modular_name', title: '数据表名称', align: 'center'},
+ { dataIndex: 'project_name', title: '项目名称', align: 'center'},
+ { dataIndex: 'is_show', title: '展示状态', align: 'center'},
+ { dataIndex: 'show_type_handle', title: '展示类型', align: 'center'},
+ // { dataIndex: 'sort', title: '排序', align: 'center'},
+ { dataIndex: 'action', title: '操作', align: 'center'},
+];
+
+export const viewCfgCols = [
+ { dataIndex: 'field_name', title: '字段名称', align: 'center'},
+ { dataIndex: 'field_title', title: '字段标题', align: 'center'},
+ { dataIndex: 'field_type_name', title: '字段类型', align: 'center'},
+ { dataIndex: 'is_search', title: '是否可搜索', align: 'center'},
+ { dataIndex: 'sort', title: '排序', align: 'center'},
+ { dataIndex: 'belong_to_table', title: '所属表名称', align: 'center'},
+ { dataIndex: 'original_sql', title: 'sql数据源', align: 'center'},
+ { dataIndex: 'action', title: '操作', align: 'center'},
+];
diff --git a/src/views/config-manage/module-cfg/index.vue b/src/views/config-manage/module-cfg/index.vue
new file mode 100644
index 0000000..939e2a2
--- /dev/null
+++ b/src/views/config-manage/module-cfg/index.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+
+
+ 字段管理
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/module-cfg/service.js b/src/views/config-manage/module-cfg/service.js
new file mode 100644
index 0000000..be564f8
--- /dev/null
+++ b/src/views/config-manage/module-cfg/service.js
@@ -0,0 +1,108 @@
+import { get, post } from "@/utils/request";
+
+// 获取数据表配置列表
+export function getModularList({ page, perPage, modularName, projectId }) {
+ return get({
+ url: "/api/v1/modular/list",
+ params: {
+ page,
+ per_page: perPage,
+ modular_name: modularName,
+ project_id: projectId,
+ },
+ });
+}
+
+// 获取数据表配置详情
+export function getModularDetail({ modularId }) {
+ return get({
+ url: "/api/v1/modular/info",
+ params: {
+ modular_id: modularId,
+ },
+ });
+}
+
+// 保存数据库配置
+export function saveModular(data) {
+ return post({
+ url: "/api/v1/modular/save",
+ data,
+ });
+}
+
+// 删除数据库配置
+export function deleteModular(data) {
+ return post({
+ url: "/api/v1/modular/del",
+ data,
+ });
+}
+
+// 修改数据表状态
+export function updateStatus(data) {
+ return post({
+ url: "/api/v1/modular/change-status",
+ data,
+ });
+}
+
+// 项目下拉
+export function getProjectSelect() {
+ return get({
+ url: `/api/v1/project/get-project-drop`,
+ });
+}
+
+// 展示类型下拉
+export function getShowTypeSelect() {
+ return get({
+ url: `/api/v1/modular/get-show-type-drop`,
+ });
+}
+
+// 字段类型下拉
+export function getFieldTypeSelect() {
+ return get({
+ url: `/api/v1/field/get-field-type-drop`,
+ });
+}
+
+// 获取字段列表
+export function getFieldList({ modularId, fieldName, page, perPage }) {
+ return get({
+ url: "/api/v1/field/list",
+ params: {
+ modular_id: modularId,
+ field_name: fieldName,
+ page,
+ per_page: perPage,
+ },
+ });
+}
+
+// 获取字段详情
+export function getFieldDetail({ fieldId }) {
+ return get({
+ url: "/api/v1/field/info",
+ params: {
+ field_id: fieldId,
+ },
+ });
+}
+
+// 保存字段
+export function saveField(data) {
+ return post({
+ url: "/api/v1/field/save",
+ data,
+ });
+}
+
+// 删除字段
+export function deleteField(data) {
+ return post({
+ url: "/api/v1/field/del",
+ data,
+ });
+}
diff --git a/src/views/config-manage/project-cfg/components/create-modal.vue b/src/views/config-manage/project-cfg/components/create-modal.vue
new file mode 100644
index 0000000..4afc6d9
--- /dev/null
+++ b/src/views/config-manage/project-cfg/components/create-modal.vue
@@ -0,0 +1,176 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 检测数据库连接
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/project-cfg/config.ts b/src/views/config-manage/project-cfg/config.ts
new file mode 100644
index 0000000..2d44078
--- /dev/null
+++ b/src/views/config-manage/project-cfg/config.ts
@@ -0,0 +1,8 @@
+export const projectCfgCols = [
+ { dataIndex: 'project_id', title: '编号', align: 'center'},
+ { dataIndex: 'project_name', title: '项目名称', align: 'center'},
+ { dataIndex: 'database_name', title: '数据库名', align: 'center'},
+ { dataIndex: 'is_show', title: '展示状态', align: 'center'},
+ // { dataIndex: 'sort', title: '排序', align: 'center'},
+ { dataIndex: 'action', title: '操作', align: 'center'},
+];
diff --git a/src/views/config-manage/project-cfg/index.vue b/src/views/config-manage/project-cfg/index.vue
new file mode 100644
index 0000000..7490022
--- /dev/null
+++ b/src/views/config-manage/project-cfg/index.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/project-cfg/service.js b/src/views/config-manage/project-cfg/service.js
new file mode 100644
index 0000000..f8d2342
--- /dev/null
+++ b/src/views/config-manage/project-cfg/service.js
@@ -0,0 +1,57 @@
+import { get, post } from "@/utils/request";
+
+// 获取项目列表
+export function getProjectList({ page, perPage, projectName }) {
+ return get({
+ url: `/api/v1/project/list`,
+ params: {
+ page,
+ per_page: perPage,
+ project_name: projectName,
+ },
+ });
+}
+
+// 获取项目详情
+export function getProjectDetail({ projectId }) {
+ return get({
+ url: `api/v1/project/info`,
+ params: {
+ project_id: projectId,
+ },
+ });
+}
+
+// 保存
+export function saveProject(data) {
+ return post({
+ url: `/api/v1/project/save`,
+ data,
+ });
+}
+
+// 删除
+export function deleteProject({ projectId }) {
+ return post({
+ url: `/api/v1/project/del`,
+ data: {
+ project_id: projectId,
+ },
+ });
+}
+
+// 检测数据库链接
+export function checkDbConnect(data) {
+ return post({
+ url: `/api/v1/project/check-database-connect`,
+ data,
+ });
+}
+
+// 修改展示状态
+export function updateStatus(data) {
+ return post({
+ url: `/api/v1/project/change-status`,
+ data,
+ });
+}
diff --git a/src/views/config-manage/view-cfg/components/create-modal.vue b/src/views/config-manage/view-cfg/components/create-modal.vue
new file mode 100644
index 0000000..02c48d2
--- /dev/null
+++ b/src/views/config-manage/view-cfg/components/create-modal.vue
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/view-cfg/config.ts b/src/views/config-manage/view-cfg/config.ts
new file mode 100644
index 0000000..d7e2158
--- /dev/null
+++ b/src/views/config-manage/view-cfg/config.ts
@@ -0,0 +1,10 @@
+export const viewCfgCols = [
+ { dataIndex: 'field_name', title: '字段名称', align: 'center'},
+ { dataIndex: 'field_title', title: '字段标题', align: 'center'},
+ { dataIndex: 'field_type_name', title: '字段类型', align: 'center'},
+ { dataIndex: 'is_search', title: '是否可搜索', align: 'center'},
+ { dataIndex: 'sort', title: '排序', align: 'center'},
+ { dataIndex: 'belong_to_table', title: '所属表名称', align: 'center'},
+ { dataIndex: 'original_sql', title: 'sql数据源', align: 'center'},
+ { dataIndex: 'action', title: '操作', align: 'center'},
+];
diff --git a/src/views/config-manage/view-cfg/index.vue b/src/views/config-manage/view-cfg/index.vue
new file mode 100644
index 0000000..4afa2c2
--- /dev/null
+++ b/src/views/config-manage/view-cfg/index.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+ 编辑
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/config-manage/view-cfg/service.js b/src/views/config-manage/view-cfg/service.js
new file mode 100644
index 0000000..6c37617
--- /dev/null
+++ b/src/views/config-manage/view-cfg/service.js
@@ -0,0 +1,40 @@
+import { get, post } from "@/utils/request";
+
+// 获取列表
+export function getFieldList({ modularId, fieldName, page, perPage }) {
+ return get({
+ url: "/api/v1/field/list",
+ params: {
+ modularId,
+ fieldName,
+ page,
+ perPage,
+ },
+ });
+}
+
+// 获取详情
+export function getFieldDetail({ fieldId }) {
+ return get({
+ url: "/api/v1/field/info",
+ params: {
+ fieldId,
+ },
+ });
+}
+
+// 保存字段
+export function saveField(data) {
+ return post({
+ url: "/api/v1/field/save",
+ data,
+ });
+}
+
+// 删除字段
+export function deleteField(data) {
+ return post({
+ url: "/api/v1/field/del",
+ data,
+ });
+}
diff --git a/src/views/data-overview/index.vue b/src/views/data-overview/index.vue
deleted file mode 100644
index 1ab0fc6..0000000
--- a/src/views/data-overview/index.vue
+++ /dev/null
@@ -1,3 +0,0 @@
-
- data
-
\ No newline at end of file
diff --git a/src/views/flow-manager/create/index.vue b/src/views/flow-manager/create/index.vue
deleted file mode 100644
index 88b2c8e..0000000
--- a/src/views/flow-manager/create/index.vue
+++ /dev/null
@@ -1,3 +0,0 @@
-
- create
-
\ No newline at end of file
diff --git a/src/views/flow-manager/list/index.vue b/src/views/flow-manager/list/index.vue
deleted file mode 100644
index 86e937d..0000000
--- a/src/views/flow-manager/list/index.vue
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- 111
-
-
- 222
-
-
\ No newline at end of file
diff --git a/src/views/view-all-manage/create-view/index.vue b/src/views/view-all-manage/create-view/index.vue
new file mode 100644
index 0000000..788439f
--- /dev/null
+++ b/src/views/view-all-manage/create-view/index.vue
@@ -0,0 +1,268 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+
+
{{ item.label }}:
+
+
{
+ toFilt(item.name, e.target.value);
+ }
+ "
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/view-all-manage/create-view/service.js b/src/views/view-all-manage/create-view/service.js
new file mode 100644
index 0000000..b19fbc5
--- /dev/null
+++ b/src/views/view-all-manage/create-view/service.js
@@ -0,0 +1,34 @@
+import { get, post } from "@/utils/request";
+
+// 项目-表-字段下拉
+export function getProModularField() {
+ return get({
+ url: "/api/v1/field/get-project-modular-field-drop",
+ });
+}
+
+// 预览
+export function preview({ modularId, fieldIds, page, perPage, filter }) {
+ return post({
+ url: "api/v1/preview/view",
+ data: {
+ modular_id: modularId,
+ field_ids: fieldIds,
+ page,
+ per_page: perPage,
+ filter,
+ },
+ });
+}
+
+// 点击保存
+export function saveView({ modularId, fieldIds, previewName }) {
+ return post({
+ url: "api/v1/preview/save",
+ data: {
+ modular_id: modularId,
+ field_ids: fieldIds,
+ preview_name: previewName,
+ },
+ });
+}
diff --git a/src/views/view-all-manage/view-list/config.ts b/src/views/view-all-manage/view-list/config.ts
new file mode 100644
index 0000000..e0fcb79
--- /dev/null
+++ b/src/views/view-all-manage/view-list/config.ts
@@ -0,0 +1,5 @@
+export const viewListCols = [
+ { dataIndex: 'preview_name', title: '视图名称', align: 'center' },
+ { dataIndex: 'created_at', title: '创建时间', align: 'center' },
+ { dataIndex: 'action', title: '操作', align: 'center' },
+];
diff --git a/src/views/view-all-manage/view-list/index.vue b/src/views/view-all-manage/view-list/index.vue
new file mode 100644
index 0000000..439607f
--- /dev/null
+++ b/src/views/view-all-manage/view-list/index.vue
@@ -0,0 +1,165 @@
+
+
+
+
+
+ {
+ toGetViewInfo(params);
+ }
+ "
+ />
+
+
+
+
+
+
+
+
diff --git a/src/views/view-all-manage/view-list/service.js b/src/views/view-all-manage/view-list/service.js
new file mode 100644
index 0000000..9f68ffb
--- /dev/null
+++ b/src/views/view-all-manage/view-list/service.js
@@ -0,0 +1,38 @@
+import { get } from "@/utils/request";
+
+// 联动下拉
+export function getProModular() {
+ return get({
+ url: "/api/v1/field/get-project-modular-drop",
+ });
+}
+
+// 视图列表
+export function getViewList({ modularId, page = 1, perPage = 20 }) {
+ return get({
+ url: "/api/v1/preview/list",
+ params: {
+ modular_id: modularId,
+ page,
+ perPage: perPage,
+ },
+ });
+}
+
+// 查看视图
+export function getViewInfo({
+ previewId,
+ page = 1,
+ perPage = 20,
+ filter = {},
+}) {
+ return get({
+ url: "/api/v1/preview/info",
+ params: {
+ preview_id: previewId,
+ page,
+ perPage: perPage,
+ filter,
+ },
+ });
+}
diff --git a/vite.config.ts b/vite.config.ts
index 9ddb338..827a72e 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
+import { server } from 'typescript';
// https://vitejs.dev/config/
export default defineConfig({
@@ -21,4 +22,8 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
+ server: {
+ hmr: true,
+ host: '0.0.0.0',
+ },
});