mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
v3.9.0 里程碑版本发布
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
import { generate } from '@ant-design/colors';
|
import { generate } from '@ant-design/colors';
|
||||||
|
import setting from '/@/settings/projectSetting';
|
||||||
|
|
||||||
export const primaryColor = '#1890FF';
|
// 代码逻辑说明: 【JHHB-579】去掉写死的主题色,根据导航栏模式确定主题色
|
||||||
|
export const primaryColor = setting.themeColor;
|
||||||
export const darkMode = 'light';
|
export const darkMode = setting.themeMode;
|
||||||
|
|
||||||
type Fn = (...arg: any) => any;
|
type Fn = (...arg: any) => any;
|
||||||
|
|
||||||
type GenerateTheme = 'default' | 'dark';
|
type GenerateTheme = 'default' | 'dark';
|
||||||
|
|||||||
@ -36,14 +36,12 @@ function createConfig(params: CreateConfigParams) {
|
|||||||
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
|
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - configuration file is build successfully:`);
|
||||||
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
|
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green(configFileName)) + '\n');
|
||||||
|
|
||||||
// update-begin--author:sunjianlei---date:20250423---for:【QQYUN-9685】构建 electron 桌面应用
|
|
||||||
// 如果是 Electron 环境,还需要将配置文件写入到 JSON 文件中
|
// 如果是 Electron 环境,还需要将配置文件写入到 JSON 文件中
|
||||||
if (config.VITE_GLOB_RUN_PLATFORM === 'electron') {
|
if (config.VITE_GLOB_RUN_PLATFORM === 'electron') {
|
||||||
writeFileSync(getRootPath(`${OUTPUT_DIR}/electron/env.json`), JSON.stringify(config));
|
writeFileSync(getRootPath(`${OUTPUT_DIR}/electron/env.json`), JSON.stringify(config));
|
||||||
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - electron env file is build successfully:`);
|
console.log(colors.cyan(`✨ [${pkg.name}]`) + ` - electron env file is build successfully:`);
|
||||||
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green('electron/env.json')) + '\n');
|
console.log(colors.gray(OUTPUT_DIR + '/' + colors.green('electron/env.json')) + '\n');
|
||||||
}
|
}
|
||||||
// update-end----author:sunjianlei---date:20250423---for:【QQYUN-9685】构建 electron 桌面应用
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(colors.red('configuration file configuration file failed to package:\n' + error));
|
console.log(colors.red('configuration file configuration file failed to package:\n' + error));
|
||||||
|
|||||||
@ -51,17 +51,15 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
|
|||||||
*/
|
*/
|
||||||
function getConfFiles() {
|
function getConfFiles() {
|
||||||
|
|
||||||
// update-begin--author:sunjianlei---date:20250411---for:【QQYUN-9685】构建 electron 桌面应用
|
// 代码逻辑说明: 【QQYUN-9685】构建 electron 桌面应用
|
||||||
const {VITE_GLOB_RUN_PLATFORM} = process.env
|
const {VITE_GLOB_RUN_PLATFORM} = process.env
|
||||||
if (VITE_GLOB_RUN_PLATFORM === 'electron') {
|
if (VITE_GLOB_RUN_PLATFORM === 'electron') {
|
||||||
return ['.env', '.env.prod_electron'];
|
return ['.env', '.env.prod_electron'];
|
||||||
}
|
}
|
||||||
// update-end----author:sunjianlei---date:20250411---for:【QQYUN-9685】构建 electron 桌面应用
|
|
||||||
|
|
||||||
const script = process.env.npm_lifecycle_script;
|
const script = process.env.npm_lifecycle_script;
|
||||||
// update-begin--author:liaozhiyang---date:20240326---for:【QQYUN-8690】修正获取当前环境下的文件名
|
// 代码逻辑说明: 【QQYUN-8690】修正获取当前环境下的文件名
|
||||||
const reg = new RegExp('NODE_ENV=([a-z_\\d]+)');
|
const reg = new RegExp('NODE_ENV=([a-z_\\d]+)');
|
||||||
// update-end--author:liaozhiyang---date:20240326---for:【QQYUN-8690】修正获取当前环境下的文件名
|
|
||||||
const result = reg.exec(script as string) as any;
|
const result = reg.exec(script as string) as any;
|
||||||
if (result) {
|
if (result) {
|
||||||
const mode = result[1] as string;
|
const mode = result[1] as string;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean, isQiankunM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// // electron plugin
|
// // electron plugin
|
||||||
// const isElectron = viteEnv.VITE_GLOB_RUN_PLATFORM === 'electron';
|
const isElectron = viteEnv.VITE_GLOB_RUN_PLATFORM === 'electron';
|
||||||
// if (isElectron) {
|
// if (isElectron) {
|
||||||
// vitePlugins.push(configElectronPlugin(viteEnv, isBuild))
|
// vitePlugins.push(configElectronPlugin(viteEnv, isBuild))
|
||||||
// }
|
// }
|
||||||
@ -82,9 +82,12 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean, isQiankunM
|
|||||||
|
|
||||||
// rollup-plugin-gzip
|
// rollup-plugin-gzip
|
||||||
vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE));
|
vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE));
|
||||||
|
|
||||||
// vite-plugin-pwa (PWA 插件注册)
|
// vite-plugin-pwa (PWA 插件注册)
|
||||||
|
if (!isElectron) {
|
||||||
vitePlugins.push(configPwaPlugin(isBuild));
|
vitePlugins.push(configPwaPlugin(isBuild));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// //vite-plugin-theme【预编译加载插件,解决vite首次打开界面加载慢问题】
|
// //vite-plugin-theme【预编译加载插件,解决vite首次打开界面加载慢问题】
|
||||||
// vitePlugins.push(PkgConfig());
|
// vitePlugins.push(PkgConfig());
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* PWA 插件配置
|
* PWA 插件配置 - 适配按需加载
|
||||||
* 适配按需加载:只预缓存关键资源,按需加载的 chunk 使用运行时缓存
|
|
||||||
*/
|
*/
|
||||||
import { VitePWA } from 'vite-plugin-pwa';
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
import type { VitePWAOptions } from 'vite-plugin-pwa';
|
import type { VitePWAOptions } from 'vite-plugin-pwa';
|
||||||
@ -34,27 +33,25 @@ export function configPwaPlugin(isBuild: boolean): PluginOption | PluginOption[]
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
workbox: {
|
workbox: {
|
||||||
// 增加文件大小限制到 10MB
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10MB
|
||||||
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024, // 10 MB
|
|
||||||
cleanupOutdatedCaches: true,
|
cleanupOutdatedCaches: true,
|
||||||
|
|
||||||
// 预缓存策略:只缓存关键资源,按需加载的 chunk 通过运行时缓存
|
// 预缓存:只缓存关键资源,不预缓存路由组件 CSS/JS(避免登录页加载全部资源)
|
||||||
// 预缓存入口文件、CSS 和静态资源,以及核心 JS(入口和 vendor)
|
|
||||||
globPatterns: [
|
globPatterns: [
|
||||||
'index.html',
|
'index.html', // 必须预缓存(避免 non-precached-url 错误)
|
||||||
'manifest.webmanifest',
|
'manifest.webmanifest',
|
||||||
'**/*.css',
|
'assets/index-*.css', // 仅入口 CSS
|
||||||
'**/*.{ico,png,svg,woff2}',
|
'favicon.ico',
|
||||||
// 预缓存入口 JS 和核心 vendor chunk
|
'logo.png',
|
||||||
'js/index-*.js',
|
'js/index-*.js',
|
||||||
'js/*-vendor-*.js',
|
'js/*-vendor-*.js',
|
||||||
],
|
],
|
||||||
// 注意:不预缓存按需加载的路由组件 chunk
|
|
||||||
// 这些 chunk 将通过运行时缓存策略按需加载和缓存
|
|
||||||
|
|
||||||
// 运行时缓存策略:处理按需加载的资源
|
// 不使用导航回退功能
|
||||||
|
navigateFallback: undefined,
|
||||||
|
|
||||||
|
// 运行时缓存:按需加载的资源
|
||||||
runtimeCaching: [
|
runtimeCaching: [
|
||||||
// 按需加载的 JS chunk:优先网络,失败后使用缓存
|
|
||||||
{
|
{
|
||||||
urlPattern: /\/js\/.*\.js$/i,
|
urlPattern: /\/js\/.*\.js$/i,
|
||||||
handler: 'NetworkFirst',
|
handler: 'NetworkFirst',
|
||||||
@ -70,9 +67,8 @@ export function configPwaPlugin(isBuild: boolean): PluginOption | PluginOption[]
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// CSS 文件:优先缓存
|
|
||||||
{
|
{
|
||||||
urlPattern: /\/css\/.*\.css$/i,
|
urlPattern: /\/assets\/.*\.css$/i,
|
||||||
handler: 'CacheFirst',
|
handler: 'CacheFirst',
|
||||||
options: {
|
options: {
|
||||||
cacheName: 'css-cache',
|
cacheName: 'css-cache',
|
||||||
@ -129,8 +125,9 @@ export function configPwaPlugin(isBuild: boolean): PluginOption | PluginOption[]
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
skipWaiting: false,
|
// 启用立即更新:新 SW 立即激活并接管页面
|
||||||
clientsClaim: false,
|
skipWaiting: true,
|
||||||
|
clientsClaim: true,
|
||||||
},
|
},
|
||||||
devOptions: {
|
devOptions: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { app, BrowserWindow, Menu, ipcMain } from 'electron';
|
import { app, BrowserWindow, Menu } from 'electron';
|
||||||
import { isDev } from './env';
|
import { isDev } from './env';
|
||||||
import { createMainWindow, createIndexWindow } from './utils/window';
|
import { createMainWindow, createIndexWindow } from './utils/window';
|
||||||
import { getAppInfo } from './utils';
|
import { getAppInfo } from './utils';
|
||||||
import { ElectronEnum } from '../src/enums/jeecgEnum';
|
|
||||||
import './ipc';
|
import './ipc';
|
||||||
|
|
||||||
// 隐藏所有菜单
|
// 隐藏所有菜单
|
||||||
@ -12,14 +11,13 @@ let mainWindow: BrowserWindow | null = null;
|
|||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
mainWindow = createMainWindow();
|
mainWindow = createMainWindow();
|
||||||
// update-begin--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
// 代码逻辑说明: 【JHHB-13】桌面应用消息通知
|
||||||
mainWindow.on('focus', () => {
|
mainWindow.on('focus', () => {
|
||||||
// 清除任务栏闪烁
|
// 清除任务栏闪烁
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
mainWindow!.flashFrame(false);
|
mainWindow!.flashFrame(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
|
||||||
return mainWindow;
|
return mainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,12 @@ import {_PATHS} from '../paths';
|
|||||||
import {$env, isDev} from '../env';
|
import {$env, isDev} from '../env';
|
||||||
|
|
||||||
const TrayIcons = {
|
const TrayIcons = {
|
||||||
// update-begin--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
// 代码逻辑说明: 【JHHB-13】桌面应用消息通知
|
||||||
normal: nativeImage.createFromPath(
|
normal: nativeImage.createFromPath(
|
||||||
process.platform === 'win32'
|
process.platform === 'win32'
|
||||||
? path.join(_PATHS.publicRoot, 'logo.png')
|
? path.join(_PATHS.publicRoot, 'logo.png')
|
||||||
: path.join(_PATHS.electronRoot, './icons/mac/tray-icon.png').replace(/[\\/]dist[\\/]/, '/')
|
: path.join(_PATHS.electronRoot, './icons/mac/tray-icon.png').replace(/[\\/]dist[\\/]/, '/')
|
||||||
),
|
),
|
||||||
// update-end--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
|
||||||
empty: nativeImage.createEmpty(),
|
empty: nativeImage.createEmpty(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import {_PATHS} from '../paths';
|
|||||||
import {$env, isDev} from '../env';
|
import {$env, isDev} from '../env';
|
||||||
import {createTray} from './tray';
|
import {createTray} from './tray';
|
||||||
|
|
||||||
// 创建窗口
|
// 获取公共窗口选项
|
||||||
export function createBrowserWindow(options?: BrowserWindowConstructorOptions) {
|
export function getBrowserWindowOptions(options?: BrowserWindowConstructorOptions): BrowserWindowConstructorOptions {
|
||||||
const win = new BrowserWindow({
|
return {
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 800,
|
height: 800,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -18,20 +18,26 @@ export function createBrowserWindow(options?: BrowserWindowConstructorOptions) {
|
|||||||
// 应用图标
|
// 应用图标
|
||||||
icon: isDev ? _PATHS.appIcon : void 0,
|
icon: isDev ? _PATHS.appIcon : void 0,
|
||||||
...options,
|
...options,
|
||||||
});
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
}
|
||||||
|
|
||||||
|
// 创建窗口
|
||||||
|
export function createBrowserWindow(options?: BrowserWindowConstructorOptions) {
|
||||||
|
const win = new BrowserWindow(getBrowserWindowOptions(options));
|
||||||
|
// 代码逻辑说明: 【JHHB-13】桌面应用消息通知
|
||||||
if (process.platform === 'darwin') { // 仅 macOS 生效
|
if (process.platform === 'darwin') { // 仅 macOS 生效
|
||||||
if (app.dock) {
|
if (app.dock) {
|
||||||
app.dock.setIcon(path.join(_PATHS.electronRoot, './icons/mac/dock.png').replace(/[\\/]dist[\\/]/, '/'));
|
app.dock.setIcon(path.join(_PATHS.electronRoot, './icons/mac/dock.png').replace(/[\\/]dist[\\/]/, '/'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250725---for:【JHHB-13】桌面应用消息通知
|
|
||||||
// 设置窗口打开处理器
|
// 设置窗口打开处理器
|
||||||
win.webContents.setWindowOpenHandler(({url}) => {
|
win.webContents.setWindowOpenHandler(() => {
|
||||||
const win = createBrowserWindow();
|
return {
|
||||||
win.loadURL(url);
|
action: 'allow',
|
||||||
// 阻止创建新窗口,因为已经被接管
|
// 覆写新窗口的选项,用于调整默认尺寸和加载preload脚本等
|
||||||
return {action: 'deny'};
|
overrideBrowserWindowOptions: getBrowserWindowOptions(),
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 当 beforeunload 阻止窗口关闭时触发
|
// 当 beforeunload 阻止窗口关闭时触发
|
||||||
@ -80,7 +86,10 @@ export function createIndexWindow() {
|
|||||||
|
|
||||||
// 开发环境加载Vite服务,生产加载打包文件
|
// 开发环境加载Vite服务,生产加载打包文件
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
win.loadURL($env.VITE_DEV_SERVER_URL!)
|
let serverUrl = $env.VITE_DEV_SERVER_URL! as string;
|
||||||
|
// 【JHHB-936】由于wps预览不能使用localhost访问,所以把localhost替换为127.0.0.1
|
||||||
|
serverUrl = serverUrl.replace('localhost', '127.0.0.1');
|
||||||
|
win.loadURL(serverUrl)
|
||||||
// 开发环境下,自动打开调试工具
|
// 开发环境下,自动打开调试工具
|
||||||
// win.webContents.openDevTools()
|
// win.webContents.openDevTools()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -48,10 +48,9 @@ export default [
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
response: ({ query }) => {
|
response: ({ query }) => {
|
||||||
const { page = 1, pageSize = 20 } = query;
|
const { page = 1, pageSize = 20 } = query;
|
||||||
// update-begin--author:liaozhiyang---date:20240730---for:【issues/6943】mock翻页之后数据id和图片没自动刷新
|
// 代码逻辑说明: 【issues/6943】mock翻页之后数据id和图片没自动刷新
|
||||||
const pageNo = +(query.pageNo ?? page);
|
const pageNo = +(query.pageNo ?? page);
|
||||||
return resultPageSuccess(pageNo, +pageSize, demoList);
|
return resultPageSuccess(pageNo, +pageSize, demoList);
|
||||||
// update-end--author:liaozhiyang---date:20240730---for:【issues/6943】mock翻页之后数据id和图片没自动刷新
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
] as MockMethod[];
|
] as MockMethod[];
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jeecgboot-vue3",
|
"name": "jeecgboot-vue3",
|
||||||
"version": "3.8.3",
|
"version": "3.9.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "北京国炬信息技术有限公司",
|
"name": "北京国炬信息技术有限公司",
|
||||||
"email": "jeecgos@163.com",
|
"email": "jeecgos@163.com",
|
||||||
@ -23,31 +23,31 @@
|
|||||||
"husky:install": "husky install"
|
"husky:install": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jeecg/online": "3.8.2-beta",
|
"@jeecg/online": "3.9.0-beta",
|
||||||
"@jeecg/aiflow": "1.1.1",
|
"@jeecg/aiflow": "3.9.0-beta",
|
||||||
"@logicflow/core": "^2.0.10",
|
"@logicflow/core": "^2.0.10",
|
||||||
"@logicflow/extension": "^2.0.14",
|
"@logicflow/extension": "^2.0.14",
|
||||||
"@logicflow/vue-node-registry": "^1.0.12",
|
"@logicflow/vue-node-registry": "^1.0.12",
|
||||||
"@iconify/iconify": "^3.1.1",
|
"@iconify/iconify": "^3.1.1",
|
||||||
"@ant-design/colors": "^7.2.0",
|
"@ant-design/colors": "^7.2.1",
|
||||||
"@ant-design/icons-vue": "^7.0.1",
|
"@ant-design/icons-vue": "^7.0.1",
|
||||||
"@vue/shared": "^3.5.13",
|
"@vue/shared": "^3.5.22",
|
||||||
"@vueuse/core": "^10.11.1",
|
"@vueuse/core": "^10.11.1",
|
||||||
"@tinymce/tinymce-vue": "4.0.7",
|
"@tinymce/tinymce-vue": "4.0.7",
|
||||||
"@zxcvbn-ts/core": "^3.0.4",
|
"@zxcvbn-ts/core": "^3.0.4",
|
||||||
"ant-design-vue": "^4.2.6",
|
"ant-design-vue": "^4.2.6",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.12.2",
|
||||||
"china-area-data": "^5.0.1",
|
"china-area-data": "^5.0.1",
|
||||||
"@vant/area-data": "^1.5.2",
|
"@vant/area-data": "^1.5.2",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"codemirror": "^5.65.18",
|
"codemirror": "^5.65.20",
|
||||||
"cron-parser": "^4.9.0",
|
"cron-parser": "^4.9.0",
|
||||||
"cropperjs": "^1.6.2",
|
"cropperjs": "^1.6.2",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.18",
|
||||||
"dom-align": "^1.12.4",
|
"dom-align": "^1.12.4",
|
||||||
"echarts": "^5.6.0",
|
"echarts": "^5.6.0",
|
||||||
"emoji-mart-vue-fast": "^15.0.3",
|
"emoji-mart-vue-fast": "^15.0.5",
|
||||||
"enquire.js": "^2.1.6",
|
"enquire.js": "^2.1.6",
|
||||||
"intro.js": "^7.2.0",
|
"intro.js": "^7.2.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
@ -63,21 +63,22 @@
|
|||||||
"path-to-regexp": "^6.3.0",
|
"path-to-regexp": "^6.3.0",
|
||||||
"pinia": "2.1.7",
|
"pinia": "2.1.7",
|
||||||
"print-js": "^1.6.0",
|
"print-js": "^1.6.0",
|
||||||
"qs": "^6.13.1",
|
"pinyin-pro": "^3.27.0",
|
||||||
|
"qs": "^6.14.0",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
"sortablejs": "^1.15.6",
|
"sortablejs": "^1.15.6",
|
||||||
"swagger-ui-dist": "^5.21.0",
|
"swagger-ui-dist": "^5.29.3",
|
||||||
"tinymce": "6.6.2",
|
"tinymce": "6.6.2",
|
||||||
"vditor": "^3.10.8",
|
"vditor": "^3.11.2",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.22",
|
||||||
"vue-cropper": "^0.6.5",
|
"vue-cropper": "^0.6.5",
|
||||||
"vue-cropperjs": "^5.0.0",
|
"vue-cropperjs": "^5.0.0",
|
||||||
"vue-i18n": "^9.14.2",
|
"vue-i18n": "^9.14.5",
|
||||||
"vue-infinite-scroll": "^2.0.2",
|
"vue-infinite-scroll": "^2.0.2",
|
||||||
"vue-print-nb-jeecg": "^1.0.12",
|
"vue-print-nb-jeecg": "^1.0.12",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.1",
|
||||||
"vue-types": "^5.1.3",
|
"vue-types": "^5.1.3",
|
||||||
"vuedraggable": "^4.1.0",
|
"vuedraggable": "^4.1.0",
|
||||||
"vxe-table": "4.13.31",
|
"vxe-table": "4.13.31",
|
||||||
@ -89,73 +90,73 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^18.6.1",
|
"@commitlint/cli": "^18.6.1",
|
||||||
"@commitlint/config-conventional": "^18.6.3",
|
"@commitlint/config-conventional": "^18.6.3",
|
||||||
"@iconify/json": "^2.2.292",
|
"@iconify/json": "^2.2.394",
|
||||||
"@purge-icons/generated": "^0.10.0",
|
"@purge-icons/generated": "^0.10.0",
|
||||||
"@types/codemirror": "^5.60.15",
|
"@types/codemirror": "^5.60.16",
|
||||||
"@types/crypto-js": "^4.2.2",
|
"@types/crypto-js": "^4.2.2",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/inquirer": "^9.0.7",
|
"@types/inquirer": "^9.0.9",
|
||||||
"@types/intro.js": "^5.1.5",
|
"@types/intro.js": "^5.1.5",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/mockjs": "^1.0.10",
|
"@types/mockjs": "^1.0.10",
|
||||||
"@types/node": "^20.17.12",
|
"@types/node": "^20.19.20",
|
||||||
"@types/nprogress": "^0.2.3",
|
"@types/nprogress": "^0.2.3",
|
||||||
"@types/qrcode": "^1.5.5",
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/qs": "^6.9.17",
|
"@types/qs": "^6.14.0",
|
||||||
"@types/showdown": "^2.0.6",
|
"@types/showdown": "^2.0.6",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
"@typescript-eslint/parser": "^6.21.0",
|
"@typescript-eslint/parser": "^6.21.0",
|
||||||
"@vitejs/plugin-vue": "5.2.1",
|
"@vitejs/plugin-vue": "5.2.4",
|
||||||
"@vitejs/plugin-vue-jsx": "4.1.1",
|
"@vitejs/plugin-vue-jsx": "4.1.1",
|
||||||
"@vue/compiler-sfc": "^3.5.13",
|
"@vue/compiler-sfc": "^3.5.22",
|
||||||
"@vue/test-utils": "^2.4.6",
|
"@vue/test-utils": "^2.4.6",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.21",
|
||||||
"commitizen": "^4.3.1",
|
"commitizen": "^4.3.1",
|
||||||
"conventional-changelog-cli": "^4.1.0",
|
"conventional-changelog-cli": "^4.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"cz-git": "^1.11.0",
|
"cz-git": "^1.12.0",
|
||||||
"czg": "^1.11.0",
|
"czg": "^1.12.0",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.6.1",
|
||||||
"eslint": "^8.57.1",
|
"eslint": "^8.57.1",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.2",
|
||||||
"eslint-define-config": "^2.1.0",
|
"eslint-define-config": "^2.1.0",
|
||||||
"eslint-plugin-jest": "^27.9.0",
|
"eslint-plugin-jest": "^27.9.0",
|
||||||
"eslint-plugin-prettier": "^5.2.1",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"eslint-plugin-vue": "^9.32.0",
|
"eslint-plugin-vue": "^9.33.0",
|
||||||
"esno": "^4.8.0",
|
"esno": "^4.8.0",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.3.2",
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"inquirer": "^9.3.7",
|
"inquirer": "^9.3.8",
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"less": "^4.2.1",
|
"less": "^4.4.2",
|
||||||
"lint-staged": "15.2.2",
|
"lint-staged": "15.2.2",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.5.6",
|
||||||
"postcss-html": "^1.7.0",
|
"postcss-html": "^1.8.0",
|
||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
"prettier": "^3.4.2",
|
"prettier": "^3.6.2",
|
||||||
"pretty-quick": "^4.0.0",
|
"pretty-quick": "^4.2.2",
|
||||||
"rimraf": "^5.0.10",
|
"rimraf": "^5.0.10",
|
||||||
"rollup": "4.52.5",
|
"rollup": "4.52.4",
|
||||||
"rollup-plugin-visualizer": "5.14.0",
|
"rollup-plugin-visualizer": "5.14.0",
|
||||||
"stylelint": "^16.12.0",
|
"stylelint": "^16.25.0",
|
||||||
"stylelint-config-prettier": "^9.0.5",
|
"stylelint-config-prettier": "^9.0.5",
|
||||||
"stylelint-config-recommended": "^14.0.1",
|
"stylelint-config-recommended": "^14.0.1",
|
||||||
"stylelint-config-recommended-vue": "^1.5.0",
|
"stylelint-config-recommended-vue": "^1.6.1",
|
||||||
"stylelint-config-standard": "^36.0.1",
|
"stylelint-config-standard": "^36.0.1",
|
||||||
"stylelint-order": "^6.0.4",
|
"stylelint-order": "^6.0.4",
|
||||||
"ts-jest": "^29.2.5",
|
"ts-jest": "^29.4.4",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^4.9.5",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^6.0.7",
|
"vite": "^6.3.6",
|
||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vite-plugin-html": "^3.2.2",
|
"vite-plugin-html": "^3.2.2",
|
||||||
"vite-plugin-mkcert": "^1.17.6",
|
"vite-plugin-mkcert": "^1.17.9",
|
||||||
"vite-plugin-mock": "^2.9.8",
|
"vite-plugin-mock": "^2.9.8",
|
||||||
"vite-plugin-optimize-persist": "^0.1.2",
|
"vite-plugin-optimize-persist": "^0.1.2",
|
||||||
"vite-plugin-package-config": "^0.1.1",
|
"vite-plugin-package-config": "^0.1.1",
|
||||||
@ -166,10 +167,10 @@
|
|||||||
"vite-plugin-qiankun": "^1.0.15",
|
"vite-plugin-qiankun": "^1.0.15",
|
||||||
"@rys-fe/vite-plugin-theme": "^0.8.6",
|
"@rys-fe/vite-plugin-theme": "^0.8.6",
|
||||||
"vite-plugin-vue-setup-extend-plus": "^0.1.0",
|
"vite-plugin-vue-setup-extend-plus": "^0.1.0",
|
||||||
"unocss": "^0.58.9",
|
"unocss": "^66.5.2",
|
||||||
"vue-eslint-parser": "^9.4.3",
|
"vue-eslint-parser": "^9.4.3",
|
||||||
"vue-tsc": "^1.8.27",
|
"vue-tsc": "^1.8.27",
|
||||||
"dingtalk-jsapi": "^3.0.42",
|
"dingtalk-jsapi": "^3.2.0",
|
||||||
"big.js": "^6.2.2"
|
"big.js": "^6.2.2"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
4795
jeecgboot-vue3/pnpm-lock.yaml
generated
4795
jeecgboot-vue3/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
// 代码逻辑说明: 【QQYUN-6366】升级到antd4.x
|
||||||
const appTheme: any = ref({});
|
const appTheme: any = ref({});
|
||||||
const { getDarkMode } = useRootSetting();
|
const { getDarkMode } = useRootSetting();
|
||||||
watch(
|
watch(
|
||||||
@ -54,11 +54,10 @@
|
|||||||
if (newValue === ThemeEnum.DARK) {
|
if (newValue === ThemeEnum.DARK) {
|
||||||
appTheme.value.algorithm = theme.darkAlgorithm;
|
appTheme.value.algorithm = theme.darkAlgorithm;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
// 代码逻辑说明: 【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
||||||
if (import.meta.env.PROD) {
|
if (import.meta.env.PROD) {
|
||||||
changeTheme(appStore.getProjectConfig.themeColor);
|
changeTheme(appStore.getProjectConfig.themeColor);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240322---for:【QQYUN-8570】生产环境暗黑模式下主题色不生效
|
|
||||||
modeAction(appTheme.value);
|
modeAction(appTheme.value);
|
||||||
appTheme.value = {
|
appTheme.value = {
|
||||||
...appTheme.value,
|
...appTheme.value,
|
||||||
@ -98,13 +97,11 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
appStore.getProjectConfig?.themeColor && changeTheme(appStore.getProjectConfig.themeColor);
|
appStore.getProjectConfig?.themeColor && changeTheme(appStore.getProjectConfig.themeColor);
|
||||||
}, 300);
|
}, 300);
|
||||||
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
// update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
|
// 代码逻辑说明: 【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
|
||||||
img {
|
img {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -10,7 +10,7 @@ enum Api {
|
|||||||
queryDepartTreeSync = '/sys/sysDepart/queryDepartTreeSync',
|
queryDepartTreeSync = '/sys/sysDepart/queryDepartTreeSync',
|
||||||
queryTreeList = '/sys/sysDepart/queryTreeList',
|
queryTreeList = '/sys/sysDepart/queryTreeList',
|
||||||
loadTreeData = '/sys/category/loadTreeData',
|
loadTreeData = '/sys/category/loadTreeData',
|
||||||
loadDictItem = '/sys/category/loadDictItem/',
|
loadDictItem = '/sys/category/loadDictItem',
|
||||||
getDictItems = '/sys/dict/getDictItems/',
|
getDictItems = '/sys/dict/getDictItems/',
|
||||||
getTableList = '/sys/user/queryUserComponentData',
|
getTableList = '/sys/user/queryUserComponentData',
|
||||||
getCategoryData = '/sys/category/loadAllData',
|
getCategoryData = '/sys/category/loadAllData',
|
||||||
|
|||||||
@ -34,8 +34,9 @@ export const getMenuList = () => {
|
|||||||
*/
|
*/
|
||||||
export function getBackMenuAndPerms() {
|
export function getBackMenuAndPerms() {
|
||||||
return defHttp.get({ url: Api.GetMenuList }).catch((e) => {
|
return defHttp.get({ url: Api.GetMenuList }).catch((e) => {
|
||||||
|
console.log('接口 getBackMenuAndPerms 异常错误信息:', e);
|
||||||
// Token过期失效,直接跳转登录页面 2025-09-08 scott
|
// Token过期失效,直接跳转登录页面 2025-09-08 scott
|
||||||
if (e && (e.message.includes('timeout') || e.message.includes('401'))) {
|
if (e && (e.message.includes('timeout') || e.message.includes('401') || e.message.includes('500'))) {
|
||||||
const userStore = useUserStoreWithOut();
|
const userStore = useUserStoreWithOut();
|
||||||
userStore.setToken('');
|
userStore.setToken('');
|
||||||
setAuthCache(TOKEN_KEY, null);
|
setAuthCache(TOKEN_KEY, null);
|
||||||
@ -53,10 +54,8 @@ export function getBackMenuAndPerms() {
|
|||||||
/**
|
/**
|
||||||
* 切换成vue3菜单
|
* 切换成vue3菜单
|
||||||
*/
|
*/
|
||||||
// update-begin--author:liaozhiyang---date:20240313---for:【QQYUN-8487】注释掉判断菜单是否vue2版本逻辑代码
|
|
||||||
// export const switchVue3Menu = () => {
|
// export const switchVue3Menu = () => {
|
||||||
// return new Promise((resolve) => {
|
// return new Promise((resolve) => {
|
||||||
// defHttp.get({ url: Api.SwitchVue3Menu });
|
// defHttp.get({ url: Api.SwitchVue3Menu });
|
||||||
// });
|
// });
|
||||||
// };
|
// };
|
||||||
// update-end--author:liaozhiyang---date:20240313---for:【QQYUN-8487】注释掉判断菜单是否vue2版本逻辑代码
|
|
||||||
|
|||||||
@ -80,7 +80,6 @@ export function phoneLoginApi(params: LoginParams, mode: ErrorMessageMode = 'mod
|
|||||||
*/
|
*/
|
||||||
export function getUserInfo() {
|
export function getUserInfo() {
|
||||||
return defHttp.get<GetUserInfoModel>({ url: Api.GetUserInfo }, {}).catch((e) => {
|
return defHttp.get<GetUserInfoModel>({ url: Api.GetUserInfo }, {}).catch((e) => {
|
||||||
// update-begin--author:zyf---date:20220425---for:【VUEN-76】捕获接口超时异常,跳转到登录界面
|
|
||||||
// Token过期失效,直接跳转登录页面
|
// Token过期失效,直接跳转登录页面
|
||||||
if (e && (e.message.includes('timeout') || e.message.includes('401'))) {
|
if (e && (e.message.includes('timeout') || e.message.includes('401'))) {
|
||||||
//接口不通时跳转到登录界面
|
//接口不通时跳转到登录界面
|
||||||
@ -95,7 +94,6 @@ export function getUserInfo() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// update-end--author:zyf---date:20220425---for:【VUEN-76】捕获接口超时异常,跳转到登录界面
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,13 +119,12 @@ export function getCaptcha(params) {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
resolve(true);
|
resolve(true);
|
||||||
} else {
|
} else {
|
||||||
//update-begin---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
// 代码逻辑说明: 【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
||||||
if(res.code != ExceptionEnum.PHONE_SMS_FAIL_CODE){
|
if(res.code != ExceptionEnum.PHONE_SMS_FAIL_CODE){
|
||||||
createErrorModal({ title: '错误提示', content: res.message || '未知问题' });
|
createErrorModal({ title: '错误提示', content: res.message || '未知问题' });
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
reject(res);
|
reject(res);
|
||||||
//update-end---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
|
||||||
}
|
}
|
||||||
}).catch((res)=>{
|
}).catch((res)=>{
|
||||||
createErrorModal({ title: '错误提示', content: res.message || '未知问题' });
|
createErrorModal({ title: '错误提示', content: res.message || '未知问题' });
|
||||||
|
|||||||
BIN
jeecgboot-vue3/src/assets/images/logo_duty.png
Normal file
BIN
jeecgboot-vue3/src/assets/images/logo_duty.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
jeecgboot-vue3/src/assets/loginmini/icon/icon-depart.png
Normal file
BIN
jeecgboot-vue3/src/assets/loginmini/icon/icon-depart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
@ -363,7 +363,10 @@
|
|||||||
.icon-password {
|
.icon-password {
|
||||||
background-image: url(../icon/icon-password.png);
|
background-image: url(../icon/icon-password.png);
|
||||||
}
|
}
|
||||||
|
.icon-depart {
|
||||||
|
top: 5px !important;
|
||||||
|
background-image: url(../icon/icon-depart.png);
|
||||||
|
}
|
||||||
.icon-code {
|
.icon-code {
|
||||||
background-image: url(../icon/icon-code.png);
|
background-image: url(../icon/icon-code.png);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,16 +153,14 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
|
|||||||
handleClose();
|
handleClose();
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
// update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-8369】搜索区分大小写,外部链接新页打开
|
// 代码逻辑说明: 【QQYUN-8369】搜索区分大小写,外部链接新页打开
|
||||||
if (to.internalOrExternal) {
|
if (to.internalOrExternal) {
|
||||||
// update-begin--author:liaozhiyang---date:20240402---for:【QQYUN-8773】配置外部网址在顶部菜单模式和搜索打不开
|
// 代码逻辑说明: 【QQYUN-8773】配置外部网址在顶部菜单模式和搜索打不开
|
||||||
const path = to.path.replace(URL_HASH_TAB, '#');
|
const path = to.path.replace(URL_HASH_TAB, '#');
|
||||||
window.open(path, '_blank');
|
window.open(path, '_blank');
|
||||||
// update-end--author:liaozhiyang---date:20240402---for:【QQYUN-8773】配置外部网址在顶部菜单模式和搜索打不开
|
|
||||||
} else {
|
} else {
|
||||||
go(to.path);
|
go(to.path);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20230803---for:【QQYUN-8369】搜索区分大小写,外部链接新页打开
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// close search modal
|
// close search modal
|
||||||
|
|||||||
@ -59,9 +59,8 @@
|
|||||||
*/
|
*/
|
||||||
lazyTime: { type: Number, default: 0 },
|
lazyTime: { type: Number, default: 0 },
|
||||||
});
|
});
|
||||||
// update-begin-author:liaozhiyang---date:2024-11-11--for:【issues/7402】CollapseContainer组件增加默认不展开属性
|
// 代码逻辑说明: 【issues/7402】CollapseContainer组件增加默认不展开属性
|
||||||
const show = ref(props.defaultExpan);
|
const show = ref(props.defaultExpan);
|
||||||
// update-begin-author:liaozhiyang---date:2024-11-11--for:【issues/7402】CollapseContainer组件增加默认不展开属性
|
|
||||||
|
|
||||||
const { prefixCls } = useDesign('collapse-container');
|
const { prefixCls } = useDesign('collapse-container');
|
||||||
|
|
||||||
|
|||||||
@ -138,9 +138,8 @@
|
|||||||
.item-style() {
|
.item-style() {
|
||||||
li {
|
li {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
//update-begin---author:wangshuai---date:2024-06-24---for:【TV360X-1576】右键样式选中缺少了一块---
|
// 代码逻辑说明: 【TV360X-1576】右键样式选中缺少了一块---
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
//update-end---author:wangshuai---date:2024-06-24---for:【TV360X-1576】右键样式选中缺少了一块---
|
|
||||||
height: @default-height;
|
height: @default-height;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
line-height: @default-height;
|
line-height: @default-height;
|
||||||
|
|||||||
@ -52,13 +52,12 @@
|
|||||||
if (beforeStartFunc && isFunction(beforeStartFunc)) {
|
if (beforeStartFunc && isFunction(beforeStartFunc)) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
//update-begin---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
// 代码逻辑说明: 【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
||||||
const canStart = await beforeStartFunc().catch((res) =>{
|
const canStart = await beforeStartFunc().catch((res) =>{
|
||||||
if(res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE){
|
if(res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE){
|
||||||
openCaptchaModal(true, {});
|
openCaptchaModal(true, {});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//update-end---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
|
||||||
canStart && start();
|
canStart && start();
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@ -60,20 +60,18 @@
|
|||||||
instance && emit('register', drawerInstance, instance.uid);
|
instance && emit('register', drawerInstance, instance.uid);
|
||||||
|
|
||||||
const getMergeProps = computed((): DrawerProps => {
|
const getMergeProps = computed((): DrawerProps => {
|
||||||
// update-begin--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(toRaw改成cloneDeep,否则props的变化不会触发computed)
|
// 代码逻辑说明: 【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(toRaw改成cloneDeep,否则props的变化不会触发computed)
|
||||||
return { ...deepMerge(cloneDeep(props), unref(propsRef)) };
|
return { ...deepMerge(cloneDeep(props), unref(propsRef)) };
|
||||||
// update-end--author:liaozhiyang---date:20240320---for:【QQYUN-8389】vue3.4以上版本导致角色抽屉隐藏footer逻辑错误(toRaw改成cloneDeep,否则props的变化不会触发computed)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const getProps = computed((): DrawerProps => {
|
const getProps = computed((): DrawerProps => {
|
||||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
// 代码逻辑说明: 【QQYUN-6366】升级到antd4.x
|
||||||
const opt = {
|
const opt = {
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
...unref(attrs),
|
...unref(attrs),
|
||||||
...unref(getMergeProps),
|
...unref(getMergeProps),
|
||||||
open: unref(visibleRef),
|
open: unref(visibleRef),
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
|
||||||
opt.title = undefined;
|
opt.title = undefined;
|
||||||
let { isDetail, width, wrapClassName, getContainer } = opt;
|
let { isDetail, width, wrapClassName, getContainer } = opt;
|
||||||
if (isDetail) {
|
if (isDetail) {
|
||||||
|
|||||||
@ -63,11 +63,10 @@ export function useDrawer(): UseDrawerReturnType {
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
openDrawer: <T = any>(visible = true, data?: T, openOnSet = true): void => {
|
openDrawer: <T = any>(visible = true, data?: T, openOnSet = true): void => {
|
||||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
// 代码逻辑说明: 【QQYUN-6366】升级到antd4.x
|
||||||
getInstance()?.setDrawerProps({
|
getInstance()?.setDrawerProps({
|
||||||
open: visible,
|
open: visible,
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
|
|
||||||
if (openOnSet) {
|
if (openOnSet) {
|
||||||
@ -81,9 +80,8 @@ export function useDrawer(): UseDrawerReturnType {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
closeDrawer: () => {
|
closeDrawer: () => {
|
||||||
// update-begin--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
// 代码逻辑说明: 【QQYUN-6366】升级到antd4.x
|
||||||
getInstance()?.setDrawerProps({ open: false });
|
getInstance()?.setDrawerProps({ open: false });
|
||||||
// update-end--author:liaozhiyang---date:20231218---for:【QQYUN-6366】升级到antd4.x
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -13,9 +13,7 @@
|
|||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
:class="[{ 'is-pop-confirm': item.popConfirm }, item.class ?? []]"
|
:class="[{ 'is-pop-confirm': item.popConfirm }, item.class ?? []]"
|
||||||
>
|
>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20231110---for:【issues/839】BasicTable表格的更多操作按钮禁用还能点击弹出气泡框 -->
|
|
||||||
<a-popconfirm :disabled="item.disabled" v-if="popconfirm && item.popConfirm" v-bind="getPopConfirmAttrs(item.popConfirm)">
|
<a-popconfirm :disabled="item.disabled" v-if="popconfirm && item.popConfirm" v-bind="getPopConfirmAttrs(item.popConfirm)">
|
||||||
<!-- update-end--author:liaozhiyang---date:20231110---for:【issues/839】BasicTable表格的更多操作按钮禁用还能点击弹出气泡框 -->
|
|
||||||
<template #icon v-if="item.popConfirm.icon">
|
<template #icon v-if="item.popConfirm.icon">
|
||||||
<Icon v-if="item.iconColor" :icon="item.popConfirm.icon" :color="item.iconColor" />
|
<Icon v-if="item.iconColor" :icon="item.popConfirm.icon" :color="item.iconColor" />
|
||||||
<Icon v-else :icon="item.popConfirm.icon" />
|
<Icon v-else :icon="item.popConfirm.icon" />
|
||||||
@ -107,7 +105,7 @@
|
|||||||
@prefix-cls: ~'@{namespace}-basic-dropdown';
|
@prefix-cls: ~'@{namespace}-basic-dropdown';
|
||||||
|
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
// update-begin--author:sunjianlei---date:20220322---for: 【VUEN-180】更多下拉菜单,只有点到字上才有效,点到空白处什么都不会发生,体验不好
|
// 代码逻辑说明: 【VUEN-180】更多下拉菜单,只有点到字上才有效,点到空白处什么都不会发生,体验不好
|
||||||
&-menu .ant-dropdown-menu-item.is-pop-confirm {
|
&-menu .ant-dropdown-menu-item.is-pop-confirm {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
@ -115,6 +113,5 @@
|
|||||||
padding: 5px 12px;
|
padding: 5px 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:sunjianlei---date:20220322---for: 【VUEN-180】更多下拉菜单,只有点到字上才有效,点到空白处什么都不会发生,体验不好
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -91,12 +91,11 @@
|
|||||||
// Get the basic configuration of the form
|
// Get the basic configuration of the form
|
||||||
const getProps = computed((): FormProps => {
|
const getProps = computed((): FormProps => {
|
||||||
let mergeProps = { ...props, ...unref(propsRef) } as FormProps;
|
let mergeProps = { ...props, ...unref(propsRef) } as FormProps;
|
||||||
//update-begin-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
|
// 代码逻辑说明: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
|
||||||
if (mergeProps.labelWidth) {
|
if (mergeProps.labelWidth) {
|
||||||
mergeProps.labelCol = undefined;
|
mergeProps.labelCol = undefined;
|
||||||
}
|
}
|
||||||
//update-end-author:sunjianlei date:20220923 for: 如果用户设置了labelWidth,则使labelCol失效,解决labelWidth设置无效的问题
|
// 代码逻辑说明: 【QQYUN-6566】BasicForm支持一行显示(inline)
|
||||||
// update-begin--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
|
||||||
if (mergeProps.layout === 'inline') {
|
if (mergeProps.layout === 'inline') {
|
||||||
if (mergeProps.labelCol === componentSetting.form.labelCol) {
|
if (mergeProps.labelCol === componentSetting.form.labelCol) {
|
||||||
mergeProps.labelCol = undefined;
|
mergeProps.labelCol = undefined;
|
||||||
@ -105,7 +104,6 @@
|
|||||||
mergeProps.wrapperCol = undefined;
|
mergeProps.wrapperCol = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
|
||||||
return mergeProps;
|
return mergeProps;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -130,11 +128,10 @@
|
|||||||
|
|
||||||
const getBindValue = computed(() => {
|
const getBindValue = computed(() => {
|
||||||
const bindValue = { ...attrs, ...props, ...unref(getProps) } as Recordable;
|
const bindValue = { ...attrs, ...props, ...unref(getProps) } as Recordable;
|
||||||
// update-begin--author:liaozhiyang---date:20250630---for:【issues/8484】分类字典中的新增弹窗的label点击会触发查询区域的input
|
// 代码逻辑说明: 【issues/8484】分类字典中的新增弹窗的label点击会触发查询区域的input
|
||||||
if (bindValue.name === undefined && bindValue.source === 'table-query') {
|
if (bindValue.name === undefined && bindValue.source === 'table-query') {
|
||||||
bindValue.name = 'top-query-form';
|
bindValue.name = 'top-query-form';
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250630---for:【issues/8484】分类字典中的新增弹窗的label点击会触发查询区域的input
|
|
||||||
return bindValue;
|
return bindValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -144,9 +141,9 @@
|
|||||||
const { defaultValue, component, componentProps } = schema;
|
const { defaultValue, component, componentProps } = schema;
|
||||||
// handle date type
|
// handle date type
|
||||||
if (defaultValue && dateItemType.includes(component)) {
|
if (defaultValue && dateItemType.includes(component)) {
|
||||||
//update-begin---author:wangshuai ---date:20230410 for:【issues/435】代码生成的日期控件赋默认值报错------------
|
// 代码逻辑说明: 【issues/435】代码生成的日期控件赋默认值报错------------
|
||||||
let valueFormat:string = "";
|
let valueFormat:string = "";
|
||||||
// update-begin--author:liaozhiyang---date:20250818---for:【issues/8683】DatePicker组件的componentProps使用函数形式时初始值获取不对
|
// 代码逻辑说明: 【issues/8683】DatePicker组件的componentProps使用函数形式时初始值获取不对
|
||||||
if(isObject(componentProps)) {
|
if(isObject(componentProps)) {
|
||||||
valueFormat = componentProps?.valueFormat;
|
valueFormat = componentProps?.valueFormat;
|
||||||
} else if (isFunction(componentProps)) {
|
} else if (isFunction(componentProps)) {
|
||||||
@ -160,36 +157,30 @@
|
|||||||
if(!valueFormat){
|
if(!valueFormat){
|
||||||
console.warn("未配置valueFormat,可能导致格式化错误!");
|
console.warn("未配置valueFormat,可能导致格式化错误!");
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20230410 for:【issues/435】代码生成的日期控件赋默认值报错------------
|
|
||||||
if (!Array.isArray(defaultValue)) {
|
if (!Array.isArray(defaultValue)) {
|
||||||
//update-begin---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
// 代码逻辑说明: [issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
||||||
if(valueFormat){
|
if(valueFormat){
|
||||||
// schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
|
// schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
|
||||||
// update-begin--author:liaozhiyang---date:20240529---for:【TV360X-346 】时间组件填写默认值有问题
|
// 代码逻辑说明: 【TV360X-346 】时间组件填写默认值有问题
|
||||||
schema.defaultValue = dateUtil(defaultValue, valueFormat).format(valueFormat);
|
schema.defaultValue = dateUtil(defaultValue, valueFormat).format(valueFormat);
|
||||||
// update-end--author:liaozhiyang---date:20240529---for:【TV360X-346 】时间组件填写默认值有问题
|
|
||||||
}else{
|
}else{
|
||||||
schema.defaultValue = dateUtil(defaultValue);
|
schema.defaultValue = dateUtil(defaultValue);
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
|
||||||
} else {
|
} else {
|
||||||
const def: dayjs.Dayjs[] = [];
|
const def: dayjs.Dayjs[] = [];
|
||||||
defaultValue.forEach((item) => {
|
defaultValue.forEach((item) => {
|
||||||
//update-begin---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
// 代码逻辑说明: [issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
||||||
if(valueFormat){
|
if(valueFormat){
|
||||||
// update-begin--author:liaozhiyang---date:20240529---for:【TV360X-346 】时间组件填写默认值有问题
|
// 代码逻辑说明: 【TV360X-346 】时间组件填写默认值有问题
|
||||||
def.push(dateUtil(item, valueFormat).format(valueFormat));
|
def.push(dateUtil(item, valueFormat).format(valueFormat));
|
||||||
// update-end--author:liaozhiyang---date:20240529---for:【TV360X-346 】时间组件填写默认值有问题
|
|
||||||
}else{
|
}else{
|
||||||
def.push(dateUtil(item));
|
def.push(dateUtil(item));
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20240328---for:【issues/1114】rangepicker等时间控件报错(vue3.4以上版本有问题)
|
// 代码逻辑说明: 【issues/1114】rangepicker等时间控件报错(vue3.4以上版本有问题)
|
||||||
def.forEach((item, index) => {
|
def.forEach((item, index) => {
|
||||||
defaultValue[index] = item;
|
defaultValue[index] = item;
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240328---for:【issues/1114】rangepicker等时间控件报错(vue3.4以上版本有问题)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,21 +284,18 @@
|
|||||||
propsRef.value = deepMerge(unref(propsRef) || {}, formProps);
|
propsRef.value = deepMerge(unref(propsRef) || {}, formProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-11-28 for: QQYUN-3121 【优化】表单视图问题#scott测试 8、此功能未实现
|
// 代码逻辑说明: QQYUN-3121 【优化】表单视图问题#scott测试 8、此功能未实现
|
||||||
const onFormSubmitWhenChange = useDebounceFn(handleSubmit, 300);
|
const onFormSubmitWhenChange = useDebounceFn(handleSubmit, 300);
|
||||||
function setFormModel(key: string, value: any) {
|
function setFormModel(key: string, value: any) {
|
||||||
formModel[key] = value;
|
formModel[key] = value;
|
||||||
// update-begin--author:liaozhiyang---date:20230922---for:【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
|
||||||
// const { validateTrigger } = unref(getBindValue);
|
// const { validateTrigger } = unref(getBindValue);
|
||||||
// if (!validateTrigger || validateTrigger === 'change') {
|
// if (!validateTrigger || validateTrigger === 'change') {
|
||||||
// validateFields([key]).catch((_) => {});
|
// validateFields([key]).catch((_) => {});
|
||||||
// }
|
// }
|
||||||
// update-end--author:liaozhiyang---date:20230922---for:【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
|
||||||
if(props.autoSearch === true){
|
if(props.autoSearch === true){
|
||||||
onFormSubmitWhenChange();
|
onFormSubmitWhenChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-11-28 for: QQYUN-3121 【优化】表单视图问题#scott测试 8、此功能未实现
|
|
||||||
|
|
||||||
function handleEnterPress(e: KeyboardEvent) {
|
function handleEnterPress(e: KeyboardEvent) {
|
||||||
const { autoSubmitOnEnter } = unref(getProps);
|
const { autoSubmitOnEnter } = unref(getProps);
|
||||||
@ -392,16 +380,13 @@
|
|||||||
&-with-help {
|
&-with-help {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240514---for:【QQYUN-9241】form表单上下间距大点
|
|
||||||
//&:not(.ant-form-item-with-help) {
|
//&:not(.ant-form-item-with-help) {
|
||||||
// margin-bottom: 24px;
|
// margin-bottom: 24px;
|
||||||
//}
|
//}
|
||||||
// update-begin--author:liaozhiyang---date:20240514---for:【QQYUN-9241】form表单上下间距大点
|
// 代码逻辑说明: 【TV360X-1420】校验时闪动
|
||||||
// update-begin--author:liaozhiyang---date:20240620---for:【TV360X-1420】校验时闪动
|
|
||||||
&-has-error {
|
&-has-error {
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240620---for:【TV360X-1420】校验时闪动
|
|
||||||
|
|
||||||
// 表单组件中间件样式
|
// 表单组件中间件样式
|
||||||
.j-form-item-middleware {
|
.j-form-item-middleware {
|
||||||
@ -460,12 +445,11 @@
|
|||||||
margin-bottom: 8px !important;
|
margin-bottom: 8px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
// 代码逻辑说明: 【QQYUN-6566】BasicForm支持一行显示(inline)
|
||||||
&.ant-form-inline {
|
&.ant-form-inline {
|
||||||
& > .ant-row {
|
& > .ant-row {
|
||||||
.ant-col { width:auto !important; }
|
.ant-col { width:auto !important; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231017---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -53,9 +53,8 @@ import JSelectInput from './jeecg/components/JSelectInput.vue';
|
|||||||
import JCategorySelect from './jeecg/components/JCategorySelect.vue';
|
import JCategorySelect from './jeecg/components/JCategorySelect.vue';
|
||||||
import JSelectMultiple from './jeecg/components/JSelectMultiple.vue';
|
import JSelectMultiple from './jeecg/components/JSelectMultiple.vue';
|
||||||
import JPopup from './jeecg/components/JPopup.vue';
|
import JPopup from './jeecg/components/JPopup.vue';
|
||||||
// update-begin--author:liaozhiyang---date:20240130---for:【QQYUN-7961】popupDict字典
|
// 代码逻辑说明: 【QQYUN-7961】popupDict字典
|
||||||
import JPopupDict from './jeecg/components/JPopupDict.vue';
|
import JPopupDict from './jeecg/components/JPopupDict.vue';
|
||||||
// update-end--author:liaozhiyang---date:20240130---for:【QQYUN-7961】popupDict字典
|
|
||||||
import JSwitch from './jeecg/components/JSwitch.vue';
|
import JSwitch from './jeecg/components/JSwitch.vue';
|
||||||
import JTreeDict from './jeecg/components/JTreeDict.vue';
|
import JTreeDict from './jeecg/components/JTreeDict.vue';
|
||||||
import JInputPop from './jeecg/components/JInputPop.vue';
|
import JInputPop from './jeecg/components/JInputPop.vue';
|
||||||
@ -79,6 +78,7 @@ import JRangeTime from './jeecg/components/JRangeTime.vue'
|
|||||||
import JInputSelect from './jeecg/components/JInputSelect.vue'
|
import JInputSelect from './jeecg/components/JInputSelect.vue'
|
||||||
import RoleSelectInput from './jeecg/components/roleSelect/RoleSelectInput.vue';
|
import RoleSelectInput from './jeecg/components/roleSelect/RoleSelectInput.vue';
|
||||||
import JSelectUserByDeptPost from './jeecg/components/JSelectUserByDeptPost.vue';
|
import JSelectUserByDeptPost from './jeecg/components/JSelectUserByDeptPost.vue';
|
||||||
|
import JDatePickerMultiple from './jeecg/components/JDatePickerMultiple.vue';
|
||||||
import {DatePickerInFilter, CascaderPcaInFilter} from "@/components/InFilter";
|
import {DatePickerInFilter, CascaderPcaInFilter} from "@/components/InFilter";
|
||||||
|
|
||||||
const componentMap = new Map<ComponentType, Component>();
|
const componentMap = new Map<ComponentType, Component>();
|
||||||
@ -112,6 +112,7 @@ componentMap.set('RangePicker', DatePicker.RangePicker);
|
|||||||
componentMap.set('WeekPicker', DatePicker.WeekPicker);
|
componentMap.set('WeekPicker', DatePicker.WeekPicker);
|
||||||
componentMap.set('TimePicker', TimePicker);
|
componentMap.set('TimePicker', TimePicker);
|
||||||
componentMap.set('DatePickerInFilter', DatePickerInFilter);
|
componentMap.set('DatePickerInFilter', DatePickerInFilter);
|
||||||
|
componentMap.set('JDatePickerMultiple', JDatePickerMultiple);
|
||||||
componentMap.set('StrengthMeter', StrengthMeter);
|
componentMap.set('StrengthMeter', StrengthMeter);
|
||||||
componentMap.set('IconPicker', IconPicker);
|
componentMap.set('IconPicker', IconPicker);
|
||||||
componentMap.set('InputCountDown', CountdownInput);
|
componentMap.set('InputCountDown', CountdownInput);
|
||||||
@ -150,9 +151,8 @@ componentMap.set(
|
|||||||
componentMap.set('JCategorySelect', JCategorySelect);
|
componentMap.set('JCategorySelect', JCategorySelect);
|
||||||
componentMap.set('JSelectMultiple', JSelectMultiple);
|
componentMap.set('JSelectMultiple', JSelectMultiple);
|
||||||
componentMap.set('JPopup', JPopup);
|
componentMap.set('JPopup', JPopup);
|
||||||
// update-begin--author:liaozhiyang---date:20240130---for:【QQYUN-7961】popupDict字典
|
// 代码逻辑说明: 【QQYUN-7961】popupDict字典
|
||||||
componentMap.set('JPopupDict', JPopupDict);
|
componentMap.set('JPopupDict', JPopupDict);
|
||||||
// update-end--author:liaozhiyang---date:20240130---for:【QQYUN-7961】popupDict字典
|
|
||||||
componentMap.set('JSwitch', JSwitch);
|
componentMap.set('JSwitch', JSwitch);
|
||||||
componentMap.set('JTreeDict', JTreeDict);
|
componentMap.set('JTreeDict', JTreeDict);
|
||||||
componentMap.set('JInputPop', JInputPop);
|
componentMap.set('JInputPop', JInputPop);
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
const emitData = ref<any[]>([]);
|
const emitData = ref<any[]>([]);
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
// update-begin--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
// 代码逻辑说明: 【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
||||||
const hasMore = ref(true);
|
const hasMore = ref(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -86,7 +86,7 @@
|
|||||||
// update-end--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
// update-end--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
||||||
// Embedded in the form, just use the hook binding to perform form verification
|
// Embedded in the form, just use the hook binding to perform form verification
|
||||||
const [state, setState] = useRuleFormItem(props, 'value', 'change', emitData);
|
const [state, setState] = useRuleFormItem(props, 'value', 'change', emitData);
|
||||||
// update-begin--author:liaozhiyang---date:20230830---for:【QQYUN-6308】解决警告
|
// 代码逻辑说明: 【QQYUN-6308】解决警告
|
||||||
let vModalValue: any;
|
let vModalValue: any;
|
||||||
const attrs_ = computed(() => {
|
const attrs_ = computed(() => {
|
||||||
let obj: any = unref(attrs) || {};
|
let obj: any = unref(attrs) || {};
|
||||||
@ -94,9 +94,9 @@
|
|||||||
vModalValue = obj['onUpdate:value'];
|
vModalValue = obj['onUpdate:value'];
|
||||||
delete obj['onUpdate:value'];
|
delete obj['onUpdate:value'];
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20231017---for:【issues/5467】ApiSelect修复覆盖了用户传递的方法
|
// 代码逻辑说明: 【issues/5467】ApiSelect修复覆盖了用户传递的方法
|
||||||
if (obj['filterOption'] === undefined) {
|
if (obj['filterOption'] === undefined) {
|
||||||
// update-begin--author:liaozhiyang---date:20230904---for:【issues/5305】无法按照预期进行搜索
|
// 代码逻辑说明: 【issues/5305】无法按照预期进行搜索
|
||||||
obj['filterOption'] = (inputValue, option) => {
|
obj['filterOption'] = (inputValue, option) => {
|
||||||
if (typeof option['label'] === 'string') {
|
if (typeof option['label'] === 'string') {
|
||||||
return option['label'].toLowerCase().indexOf(inputValue.toLowerCase()) != -1;
|
return option['label'].toLowerCase().indexOf(inputValue.toLowerCase()) != -1;
|
||||||
@ -104,12 +104,10 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20230904---for:【issues/5305】无法按照预期进行搜索
|
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231017---for:【issues/5467】ApiSelect修复覆盖了用户传递的方法
|
|
||||||
return obj;
|
return obj;
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20230830---for:【QQYUN-6308】解决警告
|
// 代码逻辑说明: 【QQYUN-6308】解决警告
|
||||||
const getOptions = computed(() => {
|
const getOptions = computed(() => {
|
||||||
const { labelField, valueField, numberToString } = props;
|
const { labelField, valueField, numberToString } = props;
|
||||||
return unref(options).reduce((prev, next: Recordable) => {
|
return unref(options).reduce((prev, next: Recordable) => {
|
||||||
@ -124,8 +122,7 @@
|
|||||||
return prev;
|
return prev;
|
||||||
}, [] as OptionsItem[]);
|
}, [] as OptionsItem[]);
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20240823---for:【issues/6999】ApiSelect联动更新字段不生效(代码还原)
|
// 代码逻辑说明: 【issues/8527】apiSelect分页加载重复请求
|
||||||
// update-begin--author:liaozhiyang---date:20250707---for:【issues/8527】apiSelect分页加载重复请求
|
|
||||||
watch(
|
watch(
|
||||||
() => props.immediate,
|
() => props.immediate,
|
||||||
() => {
|
() => {
|
||||||
@ -140,8 +137,6 @@
|
|||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
// update-end--author:liaozhiyang---date:20250707---for:【issues/8527】apiSelect分页加载重复请求
|
|
||||||
// update-end--author:liaozhiyang---date:20240823---for:【issues/6999】ApiSelect联动更新字段不生效(代码还原)
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.params,
|
() => props.params,
|
||||||
@ -165,7 +160,7 @@
|
|||||||
async function fetch() {
|
async function fetch() {
|
||||||
const api = props.api;
|
const api = props.api;
|
||||||
if (!api || !isFunction(api)) return;
|
if (!api || !isFunction(api)) return;
|
||||||
// update-begin--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
// 代码逻辑说明: 【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
||||||
if (!props.pageConfig.isPage || pagination.value.pageNo == 1) {
|
if (!props.pageConfig.isPage || pagination.value.pageNo == 1) {
|
||||||
options.value = [];
|
options.value = [];
|
||||||
}
|
}
|
||||||
@ -175,14 +170,12 @@
|
|||||||
let params = isPage
|
let params = isPage
|
||||||
? { ...props.params, [pageField]: pagination.value.pageNo, [pageSizeField]: pagination.value.pageSize }
|
? { ...props.params, [pageField]: pagination.value.pageNo, [pageSizeField]: pagination.value.pageSize }
|
||||||
: { ...props.params };
|
: { ...props.params };
|
||||||
// update-end--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
|
||||||
const res = await api(params);
|
const res = await api(params);
|
||||||
if (isPage) {
|
if (isPage) {
|
||||||
// update-begin--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
// 代码逻辑说明: 【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
||||||
options.value = [...options.value, ...res[listField]];
|
options.value = [...options.value, ...res[listField]];
|
||||||
pagination.value.total = res[totalField] || 0;
|
pagination.value.total = res[totalField] || 0;
|
||||||
hasMore.value = res[totalField] ? options.value.length < res[totalField] : res[listField] < pagination.value.pageSize;
|
hasMore.value = res[totalField] ? options.value.length < res[totalField] : res[listField] < pagination.value.pageSize;
|
||||||
// update-end--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
|
||||||
} else {
|
} else {
|
||||||
if (Array.isArray(res)) {
|
if (Array.isArray(res)) {
|
||||||
options.value = res;
|
options.value = res;
|
||||||
@ -198,19 +191,14 @@
|
|||||||
console.warn(error);
|
console.warn(error);
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
//--@updateBy-begin----author:liusq---date:20210914------for:判断选择模式,multiple多选情况下的value值空的情况下需要设置为数组------
|
|
||||||
['multiple', 'tags'].includes(unref(attrs).mode) && !Array.isArray(unref(state)) && setState([]);
|
['multiple', 'tags'].includes(unref(attrs).mode) && !Array.isArray(unref(state)) && setState([]);
|
||||||
//--@updateBy-end----author:liusq---date:20210914------for:判断选择模式,multiple多选情况下的value值空的情况下需要设置为数组------
|
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230505 for:初始化value值,如果是多选字符串的情况下显示不出来------------
|
|
||||||
initValue();
|
initValue();
|
||||||
//update-end---author:wangshuai ---date:20230505 for:初始化value值,如果是多选字符串的情况下显示不出来------------
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initValue() {
|
function initValue() {
|
||||||
let value = props.value;
|
let value = props.value;
|
||||||
// update-begin--author:liaozhiyang---date:20250407---for:【issues/8037】初始化值单选的值被错误地写入数组值
|
// 代码逻辑说明: 【issues/8037】初始化值单选的值被错误地写入数组值
|
||||||
if (['multiple', 'tags'].includes(unref(attrs).mode)) {
|
if (['multiple', 'tags'].includes(unref(attrs).mode)) {
|
||||||
if (value && typeof value === 'string' && value != 'null' && value != 'undefined') {
|
if (value && typeof value === 'string' && value != 'null' && value != 'undefined') {
|
||||||
state.value = value.split(',');
|
state.value = value.split(',');
|
||||||
@ -220,7 +208,6 @@
|
|||||||
} else {
|
} else {
|
||||||
state.value = value;
|
state.value = value;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250407---for:【issues/8037】初始化值单选的值被错误地写入数组值
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleFetch() {
|
async function handleFetch() {
|
||||||
@ -238,7 +225,6 @@
|
|||||||
vModalValue && vModalValue(_);
|
vModalValue && vModalValue(_);
|
||||||
emitData.value = args;
|
emitData.value = args;
|
||||||
}
|
}
|
||||||
// update-begin--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
|
||||||
// 滚动加载更多
|
// 滚动加载更多
|
||||||
function handlePopupScroll(e) {
|
function handlePopupScroll(e) {
|
||||||
const { scrollTop, scrollHeight, clientHeight } = e.target;
|
const { scrollTop, scrollHeight, clientHeight } = e.target;
|
||||||
@ -248,7 +234,6 @@
|
|||||||
fetch();
|
fetch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liusq---date:20250407---for:【QQYUN-11831】ApiSelect 分页下拉方案 #7883
|
|
||||||
return { state, attrs_, attrs, getOptions, loading, t, handleFetch, handleChange, handlePopupScroll,filterOption };
|
return { state, attrs_, attrs, getOptions, loading, t, handleFetch, handleChange, handlePopupScroll,filterOption };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -44,9 +44,8 @@
|
|||||||
watch(
|
watch(
|
||||||
() => props.params,
|
() => props.params,
|
||||||
() => {
|
() => {
|
||||||
//update-begin---author:wangshuai---date:2024-02-28---for:【QQYUN-8346】 ApiTreeSelect组件入参变化时,不及时刷新数据 #1054---
|
// 代码逻辑说明: 【QQYUN-8346】 ApiTreeSelect组件入参变化时,不及时刷新数据 #1054---
|
||||||
unref(isFirstLoaded) && fetch();
|
unref(isFirstLoaded) && fetch();
|
||||||
//update-end---author:wangshuai---date:2024-02-28---for:【QQYUN-8346】 ApiTreeSelect组件入参变化时,不及时刷新数据 #1054---
|
|
||||||
},
|
},
|
||||||
{ deep: true }
|
{ deep: true }
|
||||||
);
|
);
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
<a-col v-bind="actionColOpt" v-if="showActionButtonGroup">
|
<a-col v-bind="actionColOpt" v-if="showActionButtonGroup">
|
||||||
<div class="btnArea" style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
|
<div class="btnArea" style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<!-- update-begin-author:zyf Date:20211213 for:调换按钮前后位置-->
|
|
||||||
<slot name="submitBefore"></slot>
|
<slot name="submitBefore"></slot>
|
||||||
<Button type="primary" class="mr-2" v-bind="getSubmitBtnOptions" @click="submitAction" v-if="showSubmitButton">
|
<Button type="primary" class="mr-2" v-bind="getSubmitBtnOptions" @click="submitAction" v-if="showSubmitButton">
|
||||||
{{ getSubmitBtnOptions.text }}
|
{{ getSubmitBtnOptions.text }}
|
||||||
@ -12,7 +11,6 @@
|
|||||||
<Button type="default" class="mr-2" v-bind="getResetBtnOptions" @click="resetAction" v-if="showResetButton">
|
<Button type="default" class="mr-2" v-bind="getResetBtnOptions" @click="resetAction" v-if="showResetButton">
|
||||||
{{ getResetBtnOptions.text }}
|
{{ getResetBtnOptions.text }}
|
||||||
</Button>
|
</Button>
|
||||||
<!-- update-end-author:zyf Date:20211213 for:调换按钮前后位置-->
|
|
||||||
|
|
||||||
<slot name="advanceBefore"></slot>
|
<slot name="advanceBefore"></slot>
|
||||||
<Button type="link" size="small" @click="toggleAdvanced" v-if="showAdvancedButton && !hideAdvanceBtn">
|
<Button type="link" size="small" @click="toggleAdvanced" v-if="showAdvancedButton && !hideAdvanceBtn">
|
||||||
@ -75,9 +73,8 @@
|
|||||||
const { showAdvancedButton, actionSpan: span, actionColOptions } = props;
|
const { showAdvancedButton, actionSpan: span, actionColOptions } = props;
|
||||||
const actionSpan = 24 - span;
|
const actionSpan = 24 - span;
|
||||||
const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {};
|
const advancedSpanObj = showAdvancedButton ? { span: actionSpan < 6 ? 24 : actionSpan } : {};
|
||||||
// update-begin--author:liaozhiyang---date:20240105---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
// 代码逻辑说明: 【QQYUN-6566】BasicForm支持一行显示(inline)
|
||||||
const defaultSpan = props.layout == 'inline' ? {} : { span: showAdvancedButton ? 6 : 4 };
|
const defaultSpan = props.layout == 'inline' ? {} : { span: showAdvancedButton ? 6 : 4 };
|
||||||
// update-end--author:liaozhiyang---date:20240105---for:【QQYUN-6566】BasicForm支持一行显示(inline)
|
|
||||||
const actionColOpt: Partial<ColEx> = {
|
const actionColOpt: Partial<ColEx> = {
|
||||||
style: { textAlign: 'right' },
|
style: { textAlign: 'right' },
|
||||||
...defaultSpan,
|
...defaultSpan,
|
||||||
@ -127,7 +124,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240617---for:【TV360X-999】在1753px宽度下 流程设计页面查询的展开换行了
|
// 代码逻辑说明: 【TV360X-999】在1753px宽度下 流程设计页面查询的展开换行了
|
||||||
.btnArea {
|
.btnArea {
|
||||||
:deep(.ant-form-item-control-input-content) {
|
:deep(.ant-form-item-control-input-content) {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -137,5 +134,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240617---for:【TV360X-999】在1753px宽度下 流程设计页面查询的展开换行了
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -54,18 +54,16 @@
|
|||||||
formActionType: {
|
formActionType: {
|
||||||
type: Object as PropType<FormActionType>,
|
type: Object as PropType<FormActionType>,
|
||||||
},
|
},
|
||||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-857】解决禁用状态下触发校验
|
// 代码逻辑说明: 【TV360X-857】解决禁用状态下触发校验
|
||||||
clearValidate: {
|
clearValidate: {
|
||||||
type: Function,
|
type: Function,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
// update-end-author:liaozhiyang---date:20240605---for:【TV360X-857】解决禁用状态下触发校验
|
// 代码逻辑说明: 【TV360X-1511】blur不生效
|
||||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
|
||||||
formName: {
|
formName: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
|
||||||
source: {
|
source: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
@ -103,20 +101,18 @@
|
|||||||
componentProps = componentProps({ schema, tableAction, formModel, formActionType }) ?? {};
|
componentProps = componentProps({ schema, tableAction, formModel, formActionType }) ?? {};
|
||||||
}
|
}
|
||||||
if (schema.component === 'Divider') {
|
if (schema.component === 'Divider') {
|
||||||
//update-begin---author:wangshuai---date:2023-09-22---for:【QQYUN-6603】分割线标题位置显示不正确---
|
// 代码逻辑说明: 【QQYUN-6603】分割线标题位置显示不正确---
|
||||||
componentProps = Object.assign({ type: 'horizontal',orientation:'left', plain: true, }, componentProps);
|
componentProps = Object.assign({ type: 'horizontal',orientation:'left', plain: true, }, componentProps);
|
||||||
//update-end---author:wangshuai---date:2023-09-22---for:【QQYUN-6603】分割线标题位置显示不正确---
|
|
||||||
}
|
}
|
||||||
return componentProps as Recordable;
|
return componentProps as Recordable;
|
||||||
});
|
});
|
||||||
|
|
||||||
const getDisable = computed(() => {
|
const getDisable = computed(() => {
|
||||||
const { disabled: globDisabled } = props.formProps;
|
const { disabled: globDisabled } = props.formProps;
|
||||||
// update-begin--author:liaozhiyang---date:20240530---for:【TV360X-594】表单全局禁用则dynamicDisabled不生效
|
// 代码逻辑说明: 【TV360X-594】表单全局禁用则dynamicDisabled不生效
|
||||||
if (!!globDisabled) {
|
if (!!globDisabled) {
|
||||||
return globDisabled;
|
return globDisabled;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240530---for:【TV360X-594】表单全局禁用则dynamicDisabled不生效
|
|
||||||
const { dynamicDisabled } = props.schema;
|
const { dynamicDisabled } = props.schema;
|
||||||
const { disabled: itemDisabled = false } = unref(getComponentsProps);
|
const { disabled: itemDisabled = false } = unref(getComponentsProps);
|
||||||
let disabled = !!globDisabled || itemDisabled;
|
let disabled = !!globDisabled || itemDisabled;
|
||||||
@ -129,7 +125,7 @@
|
|||||||
return disabled;
|
return disabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
// 代码逻辑说明: 【QQYUN-8377】formSchema props支持动态修改
|
||||||
const getDynamicPropsValue = computed(() => {
|
const getDynamicPropsValue = computed(() => {
|
||||||
const { dynamicPropsVal, dynamicPropskey } = props.schema;
|
const { dynamicPropsVal, dynamicPropskey } = props.schema;
|
||||||
if (dynamicPropskey == null) {
|
if (dynamicPropskey == null) {
|
||||||
@ -143,7 +139,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
|
||||||
|
|
||||||
function getShow(): { isShow: boolean; isIfShow: boolean } {
|
function getShow(): { isShow: boolean; isIfShow: boolean } {
|
||||||
const { show, ifShow } = props.schema;
|
const { show, ifShow } = props.schema;
|
||||||
@ -168,7 +163,7 @@
|
|||||||
isShow = isShow && itemIsAdvanced;
|
isShow = isShow && itemIsAdvanced;
|
||||||
return { isShow, isIfShow };
|
return { isShow, isIfShow };
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
// 代码逻辑说明: 【TV360X-434】validator校验执行两次
|
||||||
let vSwitchArr: any = [],
|
let vSwitchArr: any = [],
|
||||||
prevValidatorArr: any = [];
|
prevValidatorArr: any = [];
|
||||||
const hijackValidator = (rules) => {
|
const hijackValidator = (rules) => {
|
||||||
@ -195,35 +190,30 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
|
||||||
function handleRules(): ValidationRule[] {
|
function handleRules(): ValidationRule[] {
|
||||||
const { rules: defRules = [], component, rulesMessageJoinLabel, label, dynamicRules, required, auth, field } = props.schema;
|
const { rules: defRules = [], component, rulesMessageJoinLabel, label, dynamicRules, required, auth, field } = props.schema;
|
||||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-857】解决禁用状态下触发校验
|
// 代码逻辑说明: 【TV360X-857】解决禁用状态下触发校验
|
||||||
const { disabled: globDisabled } = props.formProps;
|
const { disabled: globDisabled } = props.formProps;
|
||||||
const { disabled: itemDisabled = false } = unref(getComponentsProps);
|
const { disabled: itemDisabled = false } = unref(getComponentsProps);
|
||||||
if (!!globDisabled || !!itemDisabled) {
|
if (!!globDisabled || !!itemDisabled) {
|
||||||
props.clearValidate(field);
|
props.clearValidate(field);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-857】解决禁用状态下触发校验
|
// 代码逻辑说明: 【TV360X-842】必填项v-auth、show隐藏的情况下表单无法提交
|
||||||
// update-begin--author:liaozhiyang---date:20240531---for:【TV360X-842】必填项v-auth、show隐藏的情况下表单无法提交
|
|
||||||
const { hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
const { isShow } = getShow();
|
const { isShow } = getShow();
|
||||||
if ((auth && !hasPermission(auth)) || !isShow) {
|
if ((auth && !hasPermission(auth)) || !isShow) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240531---for:【TV360X-842】必填项v-auth、show隐藏的情况下表单无法提交
|
|
||||||
if (isFunction(dynamicRules)) {
|
if (isFunction(dynamicRules)) {
|
||||||
// update-begin--author:liaozhiyang---date:20240514---for:【issues/1244】标识了必填,但是必填标识没显示
|
// 代码逻辑说明: 【issues/1244】标识了必填,但是必填标识没显示
|
||||||
const ruleArr = dynamicRules(unref(getValues)) as ValidationRule[];
|
const ruleArr = dynamicRules(unref(getValues)) as ValidationRule[];
|
||||||
if (required) {
|
if (required) {
|
||||||
ruleArr.unshift({ required: true });
|
ruleArr.unshift({ required: true });
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
// 代码逻辑说明: 【TV360X-434】validator校验执行两次
|
||||||
hijackValidator(ruleArr);
|
hijackValidator(ruleArr);
|
||||||
// update-end--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
|
||||||
return ruleArr;
|
return ruleArr;
|
||||||
// update-end--author:liaozhiyang---date:20240514---for:【issues/1244】标识了必填,但是必填标识没显示
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let rules: ValidationRule[] = cloneDeep(defRules) as ValidationRule[];
|
let rules: ValidationRule[] = cloneDeep(defRules) as ValidationRule[];
|
||||||
@ -273,12 +263,10 @@
|
|||||||
rule.required = false;
|
rule.required = false;
|
||||||
}
|
}
|
||||||
if (component) {
|
if (component) {
|
||||||
//update-begin---author:wangshuai---date:2024-02-01---for:【QQYUN-8176】编辑表单中,校验必填时,如果组件是ApiSelect,打开编辑页面时,即使该字段有值,也会提示请选择---
|
|
||||||
//https://github.com/vbenjs/vue-vben-admin/pull/3082 github修复原文
|
//https://github.com/vbenjs/vue-vben-admin/pull/3082 github修复原文
|
||||||
/*if (!Reflect.has(rule, 'type')) {
|
/*if (!Reflect.has(rule, 'type')) {
|
||||||
rule.type = component === 'InputNumber' ? 'number' : 'string';
|
rule.type = component === 'InputNumber' ? 'number' : 'string';
|
||||||
}*/
|
}*/
|
||||||
//update-end---author:wangshuai---date:2024-02-01---for:【QQYUN-8176】编辑表单中,校验必填时,如果组件是ApiSelect,打开编辑页面时,即使该字段有值,也会提示请选择---
|
|
||||||
|
|
||||||
rule.message = rule.message || defaultMsg;
|
rule.message = rule.message || defaultMsg;
|
||||||
|
|
||||||
@ -295,7 +283,7 @@
|
|||||||
if (characterInx !== -1 && !rules[characterInx].validator) {
|
if (characterInx !== -1 && !rules[characterInx].validator) {
|
||||||
rules[characterInx].message = rules[characterInx].message || t('component.form.maxTip', [rules[characterInx].max] as Recordable);
|
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时发现正则无效)
|
// 代码逻辑说明: 【QQYUN-7495】pattern由字符串改成正则传递给antd(因使用InputNumber时发现正则无效)
|
||||||
rules.forEach((item) => {
|
rules.forEach((item) => {
|
||||||
if (typeof item.pattern === 'string') {
|
if (typeof item.pattern === 'string') {
|
||||||
try {
|
try {
|
||||||
@ -310,10 +298,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7495】pattern由字符串改成正则传递给antd(因使用InputNumber时发现正则无效)
|
// 代码逻辑说明: 【TV360X-434】validator校验执行两次
|
||||||
// update-begin--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
|
||||||
hijackValidator(rules);
|
hijackValidator(rules);
|
||||||
// update-end--author:liaozhiyang---date:20240530---for:【TV360X-434】validator校验执行两次
|
|
||||||
return rules;
|
return rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,26 +307,29 @@
|
|||||||
const { renderComponentContent, component, field, changeEvent = 'change', valueField, componentProps, dynamicRules, rules:defRules = [] } = props.schema;
|
const { renderComponentContent, component, field, changeEvent = 'change', valueField, componentProps, dynamicRules, rules:defRules = [] } = props.schema;
|
||||||
|
|
||||||
const isCheck = component && ['Switch', 'Checkbox'].includes(component);
|
const isCheck = component && ['Switch', 'Checkbox'].includes(component);
|
||||||
// update-begin--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
// 代码逻辑说明: 【QQYUN-6679】input去空格
|
||||||
let isTrim = false;
|
let isTrim = false;
|
||||||
if (component === 'Input' && componentProps && componentProps.trim) {
|
if (component === 'Input' && componentProps && componentProps.trim) {
|
||||||
isTrim = true;
|
isTrim = true;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
|
||||||
const eventKey = `on${upperFirst(changeEvent)}`;
|
const eventKey = `on${upperFirst(changeEvent)}`;
|
||||||
const getRules = (): ValidationRule[] => {
|
const getRules = (): ValidationRule[] => {
|
||||||
const dyRules = isFunction(dynamicRules) ? dynamicRules(unref(getValues)) : [];
|
const dyRules = isFunction(dynamicRules) ? dynamicRules(unref(getValues)) : [];
|
||||||
return [...dyRules, ...defRules];
|
return [...dyRules, ...defRules];
|
||||||
};
|
};
|
||||||
// update-begin--author:liaozhiyang---date:20230922---for:【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
// 代码逻辑说明: 【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
||||||
const on = {
|
const on = {
|
||||||
[eventKey]: (...args: Nullable<Recordable>[]) => {
|
[eventKey]: (...args: Nullable<Recordable>[]) => {
|
||||||
const [e] = args;
|
const [e] = args;
|
||||||
if (propsData[eventKey]) {
|
if (propsData[eventKey]) {
|
||||||
propsData[eventKey](...args);
|
propsData[eventKey](...args);
|
||||||
|
// 代码逻辑说明: 【issues/8791】js增强popup弹框的onlChange()没生效
|
||||||
|
if (eventKey == 'onPopUpChange') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const target = e ? e.target : null;
|
const target = e ? e.target : null;
|
||||||
// update-begin--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
// 代码逻辑说明: 【QQYUN-6679】input去空格
|
||||||
let value;
|
let value;
|
||||||
if (target) {
|
if (target) {
|
||||||
if (isCheck) {
|
if (isCheck) {
|
||||||
@ -351,22 +340,18 @@
|
|||||||
} else {
|
} else {
|
||||||
value = e;
|
value = e;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
|
||||||
props.setFormModel(field, value);
|
props.setFormModel(field, value);
|
||||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
// 代码逻辑说明: 【TV360X-1511】blur不生效
|
||||||
const findItem = getRules().find((item) => item?.trigger === 'blur');
|
const findItem = getRules().find((item) => item?.trigger === 'blur');
|
||||||
if (!findItem) {
|
if (!findItem) {
|
||||||
// update-begin--author:liaozhiyang---date:20240522---for:【TV360X-341】有值之后必填校验不消失
|
// 代码逻辑说明: 【TV360X-341】有值之后必填校验不消失
|
||||||
props.validateFields([field]).catch((_) => {});
|
props.validateFields([field]).catch((_) => {});
|
||||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-341】有值之后必填校验不消失
|
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
|
||||||
},
|
},
|
||||||
// onBlur: () => {
|
// onBlur: () => {
|
||||||
// props.validateFields([field], { triggerName: 'blur' }).catch((_) => {});
|
// props.validateFields([field], { triggerName: 'blur' }).catch((_) => {});
|
||||||
// },
|
// },
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20230922---for:【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
|
||||||
const Comp = componentMap.get(component) as ReturnType<typeof defineComponent>;
|
const Comp = componentMap.get(component) as ReturnType<typeof defineComponent>;
|
||||||
|
|
||||||
const { autoSetPlaceHolder, size } = props.formProps;
|
const { autoSetPlaceHolder, size } = props.formProps;
|
||||||
@ -380,27 +365,23 @@
|
|||||||
...unref(getComponentsProps),
|
...unref(getComponentsProps),
|
||||||
disabled: unref(getDisable),
|
disabled: unref(getDisable),
|
||||||
};
|
};
|
||||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
// 代码逻辑说明: 【QQYUN-8377】formSchema props支持动态修改
|
||||||
const dynamicPropskey = props.schema.dynamicPropskey;
|
const dynamicPropskey = props.schema.dynamicPropskey;
|
||||||
if (dynamicPropskey) {
|
if (dynamicPropskey) {
|
||||||
propsData[dynamicPropskey] = unref(getDynamicPropsValue);
|
propsData[dynamicPropskey] = unref(getDynamicPropsValue);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
|
||||||
|
|
||||||
// update-begin--author:sunjianlei---date:20240725---for:【TV360X-972】控件禁用时统一占位内容
|
|
||||||
// const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
// const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
||||||
const isCreatePlaceholder = !!autoSetPlaceHolder;
|
const isCreatePlaceholder = !!autoSetPlaceHolder;
|
||||||
// update-end----author:sunjianlei---date:20240725---for:【TV360X-972】控件禁用时统一占位内容
|
|
||||||
|
|
||||||
// RangePicker place是一个数组
|
// RangePicker place是一个数组
|
||||||
if (isCreatePlaceholder && component !== 'RangePicker' && component) {
|
if (isCreatePlaceholder && component !== 'RangePicker' && component) {
|
||||||
//自动设置placeholder
|
//自动设置placeholder
|
||||||
// update-begin--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
// 代码逻辑说明: 【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||||
let label = isFunction(props.schema.label) ? props.schema.label() : props.schema.label;
|
let label = isFunction(props.schema.label) ? props.schema.label() : props.schema.label;
|
||||||
if (localeStore.getLocale === 'en' && !(/^\s/.test(label))) {
|
if (localeStore.getLocale === 'en' && !(/^\s/.test(label))) {
|
||||||
label = ' ' + label;
|
label = ' ' + label;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
|
||||||
propsData.placeholder = unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component) + label;
|
propsData.placeholder = unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component) + label;
|
||||||
}
|
}
|
||||||
propsData.codeField = field;
|
propsData.codeField = field;
|
||||||
@ -432,18 +413,15 @@
|
|||||||
* @updateBy:zyf
|
* @updateBy:zyf
|
||||||
*/
|
*/
|
||||||
function renderLabelHelpMessage() {
|
function renderLabelHelpMessage() {
|
||||||
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
|
||||||
//label宽度支持自定义
|
//label宽度支持自定义
|
||||||
const { label: itemLabel, helpMessage, helpComponentProps, subLabel, labelLength } = props.schema;
|
const { label: itemLabel, helpMessage, helpComponentProps, subLabel, labelLength } = props.schema;
|
||||||
// update-begin--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
// 代码逻辑说明: 【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||||
const label = isFunction(itemLabel) ? itemLabel() : itemLabel;
|
const label = isFunction(itemLabel) ? itemLabel() : itemLabel;
|
||||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
|
||||||
let showLabel: string = label + '';
|
let showLabel: string = label + '';
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【TV360X-98】label展示的文字必须和labelLength配置一致
|
// 代码逻辑说明: 【TV360X-98】label展示的文字必须和labelLength配置一致
|
||||||
if (labelLength) {
|
if (labelLength) {
|
||||||
showLabel = showLabel.substr(0, labelLength);
|
showLabel = showLabel.substr(0, labelLength);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【TV360X-98】label展示的文字必须和labelLength配置一致
|
|
||||||
const titleObj = { title: label };
|
const titleObj = { title: label };
|
||||||
const renderLabel = subLabel ? (
|
const renderLabel = subLabel ? (
|
||||||
<span>
|
<span>
|
||||||
@ -454,7 +432,6 @@
|
|||||||
) : (
|
) : (
|
||||||
label
|
label
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
|
||||||
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
|
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
|
||||||
if (!getHelpMessage || (Array.isArray(getHelpMessage) && getHelpMessage.length === 0)) {
|
if (!getHelpMessage || (Array.isArray(getHelpMessage) && getHelpMessage.length === 0)) {
|
||||||
return renderLabel;
|
return renderLabel;
|
||||||
@ -472,12 +449,11 @@
|
|||||||
const { labelCol, wrapperCol } = unref(itemLabelWidthProp);
|
const { labelCol, wrapperCol } = unref(itemLabelWidthProp);
|
||||||
const { colon } = props.formProps;
|
const { colon } = props.formProps;
|
||||||
|
|
||||||
// update-begin--author:sunjianlei---date:20250613---for:itemProps 属性支持函数形式
|
// 代码逻辑说明: itemProps 属性支持函数形式
|
||||||
let getItemProps = itemProps;
|
let getItemProps = itemProps;
|
||||||
if (typeof getItemProps === 'function') {
|
if (typeof getItemProps === 'function') {
|
||||||
getItemProps = getItemProps(unref(getValues));
|
getItemProps = getItemProps(unref(getValues));
|
||||||
}
|
}
|
||||||
// update-end--author:sunjianlei---date:20250613---for:itemProps 属性支持函数形式
|
|
||||||
|
|
||||||
if (component === 'Divider') {
|
if (component === 'Divider') {
|
||||||
return (
|
return (
|
||||||
@ -500,9 +476,8 @@
|
|||||||
{...(getItemProps as Recordable)}
|
{...(getItemProps as Recordable)}
|
||||||
label={renderLabelHelpMessage()}
|
label={renderLabelHelpMessage()}
|
||||||
rules={handleRules()}
|
rules={handleRules()}
|
||||||
// update-begin--author:liaozhiyang---date:20240514---for:【issues/1244】标识了必填,但是必填标识没显示
|
// 代码逻辑说明: 【issues/1244】标识了必填,但是必填标识没显示
|
||||||
validateFirst = { true }
|
validateFirst = { true }
|
||||||
// update-end--author:liaozhiyang---date:20240514---for:【issues/1244】标识了必填,但是必填标识没显示
|
|
||||||
labelCol={labelCol}
|
labelCol={labelCol}
|
||||||
wrapperCol={wrapperCol}
|
wrapperCol={wrapperCol}
|
||||||
>
|
>
|
||||||
@ -525,14 +500,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { baseColProps = {} } = props.formProps;
|
const { baseColProps = {} } = props.formProps;
|
||||||
// update-begin--author:liaozhiyang---date:20230803---for:【issues-641】调整表格搜索表单的span配置无效
|
// 代码逻辑说明: 【issues-641】调整表格搜索表单的span配置无效
|
||||||
const { getIsMobile } = useAppInject();
|
const { getIsMobile } = useAppInject();
|
||||||
let realColProps;
|
let realColProps;
|
||||||
realColProps = { ...baseColProps, ...colProps };
|
realColProps = { ...baseColProps, ...colProps };
|
||||||
if (colProps['span'] && !unref(getIsMobile)) {
|
if (colProps['span'] && !unref(getIsMobile)) {
|
||||||
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach((name) => delete realColProps[name]);
|
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach((name) => delete realColProps[name]);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20230803---for:【issues-641】调整表格搜索表单的span配置无效
|
|
||||||
const { isIfShow, isShow } = getShow();
|
const { isIfShow, isShow } = getShow();
|
||||||
const values = unref(getValues);
|
const values = unref(getValues);
|
||||||
|
|
||||||
|
|||||||
@ -6,19 +6,17 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
// 代码逻辑说明: 【TV360X-1511】blur不生效
|
||||||
const formItemId = ref(null);
|
const formItemId = ref(null);
|
||||||
const props = defineProps(['formName', 'fieldName', 'source']);
|
const props = defineProps(['formName', 'fieldName', 'source']);
|
||||||
if (props.formName && props.fieldName && props.source !== 'table-query') {
|
if (props.formName && props.fieldName && props.source !== 'table-query') {
|
||||||
formItemId.value = `${props.formName}_${props.fieldName}`;
|
formItemId.value = `${props.formName}_${props.fieldName}`;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240617---for:【TV360X-1253】代码生成查询区域和新增组件没撑满
|
// 代码逻辑说明: 【TV360X-1253】代码生成查询区域和新增组件没撑满
|
||||||
div > :deep(.ant-picker) {
|
div > :deep(.ant-picker) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240617---for:【TV360X-1253】代码生成查询区域和新增组件没撑满
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
// update-begin--author:liaozhiyang---date:20240719---for:【TV360X-1090】表单label超长省略显示
|
// 代码逻辑说明: 【TV360X-1090】表单label超长省略显示
|
||||||
.jeecg-and-modal-form {
|
.jeecg-and-modal-form {
|
||||||
:deep(.ant-form-item-label) {
|
:deep(.ant-form-item-label) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -195,7 +195,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// end antdv 禁用样式
|
// end antdv 禁用样式
|
||||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-857】online代码生成详情样式调整
|
// 代码逻辑说明: 【TV360X-857】online代码生成详情样式调整
|
||||||
.jeecg-form-container-disabled :deep(.ant-upload-select) {
|
.jeecg-form-container-disabled :deep(.ant-upload-select) {
|
||||||
cursor: grabbing;
|
cursor: grabbing;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,12 +36,10 @@ function genType() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function setComponentRuleType(rule: ValidationRule, component: ComponentType, valueFormat: string) {
|
export function setComponentRuleType(rule: ValidationRule, component: ComponentType, valueFormat: string) {
|
||||||
//update-begin---author:wangshuai---date:2024-02-01---for:【QQYUN-8176】编辑表单中,校验必填时,如果组件是ApiSelect,打开编辑页面时,即使该字段有值,也会提示请选择---
|
|
||||||
//https://github.com/vbenjs/vue-vben-admin/pull/3082 github修复原文
|
//https://github.com/vbenjs/vue-vben-admin/pull/3082 github修复原文
|
||||||
if (Reflect.has(rule, 'type')) {
|
if (Reflect.has(rule, 'type')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2024-02-01---for:【QQYUN-8176】编辑表单中,校验必填时,如果组件是ApiSelect,打开编辑页面时,即使该字段有值,也会提示请选择---
|
|
||||||
if (['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'].includes(component)) {
|
if (['DatePicker', 'MonthPicker', 'WeekPicker', 'TimePicker'].includes(component)) {
|
||||||
rule.type = valueFormat ? 'string' : 'object';
|
rule.type = valueFormat ? 'string' : 'object';
|
||||||
} else if (['RangePicker', 'Upload', 'CheckboxGroup', 'TimePicker'].includes(component)) {
|
} else if (['RangePicker', 'Upload', 'CheckboxGroup', 'TimePicker'].includes(component)) {
|
||||||
@ -74,11 +72,10 @@ export function handleInputNumberValue(component?: ComponentType, val?: any) {
|
|||||||
*/
|
*/
|
||||||
export function handleInputStringValue(component?: ComponentType, val?: any) {
|
export function handleInputStringValue(component?: ComponentType, val?: any) {
|
||||||
if (!component) return val;
|
if (!component) return val;
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【TV360X-13】InputNumber设置精确3位小数传入''变成了0.00
|
// 代码逻辑说明: 【TV360X-13】InputNumber设置精确3位小数传入''变成了0.00
|
||||||
if (['InputNumber'].includes(component) && typeof val === 'string' && val != '') {
|
if (['InputNumber'].includes(component) && typeof val === 'string' && val != '') {
|
||||||
return Number(val);
|
return Number(val);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【TV360X-13】InputNumber设置精确3位小数传入''变成了0.00
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -77,29 +77,25 @@ export default function ({ advanceState, emit, getProps, getSchema, formModel, d
|
|||||||
|
|
||||||
if (isLastAction) {
|
if (isLastAction) {
|
||||||
advanceState.hideAdvanceBtn = unref(getSchema).length <= autoAdvancedCol;
|
advanceState.hideAdvanceBtn = unref(getSchema).length <= autoAdvancedCol;
|
||||||
// update-begin--author:sunjianlei---date:20211108---for: 注释掉该逻辑,使小于等于2行时,也显示展开收起按钮
|
// 代码逻辑说明: 注释掉该逻辑,使小于等于2行时,也显示展开收起按钮
|
||||||
/* if (itemColSum <= BASIC_COL_LEN * 2) {
|
/* if (itemColSum <= BASIC_COL_LEN * 2) {
|
||||||
// 小于等于2行时,不显示折叠和展开按钮
|
// 小于等于2行时,不显示折叠和展开按钮
|
||||||
advanceState.hideAdvanceBtn = true;
|
advanceState.hideAdvanceBtn = true;
|
||||||
advanceState.isAdvanced = true;
|
advanceState.isAdvanced = true;
|
||||||
} else */
|
} else */
|
||||||
// update-end--author:sunjianlei---date:20211108---for: 注释掉该逻辑,使小于等于2行时,也显示展开收起按钮
|
|
||||||
// update-begin--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
|
||||||
/*if (itemColSum > BASIC_COL_LEN * 2 && itemColSum <= BASIC_COL_LEN * (unref(getProps).autoAdvancedLine || 3)) {
|
/*if (itemColSum > BASIC_COL_LEN * 2 && itemColSum <= BASIC_COL_LEN * (unref(getProps).autoAdvancedLine || 3)) {
|
||||||
advanceState.hideAdvanceBtn = false;
|
advanceState.hideAdvanceBtn = false;
|
||||||
|
|
||||||
// 默认超过 3 行折叠
|
// 默认超过 3 行折叠
|
||||||
} else*/
|
} else*/
|
||||||
// update-end--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
|
||||||
if (!advanceState.isLoad) {
|
if (!advanceState.isLoad) {
|
||||||
advanceState.isLoad = true;
|
advanceState.isLoad = true;
|
||||||
advanceState.isAdvanced = !advanceState.isAdvanced;
|
advanceState.isAdvanced = !advanceState.isAdvanced;
|
||||||
// update-begin--author:sunjianlei---date:20211108---for: 如果总列数大于 autoAdvancedCol,就默认折叠
|
// 代码逻辑说明: 如果总列数大于 autoAdvancedCol,就默认折叠
|
||||||
if (unref(getSchema).length > autoAdvancedCol) {
|
if (unref(getSchema).length > autoAdvancedCol) {
|
||||||
advanceState.hideAdvanceBtn = false;
|
advanceState.hideAdvanceBtn = false;
|
||||||
advanceState.isAdvanced = false;
|
advanceState.isAdvanced = false;
|
||||||
}
|
}
|
||||||
// update-end--author:sunjianlei---date:20211108---for: 如果总列数大于 autoAdvancedCol,就默认折叠
|
|
||||||
}
|
}
|
||||||
return { isAdvanced: advanceState.isAdvanced, itemColSum };
|
return { isAdvanced: advanceState.isAdvanced, itemColSum };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,22 +92,20 @@ export function useForm(props?: Props): UseFormReturnType {
|
|||||||
|
|
||||||
// TODO promisify
|
// TODO promisify
|
||||||
getFieldsValue: <T>() => {
|
getFieldsValue: <T>() => {
|
||||||
//update-begin-author:taoyan date:2022-7-5 for: VUEN-1341【流程】编码方式 流程节点编辑表单时,填写数据报错 包括用户组件、部门组件、省市区
|
// 代码逻辑说明: VUEN-1341【流程】编码方式 流程节点编辑表单时,填写数据报错 包括用户组件、部门组件、省市区
|
||||||
let values = unref(formRef)?.getFieldsValue() as T;
|
let values = unref(formRef)?.getFieldsValue() as T;
|
||||||
if(values){
|
if(values){
|
||||||
Object.keys(values).map(key=>{
|
Object.keys(values).map(key=>{
|
||||||
if (values[key] instanceof Array) {
|
if (values[key] instanceof Array) {
|
||||||
// update-begin-author:sunjianlei date:20221205 for: 【issues/4330】判断如果是对象数组,则不拼接
|
// 代码逻辑说明: 【issues/4330】判断如果是对象数组,则不拼接
|
||||||
let isObject = typeof (values[key][0] || '') === 'object';
|
let isObject = typeof (values[key][0] || '') === 'object';
|
||||||
if (!isObject) {
|
if (!isObject) {
|
||||||
values[key] = values[key].join(',');
|
values[key] = values[key].join(',');
|
||||||
}
|
}
|
||||||
// update-end-author:sunjianlei date:20221205 for: 【issues/4330】判断如果是对象数组,则不拼接
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
//update-end-author:taoyan date:2022-7-5 for: VUEN-1341【流程】编码方式 流程节点编辑表单时,填写数据报错 包括用户组件、部门组件、省市区
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setFieldsValue: async <T>(values: T) => {
|
setFieldsValue: async <T>(values: T) => {
|
||||||
|
|||||||
@ -65,9 +65,8 @@ export function useFormEvents({
|
|||||||
const hasKey = Reflect.has(values, key);
|
const hasKey = Reflect.has(values, key);
|
||||||
|
|
||||||
value = handleInputNumberValue(schema?.component, value);
|
value = handleInputNumberValue(schema?.component, value);
|
||||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7535】popup回填字段inputNumber组件验证错误
|
// 代码逻辑说明: 【QQYUN-7535】popup回填字段inputNumber组件验证错误
|
||||||
value = handleInputStringValue(schema?.component, value);
|
value = handleInputStringValue(schema?.component, value);
|
||||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7535】popup回填字段inputNumber组件验证错误
|
|
||||||
// 0| '' is allow
|
// 0| '' is allow
|
||||||
if (hasKey && fields.includes(key)) {
|
if (hasKey && fields.includes(key)) {
|
||||||
// time type
|
// time type
|
||||||
@ -257,8 +256,7 @@ export function useFormEvents({
|
|||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
try {
|
try {
|
||||||
const values = await validate();
|
const values = await validate();
|
||||||
//update-begin---author:zhangdaihao Date:20140212 for:[bug号]树机构调整------------
|
//代码逻辑说明: 对查询表单提交的数组处理成字符串------
|
||||||
//--updateBy-begin----author:zyf---date:20211206------for:对查询表单提交的数组处理成字符串------
|
|
||||||
for (let key in values) {
|
for (let key in values) {
|
||||||
if (values[key] instanceof Array) {
|
if (values[key] instanceof Array) {
|
||||||
let valueType = getValueType(getProps, key);
|
let valueType = getValueType(getProps, key);
|
||||||
@ -267,15 +265,13 @@ export function useFormEvents({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//--updateBy-end----author:zyf---date:20211206------for:对查询表单提交的数组处理成字符串------
|
|
||||||
const res = handleFormValues(values);
|
const res = handleFormValues(values);
|
||||||
emit('submit', res);
|
emit('submit', res);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//update-begin-author:taoyan date:2022-11-4 for: 列表查询表单会触发校验错误导致重置失败,原因不明
|
// 代码逻辑说明: 列表查询表单会触发校验错误导致重置失败,原因不明
|
||||||
emit('submit', {});
|
emit('submit', {});
|
||||||
console.error('query form validate error, please ignore!', error)
|
console.error('query form validate error, please ignore!', error)
|
||||||
//throw new Error(error);
|
//throw new Error(error);
|
||||||
//update-end-author:taoyan date:2022-11-4 for: 列表查询表单会触发校验错误导致重置失败,原因不明
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,11 +12,10 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
|
|||||||
|
|
||||||
const { labelWidth: globalLabelWidth, labelCol: globalLabelCol, wrapperCol: globWrapperCol,layout } = unref(propsRef);
|
const { labelWidth: globalLabelWidth, labelCol: globalLabelCol, wrapperCol: globWrapperCol,layout } = unref(propsRef);
|
||||||
|
|
||||||
// update-begin--author:sunjianlei---date:20211104---for: 禁用全局 labelWidth,不自动设置 textAlign --------
|
// 代码逻辑说明: 禁用全局 labelWidth,不自动设置 textAlign --------
|
||||||
if (disabledLabelWidth) {
|
if (disabledLabelWidth) {
|
||||||
return { labelCol, wrapperCol };
|
return { labelCol, wrapperCol };
|
||||||
}
|
}
|
||||||
// update-begin--author:sunjianlei---date:20211104---for: 禁用全局 labelWidth,不自动设置 textAlign --------
|
|
||||||
|
|
||||||
// If labelWidth is set globally, all items setting
|
// If labelWidth is set globally, all items setting
|
||||||
if (!globalLabelWidth && !labelWidth && !globalLabelCol) {
|
if (!globalLabelWidth && !labelWidth && !globalLabelCol) {
|
||||||
@ -31,9 +30,8 @@ export function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsRef: Ref<
|
|||||||
|
|
||||||
if (width) {
|
if (width) {
|
||||||
width = isNumber(width) ? `${width}px` : width;
|
width = isNumber(width) ? `${width}px` : width;
|
||||||
// update-begin--author:liaozhiyang---date:20240717---for:【issues/6865】配置单个的labelWidth不生效
|
// 代码逻辑说明: 【issues/6865】配置单个的labelWidth不生效
|
||||||
col = {};
|
col = {};
|
||||||
// update-end--author:liaozhiyang---date:20240717---for:【issues/6865】配置单个的labelWidth不生效
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -31,10 +31,8 @@
|
|||||||
name: 'JAddInput',
|
name: 'JAddInput',
|
||||||
props: {
|
props: {
|
||||||
value: propTypes.string.def(''),
|
value: propTypes.string.def(''),
|
||||||
//update-begin---author:wangshuai ---date:20220516 for:[VUEN-1043]系统编码规则,最后一个输入框不能删除------------
|
|
||||||
//自定义删除按钮多少才会显示
|
//自定义删除按钮多少才会显示
|
||||||
min: propTypes.integer.def(1),
|
min: propTypes.integer.def(1),
|
||||||
//update-end---author:wangshuai ---date:20220516 for:[VUEN-1043]系统编码规则,最后一个输入框不能删除--------------
|
|
||||||
},
|
},
|
||||||
emits: ['change', 'update:value'],
|
emits: ['change', 'update:value'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
|
|||||||
@ -49,13 +49,12 @@
|
|||||||
* 监听value变化
|
* 监听value变化
|
||||||
*/
|
*/
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// update-begin--author:liaozhiyang---date:20240612--for:【TV360X-1223】省市区换新组件
|
// 代码逻辑说明: 【TV360X-1223】省市区换新组件
|
||||||
if (props.value) {
|
if (props.value) {
|
||||||
initValue();
|
initValue();
|
||||||
} else {
|
} else {
|
||||||
cascaderValue.value = [];
|
cascaderValue.value = [];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240612---for:【TV360X-1223】省市区换新组件
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,7 +62,7 @@
|
|||||||
*/
|
*/
|
||||||
function initValue() {
|
function initValue() {
|
||||||
let value = props.value ? props.value : [];
|
let value = props.value ? props.value : [];
|
||||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
// 代码逻辑说明: 【TV360X-501】省市区换新组件
|
||||||
if (value && typeof value === 'string' && value != 'null' && value != 'undefined') {
|
if (value && typeof value === 'string' && value != 'null' && value != 'undefined') {
|
||||||
const arr = value.split(',');
|
const arr = value.split(',');
|
||||||
cascaderValue.value = transform(arr);
|
cascaderValue.value = transform(arr);
|
||||||
@ -74,7 +73,6 @@
|
|||||||
cascaderValue.value = [];
|
cascaderValue.value = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
|
||||||
}
|
}
|
||||||
function transform(arr) {
|
function transform(arr) {
|
||||||
let result: any = [];
|
let result: any = [];
|
||||||
@ -112,7 +110,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
function handleChange(arr, ...args) {
|
function handleChange(arr, ...args) {
|
||||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
// 代码逻辑说明: 【TV360X-501】省市区换新组件
|
||||||
if (arr?.length) {
|
if (arr?.length) {
|
||||||
let result: any = [];
|
let result: any = [];
|
||||||
if (props.saveCode === 'region') {
|
if (props.saveCode === 'region') {
|
||||||
@ -129,12 +127,9 @@
|
|||||||
} else {
|
} else {
|
||||||
send(arr);
|
send(arr);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
|
||||||
// emitData.value = args;
|
// emitData.value = args;
|
||||||
//update-begin-author:taoyan date:2022-6-27 for: VUEN-1424【vue3】树表、单表、jvxe、erp 、内嵌子表省市县 选择不上
|
|
||||||
// 上面改的v-model:value导致选中数据没有显示
|
// 上面改的v-model:value导致选中数据没有显示
|
||||||
// state.value = result;
|
// state.value = result;
|
||||||
//update-end-author:taoyan date:2022-6-27 for: VUEN-1424【vue3】树表、单表、jvxe、erp 、内嵌子表省市县 选择不上
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -85,9 +85,8 @@
|
|||||||
() => {
|
() => {
|
||||||
loadItemByCode();
|
loadItemByCode();
|
||||||
},
|
},
|
||||||
//update-begin---author:wangshuai---date:2024-06-17---for:【TV360X-480】封装表单和原生表单,默认值生成有问题的字段:分类字典树附默认值不生效---
|
// 代码逻辑说明: 【TV360X-480】封装表单和原生表单,默认值生成有问题的字段:分类字典树附默认值不生效---
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
//update-end---author:wangshuai---date:2024-06-17---for:【TV360X-480】封装表单和原生表单,默认值生成有问题的字段:分类字典树附默认值不生效---
|
|
||||||
);
|
);
|
||||||
watch(
|
watch(
|
||||||
() => props.pcode,
|
() => props.pcode,
|
||||||
@ -222,11 +221,10 @@
|
|||||||
backValue(value.value, value.label);
|
backValue(value.value, value.label);
|
||||||
treeValue.value = value;
|
treeValue.value = value;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
// 代码逻辑说明: 【QQYUN-9110】组件有值校验没消失
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
formItemContext?.onFieldChange();
|
formItemContext?.onFieldChange();
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrTreeData() {
|
function getCurrTreeData() {
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
* 监听value
|
* 监听value
|
||||||
*/
|
*/
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
//update-begin-author:taoyan date:2022-7-4 for:issues/I5E7YX AUTO在线表单进入功能测试之后一直卡在功能测试界面
|
// 代码逻辑说明: issues/I5E7YX AUTO在线表单进入功能测试之后一直卡在功能测试界面
|
||||||
let temp = props.value;
|
let temp = props.value;
|
||||||
if(!temp && temp!==0){
|
if(!temp && temp!==0){
|
||||||
checkboxArray.value = []
|
checkboxArray.value = []
|
||||||
@ -42,12 +42,10 @@
|
|||||||
temp = temp + '';
|
temp = temp + '';
|
||||||
checkboxArray.value = temp.split(',')
|
checkboxArray.value = temp.split(',')
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-7-4 for:issues/I5E7YX AUTO在线表单进入功能测试之后一直卡在功能测试界面
|
// 代码逻辑说明: 调用表单的 resetFields不会清空当前信息,界面显示上一次的数据
|
||||||
//update-begin-author:taoyan date:20220401 for: 调用表单的 resetFields不会清空当前信息,界面显示上一次的数据
|
|
||||||
if (props.value === '' || props.value === undefined) {
|
if (props.value === '' || props.value === undefined) {
|
||||||
checkboxArray.value = [];
|
checkboxArray.value = [];
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:20220401 for: 调用表单的 resetFields不会清空当前信息,界面显示上一次的数据
|
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* 监听字典code
|
* 监听字典code
|
||||||
@ -73,13 +71,12 @@
|
|||||||
|
|
||||||
// 根据字典code查询字典项
|
// 根据字典code查询字典项
|
||||||
function loadDictOptions() {
|
function loadDictOptions() {
|
||||||
//update-begin-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
// 代码逻辑说明: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||||
let temp = props.dictCode || '';
|
let temp = props.dictCode || '';
|
||||||
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
||||||
// 编码后 是不包含空格的
|
// 编码后 是不包含空格的
|
||||||
temp = encodeURI(temp);
|
temp = encodeURI(temp);
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
|
||||||
getDictItems(temp).then((res) => {
|
getDictItems(temp).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
checkOptions.value = res.map((item) => ({value: item.value, label: item.text, color: item.color}));
|
checkOptions.value = res.map((item) => ({value: item.value, label: item.text, color: item.color}));
|
||||||
@ -113,7 +110,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
// 代码逻辑说明: 【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
||||||
.colorText {
|
.colorText {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
@ -124,5 +121,4 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -90,9 +90,8 @@
|
|||||||
// 缩进格式
|
// 缩进格式
|
||||||
tabSize: 2,
|
tabSize: 2,
|
||||||
// 主题,对应主题库 JS 需要提前引入
|
// 主题,对应主题库 JS 需要提前引入
|
||||||
// update-begin--author:liaozhiyang---date:20240327---for:【QQYUN-8639】暗黑主题适配
|
// 代码逻辑说明: 【QQYUN-8639】暗黑主题适配
|
||||||
theme: getDarkMode.value == ThemeEnum.DARK ? 'monokai' : props.theme,
|
theme: getDarkMode.value == ThemeEnum.DARK ? 'monokai' : props.theme,
|
||||||
// update-end--author:liaozhiyang---date:20240327---for:【QQYUN-8639】暗黑主题适配
|
|
||||||
smartIndent: true, // 是否智能缩进
|
smartIndent: true, // 是否智能缩进
|
||||||
// 显示行号
|
// 显示行号
|
||||||
lineNumbers: true,
|
lineNumbers: true,
|
||||||
@ -104,12 +103,10 @@
|
|||||||
// 启用代码折叠相关功能:结束
|
// 启用代码折叠相关功能:结束
|
||||||
// 光标行高亮
|
// 光标行高亮
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
// update-begin--author:liaozhiyang---date:20231201---for:【issues/869】JCodeEditor组件初始化时没有设置mode
|
// 代码逻辑说明: 【issues/869】JCodeEditor组件初始化时没有设置mode
|
||||||
mode: props.language,
|
mode: props.language,
|
||||||
// update-begin--author:liaozhiyang---date:20231201---for:【issues/869】JCodeEditor组件初始化时没有设置mode
|
// 代码逻辑说明: 【TV360X-898】代码生成之后的预览改成只读
|
||||||
// update-begin--author:liaozhiyang---date:20240603---for:【TV360X-898】代码生成之后的预览改成只读
|
|
||||||
readOnly: props.disabled,
|
readOnly: props.disabled,
|
||||||
// update-end--author:liaozhiyang---date:20240603---for:【TV360X-898】代码生成之后的预览改成只读
|
|
||||||
// 匹配括号
|
// 匹配括号
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
extraKeys: {
|
extraKeys: {
|
||||||
@ -145,10 +142,9 @@
|
|||||||
}
|
}
|
||||||
return _props;
|
return _props;
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20230904---for:【QQYUN-5955】online js增强,加入代码提示
|
// 代码逻辑说明: 【QQYUN-5955】online js增强,加入代码提示
|
||||||
const { codeHintingMount, codeHintingRegistry } = useCodeHinting(CodeMirror, props.keywords, props.language);
|
const { codeHintingMount, codeHintingRegistry } = useCodeHinting(CodeMirror, props.keywords, props.language);
|
||||||
codeHintingRegistry();
|
codeHintingRegistry();
|
||||||
// update-end--author:liaozhiyang---date:20230904---for:【QQYUN-5955】online js增强,加入代码提示
|
|
||||||
/**
|
/**
|
||||||
* 监听组件值
|
* 监听组件值
|
||||||
*/
|
*/
|
||||||
@ -162,11 +158,10 @@
|
|||||||
);
|
);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initialize();
|
initialize();
|
||||||
// update-begin--author:liaozhiyang---date:20240318---for:【QQYUN-8473】代码编辑器首次加载会有遮挡
|
// 代码逻辑说明: 【QQYUN-8473】代码编辑器首次加载会有遮挡
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
refresh();
|
refresh();
|
||||||
}, 150);
|
}, 150);
|
||||||
// update-end--author:liaozhiyang---date:20240318---for:【QQYUN-8473】代码编辑器首次加载会有遮挡
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -181,7 +176,7 @@
|
|||||||
coder?.setValue(value ?? '');
|
coder?.setValue(value ?? '');
|
||||||
innerValue = value;
|
innerValue = value;
|
||||||
trigger && emitChange(innerValue);
|
trigger && emitChange(innerValue);
|
||||||
// update-begin--author:liaozhiyang---date:20240510---for:【QQYUN-9231】代码编辑器有遮挡
|
// 代码逻辑说明: 【QQYUN-9231】代码编辑器有遮挡
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
refresh();
|
refresh();
|
||||||
// 再次刷下防止小概率下遮挡问题
|
// 再次刷下防止小概率下遮挡问题
|
||||||
@ -189,7 +184,6 @@
|
|||||||
refresh();
|
refresh();
|
||||||
}, 600);
|
}, 600);
|
||||||
}, 400);
|
}, 400);
|
||||||
// update-end--author:liaozhiyang---date:20240510---for:【QQYUN-9231】代码编辑器有遮挡
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//编辑器值修改事件
|
//编辑器值修改事件
|
||||||
@ -213,9 +207,8 @@
|
|||||||
coder.on('change', onChange);
|
coder.on('change', onChange);
|
||||||
// 初始化成功时赋值一次
|
// 初始化成功时赋值一次
|
||||||
setValue(innerValue, false);
|
setValue(innerValue, false);
|
||||||
// update-begin--author:liaozhiyang---date:20230904---for:【QQYUN-5955】online js增强,加入代码提示
|
// 代码逻辑说明: 【QQYUN-5955】online js增强,加入代码提示
|
||||||
codeHintingMount(coder);
|
codeHintingMount(coder);
|
||||||
// update-end--author:liaozhiyang---date:20230904---for:【QQYUN-5955】online js增强,加入代码提示
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换全屏状态
|
// 切换全屏状态
|
||||||
@ -223,7 +216,7 @@
|
|||||||
isFullScreen.value = !isFullScreen.value;
|
isFullScreen.value = !isFullScreen.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-5-9 for: codeEditor禁用功能
|
// 代码逻辑说明: codeEditor禁用功能
|
||||||
watch(
|
watch(
|
||||||
() => props.disabled,
|
() => props.disabled,
|
||||||
(val) => {
|
(val) => {
|
||||||
@ -232,7 +225,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:2022-5-9 for: codeEditor禁用功能
|
|
||||||
|
|
||||||
// 支持动态设置语言
|
// 支持动态设置语言
|
||||||
watch(()=>props.language, (val)=>{
|
watch(()=>props.language, (val)=>{
|
||||||
@ -243,13 +235,12 @@
|
|||||||
|
|
||||||
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-10-18 for: VUEN-2480【严重bug】online vue3测试的问题 8、online js增强样式问题
|
// 代码逻辑说明: VUEN-2480【严重bug】online vue3测试的问题 8、online js增强样式问题
|
||||||
function refresh(){
|
function refresh(){
|
||||||
if(coder){
|
if(coder){
|
||||||
coder.refresh();
|
coder.refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-10-18 for: VUEN-2480【严重bug】online vue3测试的问题 8、online js增强样式问题
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024-04-01
|
* 2024-04-01
|
||||||
@ -370,7 +361,7 @@
|
|||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240327---for:【QQYUN-8639】暗黑主题适配
|
// 代码逻辑说明: 【QQYUN-8639】暗黑主题适配
|
||||||
html[data-theme='dark'] {
|
html[data-theme='dark'] {
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
.CodeMirror {
|
.CodeMirror {
|
||||||
@ -378,5 +369,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240327---for:【QQYUN-8639】暗黑主题适配
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -0,0 +1,222 @@
|
|||||||
|
<!-- 多选日期 -->
|
||||||
|
<template>
|
||||||
|
<div class="j-date-multiple" ref="wrapperRef">
|
||||||
|
<!-- 显示选中项:使用 ASelect 多选标签模式,禁止自身下拉,仅作展示与清空/删除入口 -->
|
||||||
|
<a-select
|
||||||
|
:value="displayValues"
|
||||||
|
mode="multiple"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:disabled="disabled"
|
||||||
|
allowClear
|
||||||
|
:open="false"
|
||||||
|
:getPopupContainer="getParentContainer"
|
||||||
|
v-bind="attrs"
|
||||||
|
@change="onSelectChange"
|
||||||
|
@click="openPanel"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 隐形触发器,仅用于承载弹出层与月份切换,面板受控打开 -->
|
||||||
|
<a-date-picker
|
||||||
|
ref="pickerRef"
|
||||||
|
:value="void 0"
|
||||||
|
:open="open"
|
||||||
|
:getPopupContainer="getParentContainer"
|
||||||
|
:inputReadOnly="true"
|
||||||
|
:allowClear="false"
|
||||||
|
:disabledDate="disabledDate"
|
||||||
|
:format="format"
|
||||||
|
:showToday="false"
|
||||||
|
@openChange="onOpenChange"
|
||||||
|
class="hidden-picker"
|
||||||
|
popupClassName="j-date-multiple-popup"
|
||||||
|
>
|
||||||
|
<template #dateRender="{ current }">
|
||||||
|
<div
|
||||||
|
class="ant-picker-cell-inner jdm-cell"
|
||||||
|
:class="{ 'is-selected': isSelected(current) }"
|
||||||
|
@click.stop.prevent="onCellClick(current)"
|
||||||
|
>
|
||||||
|
{{ current.date() }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-date-picker>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {computed, nextTick, onMounted, ref, watch} from 'vue';
|
||||||
|
import dayjs, {Dayjs} from 'dayjs';
|
||||||
|
import {propTypes} from '/@/utils/propTypes';
|
||||||
|
import {useAttrs} from '/@/hooks/core/useAttrs';
|
||||||
|
import {useRuleFormItem} from '/@/hooks/component/useFormItem';
|
||||||
|
import {setPopContainer} from '/@/utils';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
value: propTypes.string.def(''), // 多个日期用分隔符拼接
|
||||||
|
placeholder: propTypes.string.def('请选择日期'),
|
||||||
|
separator: propTypes.string.def(','),
|
||||||
|
format: propTypes.string.def('YYYY-MM-DD'), // 展示格式
|
||||||
|
valueFormat: propTypes.string.def('YYYY-MM-DD'), // 存储格式
|
||||||
|
disabled: propTypes.bool.def(false),
|
||||||
|
popContainer: propTypes.string.def(''),
|
||||||
|
// 透传给 DatePicker 的禁用规则
|
||||||
|
disabledDate: {
|
||||||
|
type: Function as unknown as () => (current: Dayjs) => boolean,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['change', 'update:value']);
|
||||||
|
|
||||||
|
// attrs 透传到 ASelect 以复用大小/样式等
|
||||||
|
const attrs = useAttrs();
|
||||||
|
|
||||||
|
// 与表单校验联动
|
||||||
|
const emitData = ref<any[]>([]);
|
||||||
|
const [, , , formItemContext] = useRuleFormItem(props as any, 'value', 'change', emitData);
|
||||||
|
|
||||||
|
const wrapperRef = ref<HTMLElement | null>(null);
|
||||||
|
const pickerRef = ref();
|
||||||
|
const open = ref(false);
|
||||||
|
|
||||||
|
// 内部选中列表(存储格式字符串数组)
|
||||||
|
const selectedValueStrings = ref<string[]>([]);
|
||||||
|
|
||||||
|
// 从外部 value 初始化/同步内部选中
|
||||||
|
watch(
|
||||||
|
() => props.value,
|
||||||
|
(val) => {
|
||||||
|
if (!val) {
|
||||||
|
selectedValueStrings.value = [];
|
||||||
|
} else {
|
||||||
|
const arr = String(val)
|
||||||
|
.split(props.separator)
|
||||||
|
.map((s) => s && s.trim())
|
||||||
|
.filter((s) => !!s) as string[];
|
||||||
|
// 去重
|
||||||
|
const set = new Set(arr);
|
||||||
|
selectedValueStrings.value = Array.from(set);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{immediate: true}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 展示值(格式化为 format)
|
||||||
|
const displayValues = computed<string[]>(() => {
|
||||||
|
return selectedValueStrings.value.map((sv) => {
|
||||||
|
const d = dayjs(sv, props.valueFormat);
|
||||||
|
if (d.isValid()) {
|
||||||
|
return d.format(props.format);
|
||||||
|
} else {
|
||||||
|
return sv;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// 选择器容器:优先 popContainer,其次使用本组件包裹元素
|
||||||
|
function getParentContainer(node: HTMLElement) {
|
||||||
|
if (!props.popContainer) {
|
||||||
|
return wrapperRef.value ?? node?.parentNode;
|
||||||
|
} else {
|
||||||
|
return setPopContainer(node, props.popContainer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openPanel() {
|
||||||
|
if (props.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
open.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onOpenChange(val: boolean) {
|
||||||
|
// 仅在外部点击时关闭;日期点击由我们拦截,不会触发默认关闭
|
||||||
|
open.value = val;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isSelected(current: Dayjs) {
|
||||||
|
const key = current.format(props.valueFormat);
|
||||||
|
return selectedValueStrings.value.includes(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCellClick(current: Dayjs) {
|
||||||
|
if (props.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (props.disabledDate && props.disabledDate(current)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const key = current.format(props.valueFormat);
|
||||||
|
const idx = selectedValueStrings.value.indexOf(key);
|
||||||
|
if (idx >= 0) {
|
||||||
|
selectedValueStrings.value.splice(idx, 1);
|
||||||
|
} else {
|
||||||
|
selectedValueStrings.value.push(key);
|
||||||
|
}
|
||||||
|
triggerChange();
|
||||||
|
// 保持面板开启
|
||||||
|
nextTick(() => {
|
||||||
|
open.value = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSelectChange(nextDisplayValues: string[]) {
|
||||||
|
// 从展示值还原为存储格式
|
||||||
|
const nextStoreValues: string[] = [];
|
||||||
|
for (const dv of nextDisplayValues) {
|
||||||
|
const d = dayjs(dv, props.format);
|
||||||
|
if (d.isValid()) {
|
||||||
|
nextStoreValues.push(d.format(props.valueFormat));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 去重
|
||||||
|
const set = new Set(nextStoreValues);
|
||||||
|
selectedValueStrings.value = Array.from(set);
|
||||||
|
triggerChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerChange() {
|
||||||
|
const joined = selectedValueStrings.value.join(props.separator);
|
||||||
|
emit('change', joined);
|
||||||
|
emit('update:value', joined);
|
||||||
|
nextTick(() => {
|
||||||
|
if (formItemContext && formItemContext.onFieldChange) {
|
||||||
|
formItemContext.onFieldChange();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// nothing now
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.j-date-multiple {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.hidden-picker {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 32px;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.j-date-multiple-popup.ant-picker-dropdown {
|
||||||
|
.ant-picker-cell {
|
||||||
|
.ant-picker-cell-inner.jdm-cell {
|
||||||
|
&.is-selected {
|
||||||
|
color: #fff !important;
|
||||||
|
// noinspection LessUnresolvedVariable
|
||||||
|
background-color: @primary-color !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -125,7 +125,6 @@
|
|||||||
//update-end-author:taoyan date: 如果没有提供dictCode 可以走options的配置--
|
//update-end-author:taoyan date: 如果没有提供dictCode 可以走options的配置--
|
||||||
});
|
});
|
||||||
|
|
||||||
//update-begin-author:taoyan date:20220404 for: 使用useRuleFormItem定义的value,会有一个问题,如果不是操作设置的值而是代码设置的控件值而不能触发change事件
|
|
||||||
// 此处添加空值的change事件,即当组件调用地代码设置value为''也能触发change事件
|
// 此处添加空值的change事件,即当组件调用地代码设置value为''也能触发change事件
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
@ -136,7 +135,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:20220404 for: 使用useRuleFormItem定义的value,会有一个问题,如果不是操作设置的值而是代码设置的控件值而不能触发change事件
|
|
||||||
|
|
||||||
async function initDictData() {
|
async function initDictData() {
|
||||||
let { dictCode, stringToNumber } = props;
|
let { dictCode, stringToNumber } = props;
|
||||||
@ -161,7 +159,6 @@
|
|||||||
let changeValue:any;
|
let changeValue:any;
|
||||||
// 兼容多选模式
|
// 兼容多选模式
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
|
||||||
//采用一个值,不然的话state值变换触发多个change
|
//采用一个值,不然的话state值变换触发多个change
|
||||||
if (mode === 'multiple') {
|
if (mode === 'multiple') {
|
||||||
changeValue = e?.target?.value ?? e;
|
changeValue = e?.target?.value ?? e;
|
||||||
@ -177,10 +174,8 @@
|
|||||||
}
|
}
|
||||||
state.value = changeValue;
|
state.value = changeValue;
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array------------
|
// 代码逻辑说明: 【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array------------
|
||||||
emit('update:value',changeValue)
|
emit('update:value',changeValue)
|
||||||
//update-end---author:wangshuai ---date:20230403 for:【issues/4507】JDictSelectTag组件使用时,浏览器给出警告提示:Expected Function, got Array述------------
|
|
||||||
//update-end---author:wangshuai ---date:20230216 for:[QQYUN-4290]公文发文:选择机关代字报错,是因为值改变触发了change事件三次,导致数据发生改变------------
|
|
||||||
|
|
||||||
// nextTick(() => formItemContext.onFieldChange());
|
// nextTick(() => formItemContext.onFieldChange());
|
||||||
}
|
}
|
||||||
@ -188,14 +183,13 @@
|
|||||||
/** 单选radio的值变化事件 */
|
/** 单选radio的值变化事件 */
|
||||||
function handleChangeRadio(e) {
|
function handleChangeRadio(e) {
|
||||||
state.value = e?.target?.value ?? e;
|
state.value = e?.target?.value ?? e;
|
||||||
//update-begin---author:wangshuai ---date:20230504 for:【issues/506】JDictSelectTag 组件 type="radio" 没有返回值------------
|
// 代码逻辑说明: 【issues/506】JDictSelectTag 组件 type="radio" 没有返回值------------
|
||||||
emit('update:value',e?.target?.value ?? e)
|
emit('update:value',e?.target?.value ?? e)
|
||||||
//update-end---author:wangshuai ---date:20230504 for:【issues/506】JDictSelectTag 组件 type="radio" 没有返回值------------
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 用于搜索下拉框中的内容 */
|
/** 用于搜索下拉框中的内容 */
|
||||||
function handleFilterOption(input, option) {
|
function handleFilterOption(input, option) {
|
||||||
// update-begin--author:liaozhiyang---date:20230914---for:【QQYUN-6514】 配置的时候,Y轴不能输入多个字段了,控制台报错
|
// 代码逻辑说明: 【QQYUN-6514】 配置的时候,Y轴不能输入多个字段了,控制台报错
|
||||||
if (typeof option.children === 'function') {
|
if (typeof option.children === 'function') {
|
||||||
// 在 label 中搜索
|
// 在 label 中搜索
|
||||||
let labelIf = option.children()[0]?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
let labelIf = option.children()[0]?.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
@ -203,7 +197,6 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20230914---for:【QQYUN-6514】 配置的时候,Y轴不能输入多个字段了,控制台报错
|
|
||||||
if (props.onlySearchByLabel) {
|
if (props.onlySearchByLabel) {
|
||||||
// 如果开启了只在 label 中搜索,就不继续往下搜索value了
|
// 如果开启了只在 label 中搜索,就不继续往下搜索value了
|
||||||
return false;
|
return false;
|
||||||
@ -228,7 +221,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
// 代码逻辑说明: 【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
||||||
.colorText {
|
.colorText {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
@ -239,5 +232,5 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
// 代码逻辑说明: 【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -29,11 +29,10 @@
|
|||||||
function onChange(value) {
|
function onChange(value) {
|
||||||
emit('change', value);
|
emit('change', value);
|
||||||
emit('update:value', value);
|
emit('update:value', value);
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
// 代码逻辑说明: 【QQYUN-9110】组件有值校验没消失
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
formItemContext?.onFieldChange();
|
formItemContext?.onFieldChange();
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -134,7 +134,7 @@
|
|||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
(val, prevCount) => {
|
(val, prevCount) => {
|
||||||
//update-begin---author:liusq ---date:20230601 for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
|
// 代码逻辑说明: 【issues/556】JImageUpload组件value赋初始值没显示图片------------
|
||||||
if (val && val instanceof Array) {
|
if (val && val instanceof Array) {
|
||||||
val = val.join(',');
|
val = val.join(',');
|
||||||
}
|
}
|
||||||
@ -143,7 +143,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
//update-end---author:liusq ---date:20230601 for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -187,12 +186,11 @@
|
|||||||
*/
|
*/
|
||||||
function handleChange({ file, fileList, event }) {
|
function handleChange({ file, fileList, event }) {
|
||||||
initTag.value = false;
|
initTag.value = false;
|
||||||
// update-begin--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
|
||||||
// uploadFileList.value = fileList;
|
// uploadFileList.value = fileList;
|
||||||
if (file.status === 'error') {
|
if (file.status === 'error') {
|
||||||
createMessage.error(`${file.name} 上传失败.`);
|
createMessage.error(`${file.name} 上传失败.`);
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
// 代码逻辑说明: 【TV360X-1640】上传图片大小超出限制显示优化
|
||||||
if (file.status === 'done' && file.response.success === false) {
|
if (file.status === 'done' && file.response.success === false) {
|
||||||
const failIndex = uploadFileList.value.findIndex((item) => item.uid === file.uid);
|
const failIndex = uploadFileList.value.findIndex((item) => item.uid === file.uid);
|
||||||
if (failIndex != -1) {
|
if (failIndex != -1) {
|
||||||
@ -201,7 +199,6 @@
|
|||||||
createMessage.warning(file.response.message);
|
createMessage.warning(file.response.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
|
||||||
let fileUrls = [];
|
let fileUrls = [];
|
||||||
let noUploadingFileCount = 0;
|
let noUploadingFileCount = 0;
|
||||||
if (file.status != 'uploading') {
|
if (file.status != 'uploading') {
|
||||||
@ -219,14 +216,12 @@
|
|||||||
if (noUploadingFileCount == fileList.length) {
|
if (noUploadingFileCount == fileList.length) {
|
||||||
state.value = fileUrls.join(',');
|
state.value = fileUrls.join(',');
|
||||||
emit('update:value', fileUrls.join(','));
|
emit('update:value', fileUrls.join(','));
|
||||||
// update-begin---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
// 代码逻辑说明: [issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
initTag.value = true;
|
initTag.value = true;
|
||||||
});
|
});
|
||||||
// update-end---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -82,10 +82,9 @@
|
|||||||
|
|
||||||
//关闭方法
|
//关闭方法
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7477】关闭弹窗清空内容(之前上传失败关闭后不会清除)
|
// 代码逻辑说明: 【QQYUN-7477】关闭弹窗清空内容(之前上传失败关闭后不会清除)
|
||||||
closeModal();
|
closeModal();
|
||||||
reset();
|
reset();
|
||||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7477】关闭弹窗清空内容(之前上传失败关闭后不会清除)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验状态切换
|
//校验状态切换
|
||||||
@ -117,11 +116,10 @@
|
|||||||
if (unref(foreignKeys) && unref(foreignKeys).length > 0) {
|
if (unref(foreignKeys) && unref(foreignKeys).length > 0) {
|
||||||
formData.append('foreignKeys', unref(foreignKeys));
|
formData.append('foreignKeys', unref(foreignKeys));
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【issues/6124】当用户没有【Online表单开发】页面的权限时用户无权导入从表数据
|
// 代码逻辑说明: 【issues/6124】当用户没有【Online表单开发】页面的权限时用户无权导入从表数据
|
||||||
if (isObject(foreignKeys.value)) {
|
if (isObject(foreignKeys.value)) {
|
||||||
formData.append('foreignKeys', JSON.stringify(foreignKeys.value));
|
formData.append('foreignKeys', JSON.stringify(foreignKeys.value));
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【issues/6124】当用户没有【Online表单开发】页面的权限时用户无权导入从表数据
|
|
||||||
if (!!online) {
|
if (!!online) {
|
||||||
formData.append('validateStatus', unref(validateStatus));
|
formData.append('validateStatus', unref(validateStatus));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,12 +23,10 @@
|
|||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
//表单值
|
//表单值
|
||||||
const showText = ref('');
|
const showText = ref('');
|
||||||
// update-begin--author:liaozhiyang---date:20231026---for:【issues/803】JIput updateSchema不生效
|
|
||||||
//绑定属性
|
//绑定属性
|
||||||
const getBindValue = computed(() => {
|
const getBindValue = computed(() => {
|
||||||
return omit(Object.assign({}, unref(props), unref(attrs)), ['value']);
|
return omit(Object.assign({}, unref(props), unref(attrs)), ['value']);
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20231026---for:【issues/803】JIput updateSchema不生效
|
|
||||||
//监听类型变化
|
//监听类型变化
|
||||||
watch(
|
watch(
|
||||||
() => props.type,
|
() => props.type,
|
||||||
|
|||||||
@ -104,11 +104,10 @@
|
|||||||
|
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
&-popover {
|
&-popover {
|
||||||
// update-begin--author:liaozhiyang---date:20240520---for:【TV360X-144】jVxetable中的多行文本组件当title没有时去掉多余的线
|
// 代码逻辑说明: 【TV360X-144】jVxetable中的多行文本组件当title没有时去掉多余的线
|
||||||
.ant-popover-title:has(.emptyTitle) {
|
.ant-popover-title:has(.emptyTitle) {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240520---for:【TV360X-144】jVxetable中的多行文本组件当title没有时去掉多余的线
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-input {
|
&-input {
|
||||||
|
|||||||
@ -147,17 +147,15 @@
|
|||||||
function handleAddRecord(e) {
|
function handleAddRecord(e) {
|
||||||
prevent(e);
|
prevent(e);
|
||||||
openListModal(true, {
|
openListModal(true, {
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
|
// 代码逻辑说明: 【TV360X-43】修复关联记录可以添加重复数据
|
||||||
selectedRowKeys: selectRecords.value.map((item) => item.id),
|
selectedRowKeys: selectRecords.value.map((item) => item.id),
|
||||||
selectedRows: [...selectRecords.value],
|
selectedRows: [...selectRecords.value],
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function addCard(data) {
|
function addCard(data) {
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
|
// 代码逻辑说明: 【TV360X-43】修复关联记录可以添加重复数据
|
||||||
let arr = [];
|
let arr = [];
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
|
|
||||||
for (let item of data) {
|
for (let item of data) {
|
||||||
let temp = { ...item };
|
let temp = { ...item };
|
||||||
transData(temp);
|
transData(temp);
|
||||||
@ -230,17 +228,15 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// update-begin--author:liaozhiyang---date:20240522---for:【TV360X-281】分辨率小时关联记录文字被图片挤没了
|
// 代码逻辑说明: 【TV360X-281】分辨率小时关联记录文字被图片挤没了
|
||||||
if (tableLinkCardRef.value.offsetWidth < 250) {
|
if (tableLinkCardRef.value.offsetWidth < 250) {
|
||||||
fixedSpan.value = 24;
|
fixedSpan.value = 24;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240522---for:【TV360X-281】分辨率小时关联记录文字被图片挤没了
|
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20240529---for:【TV360X-389】下拉和卡片关联记录图裂开给个默认图片
|
// 代码逻辑说明: 【TV360X-389】下拉和卡片关联记录图裂开给个默认图片
|
||||||
const handleImageError = (event) => {
|
const handleImageError = (event) => {
|
||||||
event.target.src = placeholderImage;
|
event.target.src = placeholderImage;
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240529---for:【TV360X-389】下拉和卡片关联记录图裂开给个默认图片
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
popTableName,
|
popTableName,
|
||||||
|
|||||||
@ -13,11 +13,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<BasicTable ref="tableRef" @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable ref="tableRef" @register="registerTable" :rowSelection="rowSelection">
|
||||||
<!-- update-begin-author:taoyan date:2023-7-11 for: issues/4992 online表单开发 字段控件类型是关联记录 新增的时候选择列表可以添加查询么 -->
|
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-input-search v-model:value="searchText" @search="onSearch" placeholder="请输入关键词,按回车搜索" style="width: 240px" />
|
<a-input-search v-model:value="searchText" @search="onSearch" placeholder="请输入关键词,按回车搜索" style="width: 240px" />
|
||||||
</template>
|
</template>
|
||||||
<!-- update-end-author:taoyan date:2023-7-11 for: issues/4992 online表单开发 字段控件类型是关联记录 新增的时候选择列表可以添加查询么 -->
|
|
||||||
|
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
@ -275,9 +273,8 @@
|
|||||||
// modal数据新增完成 直接关闭list,将新增的数据带回表单
|
// modal数据新增完成 直接关闭list,将新增的数据带回表单
|
||||||
function handleDataSave(data) {
|
function handleDataSave(data) {
|
||||||
console.log('handleDateSave', data);
|
console.log('handleDateSave', data);
|
||||||
// update-begin--author:liaozhiyang---date:20250429---for:【issues/8163】关联记录新增丢失
|
// 代码逻辑说明: 【issues/8163】关联记录新增丢失
|
||||||
let arr = [data, ...selectedRows.value];
|
let arr = [data, ...selectedRows.value];
|
||||||
// update-end--author:liaozhiyang---date:20250429---for:【issues/8163】关联记录新增丢失
|
|
||||||
emit('success', arr);
|
emit('success', arr);
|
||||||
closeModal();
|
closeModal();
|
||||||
//reload();
|
//reload();
|
||||||
|
|||||||
@ -146,9 +146,8 @@ export function useLinkTable(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//添加一个空对象 为add操作占位
|
//添加一个空对象 为add操作占位
|
||||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-1095】高级查询关联记录去掉编辑按钮及去掉记录按钮
|
// 代码逻辑说明: 【TV360X-1095】高级查询关联记录去掉编辑按钮及去掉记录按钮
|
||||||
props.editBtnShow && dataList.push({});
|
props.editBtnShow && dataList.push({});
|
||||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-1095】高级查询关联记录去掉编辑按钮及去掉记录按钮
|
|
||||||
selectOptions.value = dataList;
|
selectOptions.value = dataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,12 +288,11 @@ export function useLinkTable(props) {
|
|||||||
function getImageSrc(item) {
|
function getImageSrc(item) {
|
||||||
if (props.imageField) {
|
if (props.imageField) {
|
||||||
let url = item[props.imageField];
|
let url = item[props.imageField];
|
||||||
// update-begin--author:liaozhiyang---date:20250517---for:【TV360X-38】关联记录空间,被关联数据优多个图片时,封面图片不展示
|
// 代码逻辑说明: 【TV360X-38】关联记录空间,被关联数据优多个图片时,封面图片不展示
|
||||||
if (typeof url === 'string') {
|
if (typeof url === 'string') {
|
||||||
// 有多张图时默认取第一张
|
// 有多张图时默认取第一张
|
||||||
url = url.split(',')[0];
|
url = url.split(',')[0];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250517---for:【TV360X-38】关联记录空间,被关联数据优多个图片时,封面图片不展示
|
|
||||||
return getFileAccessHttpUrl(url);
|
return getFileAccessHttpUrl(url);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@ -42,11 +42,10 @@
|
|||||||
function onChange(value) {
|
function onChange(value) {
|
||||||
emit('change', value);
|
emit('change', value);
|
||||||
emit('update:value', value);
|
emit('update:value', value);
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
// 代码逻辑说明: 【QQYUN-9110】组件有值校验没消失
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
formItemContext?.onFieldChange();
|
formItemContext?.onFieldChange();
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -6,13 +6,10 @@
|
|||||||
<template #prefix>
|
<template #prefix>
|
||||||
<Icon icon="ant-design:cluster-outlined"></Icon>
|
<Icon icon="ant-design:cluster-outlined"></Icon>
|
||||||
</template>
|
</template>
|
||||||
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后,有两个清除图标;后边这个清除,只是把输入框中数据清除,实际值并没有清除 -->
|
|
||||||
<!-- <template #suffix>
|
<!-- <template #suffix>
|
||||||
<Icon icon="ant-design:close-circle-outlined" @click="handleEmpty" title="清空" v-if="showText"></Icon>
|
<Icon icon="ant-design:close-circle-outlined" @click="handleEmpty" title="清空" v-if="showText"></Icon>
|
||||||
</template>-->
|
</template>-->
|
||||||
<!-- update-begin-author:taoyan date:2022-5-31 for: VUEN-1157 popup 选中后,有两个清除图标;后边这个清除,只是把输入框中数据清除,实际值并没有清除 -->
|
|
||||||
</a-input>
|
</a-input>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<!--popup弹窗-->
|
<!--popup弹窗-->
|
||||||
<JPopupOnlReportModal
|
<JPopupOnlReportModal
|
||||||
@ -28,7 +25,6 @@
|
|||||||
@ok="callBack"
|
@ok="callBack"
|
||||||
></JPopupOnlReportModal>
|
></JPopupOnlReportModal>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -79,10 +75,8 @@
|
|||||||
const [regModal, { openModal }] = useModal();
|
const [regModal, { openModal }] = useModal();
|
||||||
//表单值
|
//表单值
|
||||||
let {code, fieldConfig } = props;
|
let {code, fieldConfig } = props;
|
||||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/675】子表字段Popup弹框数据不更新
|
|
||||||
//唯一分组groupId
|
//唯一分组groupId
|
||||||
const uniqGroupId = computed(() => (props.groupId ? `${props.groupId}_${code}_${fieldConfig[0]['source']}_${fieldConfig[0]['target']}` : ''));
|
const uniqGroupId = computed(() => (props.groupId ? `${props.groupId}_${code}_${fieldConfig[0]['source']}_${fieldConfig[0]['target']}` : ''));
|
||||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/675】子表字段Popup弹框数据不更新
|
|
||||||
/**
|
/**
|
||||||
* 判断popup配置项是否正确
|
* 判断popup配置项是否正确
|
||||||
*/
|
*/
|
||||||
@ -108,9 +102,8 @@
|
|||||||
*/
|
*/
|
||||||
function handleOpen() {
|
function handleOpen() {
|
||||||
emit('focus');
|
emit('focus');
|
||||||
// update-begin--author:liaozhiyang---date:20240528---for:【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
// 代码逻辑说明: 【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
||||||
!attrs.value.disabled && openModal(true);
|
!attrs.value.disabled && openModal(true);
|
||||||
// update-end--author:liaozhiyang---date:20240528---for:【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,9 +123,8 @@
|
|||||||
let labels = []
|
let labels = []
|
||||||
for (let item of fieldConfig) {
|
for (let item of fieldConfig) {
|
||||||
let val = rows.map((row) => row[item.source]);
|
let val = rows.map((row) => row[item.source]);
|
||||||
// update-begin--author:liaozhiyang---date:20230831---for:【QQYUN-7535】数组只有一个且是number类型,join会改变值的类型为string
|
// 代码逻辑说明: 【QQYUN-7535】数组只有一个且是number类型,join会改变值的类型为string
|
||||||
val = val.length == 1 ? val[0] : val.join(',');
|
val = val.length == 1 ? val[0] : val.join(',');
|
||||||
// update-begin--author:liaozhiyang---date:20230831---for:【QQYUN-7535】数组只有一个且是number类型,join会改变值的类型为string
|
|
||||||
item.target.split(',').forEach((target) => {
|
item.target.split(',').forEach((target) => {
|
||||||
values[target] = val;
|
values[target] = val;
|
||||||
});
|
});
|
||||||
@ -154,11 +146,8 @@
|
|||||||
props.formElRef && props.formElRef.setFieldsValue(values);
|
props.formElRef && props.formElRef.setFieldsValue(values);
|
||||||
//传入赋值方法方式赋值
|
//传入赋值方法方式赋值
|
||||||
props.setFieldsValue && props.setFieldsValue(values);
|
props.setFieldsValue && props.setFieldsValue(values);
|
||||||
// update-begin--author:liaozhiyang---date:20230831---for:【issues/5288】popup弹框,无法将选择的数据填充到自身
|
// 代码逻辑说明: 【issues/5213】JPopup抛出change事件
|
||||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/5213】JPopup抛出change事件
|
|
||||||
emit('popUpChange', values);
|
emit('popUpChange', values);
|
||||||
// update-end--author:liaozhiyang---date:20230811---for:【issues/5213】JPopup抛出change事件
|
|
||||||
// update-begin--author:liaozhiyang---date:20230831---for:【issues/5288】popup弹框,无法将选择的数据填充到自身
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -176,13 +165,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JPopup {
|
.JPopup {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.components-input-demo-presuffix .anticon-close-circle {
|
.components-input-demo-presuffix .anticon-close-circle {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
<a-select v-model:value="showText" v-bind="attrs" :mode="multi ? 'multiple' : ''" @click="handleOpen" readOnly :loading="loading">
|
<a-select v-model:value="showText" v-bind="attrs" :mode="multi ? 'multiple' : ''" @click="handleOpen" readOnly :loading="loading">
|
||||||
<a-select-option v-for="item in options" :value="item.value">{{ item.text }}</a-select-option>
|
<a-select-option v-for="item in options" :value="item.value">{{ item.text }}</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<!--popup弹窗-->
|
<!--popup弹窗-->
|
||||||
<JPopupOnlReportModal
|
<JPopupOnlReportModal
|
||||||
@ -23,7 +22,6 @@
|
|||||||
@ok="callBack"
|
@ok="callBack"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -85,9 +83,8 @@
|
|||||||
* 打开pop弹出框
|
* 打开pop弹出框
|
||||||
*/
|
*/
|
||||||
function handleOpen() {
|
function handleOpen() {
|
||||||
// update-begin--author:liaozhiyang---date:20240528---for:【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
// 代码逻辑说明: 【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
||||||
!attrs.value.disabled && openModal(true);
|
!attrs.value.disabled && openModal(true);
|
||||||
// update-end--author:liaozhiyang---date:20240528---for:【TV360X-317】禁用后JPopup和JPopupdic还可以点击出弹窗
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 监听value数值
|
* 监听value数值
|
||||||
@ -211,13 +208,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JPopupDict {
|
.JPopupDict {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.components-input-demo-presuffix {
|
.components-input-demo-presuffix {
|
||||||
:deep(.ant-select-dropdown) {
|
:deep(.ant-select-dropdown) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|||||||
@ -42,9 +42,8 @@
|
|||||||
function handleChange(arr){
|
function handleChange(arr){
|
||||||
let str = ''
|
let str = ''
|
||||||
if(arr && arr.length>0){
|
if(arr && arr.length>0){
|
||||||
// update-begin--author:liaozhiyang---date:20240710---for:[issues/6368] rangeDate去掉判断允许起始项或结束项为空兼容allowEmpty
|
// 代码逻辑说明: [issues/6368] rangeDate去掉判断允许起始项或结束项为空兼容allowEmpty
|
||||||
str = arr.join(',')
|
str = arr.join(',')
|
||||||
// update-end--author:liaozhiyang---date:20240710---for:[issues/6368] rangeDate去掉判断允许起始项或结束项为空兼容allowEmpty
|
|
||||||
}
|
}
|
||||||
emit('change', str);
|
emit('change', str);
|
||||||
emit('update:value', str);
|
emit('update:value', str);
|
||||||
|
|||||||
@ -39,10 +39,9 @@
|
|||||||
|
|
||||||
function emitArray() {
|
function emitArray() {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1749】数量0输入不了,输入清空了
|
// 代码逻辑说明: 【TV360X-1749】数量0输入不了,输入清空了
|
||||||
let begin = beginValue.value ?? '';
|
let begin = beginValue.value ?? '';
|
||||||
let end = endValue.value ?? '';
|
let end = endValue.value ?? '';
|
||||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1749】数量0输入不了,输入清空了
|
|
||||||
arr.push(begin);
|
arr.push(begin);
|
||||||
arr.push(end);
|
arr.push(end);
|
||||||
emit('change', arr);
|
emit('change', arr);
|
||||||
@ -75,7 +74,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-214】范围查询控件没有根据配置格式化
|
// 代码逻辑说明: 【TV360X-214】范围查询控件没有根据配置格式化
|
||||||
.ant-input-group {
|
.ant-input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
.ant-input-number {
|
.ant-input-number {
|
||||||
@ -89,5 +88,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-214】范围查询控件没有根据配置格式化
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -77,33 +77,27 @@
|
|||||||
default: (node) => node?.parentNode,
|
default: (node) => node?.parentNode,
|
||||||
},
|
},
|
||||||
//默认开启Y轴溢出位置调整,因此在可视空间不足时下拉框位置会自动上移,导致Select的输入框被遮挡。需要注意的是,默认情况是是可视空间,而不是所拥有的空间
|
//默认开启Y轴溢出位置调整,因此在可视空间不足时下拉框位置会自动上移,导致Select的输入框被遮挡。需要注意的是,默认情况是是可视空间,而不是所拥有的空间
|
||||||
//update-begin-author:liusq date:2023-04-04 for:[issue/286]下拉搜索框遮挡问题
|
// 代码逻辑说明: [issue/286]下拉搜索框遮挡问题
|
||||||
adjustY:propTypes.bool.def(true),
|
adjustY:propTypes.bool.def(true),
|
||||||
//update-end-author:liusq date:2023-04-04 for:[issue/286]下拉搜索框遮挡问题
|
|
||||||
//是否在有值后立即触发change
|
//是否在有值后立即触发change
|
||||||
immediateChange: propTypes.bool.def(false),
|
immediateChange: propTypes.bool.def(false),
|
||||||
//update-begin-author:taoyan date:2022-8-15 for: VUEN-1971 【online 专项测试】关联记录和他表字段 1
|
|
||||||
//支持传入查询参数,如排序信息
|
//支持传入查询参数,如排序信息
|
||||||
params:{
|
params:{
|
||||||
type: Object,
|
type: Object,
|
||||||
default: ()=>{}
|
default: ()=>{}
|
||||||
},
|
},
|
||||||
//update-end-author:taoyan date:2022-8-15 for: VUEN-1971 【online 专项测试】关联记录和他表字段 1
|
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
//是否为多选
|
//是否为多选
|
||||||
multiple:{
|
multiple:{
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
},
|
},
|
||||||
emits: ['change', 'update:value'],
|
emits: ['change', 'update:value'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
const options = ref<any[]>([]);
|
const options = ref<any[]>([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
// update-begin--author:liaozhiyang---date:20231205---for:【issues/897】JSearchSelect组件添加class/style样式不生效
|
// 代码逻辑说明: 【issues/897】JSearchSelect组件添加class/style样式不生效
|
||||||
const attrs = useAttrs({'excludeDefaultKeys': false});
|
const attrs = useAttrs({'excludeDefaultKeys': false});
|
||||||
// update-end--author:liaozhiyang---date:20231205---for:【issues/897】JSearchSelect组件添加class/style样式不生效
|
|
||||||
const selectedValue = ref([]);
|
const selectedValue = ref([]);
|
||||||
const selectedAsyncValue = ref([]);
|
const selectedAsyncValue = ref([]);
|
||||||
const lastLoad = ref(0);
|
const lastLoad = ref(0);
|
||||||
@ -171,20 +165,18 @@
|
|||||||
if (!isDictTable.value) {
|
if (!isDictTable.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
isHasData = true;
|
isHasData = true;
|
||||||
searchKeyword = value;
|
searchKeyword = value;
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
|
|
||||||
lastLoad.value += 1;
|
lastLoad.value += 1;
|
||||||
const currentLoad = unref(lastLoad);
|
const currentLoad = unref(lastLoad);
|
||||||
options.value = [];
|
options.value = [];
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
let keywordInfo = getKeywordParam(value);
|
let keywordInfo = getKeywordParam(value);
|
||||||
//update-begin---author:chenrui ---date:2024/4/7 for:[QQYUN-8800]JSearchSelect的search事件在中文输入还没拼字成功时会触发,导致后端SQL注入 #6049------------
|
// 代码逻辑说明: [QQYUN-8800]JSearchSelect的search事件在中文输入还没拼字成功时会触发,导致后端SQL注入 #6049------------
|
||||||
keywordInfo = keywordInfo.replaceAll("'", '');
|
keywordInfo = keywordInfo.replaceAll("'", '');
|
||||||
//update-end---author:chenrui ---date:2024/4/7 for:[QQYUN-8800]JSearchSelect的search事件在中文输入还没拼字成功时会触发,导致后端SQL注入 #6049------------
|
|
||||||
// 字典code格式:table,text,code
|
// 字典code格式:table,text,code
|
||||||
defHttp
|
defHttp
|
||||||
.get({
|
.get({
|
||||||
@ -198,13 +190,11 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
options.value = res;
|
options.value = res;
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo++;
|
pageNo++;
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo == 1 && (isHasData = false);
|
pageNo == 1 && (isHasData = false);
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 300);
|
}, 300);
|
||||||
@ -212,18 +202,16 @@
|
|||||||
* 初始化value
|
* 初始化value
|
||||||
*/
|
*/
|
||||||
function initSelectValue() {
|
function initSelectValue() {
|
||||||
//update-begin-author:taoyan date:2022-4-24 for: 下拉搜索组件每次选中值会触发value的监听事件,触发此方法,但是实际不需要
|
// 代码逻辑说明: 下拉搜索组件每次选中值会触发value的监听事件,触发此方法,但是实际不需要
|
||||||
if (loadSelectText.value === false) {
|
if (loadSelectText.value === false) {
|
||||||
loadSelectText.value = true;
|
loadSelectText.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-4-24 for: 下拉搜索组件每次选中值会触发value的监听事件,触发此方法,但是实际不需要
|
|
||||||
let { async, value, dict } = props;
|
let { async, value, dict } = props;
|
||||||
if (async) {
|
if (async) {
|
||||||
if (!selectedAsyncValue || !selectedAsyncValue.key || selectedAsyncValue.key !== value) {
|
if (!selectedAsyncValue || !selectedAsyncValue.key || selectedAsyncValue.key !== value) {
|
||||||
defHttp.get({ url: `/sys/dict/loadDictItem/${dict}`, params: { key: value } }).then((res) => {
|
defHttp.get({ url: `/sys/dict/loadDictItem/${dict}`, params: { key: value } }).then((res) => {
|
||||||
if (res && res.length > 0) {
|
if (res && res.length > 0) {
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
//判断组件是否为多选
|
//判断组件是否为多选
|
||||||
if(props.multiple){
|
if(props.multiple){
|
||||||
if(value){
|
if(value){
|
||||||
@ -248,30 +236,25 @@
|
|||||||
if (props.value == value) {
|
if (props.value == value) {
|
||||||
selectedAsyncValue.value = { ...obj };
|
selectedAsyncValue.value = { ...obj };
|
||||||
}
|
}
|
||||||
//update-begin-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online关联记录配置页面
|
// 代码逻辑说明: 值改变触发change事件--用于online关联记录配置页面
|
||||||
if(props.immediateChange == true){
|
if(props.immediateChange == true){
|
||||||
emit('change', props.value);
|
emit('change', props.value);
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online关联记录配置页面
|
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
// 代码逻辑说明: 【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
||||||
if(!props.multiple){
|
if(!props.multiple){
|
||||||
selectedValue.value = value.toString();
|
selectedValue.value = value.toString();
|
||||||
//update-begin-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online他表字段配置界面
|
|
||||||
if(props.immediateChange == true){
|
if(props.immediateChange == true){
|
||||||
emit('change', value.toString());
|
emit('change', value.toString());
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online他表字段配置界面
|
|
||||||
}else{
|
}else{
|
||||||
//多选的情况下需要转成数组
|
//多选的情况下需要转成数组
|
||||||
selectedValue.value = value.toString().split(',');
|
selectedValue.value = value.toString().split(',');
|
||||||
}
|
}
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,11 +287,10 @@
|
|||||||
if (!dict) {
|
if (!dict) {
|
||||||
console.error('搜索组件未配置字典项');
|
console.error('搜索组件未配置字典项');
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo = 1;
|
pageNo = 1;
|
||||||
isHasData = true;
|
isHasData = true;
|
||||||
searchKeyword = '';
|
searchKeyword = '';
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
|
|
||||||
//异步一开始也加载一点数据
|
//异步一开始也加载一点数据
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -322,13 +304,11 @@
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res && res.length > 0) {
|
if (res && res.length > 0) {
|
||||||
options.value = res;
|
options.value = res;
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo++;
|
pageNo++;
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
// 代码逻辑说明: 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||||
pageNo == 1 && (isHasData = false);
|
pageNo == 1 && (isHasData = false);
|
||||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -346,19 +326,16 @@
|
|||||||
* 同步改变事件
|
* 同步改变事件
|
||||||
* */
|
* */
|
||||||
function handleChange(value) {
|
function handleChange(value) {
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
//多选也会触发change事件,需要判断如果时多选不需要赋值
|
//多选也会触发change事件,需要判断如果时多选不需要赋值
|
||||||
if(!props.multiple){
|
if(!props.multiple){
|
||||||
selectedValue.value = value;
|
selectedValue.value = value;
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 异步改变事件
|
* 异步改变事件
|
||||||
* */
|
* */
|
||||||
function handleAsyncChange(selectedObj) {
|
function handleAsyncChange(selectedObj) {
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
// 单选情况下使用change事件
|
// 单选情况下使用change事件
|
||||||
if(!props.multiple){
|
if(!props.multiple){
|
||||||
if (selectedObj) {
|
if (selectedObj) {
|
||||||
@ -371,15 +348,11 @@
|
|||||||
loadData('');
|
loadData('');
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
// update-begin--author:liaozhiyang---date:20240524---for:【TV360X-426】下拉搜索设置了默认值,把查询条件删掉,再点击重置,没附上值
|
|
||||||
// 点x清空时需要把loadSelectText设置true
|
// 点x清空时需要把loadSelectText设置true
|
||||||
selectedObj ?? (loadSelectText.value = true);
|
selectedObj ?? (loadSelectText.value = true);
|
||||||
// update-end--author:liaozhiyang---date:20240524---for:【TV360X-426】下拉搜索设置了默认值,把查询条件删掉,再点击重置,没附上值
|
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
/**
|
/**
|
||||||
* 异步值选中事件
|
* 异步值选中事件
|
||||||
* @param selectedObj
|
* @param selectedObj
|
||||||
@ -422,14 +395,12 @@
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*回调方法
|
*回调方法
|
||||||
* */
|
* */
|
||||||
function callback() {
|
function callback() {
|
||||||
loadSelectText.value = false;
|
loadSelectText.value = false;
|
||||||
//update-begin---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
//单选直接走更新值操作
|
//单选直接走更新值操作
|
||||||
if(!props.multiple){
|
if(!props.multiple){
|
||||||
emit('change', unref(selectedValue));
|
emit('change', unref(selectedValue));
|
||||||
@ -439,13 +410,12 @@
|
|||||||
emit('change', unref(selectedValue).join(","));
|
emit('change', unref(selectedValue).join(","));
|
||||||
emit('update:value', unref(selectedValue).join(","));
|
emit('update:value', unref(selectedValue).join(","));
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2025-04-17---for:【issues/8101】前端dict组件导致内存溢出问题:搜索组件支持多选---
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 过滤选中option
|
* 过滤选中option
|
||||||
*/
|
*/
|
||||||
function filterOption(input, option) {
|
function filterOption(input, option) {
|
||||||
//update-begin-author:taoyan date:2022-11-8 for: issues/218 所有功能表单的下拉搜索框搜索无效
|
// 代码逻辑说明: issues/218 所有功能表单的下拉搜索框搜索无效
|
||||||
let value = '', label = '';
|
let value = '', label = '';
|
||||||
try {
|
try {
|
||||||
value = option.value;
|
value = option.value;
|
||||||
@ -455,15 +425,13 @@
|
|||||||
}
|
}
|
||||||
let str = input.toLowerCase();
|
let str = input.toLowerCase();
|
||||||
return value.toLowerCase().indexOf(str) >= 0 || label.toLowerCase().indexOf(str) >= 0;
|
return value.toLowerCase().indexOf(str) >= 0 || label.toLowerCase().indexOf(str) >= 0;
|
||||||
//update-end-author:taoyan date:2022-11-8 for: issues/218 所有功能表单的下拉搜索框搜索无效
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParentContainer(node) {
|
function getParentContainer(node) {
|
||||||
// update-begin-author:taoyan date:20220407 for: getPopupContainer一直有值 导致popContainer的逻辑永远走不进去,把它挪到前面判断
|
// 代码逻辑说明: getPopupContainer一直有值 导致popContainer的逻辑永远走不进去,把它挪到前面判断
|
||||||
if (props.popContainer) {
|
if (props.popContainer) {
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
// 代码逻辑说明: 【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||||
return setPopContainer(node, props.popContainer);
|
return setPopContainer(node, props.popContainer);
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
|
||||||
} else {
|
} else {
|
||||||
if (typeof props.getPopupContainer === 'function') {
|
if (typeof props.getPopupContainer === 'function') {
|
||||||
return props.getPopupContainer(node);
|
return props.getPopupContainer(node);
|
||||||
@ -471,46 +439,39 @@
|
|||||||
return node?.parentNode;
|
return node?.parentNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end-author:taoyan date:20220407 for: getPopupContainer一直有值 导致popContainer的逻辑永远走不进去,把它挪到前面判断
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-8-15 for: VUEN-1971 【online 专项测试】关联记录和他表字段 1
|
|
||||||
//获取关键词参数 支持设置排序信息
|
//获取关键词参数 支持设置排序信息
|
||||||
function getKeywordParam(text){
|
function getKeywordParam(text){
|
||||||
// 如果设定了排序信息,需要写入排序信息,在关键词后加 [orderby:create_time,desc]
|
// 如果设定了排序信息,需要写入排序信息,在关键词后加 [orderby:create_time,desc]
|
||||||
if(props.params && props.params.column && props.params.order){
|
if(props.params && props.params.column && props.params.order){
|
||||||
let temp = text||''
|
let temp = text||''
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2023-5-22 for: /issues/4905 表单生成器字段配置时,选择关联字段,在进行高级配置时,无法加载数据库列表,提示 Sgin签名校验错误! #4905
|
// 代码逻辑说明: /issues/4905 表单生成器字段配置时,选择关联字段,在进行高级配置时,无法加载数据库列表,提示 Sgin签名校验错误! #4905
|
||||||
temp = temp+'[orderby:'+props.params.column+','+props.params.order+']'
|
temp = temp+'[orderby:'+props.params.column+','+props.params.order+']'
|
||||||
return encodeURI(temp);
|
return encodeURI(temp);
|
||||||
//update-end-author:taoyan date:2023-5-22 for: /issues/4905 表单生成器字段配置时,选择关联字段,在进行高级配置时,无法加载数据库列表,提示 Sgin签名校验错误! #4905
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-8-15 for: VUEN-1971 【online 专项测试】关联记录和他表字段 1
|
// 代码逻辑说明: 【TV360X-26】下拉搜索控件选中选项后再次点击下拉应该显示初始的下拉选项,而不是只展示选中结果
|
||||||
// update-begin--author:liaozhiyang---date:20240523---for:【TV360X-26】下拉搜索控件选中选项后再次点击下拉应该显示初始的下拉选项,而不是只展示选中结果
|
|
||||||
const handleAsyncFocus = () => {
|
const handleAsyncFocus = () => {
|
||||||
// update-begin--author:liaozhiyang---date:20240709---for:【issues/6681】异步查询不生效
|
// 代码逻辑说明: 【issues/6681】异步查询不生效
|
||||||
if ((isObject(selectedAsyncValue.value) || selectedAsyncValue.value?.length) && isDictTable.value && props.async) {
|
if ((isObject(selectedAsyncValue.value) || selectedAsyncValue.value?.length) && isDictTable.value && props.async) {
|
||||||
// update-begin--author:liaozhiyang---date:20240809---for:【TV360X-2062】下拉搜索选择第二页数据后,第一次点击时(得到焦点)滚动条没复原到初始位置且数据会加载第二页数据(应该只加载第一页数据)
|
// 代码逻辑说明: 【TV360X-2062】下拉搜索选择第二页数据后,第一次点击时(得到焦点)滚动条没复原到初始位置且数据会加载第二页数据(应该只加载第一页数据)
|
||||||
options.value = [];
|
options.value = [];
|
||||||
// update-end--author:liaozhiyang---date:20240809---for:【TV360X-2062】下拉搜索选择第二页数据后,第一次点击时(得到焦点)滚动条没复原到初始位置且数据会加载第二页数据(应该只加载第一页数据)
|
|
||||||
initDictTableData();
|
initDictTableData();
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240919---for:【TV360X-2348】得到焦点时options选项显示第一页内容(解决新增时显示非第一页内容)
|
// 代码逻辑说明: 【TV360X-2348】得到焦点时options选项显示第一页内容(解决新增时显示非第一页内容)
|
||||||
if (Array.isArray(selectedAsyncValue.value) && selectedAsyncValue.value.length === 0 && isDictTable.value && props.async) {
|
if (Array.isArray(selectedAsyncValue.value) && selectedAsyncValue.value.length === 0 && isDictTable.value && props.async) {
|
||||||
if (pageNo > 2) {
|
if (pageNo > 2) {
|
||||||
options.value = [];
|
options.value = [];
|
||||||
initDictTableData();
|
initDictTableData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240919---for:【TV360X-2348】得到焦点时options选项显示第一页内容(解决新增时显示非第一页内容)
|
|
||||||
attrs.onFocus?.();
|
attrs.onFocus?.();
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240523---for:【TV360X-26】下拉搜索控件选中选项后再次点击下拉应该显示初始的下拉选项,而不是只展示选中结果
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024-07-30
|
* 2024-07-30
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class="JSelectDepartPost">
|
<div class="JSelectDepartPost">
|
||||||
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" :isCustomRenderTag="isCustomRenderTag" :rowKey="getBindValue?.rowKey"/>
|
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" :isCustomRenderTag="isCustomRenderTag" :rowKey="getBindValue?.rowKey"/>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<DeptSelectModal @register="regModal" @getSelectResult="setValue" modalTitle="部门岗位选择" v-bind="getBindValue" :multiple="multiple" @close="handleClose" />
|
<DeptSelectModal @register="regModal" @getSelectResult="setValue" modalTitle="部门岗位选择" v-bind="getBindValue" :multiple="multiple" @close="handleClose" :izShowDepPath="izShowDepPath"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -32,6 +32,8 @@
|
|||||||
izOnlySelectDepartPost: propTypes.bool.def(true),
|
izOnlySelectDepartPost: propTypes.bool.def(true),
|
||||||
// 自定义渲染tag
|
// 自定义渲染tag
|
||||||
isCustomRenderTag: propTypes.bool.def(true),
|
isCustomRenderTag: propTypes.bool.def(true),
|
||||||
|
//是否显示部门路径(用户部门选择主岗位和兼职岗位需要显示全路径)
|
||||||
|
izShowDepPath: propTypes.bool.def(false),
|
||||||
},
|
},
|
||||||
emits: ['options-change', 'change', 'select', 'update:value'],
|
emits: ['options-change', 'change', 'select', 'update:value'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
|
|||||||
@ -2,11 +2,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JSelectDept">
|
<div class="JSelectDept">
|
||||||
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" :isCustomRenderTag="isCustomRenderTag" :rowKey="getBindValue?.rowKey"/>
|
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" :isCustomRenderTag="isCustomRenderTag" :rowKey="getBindValue?.rowKey"/>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<DeptSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue" :multiple="multiple" @close="handleClose"/>
|
<DeptSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue" :multiple="multiple" @close="handleClose"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -65,32 +63,26 @@
|
|||||||
* 监听组件值
|
* 监听组件值
|
||||||
*/
|
*/
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// update-begin--author:liaozhiyang---date:20240611---for:【TV360X-576】已选中了数据,再次选择打开弹窗点击取消,数据清空了(同步JSelectDept改法)
|
// 代码逻辑说明: [TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
||||||
//update-begin-author:liusq---date:2024-06-03--for: [TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
|
||||||
tempSave = [];
|
tempSave = [];
|
||||||
//update-end-author:liusq---date:2024-06-03--for:[TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
|
||||||
// update-end--author:liaozhiyang---date:20240611---for:【TV360X-576】已选中了数据,再次选择打开弹窗点击取消,数据清空了(同步JSelectDept改法)
|
|
||||||
props.value && initValue();
|
props.value && initValue();
|
||||||
});
|
});
|
||||||
|
|
||||||
//update-begin-author:liusq---date:20220609--for: 为了解决弹窗form初始化赋值问题 ---
|
// 代码逻辑说明: 为了解决弹窗form初始化赋值问题 ---
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
() => {
|
() => {
|
||||||
initValue();
|
initValue();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//update-end-author:liusq---date:20220609--for: 为了解决弹窗form初始化赋值问题 ---
|
|
||||||
/**
|
/**
|
||||||
* 监听selectValues变化
|
* 监听selectValues变化
|
||||||
*/
|
*/
|
||||||
// update-begin--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
|
||||||
// watch(selectValues, () => {
|
// watch(selectValues, () => {
|
||||||
// if (selectValues) {
|
// if (selectValues) {
|
||||||
// state.value = selectValues.value;
|
// state.value = selectValues.value;
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// update-end--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
|
||||||
/**
|
/**
|
||||||
* 监听selectOptions变化
|
* 监听selectOptions变化
|
||||||
*/
|
*/
|
||||||
@ -138,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
||||||
|
|
||||||
// update-begin--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
// 代码逻辑说明: 【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
if (tempSave.length) {
|
if (tempSave.length) {
|
||||||
selectValues.value = cloneDeep(tempSave);
|
selectValues.value = cloneDeep(tempSave);
|
||||||
@ -154,13 +146,11 @@
|
|||||||
let result = typeof props.value == 'string' ? values.join(',') : values;
|
let result = typeof props.value == 'string' ? values.join(',') : values;
|
||||||
emit('update:value', result);
|
emit('update:value', result);
|
||||||
emit('change', result);
|
emit('change', result);
|
||||||
// update-begin--author:liaozhiyang---date:20240627---for:【TV360X-1648】用户编辑界面“所属部门”与“负责部门”联动出错(同步之前丢的代码)
|
// 代码逻辑说明: 【TV360X-1648】用户编辑界面“所属部门”与“负责部门”联动出错(同步之前丢的代码)
|
||||||
if (!values || values.length == 0) {
|
if (!values || values.length == 0) {
|
||||||
emit('select', null, null);
|
emit('select', null, null);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240627---for:【TV360X-1648】用户编辑界面“所属部门”与“负责部门”联动出错(同步之前丢的代码)
|
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// state,
|
// state,
|
||||||
@ -180,13 +170,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JSelectDept {
|
.JSelectDept {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.j-select-row {
|
.j-select-row {
|
||||||
@width: 82px;
|
@width: 82px;
|
||||||
|
|
||||||
|
|||||||
@ -130,32 +130,29 @@
|
|||||||
emit('input', selectedValue.join(props.spliter));
|
emit('input', selectedValue.join(props.spliter));
|
||||||
emit('update:value', selectedValue.join(props.spliter));
|
emit('update:value', selectedValue.join(props.spliter));
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
// 代码逻辑说明: 【QQYUN-9110】组件有值校验没消失
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
formItemContext?.onFieldChange();
|
formItemContext?.onFieldChange();
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-9110】组件有值校验没消失
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParentContainer(node) {
|
function getParentContainer(node) {
|
||||||
if (!props.popContainer) {
|
if (!props.popContainer) {
|
||||||
return node?.parentNode;
|
return node?.parentNode;
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
// 代码逻辑说明: 【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
||||||
return setPopContainer(node, props.popContainer);
|
return setPopContainer(node, props.popContainer);
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9339】有多个modal弹窗内都有下拉字典多选和下拉搜索组件时,打开另一个modal时组件的options不展示
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据字典code查询字典项
|
// 根据字典code查询字典项
|
||||||
function loadDictOptions() {
|
function loadDictOptions() {
|
||||||
//update-begin-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
// 代码逻辑说明: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||||
let temp = props.dictCode || '';
|
let temp = props.dictCode || '';
|
||||||
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
||||||
// 编码后 是不包含空格的
|
// 编码后 是不包含空格的
|
||||||
temp = encodeURI(temp);
|
temp = encodeURI(temp);
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
|
||||||
getDictItems(temp).then((res) => {
|
getDictItems(temp).then((res) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
dictOptions.value = res.map((item) => ({ value: item.value, label: item.text, color:item.color }));
|
dictOptions.value = res.map((item) => ({ value: item.value, label: item.text, color:item.color }));
|
||||||
@ -167,11 +164,10 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
// 代码逻辑说明: VUEN-1145 下拉多选,搜索时,查不到数据
|
||||||
function filterOption(input, option) {
|
function filterOption(input, option) {
|
||||||
return option.children()[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.children()[0].children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-5-31 for: VUEN-1145 下拉多选,搜索时,查不到数据
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
state,
|
state,
|
||||||
|
|||||||
@ -2,11 +2,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JSelectPosition">
|
<div class="JSelectPosition">
|
||||||
<JSelectBiz @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" @change="(changeValue) => $emit('update:value', changeValue)"></JSelectBiz>
|
<JSelectBiz @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs" @change="(changeValue) => $emit('update:value', changeValue)"></JSelectBiz>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<PositionSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue"></PositionSelectModal>
|
<PositionSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue"></PositionSelectModal>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -70,23 +68,21 @@
|
|||||||
/**
|
/**
|
||||||
* 监听组件值
|
* 监听组件值
|
||||||
*/
|
*/
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【pull/8014】插槽方式弹窗中取消该数据checkbox的选中状态,需要点击第二次才生效。
|
// 代码逻辑说明: 【pull/8014】插槽方式弹窗中取消该数据checkbox的选中状态,需要点击第二次才生效。
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
() => {
|
() => {
|
||||||
if (props.value) {
|
if (props.value) {
|
||||||
initValue();
|
initValue();
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20250604---for:【issues/8233】resetFields时无法重置
|
// 代码逻辑说明: 【issues/8233】resetFields时无法重置
|
||||||
if (selectValues.value?.length) {
|
if (selectValues.value?.length) {
|
||||||
selectValues.value = [];
|
selectValues.value = [];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250604---for:【issues/8233】resetFields时无法重置
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ deep: true, immediate: true }
|
{ deep: true, immediate: true }
|
||||||
);
|
);
|
||||||
// update-end--author:liaozhiyang---date:20250423---for:【pull/8014】插槽方式弹窗中取消该数据checkbox的选中状态,需要点击第二次才生效。
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监听selectValues变化
|
* 监听selectValues变化
|
||||||
@ -126,9 +122,8 @@
|
|||||||
//emitData.value = values.join(",");
|
//emitData.value = values.join(",");
|
||||||
state.value = values;
|
state.value = values;
|
||||||
selectValues.value = values;
|
selectValues.value = values;
|
||||||
//update-begin-author:liusq date:20230517 for:选择职务组件v-model方式绑定值不生效
|
// 代码逻辑说明: 选择职务组件v-model方式绑定值不生效
|
||||||
emit('update:value', values.join(','));
|
emit('update:value', values.join(','));
|
||||||
//update-begin-author:liusq date:20230517 for:选择职务组件v-model方式绑定值不生效
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,13 +144,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JSelectPosition {
|
.JSelectPosition {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.j-select-row {
|
.j-select-row {
|
||||||
@width: 82px;
|
@width: 82px;
|
||||||
|
|
||||||
|
|||||||
@ -2,11 +2,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JSelectRole">
|
<div class="JSelectRole">
|
||||||
<JSelectBiz @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs"></JSelectBiz>
|
<JSelectBiz @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs"></JSelectBiz>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<RoleSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue"></RoleSelectModal>
|
<RoleSelectModal @register="regModal" @getSelectResult="setValue" v-bind="getBindValue"></RoleSelectModal>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -118,9 +116,8 @@
|
|||||||
//emitData.value = values.join(",");
|
//emitData.value = values.join(",");
|
||||||
state.value = values;
|
state.value = values;
|
||||||
selectValues.value = values;
|
selectValues.value = values;
|
||||||
// update-begin--author:liaozhiyang---date:20250318---for:【issues/7948】修复JselectRole组件不支持双向绑定
|
// 代码逻辑说明: 【issues/7948】修复JselectRole组件不支持双向绑定
|
||||||
emit('update:value', values);
|
emit('update:value', values);
|
||||||
// update-end--author:liaozhiyang---date:20250318---for:【issues/7948】修复JselectRole组件不支持双向绑定
|
|
||||||
}
|
}
|
||||||
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
||||||
return {
|
return {
|
||||||
@ -139,13 +136,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JSelectRole {
|
.JSelectRole {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.j-select-row {
|
.j-select-row {
|
||||||
@width: 82px;
|
@width: 82px;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JselectUser">
|
<div class="JselectUser">
|
||||||
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs"></JSelectBiz>
|
<JSelectBiz @change="handleSelectChange" @handleOpen="handleOpen" :loading="loadingEcho" v-bind="attrs"></JSelectBiz>
|
||||||
<!-- update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<UserSelectModal
|
<UserSelectModal
|
||||||
:rowKey="rowKey"
|
:rowKey="rowKey"
|
||||||
@ -13,7 +12,6 @@
|
|||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@ -48,13 +46,11 @@
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
//update-begin---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
//排除用户id的集合
|
//排除用户id的集合
|
||||||
excludeUserIdList:{
|
excludeUserIdList:{
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
},
|
},
|
||||||
emits: ['options-change', 'change', 'update:value'],
|
emits: ['options-change', 'change', 'update:value'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
@ -87,11 +83,8 @@
|
|||||||
* 监听组件值
|
* 监听组件值
|
||||||
*/
|
*/
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// update-begin--author:liaozhiyang---date:20240611---for:【TV360X-576】已选中了数据,再次选择打开弹窗点击取消,数据清空了
|
// 代码逻辑说明: [TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
||||||
//update-begin-author:liusq---date:2024-06-03--for: [TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
|
||||||
tempSave = [];
|
tempSave = [];
|
||||||
//update-end-author:liusq---date:2024-06-03--for:[TV360X-840]用户授权,没有选择,点取消,也会回显一个选过的用户
|
|
||||||
// update-end--author:liaozhiyang---date:20240611---for:【TV360X-576】已选中了数据,再次选择打开弹窗点击取消,数据清空了
|
|
||||||
props.value && initValue();
|
props.value && initValue();
|
||||||
// 查询条件重置的时候 界面显示未清空
|
// 查询条件重置的时候 界面显示未清空
|
||||||
if (!props.value) {
|
if (!props.value) {
|
||||||
@ -108,7 +101,7 @@
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
// 代码逻辑说明: 【QQYUN-5685】5、离职人员可以选自己------------
|
||||||
const excludeUserIdList = ref<any>([]);
|
const excludeUserIdList = ref<any>([]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,7 +110,6 @@
|
|||||||
watch(()=>props.excludeUserIdList,(data)=>{
|
watch(()=>props.excludeUserIdList,(data)=>{
|
||||||
excludeUserIdList.value = data;
|
excludeUserIdList.value = data;
|
||||||
},{ immediate: true })
|
},{ immediate: true })
|
||||||
//update-end---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打卡弹出框
|
* 打卡弹出框
|
||||||
@ -156,7 +148,7 @@
|
|||||||
send(values);
|
send(values);
|
||||||
}
|
}
|
||||||
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
const getBindValue = Object.assign({}, unref(props), unref(attrs));
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
// 代码逻辑说明: 【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
if (tempSave.length) {
|
if (tempSave.length) {
|
||||||
selectValues.value = cloneDeep(tempSave);
|
selectValues.value = cloneDeep(tempSave);
|
||||||
@ -173,7 +165,6 @@
|
|||||||
emit('update:value', result);
|
emit('update:value', result);
|
||||||
emit('change', result);
|
emit('change', result);
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
|
||||||
return {
|
return {
|
||||||
// state,
|
// state,
|
||||||
attrs,
|
attrs,
|
||||||
@ -193,13 +184,12 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// update-begin--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
// 代码逻辑说明: 【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
||||||
.JselectUser {
|
.JselectUser {
|
||||||
> .ant-form-item {
|
> .ant-form-item {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式
|
|
||||||
.j-select-row {
|
.j-select-row {
|
||||||
@width: 82px;
|
@width: 82px;
|
||||||
|
|
||||||
|
|||||||
@ -71,11 +71,10 @@
|
|||||||
*/
|
*/
|
||||||
watch(selectValues, () => {
|
watch(selectValues, () => {
|
||||||
if (selectValues) {
|
if (selectValues) {
|
||||||
// update-begin--author:liaozhiyang---date:20250616---for:【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
// 代码逻辑说明: 【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
||||||
if (props.value === undefined && selectValues.value?.length == 0) {
|
if (props.value === undefined && selectValues.value?.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250616---for:【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
|
||||||
state.value = selectValues.value;
|
state.value = selectValues.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -71,11 +71,10 @@
|
|||||||
*/
|
*/
|
||||||
watch(selectValues, () => {
|
watch(selectValues, () => {
|
||||||
if (selectValues) {
|
if (selectValues) {
|
||||||
// update-begin--author:liaozhiyang---date:20250616---for:【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
// 代码逻辑说明: 【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
||||||
if (props.value === undefined && selectValues.value?.length == 0) {
|
if (props.value === undefined && selectValues.value?.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250616---for:【QQYUN-12869】通过部门选择用户组件,必填状态下选择用户后,点击重置后,会出校验信息
|
|
||||||
state.value = selectValues.value;
|
state.value = selectValues.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -41,14 +41,13 @@
|
|||||||
() => props.value,
|
() => props.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (!props.query) {
|
if (!props.query) {
|
||||||
// update-begin--author:liaozhiyang---date:20231226---for:【QQYUN-7473】options使用[0,1],导致开关无法切换
|
// 代码逻辑说明: 【QQYUN-7473】options使用[0,1],导致开关无法切换
|
||||||
if (!val && !props.options.includes(val)) {
|
if (!val && !props.options.includes(val)) {
|
||||||
checked.value = false;
|
checked.value = false;
|
||||||
emitValue(props.options[1]);
|
emitValue(props.options[1]);
|
||||||
} else {
|
} else {
|
||||||
checked.value = props.options[0] == val;
|
checked.value = props.options[0] == val;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231226---for:【QQYUN-7473】options使用[0,1],导致开关无法切换
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
|||||||
@ -46,28 +46,22 @@
|
|||||||
dict: propTypes.string.def('id'),
|
dict: propTypes.string.def('id'),
|
||||||
parentCode: propTypes.string.def(''),
|
parentCode: propTypes.string.def(''),
|
||||||
pidField: propTypes.string.def('pid'),
|
pidField: propTypes.string.def('pid'),
|
||||||
//update-begin---author:wangshuai ---date:20220620 for:JTreeSelect组件pidValue还原成空,否则会影响自定义组件树示例------------
|
// 代码逻辑说明: JTreeSelect组件pidValue还原成空,否则会影响自定义组件树示例------------
|
||||||
pidValue: propTypes.string.def(''),
|
pidValue: propTypes.string.def(''),
|
||||||
//update-end---author:wangshuai ---date:20220620 for:JTreeSelect组件pidValue还原成空,否则会影响自定义组件树示例--------------
|
|
||||||
hasChildField: propTypes.string.def(''),
|
hasChildField: propTypes.string.def(''),
|
||||||
converIsLeafVal: propTypes.integer.def(1),
|
converIsLeafVal: propTypes.integer.def(1),
|
||||||
condition: propTypes.string.def(''),
|
condition: propTypes.string.def(''),
|
||||||
multiple: propTypes.bool.def(false),
|
multiple: propTypes.bool.def(false),
|
||||||
loadTriggleChange: propTypes.bool.def(false),
|
loadTriggleChange: propTypes.bool.def(false),
|
||||||
reload: propTypes.number.def(1),
|
reload: propTypes.number.def(1),
|
||||||
//update-begin-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
// 代码逻辑说明: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
url: propTypes.string.def(''),
|
url: propTypes.string.def(''),
|
||||||
params: propTypes.object.def({}),
|
params: propTypes.object.def({}),
|
||||||
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
|
||||||
//update-begin---author:wangshuai date: 20230202 for: 新增是否有复选框
|
|
||||||
//默认没有选择框
|
//默认没有选择框
|
||||||
treeCheckAble: propTypes.bool.def(false),
|
treeCheckAble: propTypes.bool.def(false),
|
||||||
//update-end---author:wangshuai date: 20230202 for: 新增是否有复选框
|
|
||||||
hiddenNodeKey: propTypes.string.def(''),
|
hiddenNodeKey: propTypes.string.def(''),
|
||||||
//update-begin---author:wangshuai---date:2025-09-06---for: 多选时渲染tag文本,为空不渲染,不支持单选---
|
|
||||||
//多选时渲染tag文本
|
//多选时渲染tag文本
|
||||||
tagRender: propTypes.func,
|
tagRender: propTypes.func,
|
||||||
//update-end---author:wangshuai---date:2025-09-06---for:多选时渲染tag文本,为空不渲染,不支持单选---
|
|
||||||
});
|
});
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -93,7 +87,7 @@
|
|||||||
/**
|
/**
|
||||||
* 监听dict变化
|
* 监听dict变化
|
||||||
*/
|
*/
|
||||||
// update-begin--author:liaozhiyang---date:20240612---for:【issues/1283】JtreeSelect组件初始调用了两次接口
|
// 代码逻辑说明: 【issues/1283】JtreeSelect组件初始调用了两次接口
|
||||||
watch(
|
watch(
|
||||||
() => props.dict,
|
() => props.dict,
|
||||||
() => {
|
() => {
|
||||||
@ -101,8 +95,7 @@
|
|||||||
loadRoot();
|
loadRoot();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// update-end--author:liaozhiyang---date:20240612---for:【issues/1283】JtreeSelect组件初始调用了两次接口
|
// 代码逻辑说明: 【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
||||||
// update-begin--author:liaozhiyang---date:20240529---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
|
||||||
watch(
|
watch(
|
||||||
() => props.hiddenNodeKey,
|
() => props.hiddenNodeKey,
|
||||||
() => {
|
() => {
|
||||||
@ -112,26 +105,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// update-end--author:liaozhiyang---date:20240529---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-5-25 for: VUEN-1056 15、严重——online树表单,添加的时候,父亲节点是空的
|
// 代码逻辑说明: VUEN-1056 15、严重——online树表单,添加的时候,父亲节点是空的
|
||||||
watch(
|
watch(
|
||||||
() => props.reload,
|
() => props.reload,
|
||||||
async () => {
|
async () => {
|
||||||
treeData.value = [];
|
treeData.value = [];
|
||||||
// update-begin--author:liaozhiyang---date:20240524---for:【TV360X-88】online树表重复新增时父节点数据加载不全且已开的子节点不重新加载
|
// 代码逻辑说明: 【TV360X-88】online树表重复新增时父节点数据加载不全且已开的子节点不重新加载
|
||||||
show.value = false;
|
show.value = false;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
show.value = true;
|
show.value = true;
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20240524---for:【TV360X-88】online树表重复新增时父节点数据加载不全且已开的子节点不重新加载
|
|
||||||
await loadRoot();
|
await loadRoot();
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: false,
|
immediate: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:2022-5-25 for: VUEN-1056 15、严重——online树表单,添加的时候,父亲节点是空的
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据code获取下拉数据并回显
|
* 根据code获取下拉数据并回显
|
||||||
@ -144,11 +134,11 @@
|
|||||||
treeValue.value = { label: null, value: null };
|
treeValue.value = { label: null, value: null };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//update-begin-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
// 代码逻辑说明: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
if(props.url){
|
if(props.url){
|
||||||
getItemFromTreeData();
|
getItemFromTreeData();
|
||||||
}else{
|
}else{
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【issues/8093】选择节点后会先变成编码再显示label文字
|
// 代码逻辑说明: 【issues/8093】选择节点后会先变成编码再显示label文字
|
||||||
if (props.value) {
|
if (props.value) {
|
||||||
if (isArray(treeValue.value)) {
|
if (isArray(treeValue.value)) {
|
||||||
let isNotRequestTransform = false;
|
let isNotRequestTransform = false;
|
||||||
@ -164,11 +154,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250423---for:【issues/8093】选择节点后会先变成编码再显示label文字
|
|
||||||
let params = { key: props.value };
|
let params = { key: props.value };
|
||||||
let result = await defHttp.get({ url: `${Api.view}${props.dict}`, params }, { isTransformResponse: false });
|
let result = await defHttp.get({ url: `${Api.view}${props.dict}`, params }, { isTransformResponse: false });
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
//update-start-author:liaozhiyang date:2023-7-17 for:【issues/5141】使用JtreeSelect 组件 控制台报错
|
|
||||||
if(props.multiple){
|
if(props.multiple){
|
||||||
let values = props.value.split(',');
|
let values = props.value.split(',');
|
||||||
treeValue.value = result.result.map((item, index) => ({
|
treeValue.value = result.result.map((item, index) => ({
|
||||||
@ -179,11 +167,9 @@
|
|||||||
}else{
|
}else{
|
||||||
treeValue.value = { key: props.value, value: props.value, label: translateTitle(result.result[0]) };
|
treeValue.value = { key: props.value, value: props.value, label: translateTitle(result.result[0]) };
|
||||||
}
|
}
|
||||||
//update-end-author:liaozhiyang date:2023-7-17 for:【issues/5141】使用JtreeSelect 组件 控制台报错
|
|
||||||
onLoadTriggleChange(result.result[0]);
|
onLoadTriggleChange(result.result[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,9 +211,8 @@
|
|||||||
i.value = i.key;
|
i.value = i.key;
|
||||||
i.isLeaf = !!i.leaf;
|
i.isLeaf = !!i.leaf;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
// 代码逻辑说明: 【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
||||||
handleHiddenNode(res.result);
|
handleHiddenNode(res.result);
|
||||||
// update-end--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
|
||||||
treeData.value = [...res.result];
|
treeData.value = [...res.result];
|
||||||
} else {
|
} else {
|
||||||
console.log('数根节点查询结果异常', res);
|
console.log('数根节点查询结果异常', res);
|
||||||
@ -272,9 +257,8 @@
|
|||||||
i.value = i.key;
|
i.value = i.key;
|
||||||
i.isLeaf = !!i.leaf;
|
i.isLeaf = !!i.leaf;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
// 代码逻辑说明: 【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
||||||
handleHiddenNode(res.result);
|
handleHiddenNode(res.result);
|
||||||
// update-end--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
|
||||||
//添加子节点
|
//添加子节点
|
||||||
addChildren(pid, res.result, treeData.value);
|
addChildren(pid, res.result, treeData.value);
|
||||||
treeData.value = [...treeData.value];
|
treeData.value = [...treeData.value];
|
||||||
@ -313,7 +297,7 @@
|
|||||||
} else {
|
} else {
|
||||||
emitValue(value.value);
|
emitValue(value.value);
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【issues/8093】删除后会先变成编码再显示label文字
|
// 代码逻辑说明: 【issues/8093】删除后会先变成编码再显示label文字
|
||||||
if (isArray(value)) {
|
if (isArray(value)) {
|
||||||
// 编辑删除时有选中的值是异步(第二级以上的)会不显示label
|
// 编辑删除时有选中的值是异步(第二级以上的)会不显示label
|
||||||
value.forEach((item) => {
|
value.forEach((item) => {
|
||||||
@ -328,7 +312,6 @@
|
|||||||
} else {
|
} else {
|
||||||
treeValue.value = value;
|
treeValue.value = value;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250423---for:【issues/8093】删除后会先变成编码再显示label文字
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitValue(value) {
|
function emitValue(value) {
|
||||||
@ -368,7 +351,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
// 代码逻辑说明: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
watch(()=>props.url, async (val)=>{
|
watch(()=>props.url, async (val)=>{
|
||||||
if(val){
|
if(val){
|
||||||
await loadRootByUrl();
|
await loadRootByUrl();
|
||||||
@ -388,9 +371,8 @@
|
|||||||
i.key = i.value;
|
i.key = i.value;
|
||||||
i.isLeaf = !!i.leaf;
|
i.isLeaf = !!i.leaf;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
// 代码逻辑说明: 【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
||||||
handleHiddenNode(res.result);
|
handleHiddenNode(res.result);
|
||||||
// update-end--author:liaozhiyang---date:20240523---for:【TV360X-87】树表编辑时不可选自己及子孙节点当父节点
|
|
||||||
treeData.value = [...res.result];
|
treeData.value = [...res.result];
|
||||||
} else {
|
} else {
|
||||||
console.log('数根节点查询结果异常', res);
|
console.log('数根节点查询结果异常', res);
|
||||||
@ -431,7 +413,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 2024-05-23
|
* 2024-05-23
|
||||||
|
|||||||
@ -97,19 +97,17 @@
|
|||||||
});
|
});
|
||||||
// 合并 props 和 attrs
|
// 合并 props 和 attrs
|
||||||
const bindProps = computed(() => {
|
const bindProps = computed(() => {
|
||||||
//update-begin-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
// 代码逻辑说明: [issue/455]上传组件传入accept限制上传文件类型无效
|
||||||
const bind: any = Object.assign({}, props, unref(attrs));
|
const bind: any = Object.assign({}, props, unref(attrs));
|
||||||
//update-end-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
|
||||||
|
|
||||||
bind.name = 'file';
|
bind.name = 'file';
|
||||||
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
||||||
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
||||||
bind.data = { biz: props.bizPath, ...bind.data };
|
bind.data = { biz: props.bizPath, ...bind.data };
|
||||||
//update-begin-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
// 代码逻辑说明: 自定义beforeUpload return false,并不能中断上传过程
|
||||||
if (!bind.beforeUpload) {
|
if (!bind.beforeUpload) {
|
||||||
bind.beforeUpload = onBeforeUpload;
|
bind.beforeUpload = onBeforeUpload;
|
||||||
}
|
}
|
||||||
//update-end-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
|
||||||
// 如果当前是图片上传模式,就只能上传图片
|
// 如果当前是图片上传模式,就只能上传图片
|
||||||
if (isImageMode.value && !bind.accept) {
|
if (isImageMode.value && !bind.accept) {
|
||||||
bind.accept = 'image/*';
|
bind.accept = 'image/*';
|
||||||
@ -127,13 +125,12 @@
|
|||||||
parseArrayValue(val);
|
parseArrayValue(val);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//update-begin---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
// 代码逻辑说明: [issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
||||||
if (props.returnUrl) {
|
if (props.returnUrl) {
|
||||||
parsePathsValue(val);
|
parsePathsValue(val);
|
||||||
} else {
|
} else {
|
||||||
val && parseArrayValue(JSON.parse(val));
|
val && parseArrayValue(JSON.parse(val));
|
||||||
}
|
}
|
||||||
//update-end---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
@ -202,9 +199,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let list: any[] = [];
|
let list: any[] = [];
|
||||||
// update-begin--author:liaozhiyang---date:20250325---for:【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
// 代码逻辑说明: 【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
||||||
const result = split(paths);
|
const result = split(paths);
|
||||||
// update-end--author:liaozhiyang---date:20250325---for:【issues/7990】图片参数中包含逗号会错误的识别成多张图
|
|
||||||
for (const item of result) {
|
for (const item of result) {
|
||||||
let url = getFileAccessHttpUrl(item);
|
let url = getFileAccessHttpUrl(item);
|
||||||
list.push({
|
list.push({
|
||||||
@ -309,10 +305,8 @@
|
|||||||
} else if (info.file.status === 'error') {
|
} else if (info.file.status === 'error') {
|
||||||
createMessage.error(`${info.file.name} 上传失败.`);
|
createMessage.error(`${info.file.name} 上传失败.`);
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240628---for:【issues/1273】上传组件JUpload配置beforeUpload阻止了上传,前端页面中还是显示缩略图
|
|
||||||
// beforeUpload 返回false,则没有status
|
// beforeUpload 返回false,则没有status
|
||||||
info.file.status && (fileList.value = fileListTemp);
|
info.file.status && (fileList.value = fileListTemp);
|
||||||
// update-end--author:liaozhiyang---date:20240628---for:【issues/1273】上传组件JUpload配置beforeUpload阻止了上传,前端页面中还是显示缩略图
|
|
||||||
if (info.file.status === 'done' || info.file.status === 'removed') {
|
if (info.file.status === 'done' || info.file.status === 'removed') {
|
||||||
//returnUrl为true时仅返回文件路径
|
//returnUrl为true时仅返回文件路径
|
||||||
if (props.returnUrl) {
|
if (props.returnUrl) {
|
||||||
@ -332,9 +326,8 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//update-begin---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
// 代码逻辑说明: [issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
||||||
emitValue(JSON.stringify(newFileList));
|
emitValue(JSON.stringify(newFileList));
|
||||||
//update-end---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,8 +27,8 @@
|
|||||||
v-bind="attrs"
|
v-bind="attrs"
|
||||||
>
|
>
|
||||||
<template v-if="isCustomRenderTag" #tagRender="{ label, value, option}">
|
<template v-if="isCustomRenderTag" #tagRender="{ label, value, option}">
|
||||||
<a-tag class="ant-select-selection-item">
|
<a-tag class="ant-select-selection-item" style="margin-right: 4px">
|
||||||
<span class="ant-select-selection-item-content" style="font-size: 14px;max-width: 300px" :title="tagRender(label, value, option)">{{ tagRender(label, value, option) }}</span>
|
<span class="ant-select-selection-item-content" style="font-size: 14px;max-width: 300px" :title="tagRender(label, value, false)">{{ tagRender(label, value, true) }}</span>
|
||||||
<span class="ant-select-selection-item-remove">
|
<span class="ant-select-selection-item-remove">
|
||||||
<Icon icon="ant-design:close-outlined" size="12" @click="handleRemoveClick(value)"></Icon>
|
<Icon icon="ant-design:close-outlined" size="12" @click="handleRemoveClick(value)"></Icon>
|
||||||
</span>
|
</span>
|
||||||
@ -79,11 +79,9 @@
|
|||||||
buttonIcon: propTypes.string.def(''),
|
buttonIcon: propTypes.string.def(''),
|
||||||
// 【TV360X-1002】是否是详情模式
|
// 【TV360X-1002】是否是详情模式
|
||||||
isDetailsMode: propTypes.bool.def(false),
|
isDetailsMode: propTypes.bool.def(false),
|
||||||
//update-begin---author:wangshuai---date:2025-09-06---for: 多选时是否自定义渲染tag文本,为空不渲染,不支持单选---
|
|
||||||
//是否自定义渲染tag
|
//是否自定义渲染tag
|
||||||
isCustomRenderTag: propTypes.bool.def(false),
|
isCustomRenderTag: propTypes.bool.def(false),
|
||||||
rowKey: propTypes.string.def('id'),
|
rowKey: propTypes.string.def('id'),
|
||||||
//update-end---author:wangshuai---date:2025-09-06---for:多选时是否自定义渲染tag文本,为空不渲染,不支持单选---
|
|
||||||
},
|
},
|
||||||
emits: ['handleOpen', 'change'],
|
emits: ['handleOpen', 'change'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
:checkStrictly="getCheckStrictly"
|
:checkStrictly="getCheckStrictly"
|
||||||
:key="reloadKey"
|
:key="reloadKey"
|
||||||
>
|
>
|
||||||
<template #title="{ orgCategory, title }">
|
<template #title="{ orgCategory, title, orgCode }">
|
||||||
<TreeIcon :orgCategory="orgCategory" :title="title"></TreeIcon>
|
<TreeIcon :orgCategory="orgCategory" :title="getTitle(orgCategory, title, orgCode)"></TreeIcon>
|
||||||
</template>
|
</template>
|
||||||
</BasicTree>
|
</BasicTree>
|
||||||
<!--树操作部分-->
|
<!--树操作部分-->
|
||||||
@ -30,6 +30,8 @@
|
|||||||
<a-menu-item v-if="multiple" key="2" @click="checkALL(false)">取消全选</a-menu-item>
|
<a-menu-item v-if="multiple" key="2" @click="checkALL(false)">取消全选</a-menu-item>
|
||||||
<a-menu-item key="3" @click="expandAll(true)">展开全部</a-menu-item>
|
<a-menu-item key="3" @click="expandAll(true)">展开全部</a-menu-item>
|
||||||
<a-menu-item key="4" @click="expandAll(false)">折叠全部</a-menu-item>
|
<a-menu-item key="4" @click="expandAll(false)">折叠全部</a-menu-item>
|
||||||
|
<a-menu-item v-if="multiple" key="5" @click="toggleCheckStrictly(false)">层级关联</a-menu-item>
|
||||||
|
<a-menu-item v-if="multiple" key="6" @click="toggleCheckStrictly(true)">层级独立</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<a-button style="float: left"> 树操作 <Icon icon="ant-design:up-outlined" /> </a-button>
|
<a-button style="float: left"> 树操作 <Icon icon="ant-design:up-outlined" /> </a-button>
|
||||||
@ -39,7 +41,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, unref } from 'vue';
|
import { defineComponent, ref, unref, reactive } from 'vue';
|
||||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||||
import { queryDepartTreeSync, queryTreeList, queryDepartAndPostTreeSync } from '/@/api/common/api';
|
import { queryDepartTreeSync, queryTreeList, queryDepartAndPostTreeSync } from '/@/api/common/api';
|
||||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||||
@ -49,6 +51,7 @@
|
|||||||
import {propTypes} from "/@/utils/propTypes";
|
import {propTypes} from "/@/utils/propTypes";
|
||||||
import { omit } from 'lodash-es';
|
import { omit } from 'lodash-es';
|
||||||
import TreeIcon from '@/components/Form/src/jeecg/components/TreeIcon/TreeIcon.vue';
|
import TreeIcon from '@/components/Form/src/jeecg/components/TreeIcon/TreeIcon.vue';
|
||||||
|
import { getDepartPathNameByOrgCode } from "@/utils/common/compUtils";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'DeptSelectModal',
|
name: 'DeptSelectModal',
|
||||||
@ -64,18 +67,22 @@
|
|||||||
type: String,
|
type: String,
|
||||||
default: '部门选择',
|
default: '部门选择',
|
||||||
},
|
},
|
||||||
// update-begin--author:liaozhiyang---date:20231220---for:【QQYUN-7678】部门组件内容过多没有滚动条(给一个默认最大高)
|
// 代码逻辑说明: 【QQYUN-7678】部门组件内容过多没有滚动条(给一个默认最大高)
|
||||||
maxHeight: {
|
maxHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 500,
|
default: 500,
|
||||||
},
|
},
|
||||||
// update-end--author:liaozhiyang---date:20231220---for:【QQYUN-7678】部门组件内容过多没有滚动条(给一个默认最大高)
|
|
||||||
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||||
//查询参数
|
//查询参数
|
||||||
params: {
|
params: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
|
//是否显示部门路径(用户部门选择主岗位和兼职岗位需要显示全路径)
|
||||||
|
izShowDepPath: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['register', 'getSelectResult', 'close'],
|
emits: ['register', 'getSelectResult', 'close'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
@ -86,20 +93,18 @@
|
|||||||
//加载树key
|
//加载树key
|
||||||
const reloadKey = ref<number>(Math.random());
|
const reloadKey = ref<number>(Math.random());
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-10-28 for: 部门选择警告类型不匹配
|
// 代码逻辑说明: 部门选择警告类型不匹配
|
||||||
let propValue = props.value === ''?[]:props.value;
|
let propValue = props.value === ''?[]:props.value;
|
||||||
// 确保传递给BasicTree的value是数组格式
|
// 确保传递给BasicTree的value是数组格式
|
||||||
if (propValue && typeof propValue === 'string') {
|
if (propValue && typeof propValue === 'string') {
|
||||||
propValue = propValue.split(',');
|
propValue = propValue.split(',');
|
||||||
}
|
}
|
||||||
//update-begin-author:liusq date:2023-05-26 for: [issues/538]JSelectDept组件受 dynamicDisabled 影响
|
// 代码逻辑说明: [issues/538]JSelectDept组件受 dynamicDisabled 影响
|
||||||
let temp = Object.assign({}, unref(props), unref(attrs), {value: propValue},{disabled: false});
|
let temp = Object.assign({}, unref(props), unref(attrs), {value: propValue},{disabled: false});
|
||||||
const getBindValue = omit(temp, 'multiple');
|
const getBindValue = omit(temp, 'multiple');
|
||||||
//update-end-author:liusq date:2023-05-26 for: [issues/538]JSelectDept组件受 dynamicDisabled 影响
|
|
||||||
//update-end-author:taoyan date:2022-10-28 for: 部门选择警告类型不匹配
|
|
||||||
|
|
||||||
const queryUrl = getQueryUrl();
|
const queryUrl = getQueryUrl();
|
||||||
const [{ visibleChange, checkedKeys, getCheckStrictly, getSelectTreeData, onCheck, onLoadData, treeData, checkALL, expandAll, onSelect, onSearch, expandedKeys }] =
|
const [{ visibleChange, checkedKeys, getCheckStrictly, getSelectTreeData, onCheck, onLoadData, treeData, checkALL, expandAll, onSelect, onSearch, expandedKeys, checkStrictly }] =
|
||||||
useTreeBiz(treeRef, queryUrl, getBindValue, props, emit);
|
useTreeBiz(treeRef, queryUrl, getBindValue, props, emit);
|
||||||
const searchInfo = ref(props.params || {});
|
const searchInfo = ref(props.params || {});
|
||||||
const tree = ref([]);
|
const tree = ref([]);
|
||||||
@ -123,9 +128,8 @@
|
|||||||
/** 获取查询数据方法 */
|
/** 获取查询数据方法 */
|
||||||
function getQueryUrl() {
|
function getQueryUrl() {
|
||||||
let queryFn = props.izOnlySelectDepartPost ? queryDepartAndPostTreeSync :props.sync ? queryDepartTreeSync : queryTreeList;
|
let queryFn = props.izOnlySelectDepartPost ? queryDepartAndPostTreeSync :props.sync ? queryDepartTreeSync : queryTreeList;
|
||||||
//update-begin-author:taoyan date:2022-7-4 for: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
// 代码逻辑说明: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
||||||
return (params) => queryFn(Object.assign({}, params, { primaryKey: props.rowKey }));
|
return (params) => queryFn(Object.assign({}, params, { primaryKey: props.rowKey }));
|
||||||
//update-end-author:taoyan date:2022-7-4 for: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -137,6 +141,44 @@
|
|||||||
reloadKey.value = Math.random();
|
reloadKey.value = Math.random();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置层级关联和层级独立
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
*/
|
||||||
|
function toggleCheckStrictly(value) {
|
||||||
|
checkStrictly.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
//标题缓存
|
||||||
|
const titleCache = reactive<Record<string, string>>({});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取标题
|
||||||
|
* @param orgCategory
|
||||||
|
* @param title
|
||||||
|
* @param orgCode
|
||||||
|
*/
|
||||||
|
function getTitle(orgCategory, title, orgCode) {
|
||||||
|
if(props.izShowDepPath && orgCategory === '2'){
|
||||||
|
const cached = titleCache[orgCode];
|
||||||
|
if (cached){
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
getDepartPathNameByOrgCode(orgCode,title,"").then(res=>{
|
||||||
|
if(res){
|
||||||
|
titleCache[orgCode] = title + "(" + res.substring(0, res.lastIndexOf('/')) + ")";
|
||||||
|
}else{
|
||||||
|
titleCache[orgCode] = title;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return title;
|
||||||
|
} else {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tree,
|
tree,
|
||||||
handleOk,
|
handleOk,
|
||||||
@ -158,6 +200,8 @@
|
|||||||
onSearch,
|
onSearch,
|
||||||
reloadKey,
|
reloadKey,
|
||||||
handelSearchChange,
|
handelSearchChange,
|
||||||
|
toggleCheckStrictly,
|
||||||
|
getTitle,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -109,11 +109,10 @@
|
|||||||
const toggleSearchStatus = ref(false);
|
const toggleSearchStatus = ref(false);
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const tableScroll = ref({ x: true });
|
const tableScroll = ref({ x: true });
|
||||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/675】子表字段Popup弹框数据不更新
|
// 代码逻辑说明: 【issues/675】子表字段Popup弹框数据不更新
|
||||||
const getBindValue = computed(() => {
|
const getBindValue = computed(() => {
|
||||||
return Object.assign({}, unref(props), unref(attrs));
|
return Object.assign({}, unref(props), unref(attrs));
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20230811---for:【issues/675】子表字段Popup弹框数据不更新
|
|
||||||
const [
|
const [
|
||||||
{
|
{
|
||||||
visibleChange,
|
visibleChange,
|
||||||
@ -159,12 +158,11 @@
|
|||||||
watch(
|
watch(
|
||||||
() => props.param,
|
() => props.param,
|
||||||
() => {
|
() => {
|
||||||
// update-begin--author:liaozhiyang---date:20231213---for:【issues/901】JPopup组件配置param参数后异常
|
// 代码逻辑说明: 【issues/901】JPopup组件配置param参数后异常
|
||||||
if (visible.value) {
|
if (visible.value) {
|
||||||
dynamicParamHandler();
|
dynamicParamHandler();
|
||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20231213---for:【issues/901】JPopup组件配置param参数后异常
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
@ -189,7 +187,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//update-begin-author:taoyan date:2022-5-31 for: VUEN-1156 popup 多数据有分页时,选中其他页,关闭popup 再点开,分页仍然选中上一次点击的分页,但数据是第一页的数据 未刷新
|
// 代码逻辑说明: VUEN-1156 popup 多数据有分页时,选中其他页,关闭popup 再点开,分页仍然选中上一次点击的分页,但数据是第一页的数据 未刷新
|
||||||
watch(
|
watch(
|
||||||
() => pagination.current,
|
() => pagination.current,
|
||||||
(current) => {
|
(current) => {
|
||||||
@ -200,7 +198,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
//update-end-author:taoyan date:2022-5-31 for: VUEN-1156 popup 多数据有分页时,选中其他页,关闭popup 再点开,分页仍然选中上一次点击的分页,但数据是第一页的数据 未刷新
|
|
||||||
|
|
||||||
function handleToggleSearch() {
|
function handleToggleSearch() {
|
||||||
toggleSearchStatus.value = !unref(toggleSearchStatus);
|
toggleSearchStatus.value = !unref(toggleSearchStatus);
|
||||||
@ -212,9 +209,8 @@
|
|||||||
closeModal();
|
closeModal();
|
||||||
checkedKeys.value = [];
|
checkedKeys.value = [];
|
||||||
selectRows.value = [];
|
selectRows.value = [];
|
||||||
// update-begin--author:liaozhiyang---date:20230908---for:【issues/742】选择后删除默认仍然存在
|
// 代码逻辑说明: 【issues/742】选择后删除默认仍然存在
|
||||||
tableRef.value.clearSelectedRowKeys();
|
tableRef.value.clearSelectedRowKeys();
|
||||||
// update-end--author:liaozhiyang---date:20230908---for:【issues/742】选择后删除默认仍然存在
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -230,10 +226,9 @@
|
|||||||
createMessage.warning('至少选择一条记录');
|
createMessage.warning('至少选择一条记录');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//update-begin-author:taoyan date:2022-5-31 for: VUEN-1155 popup 选择数据时,会选择多条重复数据
|
// 代码逻辑说明: VUEN-1155 popup 选择数据时,会选择多条重复数据
|
||||||
let rows = getOkSelectRows!();
|
let rows = getOkSelectRows!();
|
||||||
emit('ok', rows);
|
emit('ok', rows);
|
||||||
//update-end-author:taoyan date:2022-5-31 for: VUEN-1155 popup 选择数据时,会选择多条重复数据
|
|
||||||
handleCancel();
|
handleCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +279,7 @@
|
|||||||
createImgPreview({ imageList: imgList });
|
createImgPreview({ imageList: imgList });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20250415--for:【issues/3656】popupdict回显
|
// 代码逻辑说明: 【issues/3656】popupdict回显
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
if (props.selected && props.rowkey) {
|
if (props.selected && props.rowkey) {
|
||||||
const selected = props.multi ? props.selected : [props.selected];
|
const selected = props.multi ? props.selected : [props.selected];
|
||||||
@ -292,7 +287,6 @@
|
|||||||
selectRows!.value = selected;
|
selectRows!.value = selected;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20250415--for:【issues/3656】popupdict回显
|
|
||||||
return {
|
return {
|
||||||
attrs,
|
attrs,
|
||||||
register,
|
register,
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
<template v-for="item in searchResult.depart" :key="item.id">
|
<template v-for="item in searchResult.depart" :key="item.id">
|
||||||
<div class="search-depart-item" @click="handleSearchDepartClick(item)">
|
<div class="search-depart-item" @click="handleSearchDepartClick(item)">
|
||||||
<a-checkbox v-model:checked="item.checked" @click.stop @change="($event) => handleSearchDepartCheck($event, item)" />
|
<a-checkbox v-model:checked="item.checked" @click.stop @change="($event) => handleSearchDepartCheck($event, item)" />
|
||||||
<div class="search-depart-item-name">{{ item.departName }}</div>
|
<div class="search-depart-item-name">{{ getDepartName(item.departName, item.departNameAbbr) }}</div>
|
||||||
<RightOutlined />
|
<RightOutlined />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -62,16 +62,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
|
<div ref="breadcrumbBoxRef">
|
||||||
<a-breadcrumb v-if="breadcrumb.length">
|
<a-breadcrumb v-if="breadcrumb.length">
|
||||||
<a-breadcrumb-item @click="handleBreadcrumbClick()">
|
<a-breadcrumb-item @click="handleBreadcrumbClick()">
|
||||||
<HomeOutlined />
|
<HomeOutlined />
|
||||||
</a-breadcrumb-item>
|
</a-breadcrumb-item>
|
||||||
<template v-for="item in breadcrumb" :key="item?.id">
|
<template v-for="item in breadcrumb" :key="item?.id">
|
||||||
<a-breadcrumb-item @click="handleBreadcrumbClick(item)">
|
<a-breadcrumb-item @click="handleBreadcrumbClick(item)">
|
||||||
<span>{{ item.departName }}</span>
|
<span>{{ getDepartName(item.departName, item.departNameAbbr) }}</span>
|
||||||
</a-breadcrumb-item>
|
</a-breadcrumb-item>
|
||||||
</template>
|
</template>
|
||||||
</a-breadcrumb>
|
</a-breadcrumb>
|
||||||
|
</div>
|
||||||
<div v-if="currentDepartUsers.length">
|
<div v-if="currentDepartUsers.length">
|
||||||
<!-- 当前部门用户树 -->
|
<!-- 当前部门用户树 -->
|
||||||
<div class="depart-users-tree">
|
<div class="depart-users-tree">
|
||||||
@ -96,7 +98,7 @@
|
|||||||
<template v-for="item in currentDepartTree" :key="item.id">
|
<template v-for="item in currentDepartTree" :key="item.id">
|
||||||
<div class="depart-tree-item" @click="handleDepartTreeClick(item)">
|
<div class="depart-tree-item" @click="handleDepartTreeClick(item)">
|
||||||
<a-checkbox v-model:checked="item.checked" @click.stop @change="($event) => handleDepartTreeCheck($event, item)" />
|
<a-checkbox v-model:checked="item.checked" @click.stop @change="($event) => handleDepartTreeCheck($event, item)" />
|
||||||
<div class="depart-tree-item-name">{{ item.departName }}</div>
|
<div class="depart-tree-item-name">{{ getDepartName(item.departName, item.departNameAbbr) }}</div>
|
||||||
<RightOutlined />
|
<RightOutlined />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -130,7 +132,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { RightOutlined, HomeOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
import { RightOutlined, HomeOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
||||||
import { BasicModal, useModalInner } from '/@/components/Modal';
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||||
import { queryTreeList, getTableList as getTableListOrigin } from '/@/api/common/api';
|
import { queryTreeList, getTableList as getTableListOrigin } from '/@/api/common/api';
|
||||||
@ -164,6 +166,11 @@
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
|
// 是否启用公司简称
|
||||||
|
useCompanyShortName: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
//最大选择数量
|
//最大选择数量
|
||||||
maxSelectCount: {
|
maxSelectCount: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -198,6 +205,8 @@
|
|||||||
depart: [],
|
depart: [],
|
||||||
user: [],
|
user: [],
|
||||||
});
|
});
|
||||||
|
// 面包屑框
|
||||||
|
const breadcrumbBoxRef = ref();
|
||||||
// 映射部门和人员的关系
|
// 映射部门和人员的关系
|
||||||
const cacheDepartUser = {};
|
const cacheDepartUser = {};
|
||||||
//注册弹框
|
//注册弹框
|
||||||
@ -361,7 +370,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
currentDepartUsers.value = result;
|
currentDepartUsers.value = result.sort((a, b) => a.sort - b.sort );
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 没有子节点,则显示用户
|
// 没有子节点,则显示用户
|
||||||
@ -382,7 +391,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
currentDepartAllUsers.value = checked;
|
currentDepartAllUsers.value = checked;
|
||||||
currentDepartUsers.value = res.records;
|
currentDepartUsers.value = res.records.sort((a, b) => a.sort - b.sort );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -467,6 +476,17 @@
|
|||||||
const result = currentDepartUsers.value.every((item: any) => !!item.checked);
|
const result = currentDepartUsers.value.every((item: any) => !!item.checked);
|
||||||
currentDepartAllUsers.value = result;
|
currentDepartAllUsers.value = result;
|
||||||
};
|
};
|
||||||
|
watch(breadcrumb, () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
breadcrumbScrollToRight();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
const breadcrumbScrollToRight = () => {
|
||||||
|
const olEle = breadcrumbBoxRef.value?.querySelector('ol');
|
||||||
|
if (olEle) {
|
||||||
|
olEle.scrollLeft = 30000;
|
||||||
|
}
|
||||||
|
};
|
||||||
// 解析参数
|
// 解析参数
|
||||||
const parseParams = (params) => {
|
const parseParams = (params) => {
|
||||||
if (props?.params) {
|
if (props?.params) {
|
||||||
@ -542,7 +562,7 @@
|
|||||||
const result: any[] = [];
|
const result: any[] = [];
|
||||||
const search = (nodes: any[]) => {
|
const search = (nodes: any[]) => {
|
||||||
for (const node of nodes) {
|
for (const node of nodes) {
|
||||||
if (node.departName?.toLowerCase().includes(name.toLowerCase())) {
|
if (getDepartName(node.departName, node.departNameAbbr)?.toLowerCase().includes(name.toLowerCase())) {
|
||||||
result.push(node);
|
result.push(node);
|
||||||
}
|
}
|
||||||
if (node.children?.length) {
|
if (node.children?.length) {
|
||||||
@ -568,6 +588,13 @@
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
// 获取部门名称(如果启用公司简称且公司简称不为空,则返回公司简称)
|
||||||
|
function getDepartName(departName, departNameAbbr) {
|
||||||
|
if (props.useCompanyShortName && departNameAbbr) {
|
||||||
|
return departNameAbbr;
|
||||||
|
}
|
||||||
|
return departName;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.JSelectUserByDepartmentModal {
|
.JSelectUserByDepartmentModal {
|
||||||
@ -603,9 +630,34 @@
|
|||||||
:deep(.ant-breadcrumb) {
|
:deep(.ant-breadcrumb) {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
|
margin-right: 16px;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
ol {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
overflow-x: auto;
|
||||||
|
/* 美化滚动条 */
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
height: 3px;
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background: #bfbfbf;
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
&:hover {
|
||||||
|
background: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
li {
|
li {
|
||||||
|
flex: none;
|
||||||
.ant-breadcrumb-link {
|
.ant-breadcrumb-link {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
&:hover {
|
&:hover {
|
||||||
@ -777,7 +829,7 @@
|
|||||||
}
|
}
|
||||||
.selected-users {
|
.selected-users {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow: hidden auto;
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
xl: 10,
|
xl: 10,
|
||||||
xxl: 10,
|
xxl: 10,
|
||||||
},
|
},
|
||||||
//update-begin-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
// 代码逻辑说明: [issues/5514]组件页面显示错位
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 8,
|
sm: 8,
|
||||||
@ -109,7 +109,6 @@
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-end-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
label: '职务名称',
|
label: '职务名称',
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
xl: 14,
|
xl: 14,
|
||||||
xxl: 14,
|
xxl: 14,
|
||||||
},
|
},
|
||||||
//update-begin-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
// 代码逻辑说明: [issues/5514]组件页面显示错位
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 8,
|
sm: 8,
|
||||||
@ -76,7 +76,6 @@
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-end-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
label: '角色名称',
|
label: '角色名称',
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<a-col :md="17" :sm="24">
|
<a-col :md="17" :sm="24">
|
||||||
<a-card :style="{ minHeight: '613px', overflow: 'auto' }">
|
<a-card :style="{ minHeight: '613px', overflow: 'auto' }">
|
||||||
<!--用户列表-->
|
<!--用户列表-->
|
||||||
<BasicTable ref="tableRef" v-bind="getBindValue" :searchInfo="searchInfo" :api="getTableList" :rowSelection="rowSelection"></BasicTable>
|
<BasicTable ref="tableRef" v-bind="getBindValue" :searchInfo="searchInfo" :api="getTableList" :rowSelection="rowSelection" :defSort="{ column: '', order: '' }"></BasicTable>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -97,6 +97,12 @@
|
|||||||
{
|
{
|
||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
|
customRender:( { record, text })=>{
|
||||||
|
if(record.izHideContact && record.izHideContact === '1'){
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
// width: 50,
|
// width: 50,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -116,7 +122,7 @@
|
|||||||
xl: 6,
|
xl: 6,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-begin-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
// 代码逻辑说明: [issues/5514]组件页面显示错位
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 12,
|
sm: 12,
|
||||||
@ -125,7 +131,6 @@
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-end-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
label: '账号',
|
label: '账号',
|
||||||
|
|||||||
@ -103,6 +103,12 @@
|
|||||||
{
|
{
|
||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
|
customRender:( { record, text })=>{
|
||||||
|
if(record.izHideContact && record.izHideContact === '1'){
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
@ -121,7 +127,7 @@
|
|||||||
xl: 6,
|
xl: 6,
|
||||||
xxl: 10,
|
xxl: 10,
|
||||||
},
|
},
|
||||||
//update-begin-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
// 代码逻辑说明: [issues/5514]组件页面显示错位
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 12,
|
sm: 12,
|
||||||
@ -130,7 +136,6 @@
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-end-author:liusq date:2023-10-30 for: [issues/5514]组件页面显示错位
|
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
label: '账号',
|
label: '账号',
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
@register="register"
|
@register="register"
|
||||||
:title="modalTitle"
|
:title="modalTitle"
|
||||||
:width="showSelected ? '1200px' : '900px'"
|
:width="showSelected ? '1200px' : '900px'"
|
||||||
wrapClassName="j-user-select-modal"
|
:wrapClassName="modalWrapClassName"
|
||||||
@ok="handleOk"
|
@ok="handleOk"
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
:maxHeight="maxHeight"
|
:maxHeight="maxHeight"
|
||||||
@ -30,10 +30,9 @@
|
|||||||
:indexColumnProps="indexColumnProps"
|
:indexColumnProps="indexColumnProps"
|
||||||
:afterFetch="afterFetch"
|
:afterFetch="afterFetch"
|
||||||
:beforeFetch="beforeFetch"
|
:beforeFetch="beforeFetch"
|
||||||
|
:defSort="{ column: '', order: '' }"
|
||||||
>
|
>
|
||||||
<!-- update-begin-author:taoyan date:2022-5-25 for: VUEN-1112一对多 用户选择 未显示选择条数,及清空 -->
|
|
||||||
<template #tableTitle></template>
|
<template #tableTitle></template>
|
||||||
<!-- update-end-author:taoyan date:2022-5-25 for: VUEN-1112一对多 用户选择 未显示选择条数,及清空 -->
|
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="showSelected ? 6 : 0">
|
<a-col :span="showSelected ? 6 : 0">
|
||||||
@ -78,22 +77,29 @@
|
|||||||
type: String,
|
type: String,
|
||||||
default: '选择用户',
|
default: '选择用户',
|
||||||
},
|
},
|
||||||
//update-begin---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
//排除用户id的集合
|
//排除用户id的集合
|
||||||
excludeUserIdList: {
|
excludeUserIdList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: [],
|
||||||
},
|
},
|
||||||
//update-end---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
|
|
||||||
|
// wrap类名
|
||||||
|
modalWrapClassName: {
|
||||||
|
type: String,
|
||||||
|
default: 'j-user-select-modal',
|
||||||
|
},
|
||||||
// 查询table数据使用的自定义接口
|
// 查询table数据使用的自定义接口
|
||||||
customListApi: {type: Function},
|
customListApi: {type: Function},
|
||||||
// 自定义接口的查询条件是否使用 JInput
|
// 自定义接口的查询条件是否使用 JInput
|
||||||
customApiJInput: {type: Boolean, default: true},
|
customApiJInput: {type: Boolean, default: true},
|
||||||
|
// 自定义表单配置条件
|
||||||
|
customFormConfig: {type: Object},
|
||||||
|
// 自定义表格列
|
||||||
|
customTableColumns: {type: Array},
|
||||||
},
|
},
|
||||||
emits: ['register', 'getSelectResult', 'close'],
|
emits: ['register', 'getSelectResult', 'close'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
// update-begin-author:taoyan date:2022-5-24 for: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条
|
// 代码逻辑说明: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条
|
||||||
const tableScroll = ref<any>({ x: false });
|
const tableScroll = ref<any>({ x: false });
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const maxHeight = ref(600);
|
const maxHeight = ref(600);
|
||||||
@ -107,15 +113,13 @@
|
|||||||
} else {
|
} else {
|
||||||
tableScroll.value = { x: false };
|
tableScroll.value = { x: false };
|
||||||
}
|
}
|
||||||
//update-begin-author:taoyan date:2022-6-2 for: VUEN-1112 一对多 用户选择 未显示选择条数,及清空
|
// 代码逻辑说明: VUEN-1112 一对多 用户选择 未显示选择条数,及清空
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (tableRef.value) {
|
if (tableRef.value) {
|
||||||
tableRef.value.setSelectedRowKeys(selectValues['value'] || []);
|
tableRef.value.setSelectedRowKeys(selectValues['value'] || []);
|
||||||
}
|
}
|
||||||
}, 800);
|
}, 800);
|
||||||
//update-end-author:taoyan date:2022-6-2 for: VUEN-1112 一对多 用户选择 未显示选择条数,及清空
|
|
||||||
});
|
});
|
||||||
// update-end-author:taoyan date:2022-5-24 for: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条
|
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
//表格配置
|
//表格配置
|
||||||
const config = {
|
const config = {
|
||||||
@ -130,15 +134,13 @@
|
|||||||
emit
|
emit
|
||||||
);
|
);
|
||||||
const searchInfo = ref(props.params);
|
const searchInfo = ref(props.params);
|
||||||
// update-begin--author:liaozhiyang---date:20230811---for:【issues/657】右侧选中列表删除无效
|
// 代码逻辑说明: 【issues/657】右侧选中列表删除无效
|
||||||
watch(rowSelection.selectedRowKeys, (newVal) => {
|
watch(rowSelection.selectedRowKeys, (newVal) => {
|
||||||
//update-begin---author:wangshuai ---date: 20230829 for:null指针异常导致控制台报错页面不显示------------
|
// 代码逻辑说明: null指针异常导致控制台报错页面不显示------------
|
||||||
if(tableRef.value){
|
if(tableRef.value){
|
||||||
tableRef.value.setSelectedRowKeys(newVal);
|
tableRef.value.setSelectedRowKeys(newVal);
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date: 20230829 for:null指针异常导致控制台报错页面不显示------------
|
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20230811---for:【issues/657】右侧选中列表删除无效
|
|
||||||
//查询form
|
//查询form
|
||||||
const formConfig = {
|
const formConfig = {
|
||||||
baseColProps: {
|
baseColProps: {
|
||||||
@ -149,7 +151,7 @@
|
|||||||
xl: 6,
|
xl: 6,
|
||||||
xxl: 6,
|
xxl: 6,
|
||||||
},
|
},
|
||||||
//update-begin-author:taoyan date:2022-5-24 for: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条---查询表单按钮的栅格布局和表单的保持一致
|
// 代码逻辑说明: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条---查询表单按钮的栅格布局和表单的保持一致
|
||||||
actionColOptions: {
|
actionColOptions: {
|
||||||
xs: 24,
|
xs: 24,
|
||||||
sm: 8,
|
sm: 8,
|
||||||
@ -158,7 +160,6 @@
|
|||||||
xl: 8,
|
xl: 8,
|
||||||
xxl: 8,
|
xxl: 8,
|
||||||
},
|
},
|
||||||
//update-end-author:taoyan date:2022-5-24 for: VUEN-1086 【移动端】用户选择 查询按钮 效果不好 列表展示没有滚动条---查询表单按钮的栅格布局和表单的保持一致
|
|
||||||
schemas: [
|
schemas: [
|
||||||
{
|
{
|
||||||
label: '账号',
|
label: '账号',
|
||||||
@ -171,10 +172,12 @@
|
|||||||
component: (hasCustomApi.value && !props.customApiJInput) ? 'Input' : 'JInput',
|
component: (hasCustomApi.value && !props.customApiJInput) ? 'Input' : 'JInput',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
autoSubmitOnEnter: true
|
autoSubmitOnEnter: true,
|
||||||
|
|
||||||
|
...props.customFormConfig,
|
||||||
};
|
};
|
||||||
//定义表格列
|
//定义表格列
|
||||||
const columns = [
|
const columns = props.customTableColumns?.length ? props.customTableColumns : [
|
||||||
{
|
{
|
||||||
title: '用户账号',
|
title: '用户账号',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
@ -195,10 +198,22 @@
|
|||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
customRender:( { record, text })=>{
|
||||||
|
if(record.izHideContact && record.izHideContact === '1'){
|
||||||
|
return '/';
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '邮箱',
|
title: '邮箱',
|
||||||
dataIndex: 'email',
|
dataIndex: 'email',
|
||||||
|
customRender:( { record, text })=>{
|
||||||
|
if(record.izHideContact && record.izHideContact === '1'){
|
||||||
|
return text?'/':'';
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
// width: 40,
|
// width: 40,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -243,7 +258,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
/**
|
/**
|
||||||
* 用户返回结果逻辑查询
|
* 用户返回结果逻辑查询
|
||||||
*/
|
*/
|
||||||
@ -264,19 +278,15 @@
|
|||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
// 代码逻辑说明: 【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
emit('close');
|
emit('close');
|
||||||
};
|
};
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
|
||||||
//update-end---author:wangshuai ---date:20230703 for:【QQYUN-5685】5、离职人员可以选自己------------
|
|
||||||
|
|
||||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-305】小屏幕展示10条
|
// 代码逻辑说明: 【TV360X-305】小屏幕展示10条
|
||||||
const clientHeight = document.documentElement.clientHeight * 200;
|
const clientHeight = document.documentElement.clientHeight * 200;
|
||||||
maxHeight.value = clientHeight > 600 ? 600 : clientHeight;
|
maxHeight.value = clientHeight > 600 ? 600 : clientHeight;
|
||||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-305】小屏幕展示10条
|
|
||||||
|
|
||||||
//update-begin---author:wangshuai---date:2024-07-03---for:【TV360X-1629】用户选择组件不是根据创建时间正序排序的---
|
|
||||||
/**
|
/**
|
||||||
* 请求之前根据创建时间排序
|
* 请求之前根据创建时间排序
|
||||||
*
|
*
|
||||||
@ -285,7 +295,6 @@
|
|||||||
function beforeFetch(params) {
|
function beforeFetch(params) {
|
||||||
return Object.assign({ column: 'createTime', order: 'desc' }, params);
|
return Object.assign({ column: 'createTime', order: 'desc' }, params);
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2024-07-03---for:【TV360X-1629】用户选择组件不是根据创建时间正序排序的---
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
//config,
|
//config,
|
||||||
|
|||||||
@ -39,12 +39,11 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
// update-begin--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
// 代码逻辑说明: 【issues/8078】角色选择组件点击文字部分会一直选中
|
||||||
maxSelectCount: {
|
maxSelectCount: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 2,
|
default: 2,
|
||||||
},
|
},
|
||||||
// update-end--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
|
||||||
store: {
|
store: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'id',
|
default: 'id',
|
||||||
|
|||||||
@ -156,11 +156,10 @@
|
|||||||
if(!list || list.length ==0 ){
|
if(!list || list.length ==0 ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
// 代码逻辑说明: 【issues/8078】角色选择组件点击文字部分会一直选中
|
||||||
let findItem = list.find((item) => item.id == id);
|
let findItem = list.find((item) => item.id == id);
|
||||||
findItem.checked = false;
|
findItem.checked = false;
|
||||||
selectedKeys.value = selectedKeys.value.filter((key) => key != id);
|
selectedKeys.value = selectedKeys.value.filter((key) => key != id);
|
||||||
// update-end--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadDataList() {
|
async function loadDataList() {
|
||||||
@ -195,7 +194,6 @@
|
|||||||
|
|
||||||
function onSelect(e, item) {
|
function onSelect(e, item) {
|
||||||
prevent(e);
|
prevent(e);
|
||||||
// update-begin--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
|
||||||
// 单选模式下,先清除所有选中状态
|
// 单选模式下,先清除所有选中状态
|
||||||
if (!props.multi) {
|
if (!props.multi) {
|
||||||
dataList.value.forEach(dataItem => {
|
dataList.value.forEach(dataItem => {
|
||||||
@ -216,7 +214,6 @@
|
|||||||
} else {
|
} else {
|
||||||
selectedKeys.value = selectedKeys.value.filter(key => key !== item.id);
|
selectedKeys.value = selectedKeys.value.filter(key => key !== item.id);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20250414--for:【issues/8078】角色选择组件点击文字部分会一直选中
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function prevent(e) {
|
function prevent(e) {
|
||||||
|
|||||||
@ -0,0 +1,448 @@
|
|||||||
|
<template>
|
||||||
|
<BasicModal
|
||||||
|
@register="register"
|
||||||
|
:getContainer="getContainer"
|
||||||
|
:canFullscreen="false"
|
||||||
|
destroyOnClose
|
||||||
|
title="会签人员选择"
|
||||||
|
:width="600"
|
||||||
|
wrapClassName="j-filtered-user-select-modal"
|
||||||
|
>
|
||||||
|
<!-- 节点说明 -->
|
||||||
|
<a-select
|
||||||
|
value="系统角色会签,请筛选参与人员"
|
||||||
|
disabled
|
||||||
|
style="width: 100%"
|
||||||
|
class="node-label-select"
|
||||||
|
>
|
||||||
|
<a-select-option value="系统角色会签,请筛选参与人员">
|
||||||
|
系统角色会签,请筛选参与人员
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
|
||||||
|
<div class="modal-content">
|
||||||
|
<!-- 搜索框 -->
|
||||||
|
<div :class="['search-wrapper', { 'search-expanded': searchInputStatus }]">
|
||||||
|
<span v-show="!searchInputStatus" class="search-icon" @click="showSearchInput">
|
||||||
|
<SearchOutlined />
|
||||||
|
</span>
|
||||||
|
<div v-show="searchInputStatus" class="search-input">
|
||||||
|
<a-input
|
||||||
|
v-model:value="searchText"
|
||||||
|
placeholder="请输入用户名按回车搜索"
|
||||||
|
@pressEnter="onSearchUser"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<SearchOutlined />
|
||||||
|
</template>
|
||||||
|
<template #suffix>
|
||||||
|
<CloseOutlined title="退出搜索" @click="clearSearch" />
|
||||||
|
</template>
|
||||||
|
</a-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 用户列表 -->
|
||||||
|
<div class="user-list-wrapper">
|
||||||
|
<user-list
|
||||||
|
:multi="multi"
|
||||||
|
:dataList="userDataList"
|
||||||
|
:selectedIdList="selectedIdList"
|
||||||
|
@selected="onSelectUser"
|
||||||
|
@unSelect="unSelectUser"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 已选用户标签 -->
|
||||||
|
<div v-if="selectedUserList.length > 0" class="selected-users">
|
||||||
|
<SelectedUserItem
|
||||||
|
v-for="item in selectedUserList"
|
||||||
|
:key="item.id"
|
||||||
|
:info="item"
|
||||||
|
@unSelect="unSelectUser"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="pagination-wrapper">
|
||||||
|
<a-pagination
|
||||||
|
v-model:current="pageNo"
|
||||||
|
size="small"
|
||||||
|
:total="totalRecord"
|
||||||
|
:pageSize="PAGE_SIZE"
|
||||||
|
show-quick-jumper
|
||||||
|
@change="onPageChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="!hasSelectedUser"
|
||||||
|
@click="handleOk"
|
||||||
|
>
|
||||||
|
确认提交
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, computed, ref, toRaw, PropType } from 'vue';
|
||||||
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||||
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { Pagination } from 'ant-design-vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import UserList from './UserList.vue';
|
||||||
|
import SelectedUserItem from './SelectedUserItem.vue';
|
||||||
|
|
||||||
|
// 用户数据接口
|
||||||
|
interface UserInfo {
|
||||||
|
id: string;
|
||||||
|
username: string;
|
||||||
|
realname: string;
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹窗打开参数接口
|
||||||
|
interface ModalData {
|
||||||
|
usernames?: string[];
|
||||||
|
list?: UserInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 常量定义
|
||||||
|
const PAGE_SIZE = 10;
|
||||||
|
const API_URL = '/sys/user/selectUserList';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'FilteredUserSelectModal',
|
||||||
|
components: {
|
||||||
|
BasicModal,
|
||||||
|
SearchOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
SelectedUserItem,
|
||||||
|
UserList,
|
||||||
|
APagination: Pagination,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
// 是否多选
|
||||||
|
multi: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
// 容器函数
|
||||||
|
getContainer: {
|
||||||
|
type: Function as PropType<() => HTMLElement>,
|
||||||
|
default: undefined,
|
||||||
|
},
|
||||||
|
// 传入的用户账号列表(用于过滤)
|
||||||
|
usernames: {
|
||||||
|
type: Array as PropType<string[]>,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emits: ['selected', 'register'],
|
||||||
|
setup(props, { emit }) {
|
||||||
|
// ==================== 状态定义 ====================
|
||||||
|
const selectedUserList = ref<UserInfo[]>([]);
|
||||||
|
const actualUsernames = ref<string[]>([]);
|
||||||
|
const searchInputStatus = ref(false);
|
||||||
|
const searchText = ref('');
|
||||||
|
const pageNo = ref(1);
|
||||||
|
const totalRecord = ref(0);
|
||||||
|
const userDataList = ref<UserInfo[]>([]);
|
||||||
|
|
||||||
|
// ==================== 计算属性 ====================
|
||||||
|
const selectedIdList = computed(() =>
|
||||||
|
selectedUserList.value.map((item) => item.id)
|
||||||
|
);
|
||||||
|
|
||||||
|
const hasSelectedUser = computed(() =>
|
||||||
|
selectedUserList.value.length > 0
|
||||||
|
);
|
||||||
|
|
||||||
|
// ==================== 弹窗事件 ====================
|
||||||
|
const [register] = useModalInner((data: ModalData) => {
|
||||||
|
initUsernames(data);
|
||||||
|
initSelectedUsers(data);
|
||||||
|
resetSearchState();
|
||||||
|
loadUserList();
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化用户名列表
|
||||||
|
*/
|
||||||
|
function initUsernames(data: ModalData) {
|
||||||
|
if (data?.usernames?.length) {
|
||||||
|
actualUsernames.value = [...data.usernames];
|
||||||
|
} else if (props.usernames?.length) {
|
||||||
|
actualUsernames.value = [...props.usernames];
|
||||||
|
} else {
|
||||||
|
actualUsernames.value = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化已选用户
|
||||||
|
*/
|
||||||
|
function initSelectedUsers(data: ModalData) {
|
||||||
|
selectedUserList.value = data?.list?.length ? [...data.list] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置搜索状态
|
||||||
|
*/
|
||||||
|
function resetSearchState() {
|
||||||
|
searchText.value = '';
|
||||||
|
searchInputStatus.value = false;
|
||||||
|
pageNo.value = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 用户操作 ====================
|
||||||
|
/**
|
||||||
|
* 确认选择
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
if (!hasSelectedUser.value) return;
|
||||||
|
emit('selected', toRaw(selectedUserList.value));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中用户
|
||||||
|
*/
|
||||||
|
function onSelectUser(info: UserInfo) {
|
||||||
|
if (!props.multi) {
|
||||||
|
selectedUserList.value = [{ ...info }];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selectedIdList.value.includes(info.id)) {
|
||||||
|
selectedUserList.value.push({ ...info });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消选中用户
|
||||||
|
*/
|
||||||
|
function unSelectUser(id: string) {
|
||||||
|
const index = selectedUserList.value.findIndex((item) => item.id === id);
|
||||||
|
if (index >= 0) {
|
||||||
|
selectedUserList.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 搜索功能 ====================
|
||||||
|
/**
|
||||||
|
* 显示搜索框
|
||||||
|
*/
|
||||||
|
function showSearchInput(e?: Event) {
|
||||||
|
e?.preventDefault();
|
||||||
|
e?.stopPropagation();
|
||||||
|
searchInputStatus.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行搜索
|
||||||
|
*/
|
||||||
|
function onSearchUser() {
|
||||||
|
pageNo.value = 1;
|
||||||
|
loadUserList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除搜索
|
||||||
|
*/
|
||||||
|
function clearSearch(e?: Event) {
|
||||||
|
e?.preventDefault();
|
||||||
|
e?.stopPropagation();
|
||||||
|
searchText.value = '';
|
||||||
|
searchInputStatus.value = false;
|
||||||
|
pageNo.value = 1;
|
||||||
|
loadUserList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 分页功能 ====================
|
||||||
|
/**
|
||||||
|
* 翻页处理
|
||||||
|
*/
|
||||||
|
function onPageChange() {
|
||||||
|
loadUserList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 数据加载 ====================
|
||||||
|
/**
|
||||||
|
* 加载用户列表
|
||||||
|
*/
|
||||||
|
async function loadUserList() {
|
||||||
|
if (!actualUsernames.value?.length) {
|
||||||
|
userDataList.value = [];
|
||||||
|
totalRecord.value = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const params: Record<string, any> = {
|
||||||
|
pageNo: pageNo.value,
|
||||||
|
pageSize: PAGE_SIZE,
|
||||||
|
includeUsernameList: actualUsernames.value.join(','),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (searchText.value.trim()) {
|
||||||
|
params.keyword = searchText.value.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
const { success, result } = await defHttp.get(
|
||||||
|
{ url: API_URL, params },
|
||||||
|
{ isTransformResponse: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (success && result) {
|
||||||
|
userDataList.value = result.records || [];
|
||||||
|
totalRecord.value = result.total || 0;
|
||||||
|
} else {
|
||||||
|
resetUserData();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载用户列表失败:', error);
|
||||||
|
resetUserData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置用户数据
|
||||||
|
*/
|
||||||
|
function resetUserData() {
|
||||||
|
userDataList.value = [];
|
||||||
|
totalRecord.value = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 返回值 ====================
|
||||||
|
return {
|
||||||
|
PAGE_SIZE,
|
||||||
|
register,
|
||||||
|
handleOk,
|
||||||
|
searchText,
|
||||||
|
searchInputStatus,
|
||||||
|
showSearchInput,
|
||||||
|
onSearchUser,
|
||||||
|
clearSearch,
|
||||||
|
pageNo,
|
||||||
|
totalRecord,
|
||||||
|
onPageChange,
|
||||||
|
userDataList,
|
||||||
|
selectedUserList,
|
||||||
|
selectedIdList,
|
||||||
|
hasSelectedUser,
|
||||||
|
onSelectUser,
|
||||||
|
unSelectUser,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.j-filtered-user-select-modal {
|
||||||
|
// 节点说明标签
|
||||||
|
.node-label-select {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
:deep(.ant-select-selector) {
|
||||||
|
color: #fff !important;
|
||||||
|
background-color: #409eff !important;
|
||||||
|
border-radius: 5px !important;
|
||||||
|
cursor: not-allowed !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-select-selection-item),
|
||||||
|
:deep(.ant-select-arrow) {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弹窗内容区
|
||||||
|
.modal-content {
|
||||||
|
position: relative;
|
||||||
|
min-height: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索框容器
|
||||||
|
.search-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 14px;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
&.search-expanded {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-icon {
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #c0c0c0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #0a8fe9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
:deep(.anticon) {
|
||||||
|
color: #c0c0c0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #0a8fe9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户列表
|
||||||
|
.user-list-wrapper {
|
||||||
|
padding-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 已选用户标签
|
||||||
|
.selected-users {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
padding-top: 15px;
|
||||||
|
width: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 底部容器
|
||||||
|
.modal-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
gap: 16px;
|
||||||
|
|
||||||
|
.pagination-wrapper {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
:deep(.ant-pagination) {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 滚动容器优化
|
||||||
|
:deep(.scroll-container) {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -137,7 +137,7 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}
|
}
|
||||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
//代码逻辑说明: 【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||||
/* function records2DataList() {
|
/* function records2DataList() {
|
||||||
let arr:any[] = [];
|
let arr:any[] = [];
|
||||||
let excludeList = props.excludeUserIdList;
|
let excludeList = props.excludeUserIdList;
|
||||||
@ -157,7 +157,6 @@
|
|||||||
if(excludeList && excludeList.length>0){
|
if(excludeList && excludeList.length>0){
|
||||||
return records2DataList();
|
return records2DataList();
|
||||||
}*/
|
}*/
|
||||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
|
||||||
return props.dataList;
|
return props.dataList;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -76,6 +76,7 @@
|
|||||||
const data = await loadDepartTree();
|
const data = await loadDepartTree();
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
let arr = data.result;
|
let arr = data.result;
|
||||||
|
fillTitles(arr);
|
||||||
treeData.value = arr;
|
treeData.value = arr;
|
||||||
emitDepartOptions(arr);
|
emitDepartOptions(arr);
|
||||||
} else {
|
} else {
|
||||||
@ -121,6 +122,7 @@
|
|||||||
if (data.success) {
|
if (data.success) {
|
||||||
let arr = data.result;
|
let arr = data.result;
|
||||||
treeNode.dataRef.children = [...arr];
|
treeNode.dataRef.children = [...arr];
|
||||||
|
fillTitles(treeData.value);
|
||||||
treeData.value = [...treeData.value];
|
treeData.value = [...treeData.value];
|
||||||
} else {
|
} else {
|
||||||
console.error(data.message);
|
console.error(data.message);
|
||||||
@ -128,11 +130,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const maxHeight = ref(300);
|
const maxHeight = ref(300);
|
||||||
maxHeight.value = window.innerHeight - 300;
|
maxHeight.value = window.innerHeight - 500;
|
||||||
const containerStyle = computed(() => {
|
const containerStyle = computed(() => {
|
||||||
return {
|
return {
|
||||||
'overflow-y': 'auto',
|
'overflow-y': 'auto',
|
||||||
'max-height': maxHeight.value + 'px',
|
// 代码逻辑说明: JHHB-911 【用户选择】用户选择组件 有滚动条时 不好用 没有显示简称
|
||||||
|
'max-height': (maxHeight.value>=300?maxHeight.value:300) + 'px',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -149,11 +152,10 @@
|
|||||||
if (selectedDepartId.value) {
|
if (selectedDepartId.value) {
|
||||||
params['departId'] = selectedDepartId.value;
|
params['departId'] = selectedDepartId.value;
|
||||||
}
|
}
|
||||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
// 代码逻辑说明: 【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||||
if(props.excludeUserIdList && props.excludeUserIdList.length>0){
|
if(props.excludeUserIdList && props.excludeUserIdList.length>0){
|
||||||
params['excludeUserIdList'] = props.excludeUserIdList.join(",");
|
params['excludeUserIdList'] = props.excludeUserIdList.join(",");
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
|
||||||
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
const { records } = data.result;
|
const { records } = data.result;
|
||||||
@ -176,7 +178,18 @@
|
|||||||
function unSelectUser(id) {
|
function unSelectUser(id) {
|
||||||
emit('unSelect', id);
|
emit('unSelect', id);
|
||||||
}
|
}
|
||||||
|
// 递归将 departNameAbbr 赋给 title,并递归处理 children
|
||||||
|
function fillTitles(nodes: any[] = []) {
|
||||||
|
for (const node of nodes) {
|
||||||
|
if (!node) continue;
|
||||||
|
if (node?.departNameAbbr) {
|
||||||
|
node.title = node.departNameAbbr;
|
||||||
|
}
|
||||||
|
if (Array.isArray(node.children) && node.children.length) {
|
||||||
|
fillTitles(node.children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
containerStyle,
|
containerStyle,
|
||||||
treeData,
|
treeData,
|
||||||
|
|||||||
@ -98,11 +98,10 @@
|
|||||||
if (selectedRoleId.value) {
|
if (selectedRoleId.value) {
|
||||||
params['roleId'] = selectedRoleId.value;
|
params['roleId'] = selectedRoleId.value;
|
||||||
}
|
}
|
||||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
// 代码逻辑说明: 【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||||
if(props.excludeUserIdList && props.excludeUserIdList.length>0){
|
if(props.excludeUserIdList && props.excludeUserIdList.length>0){
|
||||||
params['excludeUserIdList'] = props.excludeUserIdList.join(",");
|
params['excludeUserIdList'] = props.excludeUserIdList.join(",");
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
|
||||||
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
const { records } = data.result;
|
const { records } = data.result;
|
||||||
|
|||||||
@ -3,8 +3,9 @@
|
|||||||
@register="register"
|
@register="register"
|
||||||
:getContainer="getContainer"
|
:getContainer="getContainer"
|
||||||
:canFullscreen="false"
|
:canFullscreen="false"
|
||||||
|
destroyOnClose
|
||||||
title="选择用户"
|
title="选择用户"
|
||||||
:width="600"
|
:width="800"
|
||||||
wrapClassName="j-user-select-modal2"
|
wrapClassName="j-user-select-modal2"
|
||||||
>
|
>
|
||||||
<!-- 部门下拉框 -->
|
<!-- 部门下拉框 -->
|
||||||
@ -228,11 +229,10 @@
|
|||||||
params['departId'] = selectedDepart.value;
|
params['departId'] = selectedDepart.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
// 代码逻辑说明: 【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
||||||
if(unref(excludeUserIdList) && unref(excludeUserIdList).length>0){
|
if(unref(excludeUserIdList) && unref(excludeUserIdList).length>0){
|
||||||
params['excludeUserIdList'] = excludeUserIdList.value.join(",");
|
params['excludeUserIdList'] = excludeUserIdList.value.join(",");
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai---date:2024-02-02---for:【QQYUN-8239】用户角色,添加用户 返回2页数据,实际只显示一页---
|
|
||||||
|
|
||||||
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
const data = await defHttp.get({ url, params }, { isTransformResponse: false });
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
|
|||||||
@ -161,7 +161,7 @@
|
|||||||
let idList = [];
|
let idList = [];
|
||||||
selectedUserList.value = [];
|
selectedUserList.value = [];
|
||||||
if(ids){
|
if(ids){
|
||||||
// update-begin-author:sunjianlei date:20230330 for: 修复用户选择器逗号分割回显不生效的问题
|
// 代码逻辑说明: 修复用户选择器逗号分割回显不生效的问题
|
||||||
let tempArray = ids.split(',').map(s => s.trim()).filter(s => s != '');
|
let tempArray = ids.split(',').map(s => s.trim()).filter(s => s != '');
|
||||||
if (tempArray.includes(mySelfExpress)) {
|
if (tempArray.includes(mySelfExpress)) {
|
||||||
hasUserExpress = true;
|
hasUserExpress = true;
|
||||||
@ -169,7 +169,6 @@
|
|||||||
} else {
|
} else {
|
||||||
idList = tempArray;
|
idList = tempArray;
|
||||||
}
|
}
|
||||||
// update-end-author:sunjianlei date:20230330 for: 修复用户选择器逗号分割回显不生效的问题
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(idList.length>0){
|
if(idList.length>0){
|
||||||
|
|||||||
@ -109,7 +109,7 @@ export const useCodeHinting = (CodeMirror, keywords, language) => {
|
|||||||
from: CodeMirror.Pos(cur.line, start),
|
from: CodeMirror.Pos(cur.line, start),
|
||||||
to: CodeMirror.Pos(cur.line, end),
|
to: CodeMirror.Pos(cur.line, end),
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-8865】js增强加上鼠标移入提示
|
// 代码逻辑说明: 【QQYUN-8865】js增强加上鼠标移入提示
|
||||||
const item = currentKeywords[0];
|
const item = currentKeywords[0];
|
||||||
if (item?.desc) {
|
if (item?.desc) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -126,7 +126,6 @@ export const useCodeHinting = (CodeMirror, keywords, language) => {
|
|||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240429---for:【QQYUN-8865】js增强加上鼠标移入提示
|
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,16 +26,11 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
watch(
|
watch(
|
||||||
selectValues,
|
selectValues,
|
||||||
() => {
|
() => {
|
||||||
//update-begin-author:liusq---date:2023-10-19--for: [issues/788]判断有设置数值才去加载
|
|
||||||
//if (selectValues['change'] == false && !isEmpty(selectValues['value'])) {
|
//if (selectValues['change'] == false && !isEmpty(selectValues['value'])) {
|
||||||
if (selectValues['change'] == false && !isEmpty(selectValues['value'])) {
|
if (selectValues['change'] == false && !isEmpty(selectValues['value'])) {
|
||||||
//update-end-author:liusq---date:2023-10-19--for: [issues/788]判断有设置数值才去加载
|
// 代码逻辑说明: 【issues/7405】部门选择用户同时全部选择两页用户,回显到父页面。第二页用户显示的不是真是姓名
|
||||||
//update-begin---author:wangshuai ---date:20220412 for:[VUEN-672]发文草稿箱编辑时拟稿人显示用户名------------
|
|
||||||
// update-begin-author:liaozhiyang---date:2024-11-11--for:【issues/7405】部门选择用户同时全部选择两页用户,回显到父页面。第二页用户显示的不是真是姓名
|
|
||||||
let params = { isMultiTranslate: 'true', pageSize: selectValues.value?.length };
|
let params = { isMultiTranslate: 'true', pageSize: selectValues.value?.length };
|
||||||
// update-end-author:liaozhiyang---date:2024-10-11--for:【issues/7405】部门选择用户同时全部选择两页用户,回显到父页面。第二页用户显示的不是真是姓名
|
|
||||||
params[props.rowKey] = selectValues['value'].join(',');
|
params[props.rowKey] = selectValues['value'].join(',');
|
||||||
//update-end---author:wangshuai ---date:20220412 for:[VUEN-672]发文草稿箱编辑时拟稿人显示用户名--------------
|
|
||||||
loadingEcho.value = isFirstLoadEcho;
|
loadingEcho.value = isFirstLoadEcho;
|
||||||
isFirstLoadEcho = false;
|
isFirstLoadEcho = false;
|
||||||
getDataSource(params, true)
|
getDataSource(params, true)
|
||||||
@ -45,9 +40,8 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
//设置列表默认选中
|
//设置列表默认选中
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
// 代码逻辑说明: 【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
||||||
checkedKeys['value'] = [...selectValues['value']];
|
checkedKeys['value'] = [...selectValues['value']];
|
||||||
// update-end--author:liaozhiyang---date:20250423---for:【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
@ -70,16 +64,13 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
* 选择列配置
|
* 选择列配置
|
||||||
*/
|
*/
|
||||||
const rowSelection = {
|
const rowSelection = {
|
||||||
//update-begin-author:liusq---date:20220517--for: 动态设置rowSelection的type值,默认是'checkbox' ---
|
// 代码逻辑说明: 动态设置rowSelection的type值,默认是'checkbox' ---
|
||||||
type: props.isRadioSelection ? 'radio' : 'checkbox',
|
type: props.isRadioSelection ? 'radio' : 'checkbox',
|
||||||
//update-end-author:liusq---date:20220517--for: 动态设置rowSelection的type值,默认是'checkbox' ---
|
|
||||||
columnWidth: 20,
|
columnWidth: 20,
|
||||||
selectedRowKeys: checkedKeys,
|
selectedRowKeys: checkedKeys,
|
||||||
onChange: onSelectChange,
|
onChange: onSelectChange,
|
||||||
//update-begin-author:wangshuai---date:20221102--for: [VUEN-2562]用户选择,跨页选择后,只有当前页人员 ---
|
|
||||||
//table4.4.0新增属性选中之后是否清空上一页下一页的数据,默认false
|
//table4.4.0新增属性选中之后是否清空上一页下一页的数据,默认false
|
||||||
preserveSelectedRowKeys:true,
|
preserveSelectedRowKeys:true,
|
||||||
//update-end-author:wangshuai---date:20221102--for: [VUEN-2562]用户选择,跨页选择后,只有当前页人员 ---
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,9 +102,8 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
code: selectValues['value'].join(','),
|
code: selectValues['value'].join(','),
|
||||||
pageSize: selectValues['value'].length,
|
pageSize: selectValues['value'].length,
|
||||||
});
|
});
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
// 代码逻辑说明: 【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
||||||
checkedKeys['value'] = [...selectValues['value']];
|
checkedKeys['value'] = [...selectValues['value']];
|
||||||
// update-end--author:liaozhiyang---date:20250423---for:【QQYUN-12155】弹窗中勾选,再点取消,值被选中了
|
|
||||||
selectRows['value'] = records;
|
selectRows['value'] = records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,15 +112,13 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
*/
|
*/
|
||||||
async function visibleChange(visible) {
|
async function visibleChange(visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【QQYUN-12179】弹窗勾选了值,点击取消再次打开弹窗遗留了上次的勾选的值
|
// 代码逻辑说明: 【QQYUN-12179】弹窗勾选了值,点击取消再次打开弹窗遗留了上次的勾选的值
|
||||||
checkedKeys['value'] = [...selectValues['value']];
|
checkedKeys['value'] = [...selectValues['value']];
|
||||||
// update-begin--author:liaozhiyang---date:20250423---for:【QQYUN-12179】弹窗勾选了值,点击取消再次打开弹窗遗留了上次的勾选的值
|
|
||||||
//设置列表默认选中
|
//设置列表默认选中
|
||||||
props.showSelected && initSelectRows();
|
props.showSelected && initSelectRows();
|
||||||
} else {
|
} else {
|
||||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
// 代码逻辑说明: 【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
||||||
emit?.('close');
|
emit?.('close');
|
||||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,10 +143,9 @@ export function useSelectBiz(getList, props, emit?) {
|
|||||||
}
|
}
|
||||||
//删除已选择的信息
|
//删除已选择的信息
|
||||||
function handleDeleteSelected(record) {
|
function handleDeleteSelected(record) {
|
||||||
//update-begin---author:wangshuai ---date:20230404 for:【issues/424】开启右侧列表后,在右侧列表中删除用户时,逻辑有问题------------
|
// 代码逻辑说明: 【issues/424】开启右侧列表后,在右侧列表中删除用户时,逻辑有问题------------
|
||||||
checkedKeys.value = checkedKeys.value.filter((item) => item != record[props.rowKey]);
|
checkedKeys.value = checkedKeys.value.filter((item) => item != record[props.rowKey]);
|
||||||
selectRows.value = selectRows.value.filter((item) => item[props.rowKey] !== record[props.rowKey]);
|
selectRows.value = selectRows.value.filter((item) => item[props.rowKey] !== record[props.rowKey]);
|
||||||
//update-end---author:wangshuai ---date:20230404 for:【issues/424】开启右侧列表后,在右侧列表中删除用户时,逻辑有问题------------
|
|
||||||
}
|
}
|
||||||
//清空选择项
|
//清空选择项
|
||||||
function reset() {
|
function reset() {
|
||||||
|
|||||||
@ -21,8 +21,10 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
const selectRows = ref<Array<object>>([]);
|
const selectRows = ref<Array<object>>([]);
|
||||||
//是否是打开弹框模式
|
//是否是打开弹框模式
|
||||||
const openModal = ref(false);
|
const openModal = ref(false);
|
||||||
|
//是否层级关联
|
||||||
|
const checkStrictly = ref<boolean>(realProps.multiple ? props.checkStrictly : true);
|
||||||
// 是否开启父子关联,如果不可以多选,就始终取消父子关联
|
// 是否开启父子关联,如果不可以多选,就始终取消父子关联
|
||||||
const getCheckStrictly = computed(() => (realProps.multiple ? props.checkStrictly : true));
|
const getCheckStrictly = computed(() => checkStrictly.value);
|
||||||
// 是否是首次加载回显,只有首次加载,才会显示 loading
|
// 是否是首次加载回显,只有首次加载,才会显示 loading
|
||||||
let isFirstLoadEcho = true;
|
let isFirstLoadEcho = true;
|
||||||
let prevSelectValues = [];
|
let prevSelectValues = [];
|
||||||
@ -39,7 +41,7 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
if(!values){
|
if(!values){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// update-begin--author:liaozhiyang---date:20250604---for:【issues/8232】代码设置JSelectDept组件值没翻译
|
// 代码逻辑说明: 【issues/8232】代码设置JSelectDept组件值没翻译
|
||||||
if (values.length > 0) {
|
if (values.length > 0) {
|
||||||
// 防止多次请求
|
// 防止多次请求
|
||||||
if (isEqual(values, prevSelectValues)) return;
|
if (isEqual(values, prevSelectValues)) return;
|
||||||
@ -49,7 +51,6 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
onLoadData(null, values.join(',')).finally(() => {
|
onLoadData(null, values.join(',')).finally(() => {
|
||||||
loadingEcho.value = false;
|
loadingEcho.value = false;
|
||||||
});
|
});
|
||||||
// update-end--author:liaozhiyang---date:20250604---for:【issues/8232】代码设置JSelectDept组件值没翻译
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
@ -148,23 +149,26 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
* 树节点选择
|
* 树节点选择
|
||||||
*/
|
*/
|
||||||
function onCheck(keys, info) {
|
function onCheck(keys, info) {
|
||||||
|
if(!info){
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (props.checkable == true) {
|
if (props.checkable == true) {
|
||||||
// 如果不能多选,就只保留最后一个选中的
|
// 如果不能多选,就只保留最后一个选中的
|
||||||
if (!realProps.multiple) {
|
if (!realProps.multiple) {
|
||||||
if (info.checked) {
|
if (info.checked) {
|
||||||
//update-begin-author:taoyan date:20220408 for: 单选模式下,设定rowKey,无法选中数据-
|
// 代码逻辑说明: 单选模式下,设定rowKey,无法选中数据-
|
||||||
checkedKeys.value = [info.node.eventKey];
|
checkedKeys.value = [info.node.eventKey];
|
||||||
let rowKey = props.rowKey;
|
let rowKey = props.rowKey;
|
||||||
let temp = info.checkedNodes.find((n) => n[rowKey] === info.node.eventKey);
|
let temp = info.checkedNodes.find((n) => n[rowKey] === info.node.eventKey);
|
||||||
selectRows.value = [temp];
|
selectRows.value = [temp];
|
||||||
//update-end-author:taoyan date:20220408 for: 单选模式下,设定rowKey,无法选中数据-
|
|
||||||
} else {
|
} else {
|
||||||
checkedKeys.value = [];
|
checkedKeys.value = [];
|
||||||
selectRows.value = [];
|
selectRows.value = [];
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
checkedKeys.value = props.checkStrictly ? keys.checked : keys;
|
// 代码逻辑说明: 【JHHB-250】选择部门加一个层级关联/独立的配置,现在是点击就全勾选了---
|
||||||
|
checkedKeys.value = checkStrictly.value ? keys.checked : keys;
|
||||||
const { checkedNodes } = info;
|
const { checkedNodes } = info;
|
||||||
let rows = <any[]>[];
|
let rows = <any[]>[];
|
||||||
checkedNodes.forEach((item) => {
|
checkedNodes.forEach((item) => {
|
||||||
@ -179,7 +183,7 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
*/
|
*/
|
||||||
async function checkALL(checkAll) {
|
async function checkALL(checkAll) {
|
||||||
getTree().checkAll(checkAll);
|
getTree().checkAll(checkAll);
|
||||||
//update-begin---author:wangshuai ---date:20230403 for:【issues/394】所属部门树操作全部勾选不生效/【issues/4646】部门全部勾选后,点击确认按钮,部门信息丢失------------
|
// 代码逻辑说明: 【issues/394】所属部门树操作全部勾选不生效/【issues/4646】部门全部勾选后,点击确认按钮,部门信息丢失------------
|
||||||
await nextTick();
|
await nextTick();
|
||||||
checkedKeys.value = getTree().getCheckedKeys();
|
checkedKeys.value = getTree().getCheckedKeys();
|
||||||
if(checkAll){
|
if(checkAll){
|
||||||
@ -187,7 +191,6 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
}else{
|
}else{
|
||||||
selectRows.value = [];
|
selectRows.value = [];
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20230403 for:【issues/394】所属部门树操作全部勾选不生效/【issues/4646】部门全部勾选后,点击确认按钮,部门信息丢失------------
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -219,9 +222,8 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
let startPid = '';
|
let startPid = '';
|
||||||
if (treeNode) {
|
if (treeNode) {
|
||||||
startPid = treeNode.eventKey;
|
startPid = treeNode.eventKey;
|
||||||
//update-begin---author:wangshuai ---date:20220407 for:rowkey不设置成id,sync开启异步的时候,点击上级下级不显示------------
|
// 代码逻辑说明: rowkey不设置成id,sync开启异步的时候,点击上级下级不显示------------
|
||||||
params['pid'] = treeNode.value;
|
params['pid'] = treeNode.value;
|
||||||
//update-end---author:wangshuai ---date:20220407 for:rowkey不设置成id,sync开启异步的时候,点击上级下级不显示------------
|
|
||||||
}
|
}
|
||||||
if (ids) {
|
if (ids) {
|
||||||
startPid = '';
|
startPid = '';
|
||||||
@ -272,9 +274,8 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
} else {
|
} else {
|
||||||
const options = <any[]>[];
|
const options = <any[]>[];
|
||||||
optionData.forEach((item) => {
|
optionData.forEach((item) => {
|
||||||
//update-begin-author:taoyan date:2022-7-4 for: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
// 代码逻辑说明: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
||||||
options.push({ label: item[props.labelKey], value: item[props.rowKey] });
|
options.push({ label: item[props.labelKey], value: item[props.rowKey] });
|
||||||
//update-end-author:taoyan date:2022-7-4 for: issues/I5F3P4 online配置部门选择后编辑,查看数据应该显示部门名称,不是部门代码
|
|
||||||
});
|
});
|
||||||
selectOptions.value = options;
|
selectOptions.value = options;
|
||||||
}
|
}
|
||||||
@ -385,9 +386,7 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
openModal.value = false;
|
openModal.value = false;
|
||||||
// update-begin--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
|
||||||
emit?.('close');
|
emit?.('close');
|
||||||
// update-end--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,6 +447,7 @@ export function useTreeBiz(treeRef, getList, props, realProps, emit) {
|
|||||||
getSelectTreeData,
|
getSelectTreeData,
|
||||||
onSearch,
|
onSearch,
|
||||||
expandedKeys,
|
expandedKeys,
|
||||||
|
checkStrictly,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,9 +5,8 @@ export const selectProps = {
|
|||||||
//是否多选
|
//是否多选
|
||||||
isRadioSelection: {
|
isRadioSelection: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
//update-begin---author:wangshuai ---date:20220527 for:部门用户组件默认应该单选,否则其他地方有问题------------
|
// 代码逻辑说明: 部门用户组件默认应该单选,否则其他地方有问题------------
|
||||||
default: false,
|
default: false,
|
||||||
//update-end---author:wangshuai ---date:20220527 for:部门用户组件默认应该单选,否则其他地方有问题--------------
|
|
||||||
},
|
},
|
||||||
//回传value字段名
|
//回传value字段名
|
||||||
rowKey: {
|
rowKey: {
|
||||||
|
|||||||
@ -67,10 +67,8 @@ export const basicProps = {
|
|||||||
rulesMessageJoinLabel: propTypes.bool.def(true),
|
rulesMessageJoinLabel: propTypes.bool.def(true),
|
||||||
// 【jeecg】超过3列自动折叠
|
// 【jeecg】超过3列自动折叠
|
||||||
autoAdvancedCol: propTypes.number.def(3),
|
autoAdvancedCol: propTypes.number.def(3),
|
||||||
// update-begin--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
|
||||||
// 超过3行自动折叠
|
// 超过3行自动折叠
|
||||||
// autoAdvancedLine: propTypes.number.def(3),
|
// autoAdvancedLine: propTypes.number.def(3),
|
||||||
// update-end--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
|
||||||
// 不受折叠影响的行数
|
// 不受折叠影响的行数
|
||||||
alwaysShowLines: propTypes.number.def(1),
|
alwaysShowLines: propTypes.number.def(1),
|
||||||
|
|
||||||
|
|||||||
@ -100,9 +100,8 @@ export interface FormProps {
|
|||||||
// 【jeecg】如果 showAdvancedButton 为 true,超过指定列数默认折叠,默认为3
|
// 【jeecg】如果 showAdvancedButton 为 true,超过指定列数默认折叠,默认为3
|
||||||
autoAdvancedCol?: number;
|
autoAdvancedCol?: number;
|
||||||
// 如果 showAdvancedButton 为 true,超过指定行数行默认折叠
|
// 如果 showAdvancedButton 为 true,超过指定行数行默认折叠
|
||||||
// update-begin--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
// 代码逻辑说明: 【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
||||||
// autoAdvancedLine?: number;
|
// autoAdvancedLine?: number;
|
||||||
// update-end--author:liaozhiyang---date:202401009---for:【issues/7261】表格上方查询项autoAdvancedLine配置没有效果(删除autoAdvancedLine)
|
|
||||||
// 折叠时始终保持显示的行数
|
// 折叠时始终保持显示的行数
|
||||||
alwaysShowLines?: number;
|
alwaysShowLines?: number;
|
||||||
// Whether to show the operation button
|
// Whether to show the operation button
|
||||||
@ -135,9 +134,8 @@ export interface FormSchema {
|
|||||||
// Variable name bound to v-model Default value
|
// Variable name bound to v-model Default value
|
||||||
valueField?: string;
|
valueField?: string;
|
||||||
// Label name
|
// Label name
|
||||||
// update-begin--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
// 代码逻辑说明: 【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||||
label: string | VNode | Fn;
|
label: string | VNode | Fn;
|
||||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
|
||||||
// Auxiliary text
|
// Auxiliary text
|
||||||
subLabel?: string;
|
subLabel?: string;
|
||||||
// Help text on the right side of the text
|
// Help text on the right side of the text
|
||||||
@ -200,11 +198,9 @@ export interface FormSchema {
|
|||||||
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
dynamicDisabled?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
||||||
|
|
||||||
dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[];
|
dynamicRules?: (renderCallbackParams: RenderCallbackParams) => Rule[];
|
||||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
|
||||||
// 设置组件props的key
|
// 设置组件props的key
|
||||||
dynamicPropskey?: string;
|
dynamicPropskey?: string;
|
||||||
dynamicPropsVal?: ((renderCallbackParams: RenderCallbackParams) => any);
|
dynamicPropsVal?: ((renderCallbackParams: RenderCallbackParams) => any);
|
||||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
|
||||||
|
|
||||||
// 这个属性自定义的 用于自定义的业务 比如在表单打开的时候修改表单的禁用状态,但是又不能重写componentProps,因为他的内容太多了,所以使用dynamicDisabled和buss实现
|
// 这个属性自定义的 用于自定义的业务 比如在表单打开的时候修改表单的禁用状态,但是又不能重写componentProps,因为他的内容太多了,所以使用dynamicDisabled和buss实现
|
||||||
buss?: any;
|
buss?: any;
|
||||||
|
|||||||
@ -106,6 +106,7 @@ export type ComponentType =
|
|||||||
| 'WeekPicker'
|
| 'WeekPicker'
|
||||||
| 'TimePicker'
|
| 'TimePicker'
|
||||||
| 'DatePickerInFilter'
|
| 'DatePickerInFilter'
|
||||||
|
| 'JDatePickerMultiple'
|
||||||
| 'Switch'
|
| 'Switch'
|
||||||
| 'StrengthMeter'
|
| 'StrengthMeter'
|
||||||
| 'Upload'
|
| 'Upload'
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class Area {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin-author:liusq---date:20230404--for: [issue/382]省市区组件JAreaLinkage数据不回显---
|
// 代码逻辑说明: [issue/382]省市区组件JAreaLinkage数据不回显---
|
||||||
getText(code,index=3) {
|
getText(code,index=3) {
|
||||||
if (!code || code.length == 0) {
|
if (!code || code.length == 0) {
|
||||||
return '';
|
return '';
|
||||||
@ -66,7 +66,6 @@ class Area {
|
|||||||
this.getAreaBycode(code, arr, index);
|
this.getAreaBycode(code, arr, index);
|
||||||
return arr.join('/');
|
return arr.join('/');
|
||||||
}
|
}
|
||||||
//update-end-author:liusq---date:20230404--for: [issue/382]省市区组件JAreaLinkage数据不回显---
|
|
||||||
|
|
||||||
getRealCode(code) {
|
getRealCode(code) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@ -101,12 +100,11 @@ const jeecgAreaData = new Area();
|
|||||||
// 根据code找文本
|
// 根据code找文本
|
||||||
const getAreaTextByCode = function (code) {
|
const getAreaTextByCode = function (code) {
|
||||||
let index = 3;
|
let index = 3;
|
||||||
//update-begin-author:liusq---date:20220531--for: 判断code是否是多code逗号分割的字符串,是的话,获取最后一位的code ---
|
// 代码逻辑说明: 判断code是否是多code逗号分割的字符串,是的话,获取最后一位的code ---
|
||||||
if (code && code.includes(',')) {
|
if (code && code.includes(',')) {
|
||||||
index = code.split(",").length;
|
index = code.split(",").length;
|
||||||
code = code.substr(code.lastIndexOf(',') + 1);
|
code = code.substr(code.lastIndexOf(',') + 1);
|
||||||
}
|
}
|
||||||
//update-end-author:liusq---date:20220531--for: 判断code是否是多code逗号分割的字符串,是的话,获取最后一位的code ---
|
|
||||||
return jeecgAreaData.getText(code,index);
|
return jeecgAreaData.getText(code,index);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -36,10 +36,9 @@ export function handleRangeTimeValue(props, values) {
|
|||||||
timeValue = timeValue.split(',');
|
timeValue = timeValue.split(',');
|
||||||
}
|
}
|
||||||
const [startTime, endTime]: string[] = timeValue;
|
const [startTime, endTime]: string[] = timeValue;
|
||||||
//update-begin---author:wangshuai---date:2024-10-08---for:【issues/7216】当RangePicker组件值允许开始/结束为空时,表单的fieldMapToTime处理异常---
|
// 代码逻辑说明: 【issues/7216】当RangePicker组件值允许开始/结束为空时,表单的fieldMapToTime处理异常---
|
||||||
startTime && (values[startTimeKey] = dateUtil(startTime).format(format));
|
startTime && (values[startTimeKey] = dateUtil(startTime).format(format));
|
||||||
endTime && (values[endTimeKey] = dateUtil(endTime).format(format));
|
endTime && (values[endTimeKey] = dateUtil(endTime).format(format));
|
||||||
//update-end---author:wangshuai---date:2024-10-08---for:【issues/7216】当RangePicker组件值允许开始/结束为空时,表单的fieldMapToTime处理异常---
|
|
||||||
Reflect.deleteProperty(values, field);
|
Reflect.deleteProperty(values, field);
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
@ -60,13 +59,12 @@ export function handleRangeNumberValue(props, values) {
|
|||||||
if (!field || !startNumberKey || !endNumberKey || !values[field]) {
|
if (!field || !startNumberKey || !endNumberKey || !values[field]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//update-begin-author:taoyan date:2022-5-10 for: 用于数值的范围查询 数组格式的中间转换不知道哪里出了问题,这里会变成字符串,需要再强制转成数组
|
// 代码逻辑说明: 用于数值的范围查询 数组格式的中间转换不知道哪里出了问题,这里会变成字符串,需要再强制转成数组
|
||||||
let temp = values[field];
|
let temp = values[field];
|
||||||
if (typeof temp === 'string') {
|
if (typeof temp === 'string') {
|
||||||
temp = temp.split(',');
|
temp = temp.split(',');
|
||||||
}
|
}
|
||||||
const [startNumber, endNumber]: number[] = temp;
|
const [startNumber, endNumber]: number[] = temp;
|
||||||
//update-end-author:taoyan date:2022-5-10 for: 用于数值的范围查询 数组格式的中间转换不知道哪里出了问题,这里会变成字符串,需要再强制转成数组
|
|
||||||
values[startNumberKey] = startNumber;
|
values[startNumberKey] = startNumber;
|
||||||
values[endNumberKey] = endNumber;
|
values[endNumberKey] = endNumber;
|
||||||
Reflect.deleteProperty(values, field);
|
Reflect.deleteProperty(values, field);
|
||||||
|
|||||||
@ -88,10 +88,9 @@
|
|||||||
function handleSearchChange(e: ChangeEvent) {
|
function handleSearchChange(e: ChangeEvent) {
|
||||||
const value = e.target.value;
|
const value = e.target.value;
|
||||||
console.log("value::::",value)
|
console.log("value::::",value)
|
||||||
//update-begin---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效------------
|
// 代码逻辑说明: 【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效------------
|
||||||
setCurrentPage(1);
|
setCurrentPage(1);
|
||||||
current.value = 1;
|
current.value = 1;
|
||||||
//update-end---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无述------------
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
currentList.value = props.currentList;
|
currentList.value = props.currentList;
|
||||||
return;
|
return;
|
||||||
@ -99,7 +98,6 @@
|
|||||||
currentList.value = props.currentList.filter((item) => item.includes(value));
|
currentList.value = props.currentList.filter((item) => item.includes(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效,输入框后面的图标点击之后清空数据------------
|
|
||||||
/**
|
/**
|
||||||
* 图标点击重置页数
|
* 图标点击重置页数
|
||||||
*/
|
*/
|
||||||
@ -111,14 +109,12 @@
|
|||||||
currentList.value = props.currentList;
|
currentList.value = props.currentList;
|
||||||
searchIconValue.value = '';
|
searchIconValue.value = '';
|
||||||
}
|
}
|
||||||
//update-end---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效,输入框后面的图标点击之后清空数据------------
|
|
||||||
|
|
||||||
function handlePageChange(page: number, size: number) {
|
function handlePageChange(page: number, size: number) {
|
||||||
//update-begin---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效------------
|
// 代码逻辑说明: 【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效------------
|
||||||
current.value = page;
|
current.value = page;
|
||||||
pageSize.value = size;
|
pageSize.value = size;
|
||||||
setPageSize(size);
|
setPageSize(size);
|
||||||
//update-end---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效------------
|
|
||||||
setCurrentPage(page);
|
setCurrentPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -122,7 +122,7 @@
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { prefixCls } = useDesign('icon-picker');
|
const { prefixCls } = useDesign('icon-picker');
|
||||||
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-08---for:【QQYUN-8924】图标库选择组件不如vue2的方便---
|
// 代码逻辑说明: 【QQYUN-8924】图标库选择组件不如vue2的方便---
|
||||||
const iconOpen = ref<boolean>(false);
|
const iconOpen = ref<boolean>(false);
|
||||||
//方向性图标
|
//方向性图标
|
||||||
const directionIcons = ['ant-design:step-backward-outlined', 'ant-design:step-forward-outlined', 'ant-design:fast-backward-outlined', 'ant-design:fast-forward-outlined', 'ant-design:shrink-outlined', 'ant-design:arrows-alt-outlined', 'ant-design:down-outlined', 'ant-design:up-outlined', 'ant-design:left-outlined', 'ant-design:right-outlined', 'ant-design:caret-up-outlined', 'ant-design:caret-down-outlined', 'ant-design:caret-left-outlined', 'ant-design:caret-right-outlined', 'ant-design:up-circle-outlined', 'ant-design:down-circle-outlined', 'ant-design:left-circle-outlined', 'ant-design:right-circle-outlined', 'ant-design:double-right-outlined', 'ant-design:double-left-outlined', 'ant-design:vertical-left-outlined', 'ant-design:vertical-right-outlined', 'ant-design:forward-outlined', 'ant-design:backward-outlined', 'ant-design:rollback-outlined', 'ant-design:enter-outlined', 'ant-design:retweet-outlined', 'ant-design:swap-outlined', 'ant-design:swap-left-outlined', 'ant-design:swap-right-outlined', 'ant-design:arrow-up-outlined', 'ant-design:arrow-down-outlined', 'ant-design:arrow-left-outlined', 'ant-design:arrow-right-outlined', 'ant-design:play-circle-outlined', 'ant-design:up-square-outlined', 'ant-design:down-square-outlined', 'ant-design:left-square-outlined', 'ant-design:right-square-outlined', 'ant-design:login-outlined', 'ant-design:logout-outlined', 'ant-design:menu-fold-outlined', 'ant-design:menu-unfold-outlined', 'ant-design:border-bottom-outlined', 'ant-design:border-horizontal-outlined', 'ant-design:border-inner-outlined', 'ant-design:border-left-outlined', 'ant-design:border-right-outlined', 'ant-design:border-top-outlined', 'ant-design:border-verticle-outlined', 'ant-design:pic-center-outlined', 'ant-design:pic-left-outlined', 'ant-design:pic-right-outlined', 'ant-design:radius-bottomleft-outlined', 'ant-design:radius-bottomright-outlined', 'ant-design:radius-upleft-outlined', 'ant-design:radius-upright-outlined', 'ant-design:fullscreen-outlined', 'ant-design:fullscreen-exit-outlined']
|
const directionIcons = ['ant-design:step-backward-outlined', 'ant-design:step-forward-outlined', 'ant-design:fast-backward-outlined', 'ant-design:fast-forward-outlined', 'ant-design:shrink-outlined', 'ant-design:arrows-alt-outlined', 'ant-design:down-outlined', 'ant-design:up-outlined', 'ant-design:left-outlined', 'ant-design:right-outlined', 'ant-design:caret-up-outlined', 'ant-design:caret-down-outlined', 'ant-design:caret-left-outlined', 'ant-design:caret-right-outlined', 'ant-design:up-circle-outlined', 'ant-design:down-circle-outlined', 'ant-design:left-circle-outlined', 'ant-design:right-circle-outlined', 'ant-design:double-right-outlined', 'ant-design:double-left-outlined', 'ant-design:vertical-left-outlined', 'ant-design:vertical-right-outlined', 'ant-design:forward-outlined', 'ant-design:backward-outlined', 'ant-design:rollback-outlined', 'ant-design:enter-outlined', 'ant-design:retweet-outlined', 'ant-design:swap-outlined', 'ant-design:swap-left-outlined', 'ant-design:swap-right-outlined', 'ant-design:arrow-up-outlined', 'ant-design:arrow-down-outlined', 'ant-design:arrow-left-outlined', 'ant-design:arrow-right-outlined', 'ant-design:play-circle-outlined', 'ant-design:up-square-outlined', 'ant-design:down-square-outlined', 'ant-design:left-square-outlined', 'ant-design:right-square-outlined', 'ant-design:login-outlined', 'ant-design:logout-outlined', 'ant-design:menu-fold-outlined', 'ant-design:menu-unfold-outlined', 'ant-design:border-bottom-outlined', 'ant-design:border-horizontal-outlined', 'ant-design:border-inner-outlined', 'ant-design:border-left-outlined', 'ant-design:border-right-outlined', 'ant-design:border-top-outlined', 'ant-design:border-verticle-outlined', 'ant-design:pic-center-outlined', 'ant-design:pic-left-outlined', 'ant-design:pic-right-outlined', 'ant-design:radius-bottomleft-outlined', 'ant-design:radius-bottomright-outlined', 'ant-design:radius-upleft-outlined', 'ant-design:radius-upright-outlined', 'ant-design:fullscreen-outlined', 'ant-design:fullscreen-exit-outlined']
|
||||||
@ -138,35 +138,30 @@
|
|||||||
const logoIcons = ['ant-design:android-outlined', 'ant-design:apple-outlined', 'ant-design:windows-outlined', 'ant-design:ie-outlined', 'ant-design:chrome-outlined', 'ant-design:github-outlined', 'ant-design:aliwangwang-outlined', 'ant-design:dingding-outlined', 'ant-design:weibo-square-outlined', 'ant-design:weibo-circle-outlined', 'ant-design:taobao-circle-outlined', 'ant-design:html5-outlined', 'ant-design:weibo-outlined', 'ant-design:twitter-outlined', 'ant-design:wechat-outlined', 'ant-design:youtube-outlined', 'ant-design:alipay-circle-outlined', 'ant-design:taobao-outlined', 'ant-design:skype-outlined', 'ant-design:qq-outlined', 'ant-design:medium-workmark-outlined', 'ant-design:gitlab-outlined', 'ant-design:medium-outlined', 'ant-design:linkedin-outlined', 'ant-design:google-plus-outlined', 'ant-design:dropbox-outlined', 'ant-design:facebook-outlined', 'ant-design:codepen-outlined', 'ant-design:amazon-outlined', 'ant-design:google-outlined', 'ant-design:codepen-circle-outlined', 'ant-design:alipay-outlined', 'ant-design:ant-design-outlined', 'ant-design:aliyun-outlined', 'ant-design:zhihu-outlined', 'ant-design:slack-outlined', 'ant-design:slack-square-outlined', 'ant-design:behance-outlined', 'ant-design:behance-square-outlined', 'ant-design:dribbble-outlined', 'ant-design:dribbble-square-outlined', 'ant-design:instagram-outlined', 'ant-design:yuque-outlined', 'ant-design:alibaba-outlined', 'ant-design:yahoo-outlined']
|
const logoIcons = ['ant-design:android-outlined', 'ant-design:apple-outlined', 'ant-design:windows-outlined', 'ant-design:ie-outlined', 'ant-design:chrome-outlined', 'ant-design:github-outlined', 'ant-design:aliwangwang-outlined', 'ant-design:dingding-outlined', 'ant-design:weibo-square-outlined', 'ant-design:weibo-circle-outlined', 'ant-design:taobao-circle-outlined', 'ant-design:html5-outlined', 'ant-design:weibo-outlined', 'ant-design:twitter-outlined', 'ant-design:wechat-outlined', 'ant-design:youtube-outlined', 'ant-design:alipay-circle-outlined', 'ant-design:taobao-outlined', 'ant-design:skype-outlined', 'ant-design:qq-outlined', 'ant-design:medium-workmark-outlined', 'ant-design:gitlab-outlined', 'ant-design:medium-outlined', 'ant-design:linkedin-outlined', 'ant-design:google-plus-outlined', 'ant-design:dropbox-outlined', 'ant-design:facebook-outlined', 'ant-design:codepen-outlined', 'ant-design:amazon-outlined', 'ant-design:google-outlined', 'ant-design:codepen-circle-outlined', 'ant-design:alipay-outlined', 'ant-design:ant-design-outlined', 'ant-design:aliyun-outlined', 'ant-design:zhihu-outlined', 'ant-design:slack-outlined', 'ant-design:slack-square-outlined', 'ant-design:behance-outlined', 'ant-design:behance-square-outlined', 'ant-design:dribbble-outlined', 'ant-design:dribbble-square-outlined', 'ant-design:instagram-outlined', 'ant-design:yuque-outlined', 'ant-design:alibaba-outlined', 'ant-design:yahoo-outlined']
|
||||||
//其他
|
//其他
|
||||||
const otherIcons = ref<any>([]);
|
const otherIcons = ref<any>([]);
|
||||||
//update-end---author:wangshuai---date:2024-05-08---for:【QQYUN-8924】图标库选择组件不如vue2的方便---
|
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
// update-begin--author:liaozhiyang---date:20240528---for:【TV360X-136】按钮图标改成图标组件选择
|
// 代码逻辑说明: 【TV360X-136】按钮图标改成图标组件选择
|
||||||
let value = props.value;
|
let value = props.value;
|
||||||
if (!props.iconPrefixSave && value) {
|
if (!props.iconPrefixSave && value) {
|
||||||
value = `ant-design:${value}`;
|
value = `ant-design:${value}`;
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240528---for:【TV360X-136】按钮图标改成图标组件选择
|
|
||||||
currentSelect.value = value;
|
currentSelect.value = value;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => currentSelect.value,
|
() => currentSelect.value,
|
||||||
(v) => {
|
(v) => {
|
||||||
// update-begin--author:liaozhiyang---date:20240528---for:【TV360X-136】按钮图标改成图标组件选择
|
// 代码逻辑说明: 【TV360X-136】按钮图标改成图标组件选择
|
||||||
let value = v;
|
let value = v;
|
||||||
if (!props.iconPrefixSave && value) {
|
if (!props.iconPrefixSave && value) {
|
||||||
value = value.split('ant-design:')[1];
|
value = value.split('ant-design:')[1];
|
||||||
}
|
}
|
||||||
// update-end--author:liaozhiyang---date:20240528---for:【TV360X-136】按钮图标改成图标组件选择
|
|
||||||
emit('update:value', value);
|
emit('update:value', value);
|
||||||
return emit('change', value);
|
return emit('change', value);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//update-begin---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效,输入框后面的图标点击之后清空数据------------
|
|
||||||
//update-begin---author:wangshuai---date:2024-05-08---for:【QQYUN-8924】图标库选择组件不如vue2的方便---
|
|
||||||
/**
|
/**
|
||||||
* 图标点击重置页数
|
* 图标点击重置页数
|
||||||
*/
|
*/
|
||||||
@ -179,7 +174,6 @@
|
|||||||
iconListRef.value.currentSelectClick();
|
iconListRef.value.currentSelectClick();
|
||||||
},100)
|
},100)
|
||||||
}
|
}
|
||||||
//update-begin---author:wangshuai ---date:20230522 for:【issues/4947】菜单编辑页面菜单图标选择模板,每页显示数量切换无效,输入框后面的图标点击之后清空数据------------
|
|
||||||
|
|
||||||
function initOtherIcon() {
|
function initOtherIcon() {
|
||||||
otherIcons.value = icons.filter(item => {
|
otherIcons.value = icons.filter(item => {
|
||||||
@ -210,7 +204,6 @@
|
|||||||
//初始化加载图标
|
//初始化加载图标
|
||||||
initOtherIcon();
|
initOtherIcon();
|
||||||
})
|
})
|
||||||
//update-end---author:wangshuai---date:2024-05-08---for:【QQYUN-8924】图标库选择组件不如vue2的方便---
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@prefix-cls: ~'@{namespace}-icon-picker';
|
@prefix-cls: ~'@{namespace}-icon-picker';
|
||||||
|
|||||||
@ -100,9 +100,8 @@ watch(innerValue, (val) => {
|
|||||||
}
|
}
|
||||||
emit('change', val)
|
emit('change', val)
|
||||||
emit('update:value', val)
|
emit('update:value', val)
|
||||||
// update-begin--author:liaozhiyang---date:20240509---for:【QQYUN-9227】日期校验没清空
|
// 代码逻辑说明: 【QQYUN-9227】日期校验没清空
|
||||||
formItemContext?.onFieldChange();
|
formItemContext?.onFieldChange();
|
||||||
// update-end--author:liaozhiyang---date:20240509---for:【QQYUN-9227】日期校验没清空
|
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => props.allowSelectRange, (allow) => {
|
watch(() => props.allowSelectRange, (allow) => {
|
||||||
|
|||||||
@ -24,10 +24,9 @@ export async function registerJVxeCustom() {
|
|||||||
await registerAsyncComponent(JVxeTypes.departSelect, import('./src/components/JVxeDepartSelectCell.vue'));
|
await registerAsyncComponent(JVxeTypes.departSelect, import('./src/components/JVxeDepartSelectCell.vue'));
|
||||||
// 注册【省市区选择】组件
|
// 注册【省市区选择】组件
|
||||||
// await registerAsyncComponent(JVxeTypes.pca, import('./src/components/JVxePcaCell.vue'));
|
// await registerAsyncComponent(JVxeTypes.pca, import('./src/components/JVxePcaCell.vue'));
|
||||||
// update-begin--author:liaozhiyang---date:20240308---for:【QQYUN-8241】为避免首次加载china-area-data,JVxePcaCell组件需异步加载
|
// 代码逻辑说明: 【QQYUN-8241】为避免首次加载china-area-data,JVxePcaCell组件需异步加载
|
||||||
registerASyncComponentReal(
|
registerASyncComponentReal(
|
||||||
JVxeTypes.pca,
|
JVxeTypes.pca,
|
||||||
createAsyncComponent(() => import('./src/components/JVxePcaCell.vue'))
|
createAsyncComponent(() => import('./src/components/JVxePcaCell.vue'))
|
||||||
);
|
);
|
||||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8241】为避免首次加载china-area-data,JVxePcaCell组件需异步加载
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user