Browse Source

代码重构

dev-V1.0.1
庄锐波 6 months ago
parent
commit
f037d4e193
  1. 4
      script/sql/zfjd-refactoring-v1/005-重新生成菜单.sql
  2. 135
      zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/integrationmock/siq/index.vue
  3. 0
      zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/integrationmock/szy/index.vue

4
script/sql/zfjd-refactoring-v1/005-重新生成菜单.sql

@ -122,6 +122,10 @@ INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component,
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (1622, '配置编辑', 118, 6, '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, '2026-03-31 20:14:46', null, null, ''); INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (1622, '配置编辑', 118, 6, '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:edit', '#', 103, 1, '2026-03-31 20:14:46', null, null, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (1623, '配置删除', 118, 6, '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, '2026-03-31 20:14:46', null, null, ''); INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark) VALUES (1623, '配置删除', 118, 6, '#', '', '', 1, 0, 'F', '0', '0', 'system:ossConfig:remove', '#', 103, 1, '2026-03-31 20:14:46', null, null, '');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark,system_code) VALUES (7, '系统集成模拟', 0, 7, 'system-integration-mock', null, '', 1, 0, 'M', '0', '0', '', 'redis', 103, 1, '2026-03-31 20:14:46', null, null, '系统集成模拟','authService');
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (1624, '深i企模拟集成', 7, 1, 'integrationmock-siq', 'efcode/integrationmock/siq/index', '', 1, 0, '#', '', 'C', '0', '0', 'integration:siq:list', '#', '103', 1, '2026-03-31 20:14:46', null, null, '深i企模拟集成', 'authService', null);
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (1625, '深政易模拟集成', 7, 2, 'integrationmock-szy', 'efcode/integrationmock/szy/index', '', 1, 0, '#', '', 'C', '0', '0', 'integration:szy:list', '#', '103', 1, '2026-03-31 20:14:46', null, null, '深政易模拟集成', 'authService', null);
update sys_menu set system_code = 'authService' where create_time='2026-03-31 20:14:46'; update sys_menu set system_code = 'authService' where create_time='2026-03-31 20:14:46';
UPDATE sys_menu SET menu_name = '菜单管理', parent_id = 1, order_num = 3, path = 'menu', component = 'system/menu/index-groupby', query_param = '', is_frame = 1, is_cache = 0, url = '#', target = '', menu_type = 'C', visible = '0', status = '0', perms = 'system:menu:list', icon = 'tree-table', create_dept = '103', create_by = 1, create_time = '2026-03-31 20:14:46', update_by = null, update_time = null, remark = '菜单管理菜单', system_code = 'authService', type = null WHERE menu_id = 102; UPDATE sys_menu SET menu_name = '菜单管理', parent_id = 1, order_num = 3, path = 'menu', component = 'system/menu/index-groupby', query_param = '', is_frame = 1, is_cache = 0, url = '#', target = '', menu_type = 'C', visible = '0', status = '0', perms = 'system:menu:list', icon = 'tree-table', create_dept = '103', create_by = 1, create_time = '2026-03-31 20:14:46', update_by = null, update_time = null, remark = '菜单管理菜单', system_code = 'authService', type = null WHERE menu_id = 102;

135
zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/integrationmock/siq/index.vue

@ -0,0 +1,135 @@
<template>
<div class="app-container">
<el-card shadow="hover">
<template #header>
<span style="font-weight: bold; font-size: 18px">模拟深i企登录</span>
</template>
<el-form :model="formData" label-width="120px" style="max-width: 700px">
<!-- 目标地址 -->
<el-form-item label="目标地址">
<el-input v-model="formData.targetUrl" placeholder="请输入目标地址" clearable />
</el-form-item>
<!-- 登录账号选择 -->
<el-form-item label="登录账号">
<el-select
v-model="formData.selectedIndex"
placeholder="请选择登录账号"
style="width: 100%"
clearable
>
<el-option
v-for="(item, index) in userList"
:key="index"
:label="`${item.userName}(${item.loginName})`"
:value="index"
/>
</el-select>
</el-form-item>
<!-- 选中用户信息展示 -->
<el-form-item v-if="selectedUser" label="用户信息">
<el-descriptions :column="1" border size="small">
<el-descriptions-item label="用户名称">{{ selectedUser.userName }}</el-descriptions-item>
<el-descriptions-item label="登录账号">{{ selectedUser.loginName }}</el-descriptions-item>
<el-descriptions-item label="用户ID">{{ selectedUser.userId }}</el-descriptions-item>
</el-descriptions>
</el-form-item>
<!-- 拼接后的地址预览 -->
<el-form-item v-if="selectedUser" label="请求地址预览">
<el-input
:model-value="previewUrl"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
readonly
/>
</el-form-item>
<!-- 操作按钮 -->
<el-form-item>
<el-button type="primary" @click="handleMockLogin" :disabled="selectedUser == null">
模拟登录
</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script setup lang="ts" name="SiqMockLogin">
import { ref, computed } from 'vue';
import { ElMessage } from 'element-plus';
interface MockUser {
userName: string;
loginName: string;
userId: number | string;
}
const DEFAULT_TARGET_URL = 'http://127.0.0.1:12001/enterprise/enterpriseHome';
/** 可选的登录账号列表 */
const userList = ref<MockUser[]>([
{ userName: '深圳农牧美益肉业有限公司', loginName: 'weil45', userId: 21 },
{ userName: '深圳市深水龙岗污水处理有限公司', loginName: 'DGD440881199506180622', userId: 12 },
{ userName: '深圳康泰生物制品股份有限公司', loginName: 'smiledzb1982', userId: 10 },
{ userName: '深圳市里程食品有限公司', loginName: 'A7271888', userId: 9 },
{ userName: '欧姆龙电子部件(深圳)有限公司', loginName: 'qintongzhen138', userId: 8 },
{ userName: '深圳市强达电路股份有限公司', loginName: 'XP073215', userId: 7 },
{ userName: '吉田拉链(深圳)有限公司公明工厂', loginName: '33ef1970fd449676fa4bc197', userId: 6 },
]);
const formData = ref({
targetUrl: DEFAULT_TARGET_URL,
selectedIndex: undefined as number | undefined,
});
/** 当前选中的用户 */
const selectedUser = computed<MockUser | null>(() => {
if (formData.value.selectedIndex != null) {
return userList.value[formData.value.selectedIndex];
}
return null;
});
/** 预览拼接后的完整地址 */
const previewUrl = computed(() => {
if (!selectedUser.value) return '';
return buildMockLoginUrl();
});
/** 构建模拟登录 URL */
function buildMockLoginUrl(): string {
const user = selectedUser.value;
if (!user) return '';
const baseUrl = formData.value.targetUrl || DEFAULT_TARGET_URL;
const userInfo = JSON.stringify({ userName: user.userName, loginName: user.loginName, userId: user.userId });
const params = new URLSearchParams();
params.set('mockLogin', 'true');
params.set('mockLoginFrom', 'siq');
params.set('userInfo', userInfo);
const separator = baseUrl.includes('?') ? '&' : '?';
return `${baseUrl}${separator}${params.toString()}`;
}
/** 模拟登录:打开新窗口 */
function handleMockLogin() {
if (!selectedUser.value) {
ElMessage.warning('请先选择登录账号');
return;
}
const url = buildMockLoginUrl();
window.open(url, '_blank');
}
/** 重置表单 */
function handleReset() {
formData.value.targetUrl = DEFAULT_TARGET_URL;
formData.value.selectedIndex = undefined;
}
</script>

0
zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/integrationmock/szy/index.vue

Loading…
Cancel
Save