修复bug

pull/975/head
zhangdaiscott 2023-12-29 21:24:32 +08:00
parent 21e5143937
commit a72dcdf0ec
18 changed files with 149 additions and 32 deletions

View File

@ -30,13 +30,30 @@
// get inherit binding value
const getBindValues = computed(() => {
return Object.assign(
// update-begin--author:liaozhiyang---date:20231228---forissues/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---forissues/936
});
return () => {

View File

@ -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---forQQYUN-7495patternantd使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---forQQYUN-7495patternantd使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),

View File

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

View File

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

View File

@ -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---forQQYUN-7678
maxHeight: {
type: Number,
default: 500,
},
// update-end--author:liaozhiyang---date:20231220---forQQYUN-7678
value: propTypes.oneOfType([propTypes.string, propTypes.array])
},
emits: ['register', 'getSelectResult'],

View File

@ -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: () => [],

View File

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

View File

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

View File

@ -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>
<!-- 部门用户 -->

View File

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

View File

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

View File

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

View File

@ -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 => {
return {
minHeight: `${props.minHeight}px`,
[props.fullScreen ? 'height' : 'maxHeight']: `${unref(realHeightRef)}px`,
};
// update-begin--author:liaozhiyang---date:20231205---forQQYUN-7147Model
if (props.fullScreen) {
return {
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---forQQYUN-7641basicModalMaxHeight
maxHeight: `${props.maxHeight ? props.maxHeight : unref(realHeightRef)}px`,
// update-end--author:liaozhiyang---date:20231219---forQQYUN-7641basicModalMaxHeight
};
}
}
// update-end--author:liaozhiyang---date:20231205---forQQYUN-7147Model
});
watchEffect(() => {

View File

@ -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---forissues/179slots
// update-begin--author:liaozhiyang---date:20231226---forissues/945BasicTable
nextTick(() => {
getProps.value.defaultExpandAllRows && expandAll();
})
// update-end--author:sunjianlei---date:20231226---forissues/945BasicTable
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 {

View File

@ -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 行编辑升级

View File

@ -206,7 +206,13 @@ export function usePopBiz(ob, tableRef?) {
width: 60,
align: 'center',
customRender: function ({ text }) {
return parseInt(text) + 1;
// 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)));
}

View File

@ -236,6 +236,9 @@
}
&-dropdown-overlay {
// update-begin--author:liaozhiyang---date:20231226---forQQYUN-7512
width: 160px;
// update-end--author:liaozhiyang---date:20231226---forQQYUN-7512
.ant-dropdown-menu-item {
min-width: 160px;
}

View File

@ -488,9 +488,15 @@ export async function userExitChangeLoginTenantId(tenantId){
}
}
}
let loginTenantId = getTenantId();
userStore.setTenant(currentTenantId);
//切换租户后要刷新首页
window.location.reload();
//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一致再刷新---
}
/**