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

This commit is contained in:
JEECG
2025-03-30 19:09:07 +08:00
parent 62daec9c16
commit 502ef2f65d
35 changed files with 1472 additions and 1586 deletions

View File

@ -89,7 +89,6 @@
opt.getContainer = `.${prefixVar}-layout-content` as any;
}
}
console.log('getProps:opt',opt);
return opt as DrawerProps;
});

View File

@ -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>,

View File

@ -6,6 +6,7 @@
style="width: 100%"
:disabled="disabled"
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
showCheckedStrategy="SHOW_ALL"
:placeholder="placeholder"
:loadData="asyncLoadTreeData"
:value="treeValue"

View File

@ -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,

View File

@ -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(),

View File

@ -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 {

View File

@ -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) {

View File

@ -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">

View File

@ -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, {

View File

@ -199,6 +199,9 @@ export interface ModalProps {
zIndex?: number;
enableComment?: boolean;
modalHeaderHeight: number;
modalFooterHeight: number;
}
export interface ModalWrapperProps {

View File

@ -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;

View File

@ -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);

View File

@ -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) {

View File

@ -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;
}
}
}

View File

@ -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) {

View File

@ -38,6 +38,7 @@ interface OnlineColumn {
dbType?:string;
//他表字段用
linkField?:string;
fieldExtendJson?:string
}
export { OnlineColumn, HrefSlots };

View File

@ -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;