修复bug
parent
21e5143937
commit
a72dcdf0ec
|
@ -30,13 +30,30 @@
|
|||
|
||||
// get inherit binding value
|
||||
const getBindValues = computed(() => {
|
||||
return Object.assign(
|
||||
// update-begin--author:liaozhiyang---date:20231228---for:【issues/936】表格操作栏删除当接口失败时,气泡确认框不会消失
|
||||
const result: any = Object.assign(
|
||||
{
|
||||
okText: t('common.okText'),
|
||||
cancelText: t('common.cancelText'),
|
||||
},
|
||||
{ ...props, ...unref(attrs) }
|
||||
);
|
||||
if (result.onConfirm) {
|
||||
const confirm = result.confirm;
|
||||
result.onConfirm = () => {
|
||||
return new Promise<void>((resolve) => {
|
||||
confirm()
|
||||
?.finally(() => {
|
||||
resolve();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
return result;
|
||||
// update-end--author:liaozhiyang---date:20231228---for:【issues/936】表格操作栏删除当接口失败时,气泡确认框不会消失
|
||||
});
|
||||
|
||||
return () => {
|
||||
|
|
|
@ -202,6 +202,22 @@
|
|||
if (characterInx !== -1 && !rules[characterInx].validator) {
|
||||
rules[characterInx].message = rules[characterInx].message || t('component.form.maxTip', [rules[characterInx].max] as Recordable);
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20241226---for:【QQYUN-7495】pattern由字符串改成正则传递给antd(因使用InputNumber时发现正则无效)
|
||||
rules.forEach((item) => {
|
||||
if (typeof item.pattern === 'string') {
|
||||
try {
|
||||
const reg = new Function('item', `return ${item.pattern}`)(item);
|
||||
if (Object.prototype.toString.call(reg) === '[object RegExp]') {
|
||||
item.pattern = reg;
|
||||
} else {
|
||||
item.pattern = new RegExp(item.pattern);
|
||||
}
|
||||
} catch (error) {
|
||||
item.pattern = new RegExp(item.pattern);
|
||||
}
|
||||
}
|
||||
});
|
||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7495】pattern由字符串改成正则传递给antd(因使用InputNumber时发现正则无效)
|
||||
return rules;
|
||||
}
|
||||
|
||||
|
@ -249,7 +265,10 @@
|
|||
const { autoSetPlaceHolder, size } = props.formProps;
|
||||
const propsData: Recordable = {
|
||||
allowClear: true,
|
||||
getPopupContainer: (trigger: Element) => trigger.parentNode,
|
||||
getPopupContainer: (trigger: Element) => {
|
||||
|
||||
return trigger?.parentNode;
|
||||
},
|
||||
size,
|
||||
...unref(getComponentsProps),
|
||||
disabled: unref(getDisable),
|
||||
|
|
|
@ -61,6 +61,18 @@ export function handleInputNumberValue(component?: ComponentType, val?: any) {
|
|||
}
|
||||
return val;
|
||||
}
|
||||
/**
|
||||
*liaozhiyang
|
||||
*2023-12-26
|
||||
*某些组件的传值需要把字符串类型转成数值类型
|
||||
*/
|
||||
export function handleInputStringValue(component?: ComponentType, val?: any) {
|
||||
if (!component) return val;
|
||||
if (['InputNumber'].includes(component) && typeof val === 'string') {
|
||||
return Number(val);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间字段
|
||||
|
|
|
@ -4,7 +4,7 @@ import type { NamePath, ValidateOptions } from 'ant-design-vue/lib/form/interfac
|
|||
import { unref, toRaw } from 'vue';
|
||||
import { isArray, isFunction, isObject, isString } from '/@/utils/is';
|
||||
import { deepMerge, getValueType } from '/@/utils';
|
||||
import { dateItemType, handleInputNumberValue } from '../helper';
|
||||
import { dateItemType, handleInputNumberValue, handleInputStringValue } from '../helper';
|
||||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
import { cloneDeep, uniqBy } from 'lodash-es';
|
||||
import { error } from '/@/utils/log';
|
||||
|
@ -65,6 +65,9 @@ export function useFormEvents({
|
|||
const hasKey = Reflect.has(values, key);
|
||||
|
||||
value = handleInputNumberValue(schema?.component, value);
|
||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7535】popup回填字段inputNumber组件验证错误
|
||||
value = handleInputStringValue(schema?.component, value);
|
||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7535】popup回填字段inputNumber组件验证错误
|
||||
// 0| '' is allow
|
||||
if (hasKey && fields.includes(key)) {
|
||||
// time type
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--部门选择框-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="register" :title="modalTitle" width="500px" @ok="handleOk" destroyOnClose @visible-change="visibleChange">
|
||||
<BasicModal v-bind="$attrs" @register="register" :title="modalTitle" width="500px" :maxHeight="maxHeight" @ok="handleOk" destroyOnClose @visible-change="visibleChange">
|
||||
<BasicTree
|
||||
ref="treeRef"
|
||||
:treeData="treeData"
|
||||
|
@ -55,6 +55,12 @@
|
|||
type: String,
|
||||
default: '部门选择',
|
||||
},
|
||||
// update-begin--author:liaozhiyang---date:20231220---for:【QQYUN-7678】部门组件内容过多没有滚动条(给一个默认最大高)
|
||||
maxHeight: {
|
||||
type: Number,
|
||||
default: 500,
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20231220---for:【QQYUN-7678】部门组件内容过多没有滚动条(给一个默认最大高)
|
||||
value: propTypes.oneOfType([propTypes.string, propTypes.array])
|
||||
},
|
||||
emits: ['register', 'getSelectResult'],
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<template #renderItem="{ item }">
|
||||
<a-list-item style="padding: 3px 0">
|
||||
<div class="user-select-user-info" @click="(e) => onClickUser(e, item)">
|
||||
<div>
|
||||
<a-checkbox v-model:checked="checkStatus[item.id]" />
|
||||
<div style="margin-left: 10px">
|
||||
<a-checkbox v-model:checked="checkStatus[item.id]" v-if="multi" />
|
||||
<a-radio v-model:checked="checkStatus[item.id]" v-else />
|
||||
</div>
|
||||
<div>
|
||||
<a-avatar v-if="item.avatar" :src="getFileAccessHttpUrl(item.avatar)"></a-avatar>
|
||||
|
@ -38,6 +39,10 @@
|
|||
export default {
|
||||
name: 'UserList',
|
||||
props: {
|
||||
multi: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
dataList: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</a-col>
|
||||
<a-col :span="12" style="padding-left: 10px">
|
||||
<div :style="containerStyle">
|
||||
<user-list :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
<user-list :multi="multi" :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -50,6 +50,10 @@
|
|||
excludeUserIdList:{
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
multi: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
emits: ['loaded', 'selected', 'unSelect'],
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</a-col>
|
||||
<a-col :span="12" style="padding-left: 10px">
|
||||
<div :style="containerStyle">
|
||||
<user-list :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
<user-list :multi="multi" :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@ -41,6 +41,10 @@
|
|||
excludeUserIdList:{
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
multi: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
emits: ['selected', 'unSelect'],
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<a-tabs v-model:activeKey="myActiveKey" :centered="true" @change="onChangeTab">
|
||||
<!-- 所有用户 -->
|
||||
<a-tab-pane key="1" tab="全部" forceRender>
|
||||
<user-list :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" depart @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
<user-list :multi="multi" :excludeUserIdList="excludeUserIdList" :dataList="userDataList" :selectedIdList="selectedIdList" depart @selected="onSelectUser" @unSelect="unSelectUser" />
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- 部门用户 -->
|
||||
|
|
|
@ -31,7 +31,7 @@ export function useSelectBiz(getList, props) {
|
|||
if (selectValues['change'] == false && !isEmpty(selectValues['value'])) {
|
||||
//update-end-author:liusq---date:2023-10-19--for: [issues/788]判断有设置数值才去加载
|
||||
//update-begin---author:wangshuai ---date:20220412 for:[VUEN-672]发文草稿箱编辑时拟稿人显示用户名------------
|
||||
let params = {};
|
||||
let params = { isMultiTranslate: 'true' };
|
||||
params[props.rowKey] = selectValues['value'].join(',');
|
||||
//update-end---author:wangshuai ---date:20220412 for:[VUEN-672]发文草稿箱编辑时拟稿人显示用户名--------------
|
||||
loadingEcho.value = isFirstLoadEcho;
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
theme: getDarkMode.value === 'dark' ? 'dark' : 'classic',
|
||||
lang: unref(getCurrentLang),
|
||||
mode: 'sv',
|
||||
cdn: 'https://cdn.jsdelivr.net/npm/vditor@3.9.6',
|
||||
fullscreen: {
|
||||
index: 520,
|
||||
},
|
||||
|
|
|
@ -4,17 +4,18 @@ import { basicProps } from '../props';
|
|||
import { useModalDragMove } from '../hooks/useModalDrag';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { extendSlots } from '/@/utils/helper/tsxHelper';
|
||||
import { omit } from 'lodash-es';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'Modal',
|
||||
inheritAttrs: false,
|
||||
props: basicProps,
|
||||
props: omit(basicProps, ['visible']),
|
||||
emits: ['cancel'],
|
||||
setup(props, { slots, emit }) {
|
||||
const { visible, draggable, destroyOnClose } = toRefs(props);
|
||||
const { open, draggable, destroyOnClose } = toRefs(props);
|
||||
const attrs = useAttrs();
|
||||
useModalDragMove({
|
||||
visible,
|
||||
visible: open,
|
||||
destroyOnClose,
|
||||
draggable,
|
||||
});
|
||||
|
|
|
@ -18,7 +18,8 @@
|
|||
useWrapper: { type: Boolean, default: true },
|
||||
modalHeaderHeight: { type: Number, default: 57 },
|
||||
modalFooterHeight: { type: Number, default: 74 },
|
||||
minHeight: { type: Number, default: 200 },
|
||||
minHeight: { type: Number, default: null },
|
||||
maxHeight: { type: Number, default: null },
|
||||
height: { type: Number },
|
||||
footerOffset: { type: Number, default: 0 },
|
||||
visible: { type: Boolean },
|
||||
|
@ -60,10 +61,34 @@
|
|||
});
|
||||
|
||||
const spinStyle = computed((): CSSProperties => {
|
||||
// update-begin--author:liaozhiyang---date:20231205---for:【QQYUN-7147】Model的高度设置不生效
|
||||
if (props.fullScreen) {
|
||||
return {
|
||||
minHeight: `${props.minHeight}px`,
|
||||
[props.fullScreen ? 'height' : 'maxHeight']: `${unref(realHeightRef)}px`,
|
||||
height: `${unref(realHeightRef)}px`,
|
||||
};
|
||||
} else {
|
||||
const defaultMiniHeight = 200;
|
||||
if (props.height != undefined) {
|
||||
let height: number = props.height;
|
||||
if (props.minHeight === null) {
|
||||
return {
|
||||
height: `${height}px`,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
height: `${props.minHeight > height ? props.minHeight : height}px`,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
minHeight: `${props.minHeight === null ? defaultMiniHeight : props.minHeight}px`,
|
||||
// update-begin--author:liaozhiyang---date:20231219---for:【QQYUN-7641】basicModal组件添加MaxHeight属性
|
||||
maxHeight: `${props.maxHeight ? props.maxHeight : unref(realHeightRef)}px`,
|
||||
// update-end--author:liaozhiyang---date:20231219---for:【QQYUN-7641】basicModal组件添加MaxHeight属性
|
||||
};
|
||||
}
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231205---for:【QQYUN-7147】Model的高度设置不生效
|
||||
});
|
||||
|
||||
watchEffect(() => {
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<script lang="ts">
|
||||
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam, BasicColumn } from './types/table';
|
||||
|
||||
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUnmounted, onMounted } from 'vue';
|
||||
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUnmounted, onMounted, nextTick } from 'vue';
|
||||
import { Table } from 'ant-design-vue';
|
||||
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||
import { PageWrapperFixedHeightKey } from '/@/components/Page/injectionKey';
|
||||
|
@ -370,7 +370,11 @@
|
|||
return { native, custom };
|
||||
});
|
||||
// update-end--author:sunjianlei---date:220230718---for:【issues/179】兼容新老slots写法,移除控制台警告
|
||||
|
||||
// update-begin--author:liaozhiyang---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
|
||||
nextTick(() => {
|
||||
getProps.value.defaultExpandAllRows && expandAll();
|
||||
})
|
||||
// update-end--author:sunjianlei---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
|
||||
expose(tableAction);
|
||||
|
||||
emit('register', tableAction, formActions);
|
||||
|
@ -421,8 +425,8 @@
|
|||
.@{prefix-cls} {
|
||||
//表格选择工具栏样式
|
||||
.alert {
|
||||
background-color: #323232;
|
||||
border-color: #424242;
|
||||
// background-color: #323232;
|
||||
// border-color: #424242;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -523,8 +527,8 @@
|
|||
//表格选择工具栏样式
|
||||
.alert {
|
||||
height: 38px;
|
||||
background-color: #e6f7ff;
|
||||
border-color: #91d5ff;
|
||||
// background-color: #e6f7ff;
|
||||
// border-color: #91d5ff;
|
||||
}
|
||||
&--inset {
|
||||
.ant-table-wrapper {
|
||||
|
|
|
@ -90,7 +90,8 @@ export const vxeProps = () => ({
|
|||
keyboardEdit: propTypes.bool.def(false),
|
||||
// update-begin--author:liaozhiyang---date:20231013---for:【QQYUN-5133】JVxeTable 行编辑升级
|
||||
// 横向虚拟滚动配置(不支持展开行)
|
||||
scrollX: propTypes.object.def(() => ({ enabled: true })),
|
||||
// 【QQYUN-7676】x滚动条滚动时字典变成了id
|
||||
scrollX: propTypes.object.def(() => ({ enabled: false })),
|
||||
// 纵向虚拟滚动配置(不支持展开行)
|
||||
scrollY: propTypes.object.def(() => ({ enabled: true })),
|
||||
// update-end--author:liaozhiyang---date:20231013---for:【QQYUN-5133】JVxeTable 行编辑升级
|
||||
|
|
|
@ -206,7 +206,13 @@ export function usePopBiz(ob, tableRef?) {
|
|||
width: 60,
|
||||
align: 'center',
|
||||
customRender: function ({ text }) {
|
||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7584】popup有合计时序号列会出现NaN
|
||||
if (text == undefined) {
|
||||
return '';
|
||||
} else {
|
||||
return parseInt(text) + 1;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7584】popup有合计时序号列会出现NaN
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -777,7 +783,7 @@ export function usePopBiz(ob, tableRef?) {
|
|||
title: '',
|
||||
okText: '关闭',
|
||||
width: '100%',
|
||||
visible: false,
|
||||
open: false,
|
||||
destroyOnClose: true,
|
||||
style: dialogStyle,
|
||||
// dialogStyle: dialogStyle,
|
||||
|
@ -791,8 +797,8 @@ export function usePopBiz(ob, tableRef?) {
|
|||
cancelButtonProps: { style: { display: 'none' } },
|
||||
},
|
||||
on: {
|
||||
ok: () => (hrefComponent.value.model.visible = false),
|
||||
cancel: () => (hrefComponent.value.model.visible = false),
|
||||
ok: () => (hrefComponent.value.model.open = false),
|
||||
cancel: () => (hrefComponent.value.model.open = false),
|
||||
},
|
||||
is: <any>null,
|
||||
params: {},
|
||||
|
@ -816,7 +822,7 @@ export function usePopBiz(ob, tableRef?) {
|
|||
} else {
|
||||
hrefComponent.value.params = {};
|
||||
}
|
||||
hrefComponent.value.model.visible = true;
|
||||
hrefComponent.value.model.open = true;
|
||||
hrefComponent.value.model.title = '操作';
|
||||
hrefComponent.value.is = markRaw(defineAsyncComponent(() => importViewsFile(path)));
|
||||
}
|
||||
|
|
|
@ -236,6 +236,9 @@
|
|||
}
|
||||
|
||||
&-dropdown-overlay {
|
||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7512】顶部账号划过首次弹出时位置会变更一下
|
||||
width: 160px;
|
||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7512】顶部账号划过首次弹出时位置会变更一下
|
||||
.ant-dropdown-menu-item {
|
||||
min-width: 160px;
|
||||
}
|
||||
|
|
|
@ -488,10 +488,16 @@ export async function userExitChangeLoginTenantId(tenantId){
|
|||
}
|
||||
}
|
||||
}
|
||||
let loginTenantId = getTenantId();
|
||||
userStore.setTenant(currentTenantId);
|
||||
//切换租户后要刷新首页
|
||||
|
||||
//update-begin---author:wangshuai---date:2023-11-07---for:【QQYUN-7005】退租户,判断退出的租户ID与当前租户ID一致,再刷新---
|
||||
//租户为空,说明没有租户了,需要刷新页面。或者当前租户和退出的租户一致则需要刷新浏览器
|
||||
if(!currentTenantId || tenantId == loginTenantId){
|
||||
window.location.reload();
|
||||
}
|
||||
//update-end---author:wangshuai---date:2023-11-07---for:【QQYUN-7005】退租户,判断退出的租户ID与当前租户ID一致,再刷新---
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的租户模块需要开启多租户提示
|
||||
|
|
Loading…
Reference in New Issue