【同步3.7.4版本代码】新增全局布局隐藏配置,优化多个组件的属性和逻辑

dev
JEECG 3 months ago
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---forQQYUN-6366antd4.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---forQQYUN-7535numberjoinstring
@ -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---forissues/7990
const result = split(paths);
// update-end--author:liaozhiyang---date:20250325---forissues/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
};
});
// propsexpandedRowKeys
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---forissues/7497
// TODO
enhanced = getEnhanced(props.type);
// -update-end--author:liaozhiyang---date:20241210---forissues/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---forissues/675Popup
@ -211,6 +212,15 @@ export function usePopBiz(ob, tableRef?) {
currColumns[a].sortOrder = unref(iSorter).order === 'asc' ? 'ascend' : 'descend';
}
}
// update-begin--author:liaozhiyang---date:20250114---forissues/946popup线
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---forissues/946popup线
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---forissues/946popup线
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---forissues/946popup线
// 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---forQQYUN-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---forQQYUN-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
//useSearchForfalsevalidate
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://')) {
// URLURLURL
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;
// JEECGAppName
VITE_GLOB_QIANKUN_MICRO_APP_NAME?: string;

Loading…
Cancel
Save