提交 888b345d authored 作者: kxjia's avatar kxjia

修改 bug

上级 84d8a885
...@@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip' ...@@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
#后台接口父地址(必填) #后台接口父地址(必填)
VITE_GLOB_API_URL=/jeecgboot VITE_GLOB_API_URL=/stm
#后台接口全路径地址(必填) #后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=http://127.0.0.1:8080/jeecg-boot VITE_GLOB_DOMAIN_URL=http://47.98.203.68:8180/stm
# 接口父路径前缀 # 接口父路径前缀
VITE_GLOB_API_URL_PREFIX= VITE_GLOB_API_URL_PREFIX=
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
import { ref, onMounted, computed } from 'vue' import { ref, onMounted, computed } from 'vue'
import { readXml, saveXml } from "/@/components/Process/api/definition" import { readXml, saveXml } from "/@/components/Process/api/definition"
import BpmnModel from '/@/components/Process/index.vue' import BpmnModel from '/@/components/Process/index.vue'
import vkBeautify from 'vkbeautify'
import * as vkbeautify from 'vkbeautify'
import hljs from 'highlight.js' import hljs from 'highlight.js'
import { useRouter,useRoute } from 'vue-router' import { useRouter,useRoute } from 'vue-router'
const router = useRouter(); const router = useRouter();
......
...@@ -6,6 +6,8 @@ import { render } from '/@/utils/common/renderUtils'; ...@@ -6,6 +6,8 @@ import { render } from '/@/utils/common/renderUtils';
import { getDepartPathNameByOrgCode, getDepartName, getMultiDepartPathName, getDepartPathName } from '@/utils/common/compUtils'; import { getDepartPathNameByOrgCode, getDepartName, getMultiDepartPathName, getDepartPathName } from '@/utils/common/compUtils';
import { h } from 'vue'; import { h } from 'vue';
import { Tag } from 'ant-design-vue'; import { Tag } from 'ant-design-vue';
import dayjs from 'dayjs';
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '用户账号', title: '用户账号',
...@@ -520,6 +522,197 @@ export const formPasswordSchema: FormSchema[] = [ ...@@ -520,6 +522,197 @@ export const formPasswordSchema: FormSchema[] = [
}, },
]; ];
// 代理人管理表单配置 - 新增
export const formAgentSchema: FormSchema[] = [
{
label: '用户',
field: 'userId',
component: 'JSelectUser',
componentProps: {
rowKey: 'id',
labelKey: 'realname',
maxSelectCount: 1,
params: { status: 1 },
},
required: true,
colProps: { span: 24 },
},
{
label: '代理人',
field: 'agentUserId',
component: 'JSelectUser',
componentProps: {
rowKey: 'id',
labelKey: 'realname',
maxSelectCount: 1,
params: { status: 1 },
},
required: true,
colProps: { span: 24 },
},
{
label: '开始时间',
field: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss',
placeholder: '请选择开始时间',
},
required: true,
colProps: { span: 24 },
},
{
label: '结束时间',
field: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss',
placeholder: '请选择结束时间',
},
required: true,
colProps: { span: 24 },
},
{
label: '状态',
field: 'status',
component: 'Select',
componentProps: {
options: [
{ label: '启用', value: 1 },
{ label: '停用', value: 0 },
],
},
defaultValue: 1,
required: true,
colProps: { span: 24 },
},
{
label: '备注',
field: 'remark',
component: 'InputTextArea',
colProps: { span: 24 },
componentProps: {
rows: 4,
placeholder: '请输入备注信息',
maxlength: 500,
showCount: true,
},
},
];
// 解除代理人关系表单配置 - 新增
export const formQuitAgentSchema: FormSchema[] = [
{
label: '用户账号',
field: 'username',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '用户姓名',
field: 'realname',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '代理人账号',
field: 'agentUsername',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '代理人姓名',
field: 'agentRealname',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '开始时间',
field: 'startTime',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '结束时间',
field: 'endTime',
component: 'Input',
componentProps: {
readOnly: true,
},
colProps: { span: 24 },
},
{
label: '解除原因',
field: 'quitReason',
component: 'InputTextArea',
required: true,
colProps: { span: 24 },
componentProps: {
rows: 4,
placeholder: '请输入解除代理人关系的原因',
maxlength: 500,
showCount: true,
},
rules: [
{
required: true,
message: '请输入解除原因',
},
{
min: 5,
message: '解除原因不能少于5个字符',
},
{
max: 500,
message: '解除原因不能超过500个字符',
},
],
},
{
label: '解除时间',
field: 'quitTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss',
disabledDate: (current) => {
return current && current < dayjs().startOf('day');
},
},
defaultValue: dayjs().format('YYYY-MM-DD HH:mm:ss'),
required: true,
colProps: { span: 24 },
},
{
label: '备注',
field: 'remark',
component: 'InputTextArea',
colProps: { span: 24 },
componentProps: {
rows: 3,
placeholder: '请输入其他备注信息',
maxlength: 300,
showCount: true,
},
},
];
//租户用户列表 //租户用户列表
export const userTenantColumns: BasicColumn[] = [ export const userTenantColumns: BasicColumn[] = [
...@@ -592,7 +785,6 @@ export const userTenantFormSchema: FormSchema[] = [ ...@@ -592,7 +785,6 @@ export const userTenantFormSchema: FormSchema[] = [
}, },
]; ];
/** /**
* 删除非当前部门下的数据 * 删除非当前部门下的数据
* 当所属部门发生改变时,取消主岗位和兼职岗位的选中值 * 当所属部门发生改变时,取消主岗位和兼职岗位的选中值
...@@ -692,4 +884,4 @@ async function updateDepartOption(options, updateSchema) { ...@@ -692,4 +884,4 @@ async function updateDepartOption(options, updateSchema) {
}, },
]); ]);
} }
} }
\ No newline at end of file
...@@ -45,12 +45,16 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -45,12 +45,16 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
console.log('[init] Start Port: ', VITE_PORT); console.log('[init] Start Port: ', VITE_PORT);
console.debug('[init] Vite Proxy Config: ', VITE_PROXY); console.debug('[init] Vite Proxy Config: ', VITE_PROXY);
return { return {
base: isQiankunMicro ? VITE_GLOB_QIANKUN_MICRO_APP_ENTRY : VITE_PUBLIC_PATH, base: isQiankunMicro ? VITE_GLOB_QIANKUN_MICRO_APP_ENTRY : VITE_PUBLIC_PATH,
root, root,
resolve: { resolve: {
alias: [ alias: [
// 修复 Vue 导入问题
{
find: 'vue',
replacement: resolve(__dirname, 'node_modules/vue/dist/vue.esm-bundler.js'),
},
{ {
find: 'vue-i18n', find: 'vue-i18n',
replacement: 'vue-i18n/dist/vue-i18n.cjs.js', replacement: 'vue-i18n/dist/vue-i18n.cjs.js',
...@@ -95,12 +99,45 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -95,12 +99,45 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
rollupOptions: { rollupOptions: {
// 关闭除屑优化,防止删除重要代码,导致打包后功能出现异常 // 关闭除屑优化,防止删除重要代码,导致打包后功能出现异常
treeshake: false, treeshake: false,
// 添加外部依赖配置
external: [
'vkbeautify',
'@form-create/antd-designer',
'@vxe-ui/core'
],
// 添加插件修复 form-create 的导入问题
plugins: [
{
name: 'fix-form-create-import',
transform(code, id) {
if (id.includes('@form-create/ant-design-vue')) {
// 修复 Vue 导入方式
code = code.replace(
/import\s+(\w+)\s+from\s+['"]vue['"]/g,
'import * as $1 from "vue"'
);
// 添加默认导出支持
code = code.replace(
/import\s+\*\s+as\s+(\w+)\s+from\s+['"]vue['"]/,
'import * as $1 from "vue";\nconst Vue = { ...$1, default: $1 };'
);
return code;
}
}
}
],
output: { output: {
chunkFileNames: 'js/[name]-[hash].js', // 引入文件名的名称 chunkFileNames: 'js/[name]-[hash].js',
entryFileNames: 'js/[name]-[hash].js', // 包的入口文件名称 entryFileNames: 'js/[name]-[hash].js',
// manualChunks配置 (依赖包从大到小排列) // 处理模块兼容性
globals: {
'vue': 'Vue'
},
interop: 'auto',
// 确保正确处理默认导出
exports: 'named',
// manualChunks配置
manualChunks: { manualChunks: {
// vue vue-router合并打包
'vue-vendor': ['vue', 'vue-router'], 'vue-vendor': ['vue', 'vue-router'],
'antd-vue-vendor': ['ant-design-vue','@ant-design/icons-vue','@ant-design/colors'], 'antd-vue-vendor': ['ant-design-vue','@ant-design/icons-vue','@ant-design/colors'],
'vxe-table-vendor': ['vxe-table','vxe-table-plugin-antd','xe-utils'], 'vxe-table-vendor': ['vxe-table','vxe-table-plugin-antd','xe-utils'],
...@@ -109,18 +146,13 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -109,18 +146,13 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
}, },
}, },
}, },
// 关闭brotliSize显示可以稍微减少打包时间
reportCompressedSize: false, reportCompressedSize: false,
// 提高超大静态资源警告大小
chunkSizeWarningLimit: 2000, chunkSizeWarningLimit: 2000,
}, },
esbuild: { esbuild: {
//清除全局的console.log和debug
drop: isBuild ? ['console', 'debugger'] : [], drop: isBuild ? ['console', 'debugger'] : [],
}, },
define: { define: {
// setting vue-i18-next
// Suppress warning
__INTLIFY_PROD_DEVTOOLS__: false, __INTLIFY_PROD_DEVTOOLS__: false,
__APP_INFO__: JSON.stringify(__APP_INFO__), __APP_INFO__: JSON.stringify(__APP_INFO__),
}, },
...@@ -133,18 +165,59 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { ...@@ -133,18 +165,59 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
}, },
}, },
// The vite plugin used by the project. The quantity is large, so it is separately extracted and managed // 修改插件配置,将修复插件放在最前面
// 预加载构建配置(首屏性能) plugins: [
plugins: createVitePlugins(viteEnv, isBuild, isQiankunMicro), // 先添加修复插件
{
name: 'fix-form-create-import',
enforce: 'pre', // 确保在其他插件之前执行
transform(code, id) {
if (id.includes('@form-create/ant-design-vue') && id.includes('form-create.esm.js')) {
console.log('修复 form-create 导入...');
// 方法1:只修改导入语句
code = code.replace(
/import\s+I\s+from\s+['"]vue['"]/g,
'import * as I from "vue";'
);
// 方法2:如果上面不行,使用更保守的替换
// 只替换第22行的 import I from "vue";
const lines = code.split('\n');
for (let i = 0; i < lines.length; i++) {
if (lines[i].includes('import I from "vue"')) {
lines[i] = 'import * as I from "vue";';
break;
}
}
code = lines.join('\n');
return code;
}
return code;
}
},
// 然后添加其他插件
...createVitePlugins(viteEnv, isBuild, isQiankunMicro)
],
optimizeDeps: { optimizeDeps: {
esbuildOptions: { esbuildOptions: {
target: 'es2020', target: 'es2020',
// 添加 define 来兼容
define: {
'process.env.NODE_ENV': '"development"'
}
}, },
exclude: [ exclude: [
//升级vite4后,需要排除online依赖
'@jeecg/online', '@jeecg/online',
'@jeecg/aiflow', '@jeecg/aiflow',
'vkbeautify',
'@form-create/antd-designer',
'@vxe-ui/core',
'@form-create/ant-design-vue'
], ],
include: ['vue']
}, },
}; };
}; };
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论