From a0a366923d2b3d603e09828278318a1e69ba4f40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Sat, 11 Jun 2022 14:49:16 +0800
Subject: [PATCH 1/5] feat: api
---
src/api/search/config.js | 35 +++++++++++++++++++++++++++++++++++
src/api/search/system.js | 35 +++++++++++++++++++++++++++++++++++
vite.config.js | 2 +-
3 files changed, 71 insertions(+), 1 deletion(-)
create mode 100644 src/api/search/config.js
create mode 100644 src/api/search/system.js
diff --git a/src/api/search/config.js b/src/api/search/config.js
new file mode 100644
index 0000000..069204f
--- /dev/null
+++ b/src/api/search/config.js
@@ -0,0 +1,35 @@
+import request from '@/utils/request.js';
+export const search = (params) => {
+ return request({
+ url: '/search/admin/searchConfig',
+ method: 'get',
+ params,
+ });
+};
+export const detail = (id) => {
+ return request({
+ url: '/search/admin/searchConfig/' + id,
+ method: 'get',
+ });
+};
+export const create = (data) => {
+ return request({
+ url: '/search/admin/searchConfig',
+ method: 'post',
+ data,
+ });
+};
+export const update = (data) => {
+ return request({
+ url: '/search/admin/searchConfig',
+ method: 'put',
+ data,
+ });
+};
+export const remove = (id) => {
+ return request({
+ url: '/search/admin/searchConfig',
+ method: 'delete',
+ params: { id },
+ });
+};
diff --git a/src/api/search/system.js b/src/api/search/system.js
new file mode 100644
index 0000000..c47358c
--- /dev/null
+++ b/src/api/search/system.js
@@ -0,0 +1,35 @@
+import request from '@/utils/request.js';
+export const search = (params) => {
+ return request({
+ url: '/search/admin/systemConfig',
+ method: 'get',
+ params,
+ });
+};
+export const detail = (id) => {
+ return request({
+ url: '/search/admin/systemConfig/' + id,
+ method: 'get',
+ });
+};
+export const create = (data) => {
+ return request({
+ url: '/search/admin/systemConfig',
+ method: 'post',
+ data,
+ });
+};
+export const update = (data) => {
+ return request({
+ url: '/search/admin/systemConfig',
+ method: 'put',
+ data,
+ });
+};
+export const remove = (id) => {
+ return request({
+ url: '/search/admin/systemConfig',
+ method: 'delete',
+ params: { id },
+ });
+};
diff --git a/vite.config.js b/vite.config.js
index 611fffc..0ea91a2 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -22,7 +22,7 @@ export default (configEnv) => {
'/api': {
// target: 'http://192.168.10.109:8090/', // 显雨
// target: 'http://192.168.10.5:4500', // 高玉
- // target: 'http://192.168.10.67:8090', // 罗战
+ // target: 'http://192.168.10.87:8090', // 罗战
// target: 'http://192.168.10.93:8090', // 周渺
// target: 'http://192.168.10.124:8090', // 舒梦娇
target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
From f282e344fc9b1ba20e6abb312fd8b48673842618 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Sat, 11 Jun 2022 16:10:28 +0800
Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/extra/ElTooltip.vue | 16 +
src/store/modules/search/searchSystem.js | 78 +++++
src/views/search/config/index.vue | 247 ++++++++++++++
src/views/search/system/index.vue | 389 +++++++++++++++++++++++
4 files changed, 730 insertions(+)
create mode 100644 src/components/extra/ElTooltip.vue
create mode 100644 src/store/modules/search/searchSystem.js
create mode 100644 src/views/search/config/index.vue
create mode 100644 src/views/search/system/index.vue
diff --git a/src/components/extra/ElTooltip.vue b/src/components/extra/ElTooltip.vue
new file mode 100644
index 0000000..27068e6
--- /dev/null
+++ b/src/components/extra/ElTooltip.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/src/store/modules/search/searchSystem.js b/src/store/modules/search/searchSystem.js
new file mode 100644
index 0000000..d45d247
--- /dev/null
+++ b/src/store/modules/search/searchSystem.js
@@ -0,0 +1,78 @@
+import * as api from '@/api/system/notify.js';
+import { ElMessage, ElMessageBox } from '@/plugins/element-plus';
+const state = () => ({
+ code: 'SearchSystem',
+ condition: {},
+ list: [],
+ total: 0,
+ opts: {
+ init: false,
+ },
+});
+const getters = {};
+const mutations = {
+ setCode: (state, data) => (state.code = data),
+ setCondition: (state, data) => (state.condition = data),
+ setList: (state, data) => (state.list = data),
+ setTotal: (state, data) => (state.total = data),
+ setOpts: (state, data) => (state.opts = data),
+};
+const actions = {
+ search: async ({ state, commit, rootGetters }) => {
+ let data = { ...state.condition };
+ let res = await api.search({ ...rootGetters['local/page'](state.code), ...data });
+ commit('setList', res?.records || []);
+ commit('setTotal', res?.total || 0);
+ if (!res) {
+ ElMessage.error('查询失败');
+ }
+ return res;
+ },
+ load: async ({ commit }) => {
+ commit('setOpts', {
+ init: true,
+ });
+ },
+ detail: async (context, id) => {
+ let res = await api.detail(id);
+ if (!res) {
+ ElMessage.error('加载详情失败');
+ }
+ return res;
+ },
+ save: async ({ dispatch }, data) => {
+ let save = data.id ? api.update : api.create;
+ let res = await save(data);
+ if (res) {
+ ElMessage.success('保存成功');
+ dispatch('search');
+ } else {
+ ElMessage.error('保存失败');
+ }
+ return res;
+ },
+ remove: async ({ dispatch }, idList) => {
+ if (!idList.length) {
+ ElMessage.warning('请选择要删除的数据');
+ } else {
+ try {
+ await ElMessageBox.confirm('数据删除后无法恢复,确定要删除吗?', '危险操作');
+ let res = await api.remove(idList.join(','));
+ if (res) {
+ ElMessage.success('删除成功');
+ dispatch('search');
+ } else {
+ ElMessage.error('删除失败');
+ }
+ } catch (e) {
+ console.info('取消删除', e);
+ }
+ }
+ },
+};
+export default {
+ state,
+ getters,
+ mutations,
+ actions,
+};
diff --git a/src/views/search/config/index.vue b/src/views/search/config/index.vue
new file mode 100644
index 0000000..08614ff
--- /dev/null
+++ b/src/views/search/config/index.vue
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
diff --git a/src/views/search/system/index.vue b/src/views/search/system/index.vue
new file mode 100644
index 0000000..fa0b63d
--- /dev/null
+++ b/src/views/search/system/index.vue
@@ -0,0 +1,389 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ES文档ID
+
+
+
+
+
+
+ 排序
+
+
+
+
+
+
+
+
+
+ 搜索字段
+
+
+
+
+
+
+
+
+
+ 同步频率
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ES文档ID
+
+
+
+
+
+
+ 排序
+
+
+
+
+
+
+
+
+
+ 搜索字段
+
+
+
+
+
+
+
+
+
+ 同步频率
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
From 8edf39fe4f4f3244513f8369b61f6d7adc635d97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Sat, 11 Jun 2022 16:23:53 +0800
Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=E6=90=9C=E7=B4=A2=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/store/modules/sales/category.js | 7 +-
src/store/modules/sales/orderShip.js | 5 +-
src/store/modules/search/searchConfig.js | 79 +++++
src/store/modules/search/searchSystem.js | 9 +-
src/store/modules/system/customer.js | 12 +-
src/store/modules/system/notify.js | 3 +-
src/views/search/config/index.vue | 247 ---------------
src/views/search/search/index.vue | 386 +++++++++++++++++++++++
src/views/search/system/index.vue | 228 ++++---------
9 files changed, 540 insertions(+), 436 deletions(-)
create mode 100644 src/store/modules/search/searchConfig.js
delete mode 100644 src/views/search/config/index.vue
create mode 100644 src/views/search/search/index.vue
diff --git a/src/store/modules/sales/category.js b/src/store/modules/sales/category.js
index 57b9eb1..c3fcb62 100644
--- a/src/store/modules/sales/category.js
+++ b/src/store/modules/sales/category.js
@@ -34,13 +34,10 @@ const actions = {
}
return res;
},
- load: async ({ commit }) => {
+ load: async ({ state, commit }) => {
commit('setOpts', {
+ ...state.opts,
init: true,
- visible: [
- { label: '显示', value: true },
- { label: '隐藏', value: false },
- ],
});
},
detail: async ({ state, dispatch }, id) => {
diff --git a/src/store/modules/sales/orderShip.js b/src/store/modules/sales/orderShip.js
index 35989a6..ff458b7 100644
--- a/src/store/modules/sales/orderShip.js
+++ b/src/store/modules/sales/orderShip.js
@@ -11,7 +11,7 @@ const state = () => ({
summary: [],
opts: {
init: false,
- company: [{ label: '顺丰', value: 'sf' }],
+ company: [],
},
});
const getters = {};
@@ -31,8 +31,9 @@ const actions = {
}
return res;
},
- load: async ({ commit }) => {
+ load: async ({ state, commit }) => {
commit('setOpts', {
+ ...state.opts,
init: true,
company: await api.searchShip(),
});
diff --git a/src/store/modules/search/searchConfig.js b/src/store/modules/search/searchConfig.js
new file mode 100644
index 0000000..ce103e4
--- /dev/null
+++ b/src/store/modules/search/searchConfig.js
@@ -0,0 +1,79 @@
+import * as api from '@/api/system/notify.js';
+import { ElMessage, ElMessageBox } from '@/plugins/element-plus';
+const state = () => ({
+ code: 'SearchConfig',
+ condition: {},
+ list: [],
+ total: 0,
+ opts: {
+ init: false,
+ },
+});
+const getters = {};
+const mutations = {
+ setCode: (state, data) => (state.code = data),
+ setCondition: (state, data) => (state.condition = data),
+ setList: (state, data) => (state.list = data),
+ setTotal: (state, data) => (state.total = data),
+ setOpts: (state, data) => (state.opts = data),
+};
+const actions = {
+ search: async ({ state, commit, rootGetters }) => {
+ let data = { ...state.condition };
+ let res = await api.search({ ...rootGetters['local/page'](state.code), ...data });
+ commit('setList', res?.records || []);
+ commit('setTotal', res?.total || 0);
+ if (!res) {
+ ElMessage.error('查询失败');
+ }
+ return res;
+ },
+ load: async ({ state, commit }) => {
+ commit('setOpts', {
+ ...state.opts,
+ init: true,
+ });
+ },
+ detail: async (context, id) => {
+ let res = await api.detail(id);
+ if (!res) {
+ ElMessage.error('加载详情失败');
+ }
+ return res;
+ },
+ save: async ({ dispatch }, data) => {
+ let save = data.id ? api.update : api.create;
+ let res = await save(data);
+ if (res) {
+ ElMessage.success('保存成功');
+ dispatch('search');
+ } else {
+ ElMessage.error('保存失败');
+ }
+ return res;
+ },
+ remove: async ({ dispatch }, idList) => {
+ if (!idList.length) {
+ ElMessage.warning('请选择要删除的数据');
+ } else {
+ try {
+ await ElMessageBox.confirm('数据删除后无法恢复,确定要删除吗?', '危险操作');
+ let res = await api.remove(idList.join(','));
+ if (res) {
+ ElMessage.success('删除成功');
+ dispatch('search');
+ } else {
+ ElMessage.error('删除失败');
+ }
+ } catch (e) {
+ console.info('取消删除', e);
+ }
+ }
+ },
+};
+export default {
+ state,
+ getters,
+ mutations,
+ actions,
+};
diff --git a/src/store/modules/search/searchSystem.js b/src/store/modules/search/searchSystem.js
index d45d247..1ace0e9 100644
--- a/src/store/modules/search/searchSystem.js
+++ b/src/store/modules/search/searchSystem.js
@@ -7,6 +7,12 @@ const state = () => ({
total: 0,
opts: {
init: false,
+ type: [
+ {
+ label: 'MySQL',
+ value: 1,
+ },
+ ],
},
});
const getters = {};
@@ -28,8 +34,9 @@ const actions = {
}
return res;
},
- load: async ({ commit }) => {
+ load: async ({ state, commit }) => {
commit('setOpts', {
+ ...state.opts,
init: true,
});
},
diff --git a/src/store/modules/system/customer.js b/src/store/modules/system/customer.js
index f39bdc7..dfabe3b 100644
--- a/src/store/modules/system/customer.js
+++ b/src/store/modules/system/customer.js
@@ -7,7 +7,10 @@ const state = () => ({
total: 0,
opts: {
init: false,
- gender: [],
+ gender: [
+ { label: '男', value: 1 },
+ { label: '女', value: 2 },
+ ],
},
});
const getters = {};
@@ -36,13 +39,10 @@ const actions = {
}
return res;
},
- load: async ({ commit }) => {
+ load: async ({ state, commit }) => {
commit('setOpts', {
+ ...state.opts,
init: true,
- gender: [
- { label: '男', value: 1 },
- { label: '女', value: 2 },
- ],
});
},
enable: async ({ dispatch }, data) => {
diff --git a/src/store/modules/system/notify.js b/src/store/modules/system/notify.js
index 535c033..284c8b7 100644
--- a/src/store/modules/system/notify.js
+++ b/src/store/modules/system/notify.js
@@ -33,8 +33,9 @@ const actions = {
}
return res;
},
- load: async ({ commit }) => {
+ load: async ({ state, commit }) => {
commit('setOpts', {
+ ...state.opts,
init: true,
});
},
diff --git a/src/views/search/config/index.vue b/src/views/search/config/index.vue
deleted file mode 100644
index 08614ff..0000000
--- a/src/views/search/config/index.vue
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 取消
- 保存
-
-
-
-
-
-
-
-
diff --git a/src/views/search/search/index.vue b/src/views/search/search/index.vue
new file mode 100644
index 0000000..0584b6c
--- /dev/null
+++ b/src/views/search/search/index.vue
@@ -0,0 +1,386 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ES文档ID
+
+
+
+
+
+
+ 排序
+
+
+
+
+
+
+
+
+
+ 搜索字段
+
+
+
+
+
+
+
+
+
+ 同步频率
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ES文档ID
+
+
+
+
+
+
+
+
+
+ 搜索字段
+
+
+
+
+
+
+
+
+
+ 同步频率
+
+
+
+
+
+
+ 排序
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
diff --git a/src/views/search/system/index.vue b/src/views/search/system/index.vue
index fa0b63d..73dc77b 100644
--- a/src/views/search/system/index.vue
+++ b/src/views/search/system/index.vue
@@ -14,28 +14,25 @@
@search="handleSearch"
>
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
- ES文档ID
-
+ 数据库配置
+
-
+
@@ -47,32 +44,6 @@
-
-
-
-
-
- 搜索字段
-
-
-
-
-
-
-
-
-
- 同步频率
-
-
-
-
@@ -80,31 +51,25 @@
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
+
- ES文档ID
-
+ 数据库配置
+
-
+
@@ -116,32 +81,6 @@
-
-
-
-
-
- 搜索字段
-
-
-
-
-
-
-
-
-
- 同步频率
-
-
-
-
取消
@@ -166,16 +105,12 @@
}
const state = reactive({
condition: {
- author: null,
- databaseName: null,
- documentIdExp: null,
id: null,
+ databaseType: null,
+ datasource: null,
order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
- systemId: null,
+ systemCode: null,
+ systemName: null,
},
});
watch(
@@ -187,16 +122,12 @@
);
const handleReset = () => {
state.condition = {
- author: null,
- databaseName: null,
- documentIdExp: null,
id: null,
+ databaseType: null,
+ datasource: null,
order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
- systemId: null,
+ systemCode: null,
+ systemName: null,
};
};
const handleSearch = async () => {
@@ -212,27 +143,19 @@
formVisible: false,
submitting: false,
form: {
- author: null,
- databaseName: null,
- documentIdExp: null,
id: null,
+ databaseType: null,
+ datasource: null,
order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
- systemId: null,
+ systemCode: null,
+ systemName: null,
},
rules: {
- author: [{ required: true, message: '作者不能为空' }],
- databaseName: [{ required: true, message: '数据库名称不能为空' }],
- documentIdExp: [{ required: true, message: 'ES文档ID不能为空' }],
+ databaseType: [{ required: true, message: '数据库类型不能为空' }],
+ datasource: [{ required: true, message: '数据库配置不能为空' }],
order: [{ required: true, message: '排序不能为空' }],
- searchCode: [{ required: true, message: '搜索码不能为空' }],
- searchFiled: [{ required: true, message: '搜索字段不能为空' }],
- searchName: [{ required: true, message: '搜索名不能为空' }],
- syncCron: [{ required: true, message: '同步频率不能为空' }],
- systemId: [{ required: true, message: '系统ID不能为空' }],
+ systemCode: [{ required: true, message: '系统编码不能为空' }],
+ systemName: [{ required: true, message: '系统名称不能为空' }],
},
});
// 添加/编辑
@@ -240,16 +163,12 @@
Object.assign(
formState.form,
row || {
- author: null,
- databaseName: null,
- documentIdExp: null,
id: null,
+ databaseType: null,
+ datasource: null,
order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
- systemId: null,
+ systemCode: null,
+ systemName: null,
}
);
formState.formVisible = true;
@@ -285,29 +204,28 @@
width: 100,
},
{
- label: '系统ID',
- prop: 'systemId',
+ label: '系统编码',
+ prop: 'systemCode',
},
{
- label: '作者',
- prop: 'author',
+ label: '系统名称',
+ prop: 'systemName',
},
{
- label: '数据库名称',
- prop: 'databaseName',
- minWidth: 120,
+ label: '数据库类型',
+ width: 100,
+ slots: {
+ default: ({ row }) => proxy.$dict(unref(opts).type, row.databaseType),
+ },
},
{
- prop: 'documentIdExp',
+ prop: 'datasource',
minWidth: 120,
slots: {
header: () => (
- ES文档ID
-
+ 数据库配置
+
),
},
@@ -327,44 +245,6 @@
),
},
},
- {
- label: '搜索码',
- prop: 'searchCode',
- },
- {
- prop: 'searchFiled',
- minWidth: 120,
- slots: {
- header: () => (
-
- 搜索字段
-
-
- ),
- },
- },
- {
- label: '搜索名',
- prop: 'searchName',
- },
- {
- prop: 'syncCron',
- minWidth: 120,
- slots: {
- header: () => (
-
- 同步频率
-
-
- ),
- },
- },
{
label: '操作',
fixed: 'right',
From d20aa839ae3dfb0f2aafa75a99573792ea3f4a29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Sat, 11 Jun 2022 17:46:27 +0800
Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E6=8E=A5=E5=8F=A3=E5=AF=B9?=
=?UTF-8?q?=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/store/modules/search/searchConfig.js | 5 +-
src/store/modules/search/searchSystem.js | 2 +-
src/views/search/{search => config}/index.vue | 65 ++++++++-----------
src/views/search/system/index.vue | 35 ++--------
vite.config.js | 4 +-
5 files changed, 37 insertions(+), 74 deletions(-)
rename src/views/search/{search => config}/index.vue (90%)
diff --git a/src/store/modules/search/searchConfig.js b/src/store/modules/search/searchConfig.js
index ce103e4..595ccef 100644
--- a/src/store/modules/search/searchConfig.js
+++ b/src/store/modules/search/searchConfig.js
@@ -1,4 +1,5 @@
-import * as api from '@/api/system/notify.js';
+import * as api from '@/api/search/config.js';
+import * as systemAPI from '@/api/search/system.js';
import { ElMessage, ElMessageBox } from '@/plugins/element-plus';
const state = () => ({
code: 'SearchConfig',
@@ -7,6 +8,7 @@ const state = () => ({
total: 0,
opts: {
init: false,
+ system: [],
},
});
const getters = {};
@@ -32,6 +34,7 @@ const actions = {
commit('setOpts', {
...state.opts,
init: true,
+ system: (await systemAPI.search({ pageIndex: 1, length: 99999 }))?.records || [],
});
},
detail: async (context, id) => {
diff --git a/src/store/modules/search/searchSystem.js b/src/store/modules/search/searchSystem.js
index 1ace0e9..df1e3ff 100644
--- a/src/store/modules/search/searchSystem.js
+++ b/src/store/modules/search/searchSystem.js
@@ -1,4 +1,4 @@
-import * as api from '@/api/system/notify.js';
+import * as api from '@/api/search/system.js';
import { ElMessage, ElMessageBox } from '@/plugins/element-plus';
const state = () => ({
code: 'SearchSystem',
diff --git a/src/views/search/search/index.vue b/src/views/search/config/index.vue
similarity index 90%
rename from src/views/search/search/index.vue
rename to src/views/search/config/index.vue
index 0584b6c..2015d39 100644
--- a/src/views/search/search/index.vue
+++ b/src/views/search/config/index.vue
@@ -15,12 +15,16 @@
>
+
+
+
-
-
-
@@ -84,8 +88,12 @@
:model="formState.form"
:rules="formState.rules"
>
-
-
+
+
@@ -129,16 +137,6 @@
-
-
- 排序
-
-
-
-
取消
@@ -213,7 +211,6 @@
databaseName: null,
documentIdExp: null,
id: null,
- order: null,
searchCode: null,
searchFiled: null,
searchName: null,
@@ -224,7 +221,6 @@
author: [{ required: true, message: '作者不能为空' }],
databaseName: [{ required: true, message: '数据库名称不能为空' }],
documentIdExp: [{ required: true, message: 'ES文档ID不能为空' }],
- order: [{ required: true, message: '排序不能为空' }],
searchCode: [{ required: true, message: '搜索码不能为空' }],
searchFiled: [{ required: true, message: '搜索字段不能为空' }],
searchName: [{ required: true, message: '搜索名不能为空' }],
@@ -241,7 +237,6 @@
databaseName: null,
documentIdExp: null,
id: null,
- order: null,
searchCode: null,
searchFiled: null,
searchName: null,
@@ -257,8 +252,10 @@
try {
await proxy.$validate(refsForm);
let data = _.cloneDeep(formState.form);
- await store.dispatch('searchConfig/save', data);
- formState.formVisible = false;
+ let res = await store.dispatch('searchConfig/save', data);
+ if (res) {
+ formState.formVisible = false;
+ }
} catch (e) {
console.info('取消保存', e);
}
@@ -276,15 +273,20 @@
type: 'selection',
width: 60,
},
+ {
+ label: '所属系统',
+ prop: 'systemId',
+ minWidth: 120,
+ slots: {
+ default: ({ row }) =>
+ proxy.$dict(unref(opts).system, row.systemId, { label: 'systemName', value: 'id' }),
+ },
+ },
{
label: '主键',
prop: 'id',
width: 100,
},
- {
- label: '系统ID',
- prop: 'systemId',
- },
{
label: '作者',
prop: 'author',
@@ -309,21 +311,6 @@
),
},
},
- {
- prop: 'order',
- width: 100,
- slots: {
- header: () => (
-
- 排序
-
-
- ),
- },
- },
{
label: '搜索码',
prop: 'searchCode',
diff --git a/src/views/search/system/index.vue b/src/views/search/system/index.vue
index 73dc77b..38dc4e3 100644
--- a/src/views/search/system/index.vue
+++ b/src/views/search/system/index.vue
@@ -71,16 +71,6 @@
-
-
- 排序
-
-
-
-
取消
@@ -108,7 +98,6 @@
id: null,
databaseType: null,
datasource: null,
- order: null,
systemCode: null,
systemName: null,
},
@@ -125,7 +114,6 @@
id: null,
databaseType: null,
datasource: null,
- order: null,
systemCode: null,
systemName: null,
};
@@ -146,14 +134,12 @@
id: null,
databaseType: null,
datasource: null,
- order: null,
systemCode: null,
systemName: null,
},
rules: {
databaseType: [{ required: true, message: '数据库类型不能为空' }],
datasource: [{ required: true, message: '数据库配置不能为空' }],
- order: [{ required: true, message: '排序不能为空' }],
systemCode: [{ required: true, message: '系统编码不能为空' }],
systemName: [{ required: true, message: '系统名称不能为空' }],
},
@@ -179,8 +165,10 @@
try {
await proxy.$validate(refsForm);
let data = _.cloneDeep(formState.form);
- await store.dispatch('searchSystem/save', data);
- formState.formVisible = false;
+ let res = await store.dispatch('searchSystem/save', data);
+ if (res) {
+ formState.formVisible = false;
+ }
} catch (e) {
console.info('取消保存', e);
}
@@ -230,21 +218,6 @@
),
},
},
- {
- prop: 'order',
- width: 100,
- slots: {
- header: () => (
-
- 排序
-
-
- ),
- },
- },
{
label: '操作',
fixed: 'right',
diff --git a/vite.config.js b/vite.config.js
index 0ea91a2..9cd46bf 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -22,10 +22,10 @@ export default (configEnv) => {
'/api': {
// target: 'http://192.168.10.109:8090/', // 显雨
// target: 'http://192.168.10.5:4500', // 高玉
- // target: 'http://192.168.10.87:8090', // 罗战
+ target: 'http://192.168.10.87:8090', // 罗战
// target: 'http://192.168.10.93:8090', // 周渺
// target: 'http://192.168.10.124:8090', // 舒梦娇
- target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
+ // target: 'https://k8s-horse-gateway.mashibing.cn/', // 测试地址
// target: 'https://you-gateway.mashibing.com', // 生产环境
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
From da6caa5cd6937a9fb87a7f4cd507701368fe8aa2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=90=91=E6=96=87=E5=8F=AF?= <1041367524@qq.com>
Date: Sat, 11 Jun 2022 17:51:52 +0800
Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/search/config/index.vue | 147 +++++++-----------------------
src/views/search/system/index.vue | 59 +-----------
2 files changed, 39 insertions(+), 167 deletions(-)
diff --git a/src/views/search/config/index.vue b/src/views/search/config/index.vue
index 2015d39..40167e0 100644
--- a/src/views/search/config/index.vue
+++ b/src/views/search/config/index.vue
@@ -22,61 +22,6 @@
:opts="opts.system"
/>
-
-
-
-
-
-
-
-
-
-
-
- ES文档ID
-
-
-
-
-
-
- 排序
-
-
-
-
-
-
-
-
-
- 搜索字段
-
-
-
-
-
-
-
-
-
- 同步频率
-
-
-
-
@@ -95,37 +40,34 @@
:opts="opts.system"
/>
-
-
+
+
-
-
+
+
-
+
- ES文档ID
+ 搜索字段
-
+
-
-
+
+
-
+
- 搜索字段
+ ES文档ID
-
-
-
-
+
@@ -137,6 +79,9 @@
+
+
+
取消
@@ -161,15 +106,6 @@
}
const state = reactive({
condition: {
- author: null,
- databaseName: null,
- documentIdExp: null,
- id: null,
- order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
systemId: null,
},
});
@@ -182,15 +118,6 @@
);
const handleReset = () => {
state.condition = {
- author: null,
- databaseName: null,
- documentIdExp: null,
- id: null,
- order: null,
- searchCode: null,
- searchFiled: null,
- searchName: null,
- syncCron: null,
systemId: null,
};
};
@@ -283,57 +210,49 @@
},
},
{
- label: '主键',
- prop: 'id',
- width: 100,
- },
- {
- label: '作者',
- prop: 'author',
+ label: '搜索码',
+ prop: 'searchCode',
},
{
- label: '数据库名称',
- prop: 'databaseName',
- minWidth: 120,
+ label: '搜索名',
+ prop: 'searchName',
},
{
- prop: 'documentIdExp',
+ prop: 'searchFiled',
minWidth: 120,
slots: {
header: () => (
- ES文档ID
+ 搜索字段
),
},
},
+
{
- label: '搜索码',
- prop: 'searchCode',
+ label: '数据库名称',
+ prop: 'databaseName',
+ minWidth: 120,
},
{
- prop: 'searchFiled',
+ prop: 'documentIdExp',
minWidth: 120,
slots: {
header: () => (
- 搜索字段
+ ES文档ID
),
},
},
- {
- label: '搜索名',
- prop: 'searchName',
- },
{
prop: 'syncCron',
minWidth: 120,
@@ -349,6 +268,10 @@
),
},
},
+ {
+ label: '作者',
+ prop: 'author',
+ },
{
label: '操作',
fixed: 'right',
diff --git a/src/views/search/system/index.vue b/src/views/search/system/index.vue
index 38dc4e3..66b3bdc 100644
--- a/src/views/search/system/index.vue
+++ b/src/views/search/system/index.vue
@@ -5,48 +5,14 @@
:code="code"
:config="config"
:data="list"
- :operation="['create', 'search', 'remove']"
+ :operation="['create', 'remove']"
:reset="handleReset"
title="系统配置"
:total="total"
@create="handleCreate()"
@remove="handleRemove"
@search="handleSearch"
- >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 数据库配置
-
-
-
-
-
-
- 排序
-
-
-
-
-
-
-
+ />
state.condition,
@@ -110,13 +70,7 @@
{ immediate: true, deep: true }
);
const handleReset = () => {
- state.condition = {
- id: null,
- databaseType: null,
- datasource: null,
- systemCode: null,
- systemName: null,
- };
+ state.condition = {};
};
const handleSearch = async () => {
loading.value = true;
@@ -186,11 +140,6 @@
type: 'selection',
width: 60,
},
- {
- label: '主键',
- prop: 'id',
- width: 100,
- },
{
label: '系统编码',
prop: 'systemCode',