mirror of https://github.com/jeecgboot/jeecg-boot
【同步3.7.4版本代码】新增全局布局隐藏配置,优化多个组件的属性和逻辑
parent
62daec9c16
commit
502ef2f65d
|
@ -25,3 +25,6 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
|||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||
# 作为乾坤子应用启动时必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
|
||||
#VITE_GLOB_QIANKUN_MICRO_APP_ENTRY=//localhost:3001/jeecg-vue3
|
||||
|
||||
# 全局隐藏哪些布局。可选属性:sider,header,multi-tabs;多个用逗号隔开
|
||||
#VITE_GLOB_HIDE_LAYOUT_TYPES=sider,header,multi-tabs
|
||||
|
|
|
@ -26,3 +26,6 @@ VITE_GLOB_API_URL_PREFIX=
|
|||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||
# 作为乾坤子应用启动时必填,需与qiankun主应用注册子应用时填写的 entry 保持一致
|
||||
#VITE_GLOB_QIANKUN_MICRO_APP_ENTRY=//qiankun.boot3.jeecg.com/jeecg-vue3
|
||||
|
||||
# 全局隐藏哪些布局。可选属性:sider,header,multi-tabs;多个用逗号隔开
|
||||
#VITE_GLOB_HIDE_LAYOUT_TYPES=sider,header,multi-tabs
|
||||
|
|
|
@ -57,8 +57,8 @@
|
|||
"path-to-regexp": "^6.3.0",
|
||||
"pinia": "2.1.7",
|
||||
"print-js": "^1.6.0",
|
||||
"qrcode": "^1.5.4",
|
||||
"qs": "^6.13.1",
|
||||
"qrcode": "^1.5.4",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"showdown": "^2.1.0",
|
||||
"sortablejs": "^1.15.6",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -37,6 +37,11 @@
|
|||
} else {
|
||||
Object.assign(data.token, { colorTextBase: '#333' });
|
||||
}
|
||||
|
||||
// 定义主题色 css 变量
|
||||
if (data.token.colorPrimary) {
|
||||
document.documentElement.style.setProperty('--j-global-primary-color', data.token.colorPrimary);
|
||||
}
|
||||
}
|
||||
};
|
||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
opt.getContainer = `.${prefixVar}-layout-content` as any;
|
||||
}
|
||||
}
|
||||
console.log('getProps:opt',opt);
|
||||
return opt as DrawerProps;
|
||||
});
|
||||
|
||||
|
|
|
@ -35,7 +35,8 @@ export const basicProps = {
|
|||
loading: { type: Boolean },
|
||||
maskClosable: { type: Boolean, default: true },
|
||||
getContainer: {
|
||||
type: [Object, String] as PropType<any>,
|
||||
type: [Object, String, Function, Boolean] as PropType<any>,
|
||||
default: () => 'body',
|
||||
},
|
||||
closeFunc: {
|
||||
type: [Function, Object] as PropType<any>,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
style="width: 100%"
|
||||
:disabled="disabled"
|
||||
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
showCheckedStrategy="SHOW_ALL"
|
||||
:placeholder="placeholder"
|
||||
:loadData="asyncLoadTreeData"
|
||||
:value="treeValue"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<template>
|
||||
<div class="JPopup components-input-demo-presuffix" v-if="avalid">
|
||||
<!--输入框-->
|
||||
<a-input @click="handleOpen" v-model:value="showText" :placeholder="placeholder" readOnly v-bind="attrs">
|
||||
<a-input @click="handleOpen" :value="innerShowText || showText" :placeholder="placeholder" readOnly v-bind="attrs">
|
||||
<template #prefix>
|
||||
<Icon icon="ant-design:cluster-outlined"></Icon>
|
||||
</template>
|
||||
|
@ -64,6 +64,8 @@
|
|||
default: () => [],
|
||||
},
|
||||
showAdvancedButton: propTypes.bool.def(true),
|
||||
// 是否是在 筛选(search) 中使用
|
||||
inSearch: propTypes.bool.def(false),
|
||||
},
|
||||
emits: ['update:value', 'register', 'popUpChange', 'focus'],
|
||||
setup(props, { emit, refs }) {
|
||||
|
@ -72,6 +74,7 @@
|
|||
//pop是否展示
|
||||
const avalid = ref(true);
|
||||
const showText = ref('');
|
||||
const innerShowText = ref('')
|
||||
//注册model
|
||||
const [regModal, { openModal }] = useModal();
|
||||
//表单值
|
||||
|
@ -124,6 +127,7 @@
|
|||
let { fieldConfig } = props;
|
||||
//匹配popup设置的回调值
|
||||
let values = {};
|
||||
let labels = []
|
||||
for (let item of fieldConfig) {
|
||||
let val = rows.map((row) => row[item.source]);
|
||||
// update-begin--author:liaozhiyang---date:20230831---for:【QQYUN-7535】数组只有一个且是number类型,join会改变值的类型为string
|
||||
|
@ -132,7 +136,20 @@
|
|||
item.target.split(',').forEach((target) => {
|
||||
values[target] = val;
|
||||
});
|
||||
|
||||
if (props.inSearch) {
|
||||
// 处理显示值
|
||||
if (item.label) {
|
||||
let txt = rows.map((row) => row[item.label]);
|
||||
txt = txt.length == 1 ? txt[0] : txt.join(',');
|
||||
labels.push(txt);
|
||||
} else {
|
||||
labels.push(val);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
innerShowText.value = labels.join(',');
|
||||
//传入表单示例方式赋值
|
||||
props.formElRef && props.formElRef.setFieldsValue(values);
|
||||
//传入赋值方法方式赋值
|
||||
|
@ -146,6 +163,7 @@
|
|||
|
||||
return {
|
||||
showText,
|
||||
innerShowText,
|
||||
avalid,
|
||||
uniqGroupId,
|
||||
attrs,
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
import { UploadTypeEnum } from './upload.data';
|
||||
import { getFileAccessHttpUrl, getHeaders } from '/@/utils/common/compUtils';
|
||||
import UploadItemActions from './components/UploadItemActions.vue';
|
||||
import { split } from '/@/utils/index';
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const { prefixCls } = useDesign('j-upload');
|
||||
|
@ -201,7 +202,10 @@
|
|||
return;
|
||||
}
|
||||
let list: any[] = [];
|
||||
for (const item of paths.split(',')) {
|
||||
// update-begin--author:liaozhiyang---date:20250325---for:【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
||||
const result = split(paths);
|
||||
// update-end--author:liaozhiyang---date:20250325---for:【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
||||
for (const item of result) {
|
||||
let url = getFileAccessHttpUrl(item);
|
||||
list.push({
|
||||
uid: uidGenerator(),
|
||||
|
|
|
@ -189,6 +189,12 @@
|
|||
selectType: 'sys_role',
|
||||
});
|
||||
}
|
||||
// 根据 ids 的顺序对 arr 进行排序
|
||||
if (props.store === 'code') {
|
||||
arr.sort((a, b) => ids.indexOf(a.code) - ids.indexOf(b.code));
|
||||
} else {
|
||||
arr.sort((a, b) => ids.indexOf(a.id) - ids.indexOf(b.id));
|
||||
}
|
||||
}
|
||||
selectedList.value = arr;
|
||||
} else {
|
||||
|
|
|
@ -132,13 +132,23 @@
|
|||
}
|
||||
return list.filter(item=>item.name.indexOf(text)>=0)
|
||||
});
|
||||
|
||||
|
||||
const selectedKeys = ref<string[]>([]);
|
||||
const selectedList = computed(()=>{
|
||||
let list = dataList.value;
|
||||
if(!list || list.length ==0 ){
|
||||
return []
|
||||
}
|
||||
return list.filter(item=>item.checked)
|
||||
list = list.filter(item=>item.checked)
|
||||
// 根据 selectedKeys 的顺序排序
|
||||
let arr: any[] = [];
|
||||
for (let key of selectedKeys.value) {
|
||||
let item = list.find(item => item.id == key);
|
||||
if (item) {
|
||||
arr.push(item);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
});
|
||||
|
||||
function unSelect(id) {
|
||||
|
@ -192,6 +202,11 @@
|
|||
}
|
||||
}
|
||||
item.checked = !item.checked;
|
||||
if (item.checked) {
|
||||
selectedKeys.value.push(item.id);
|
||||
} else {
|
||||
selectedKeys.value = selectedKeys.value.filter((k) => k != item.id);
|
||||
}
|
||||
}
|
||||
|
||||
function prevent(e) {
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
:maxHeight="getProps.maxHeight"
|
||||
:height="getWrapperHeight"
|
||||
:visible="visibleRef"
|
||||
:modalFooterHeight="footer !== undefined && !footer ? 0 : undefined"
|
||||
:modalHeaderHeight="getProps.modalHeaderHeight"
|
||||
:modalFooterHeight="footer !== undefined && !footer ? 0 : getProps.modalFooterHeight"
|
||||
v-bind="omit(getProps.wrapperProps, 'visible', 'height', 'modalFooterHeight')"
|
||||
@ext-height="handleExtHeight"
|
||||
@height-change="handleHeightChange">
|
||||
|
|
|
@ -17,6 +17,9 @@ export const modalProps = {
|
|||
okText: { type: String, default: t('common.okText') },
|
||||
|
||||
closeFunc: Function as PropType<() => Promise<boolean>>,
|
||||
|
||||
modalHeaderHeight: Number,
|
||||
modalFooterHeight: Number,
|
||||
};
|
||||
|
||||
export const basicProps = Object.assign({}, modalProps, {
|
||||
|
|
|
@ -199,6 +199,9 @@ export interface ModalProps {
|
|||
zIndex?: number;
|
||||
|
||||
enableComment?: boolean;
|
||||
|
||||
modalHeaderHeight: number;
|
||||
modalFooterHeight: number;
|
||||
}
|
||||
|
||||
export interface ModalWrapperProps {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { ComputedRef, Ref } from 'vue';
|
||||
import type { BasicTableProps } from '../types/table';
|
||||
import { computed, unref, ref, toRaw } from 'vue';
|
||||
import { computed, unref, ref, toRaw, watch } from 'vue';
|
||||
import { ROW_KEY } from '../const';
|
||||
|
||||
export function useTableExpand(propsRef: ComputedRef<BasicTableProps>, tableData: Ref<Recordable[]>, emit: EmitType) {
|
||||
|
@ -28,6 +28,13 @@ export function useTableExpand(propsRef: ComputedRef<BasicTableProps>, tableData
|
|||
};
|
||||
});
|
||||
|
||||
// 监听并同步props中的expandedRowKeys
|
||||
watch(() => propsRef.value?.expandedRowKeys, (keys) => {
|
||||
if (Array.isArray(keys)) {
|
||||
expandedRowKeys.value = keys;
|
||||
}
|
||||
}, {immediate: true});
|
||||
|
||||
function expandAll() {
|
||||
const keys = getAllKeys();
|
||||
expandedRowKeys.value = keys;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import type { JPromptProps } from '../typing';
|
||||
import { render, createVNode, nextTick } from 'vue';
|
||||
import { error } from '/@/utils/log';
|
||||
import { getAppContext } from "@/store";
|
||||
import JPrompt from '../JPrompt.vue';
|
||||
|
||||
export function useJPrompt() {
|
||||
|
@ -21,6 +22,7 @@ export function useJPrompt() {
|
|||
document.body.removeChild(box);
|
||||
},
|
||||
});
|
||||
vm.appContext = getAppContext()!;
|
||||
// 挂载到 body
|
||||
render(vm, box);
|
||||
document.body.appendChild(box);
|
||||
|
|
|
@ -140,11 +140,15 @@ export function useJVxeComponent(props: JVxeComponent.Props) {
|
|||
const ctx = { props, context };
|
||||
|
||||
// 获取组件增强
|
||||
const enhanced = getEnhanced(props.type);
|
||||
let enhanced = getEnhanced(props.type);
|
||||
|
||||
watch(
|
||||
value,
|
||||
(newValue) => {
|
||||
// -update-begin--author:liaozhiyang---date:20241210---for:【issues/7497】隐藏某一列后,字典没翻译,恢复后正常
|
||||
// TODO 先这样修复解决问题,根因后期再看看
|
||||
enhanced = getEnhanced(props.type);
|
||||
// -update-end--author:liaozhiyang---date:20241210---for:【issues/7497】隐藏某一列后,字典没翻译,恢复后
|
||||
// 验证值格式
|
||||
let getValue = enhanced.getValue(newValue, ctx);
|
||||
if (newValue !== getValue) {
|
||||
|
|
|
@ -77,13 +77,13 @@
|
|||
.vxe-table {
|
||||
//.vxe-table--footer-wrapper.body--wrapper,
|
||||
.vxe-table--body-wrapper.body--wrapper {
|
||||
overflow-x: hidden;
|
||||
// overflow-x: hidden;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
//.vxe-table--footer-wrapper.body--wrapper,
|
||||
.vxe-table--body-wrapper.body--wrapper {
|
||||
overflow-x: auto;
|
||||
// overflow-x: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import { useMethods } from '/@/hooks/system/useMethods';
|
|||
import { importViewsFile, _eval } from '/@/utils';
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {replaceUserInfoByExpression} from "@/utils/common/compUtils";
|
||||
import { isString } from '/@/utils/is';
|
||||
|
||||
export function usePopBiz(ob, tableRef?) {
|
||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/675】子表字段Popup弹框数据不更新
|
||||
|
@ -211,6 +212,15 @@ export function usePopBiz(ob, tableRef?) {
|
|||
currColumns[a].sortOrder = unref(iSorter).order === 'asc' ? 'ascend' : 'descend';
|
||||
}
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20250114---for:【issues/946】popup列宽和在线报表列宽读取配置
|
||||
currColumns.forEach((item) => {
|
||||
if (item.fieldWidth != null) {
|
||||
if (isString(item.fieldWidth) && item.fieldWidth.trim().length == 0) return;
|
||||
item.width = item.fieldWidth;
|
||||
delete item.fieldWidth;
|
||||
}
|
||||
});
|
||||
// update-end--author:liaozhiyang---date:20250114---for:【issues/946】popup列宽和在线报表列宽读取配置
|
||||
if (currColumns[0].key !== 'rowIndex') {
|
||||
currColumns.unshift({
|
||||
title: '序号',
|
||||
|
@ -258,7 +268,16 @@ export function usePopBiz(ob, tableRef?) {
|
|||
// href 跳转
|
||||
const fieldHrefSlotKeysMap = {};
|
||||
fieldHrefSlots.forEach((item) => (fieldHrefSlotKeysMap[item.slotName] = item));
|
||||
let currColumns = handleColumnHrefAndDict(metaColumnList, fieldHrefSlotKeysMap);
|
||||
let currColumns: any = handleColumnHrefAndDict(metaColumnList, fieldHrefSlotKeysMap);
|
||||
// update-begin--author:liaozhiyang---date:20250114---for:【issues/946】popup列宽和在线报表列宽读取配置
|
||||
currColumns.forEach((item) => {
|
||||
if (isString(item.fieldWidth) && item.fieldWidth.trim().length == 0) return;
|
||||
if (item.fieldWidth != null) {
|
||||
item.width = item.fieldWidth;
|
||||
delete item.fieldWidth;
|
||||
}
|
||||
});
|
||||
// update-end--author:liaozhiyang---date:20250114---for:【issues/946】popup列宽和在线报表列宽读取配置
|
||||
|
||||
// popup需要序号, 普通列表不需要
|
||||
if (clickThenCheckFlag === true) {
|
||||
|
|
|
@ -38,6 +38,7 @@ interface OnlineColumn {
|
|||
dbType?:string;
|
||||
//他表字段用
|
||||
linkField?:string;
|
||||
fieldExtendJson?:string
|
||||
}
|
||||
|
||||
export { OnlineColumn, HrefSlots };
|
||||
|
|
|
@ -76,7 +76,9 @@
|
|||
*/
|
||||
async function getCaptchaCode() {
|
||||
await resetFields();
|
||||
randCodeData.checkKey = new Date().getTime();
|
||||
//update-begin---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
randCodeData.checkKey = new Date().getTime() + Math.random().toString(36).slice(-4); // 1629428467008;
|
||||
//update-end---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
getCodeInfo(randCodeData.checkKey).then((res) => {
|
||||
randCodeData.randCodeImage = res;
|
||||
randCodeData.requestCodeSuccess = true;
|
||||
|
|
|
@ -52,7 +52,20 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
|
|||
window['_CONFIG'] = {}
|
||||
}
|
||||
|
||||
// update-begin--author:sunjianlei---date:220250115---for:【QQYUN-10956】配置了自定义前缀,外部连接打不开,需要兼容处理
|
||||
let domainURL = VITE_GLOB_DOMAIN_URL;
|
||||
|
||||
// 如果不是以http(s)开头的,也不是以域名开头的,那么就是拼接当前域名
|
||||
if (!/^http(s)?/.test(domainURL) && !/^(\/\/)?(.*\.)?.+\..+/.test(domainURL)) {
|
||||
if (!domainURL.startsWith('/')) {
|
||||
domainURL = '/' + domainURL;
|
||||
}
|
||||
domainURL = window.location.origin + domainURL;
|
||||
}
|
||||
// update-end--author:sunjianlei---date:220250115---for:【QQYUN-10956】配置了自定义前缀,外部连接打不开,需要兼容处理
|
||||
|
||||
// @ts-ignore
|
||||
window._CONFIG['domianURL'] = VITE_GLOB_DOMAIN_URL;
|
||||
window._CONFIG['domianURL'] = domainURL;
|
||||
|
||||
return glob as Readonly<GlobConfig>;
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@ import { useMessage } from '/@/hooks/web/useMessage';
|
|||
import { useMethods } from '/@/hooks/system/useMethods';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { filterObj } from '/@/utils/common/compUtils';
|
||||
import { isFunction } from '@/utils/is';
|
||||
const { handleExportXls, handleImportXls } = useMethods();
|
||||
|
||||
// 定义 useListPage 方法所需参数
|
||||
|
@ -24,7 +25,7 @@ interface ListPageOptions {
|
|||
// 导出文件名
|
||||
name?: string | (() => string);
|
||||
//导出参数
|
||||
params?: object;
|
||||
params?: object | (() => object);
|
||||
};
|
||||
// 导入配置
|
||||
importConfig?: {
|
||||
|
@ -71,23 +72,32 @@ export function useListPage(options: ListPageOptions) {
|
|||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
|
||||
let paramsForm:any = {};
|
||||
try {
|
||||
paramsForm = await getForm().validate();
|
||||
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
//当useSearchFor不等于false的时候,才去触发validate
|
||||
if (options?.tableProps?.useSearchForm !== false) {
|
||||
paramsForm = await getForm().validate();
|
||||
console.log('paramsForm', paramsForm);
|
||||
}
|
||||
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.warn(e);
|
||||
}
|
||||
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
|
||||
|
||||
|
||||
//update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
|
||||
if(!paramsForm?.column){
|
||||
Object.assign(paramsForm,{column:'createTime',order:'desc'});
|
||||
}
|
||||
//update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
|
||||
|
||||
|
||||
//如果参数不为空,则整合到一起
|
||||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
|
||||
if (params) {
|
||||
Object.keys(params).map((k) => {
|
||||
let temp = (params as object)[k];
|
||||
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
const realParams = isFunction(params) ? await params() : { ...(params || {}) };
|
||||
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
Object.keys(realParams).map((k) => {
|
||||
let temp = (realParams as object)[k];
|
||||
if (temp) {
|
||||
paramsForm[k] = unref(temp);
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
const getShowHeader = computed(() => {
|
||||
// 控制是否显示顶部
|
||||
if (appStore.mainAppProps.hideHeader) {
|
||||
if (appStore.getLayoutHideHeader) {
|
||||
return false;
|
||||
}
|
||||
return unref(getShowInsetHeaderRef);
|
||||
|
@ -60,7 +60,7 @@
|
|||
|
||||
const getShowTabs = computed(() => {
|
||||
// 控制是否显示多Tabs切换
|
||||
if (appStore.mainAppProps.hideMultiTabs) {
|
||||
if (appStore.getLayoutHideMultiTabs) {
|
||||
return false;
|
||||
}
|
||||
return unref(getShowMultipleTab) && !unref(getFullContent);
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
const showClassSideBarRef = computed(() => {
|
||||
// 控制是否显示侧边栏
|
||||
if (appStore.mainAppProps.hideSider) {
|
||||
if (appStore.getLayoutHideSider) {
|
||||
return false;
|
||||
}
|
||||
return unref(getSplit) ? !unref(getMenuHidden) : true;
|
||||
|
|
|
@ -2,12 +2,14 @@ import type { App } from 'vue';
|
|||
import type { Pinia } from 'pinia';
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
let app: Nullable<App<Element>> = null;
|
||||
let store: Nullable<Pinia> = null;
|
||||
|
||||
export function setupStore(app: App<Element>) {
|
||||
export function setupStore($app: App<Element>) {
|
||||
if (store == null) {
|
||||
store = createPinia();
|
||||
}
|
||||
app = $app;
|
||||
app.use(store);
|
||||
}
|
||||
|
||||
|
@ -16,4 +18,7 @@ export function destroyStore() {
|
|||
store = null;
|
||||
}
|
||||
|
||||
export { store };
|
||||
// 获取app实例
|
||||
export const getAppContext = () => app?._context;
|
||||
|
||||
export {app, store};
|
||||
|
|
|
@ -11,6 +11,7 @@ import { Persistent } from '/@/utils/cache/persistent';
|
|||
import { darkMode } from '/@/settings/designSetting';
|
||||
import { resetRouter } from '/@/router';
|
||||
import { deepMerge } from '/@/utils';
|
||||
import { getHideLayoutTypes } from '/@/utils/env';
|
||||
|
||||
interface AppState {
|
||||
darkMode?: ThemeEnum;
|
||||
|
@ -70,6 +71,28 @@ export const useAppStore = defineStore({
|
|||
getMainAppProps(): MainAppProps {
|
||||
return this.mainAppProps;
|
||||
},
|
||||
|
||||
getLayoutHideSider(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('sider')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideSider;
|
||||
},
|
||||
getLayoutHideHeader(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('header')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideHeader;
|
||||
},
|
||||
getLayoutHideMultiTabs(): boolean {
|
||||
const hideLayoutTypes = getHideLayoutTypes();
|
||||
if (hideLayoutTypes.includes('multi-tabs')) {
|
||||
return true;
|
||||
}
|
||||
return !!this.mainAppProps.hideMultiTabs;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
setPageLoading(loading: boolean): void {
|
||||
|
|
|
@ -36,6 +36,8 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_CAS_BASE_URL,
|
||||
VITE_GLOB_DOMAIN_URL,
|
||||
VITE_GLOB_ONLINE_VIEW_URL,
|
||||
// 全局隐藏哪些布局,多个用逗号隔开
|
||||
VITE_GLOB_HIDE_LAYOUT_TYPES,
|
||||
|
||||
// 【JEECG作为乾坤子应用】
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
|
||||
|
@ -59,6 +61,7 @@ export function getAppEnvConfig() {
|
|||
VITE_GLOB_APP_CAS_BASE_URL,
|
||||
VITE_GLOB_DOMAIN_URL,
|
||||
VITE_GLOB_ONLINE_VIEW_URL,
|
||||
VITE_GLOB_HIDE_LAYOUT_TYPES,
|
||||
|
||||
// 【JEECG作为乾坤子应用】
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
|
||||
|
@ -102,3 +105,11 @@ export function isDevMode(): boolean {
|
|||
export function isProdMode(): boolean {
|
||||
return import.meta.env.PROD;
|
||||
}
|
||||
|
||||
export function getHideLayoutTypes(): string[] {
|
||||
const {VITE_GLOB_HIDE_LAYOUT_TYPES} = getAppEnvConfig();
|
||||
if (typeof VITE_GLOB_HIDE_LAYOUT_TYPES !== 'string') {
|
||||
return [];
|
||||
}
|
||||
return VITE_GLOB_HIDE_LAYOUT_TYPES.split(',');
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import type { App, Plugin } from 'vue';
|
|||
import type { FormSchema } from "@/components/Form";
|
||||
|
||||
import { unref } from 'vue';
|
||||
import { isObject, isFunction } from '/@/utils/is';
|
||||
import { isObject, isFunction, isString } from '/@/utils/is';
|
||||
import Big from 'big.js';
|
||||
// update-begin--author:sunjianlei---date:20220408---for: 【VUEN-656】配置外部网址打不开,原因是带了#号,需要替换一下
|
||||
export const URL_HASH_TAB = `__AGWE4H__HASH__TAG__PWHRG__`;
|
||||
|
@ -596,3 +596,39 @@ export const getUrlParams = (url) => {
|
|||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/* 20250325
|
||||
* liaozhiyang
|
||||
* 分割url字符成数组
|
||||
* 【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
||||
* */
|
||||
export const split = (str) => {
|
||||
if (isString(str)) {
|
||||
const text = str.trim();
|
||||
if (text.startsWith('http')) {
|
||||
const parts = str.split(',');
|
||||
const urls: any = [];
|
||||
let currentUrl = '';
|
||||
for (const part of parts) {
|
||||
if (part.startsWith('http://') || part.startsWith('https://')) {
|
||||
// 如果遇到新的URL开头,保存当前URL并开始新的URL
|
||||
if (currentUrl) {
|
||||
urls.push(currentUrl);
|
||||
}
|
||||
currentUrl = part;
|
||||
} else {
|
||||
// 否则,是当前URL的一部分(如参数)
|
||||
currentUrl += ',' + part;
|
||||
}
|
||||
}
|
||||
// 添加最后一个URL
|
||||
if (currentUrl) {
|
||||
urls.push(currentUrl);
|
||||
}
|
||||
return urls;
|
||||
} else {
|
||||
return str.split(',');
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
|
|
|
@ -175,7 +175,9 @@
|
|||
function handleChangeCheckCode() {
|
||||
formData.inputCode = '';
|
||||
//TODO 兼容mock和接口,暂时这样处理
|
||||
randCodeData.checkKey = 1629428467008; //new Date().getTime();
|
||||
//update-begin---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
randCodeData.checkKey = new Date().getTime() + Math.random().toString(36).slice(-4); // 1629428467008;
|
||||
//update-end---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
getCodeInfo(randCodeData.checkKey).then((res) => {
|
||||
randCodeData.randCodeImage = res;
|
||||
randCodeData.requestCodeSuccess = true;
|
||||
|
|
|
@ -231,8 +231,9 @@
|
|||
*/
|
||||
function handleChangeCheckCode() {
|
||||
formData.inputCode = '';
|
||||
|
||||
randCodeData.checkKey = 1629428467008;
|
||||
//update-begin---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
randCodeData.checkKey = new Date().getTime() + Math.random().toString(36).slice(-4); // 1629428467008;
|
||||
//update-end---author:chenrui ---date:2025/1/7 for:[QQYUN-10775]验证码可以复用 #7674------------
|
||||
getCodeInfo(randCodeData.checkKey).then((res) => {
|
||||
randCodeData.randCodeImage = res;
|
||||
randCodeData.requestCodeSuccess = true;
|
||||
|
|
|
@ -236,14 +236,10 @@ export const formSchema: FormSchema[] = [
|
|||
{
|
||||
label: '租户',
|
||||
field: 'relTenantIds',
|
||||
component: 'ApiSelect',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
mode: 'multiple',
|
||||
api: getAllTenantList,
|
||||
numberToString: true,
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
immediate: false,
|
||||
dictCode:"sys_tenant,name,id",
|
||||
mode: "multiple"
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -16,6 +16,8 @@ enum Api {
|
|||
agreeOrRefuseJoinTenant = '/sys/tenant/agreeOrRefuseJoinTenant',
|
||||
//更改手机号
|
||||
changePhone = '/sys/user/changePhone',
|
||||
//用户注销
|
||||
userLogOff = '/sys/user/userLogOff',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,3 +131,11 @@ export const agreeOrRefuseJoinTenant = (params) => {
|
|||
export const changePhone = (params) => {
|
||||
return defHttp.put({ url: Api.changePhone, params },{ joinParamsToUrl: true, isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
* 用户注销
|
||||
* @param params
|
||||
*/
|
||||
export const userLogOff = (params) => {
|
||||
return defHttp.put({ url: Api.userLogOff, params },{ isTransformResponse:false });
|
||||
}
|
||||
|
|
|
@ -187,6 +187,8 @@ export interface GlobEnvConfig {
|
|||
VITE_GLOB_UPLOAD_URL?: string;
|
||||
// view url
|
||||
VITE_GLOB_ONLINE_VIEW_URL?: string;
|
||||
// 全局隐藏哪些布局,多个用逗号隔开
|
||||
VITE_GLOB_HIDE_LAYOUT_TYPES?: string;
|
||||
|
||||
// 【JEECG作为乾坤子应用】填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_NAME?: string;
|
||||
|
|
Loading…
Reference in New Issue