Compare commits
9 Commits
v3.4.4
...
v3.4.4last
Author | SHA1 | Date | |
---|---|---|---|
![]() |
95ca88b47c | ||
![]() |
30855ad4a0 | ||
![]() |
19931fb273 | ||
![]() |
787e763b9d | ||
![]() |
104e975a13 | ||
![]() |
136e30360c | ||
![]() |
c402eec726 | ||
![]() |
1b5f6caa41 | ||
![]() |
7b7bcba3b4 |
11
README.md
11
README.md
@@ -3,7 +3,7 @@ JEECG BOOT 低代码开发平台(Vue3前端)
|
|||||||
当前最新版本: 3.4.4(发布时间:2022-11-21)
|
当前最新版本: 3.4.4(发布时间:2022-11-21)
|
||||||
|
|
||||||
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
|
[](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE)
|
||||||
[](http://www.jeecg.com)
|
[](http://www.jeecg.com)
|
||||||
[](https://jeecg.blog.csdn.net)
|
[](https://jeecg.blog.csdn.net)
|
||||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||||
[](https://github.com/zhangdaiscott/jeecg-boot)
|
[](https://github.com/zhangdaiscott/jeecg-boot)
|
||||||
@@ -13,7 +13,7 @@ JEECG BOOT 低代码开发平台(Vue3前端)
|
|||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
JeecgBoot-Vue3采用 Vue3.0、Vite、 Ant-Design-Vue3、TypeScript 等新技术方案,包括二次封装组件、utils、hooks、动态菜单、权限校验、按钮级别权限控制等功能。
|
JeecgBoot-Vue3采用 Vue3.0、Vite、 Ant-Design-Vue3、TypeScript 等新技术方案,包括二次封装组件、utils、hooks、动态菜单、权限校验、按钮级别权限控制等功能。
|
||||||
是JeecgBoot低代码平台的vue3技术栈的全新UI版本,功能强于vue2版。
|
是采用Vben实现的 JeecgBoot低代码平台的全新vue3版本。
|
||||||
|
|
||||||
> 强大的代码生成器让前后端代码一键生成! JeecgBoot引领低代码开发模式(OnlineCoding-> 代码生成-> 手工MERGE), 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省成本,同时又不失灵活性
|
> 强大的代码生成器让前后端代码一键生成! JeecgBoot引领低代码开发模式(OnlineCoding-> 代码生成-> 手工MERGE), 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省成本,同时又不失灵活性
|
||||||
|
|
||||||
@@ -41,14 +41,15 @@ JeecgBoot-Vue3采用 Vue3.0、Vite、 Ant-Design-Vue3、TypeScript 等新技术
|
|||||||
|
|
||||||
- 官方文档:[http://vue3.jeecg.com](http://vue3.jeecg.com)
|
- 官方文档:[http://vue3.jeecg.com](http://vue3.jeecg.com)
|
||||||
- 官方网站: [http://www.jeecg.com](http://www.jeecg.com)
|
- 官方网站: [http://www.jeecg.com](http://www.jeecg.com)
|
||||||
- 在线演示:[http://boot3.jeecg.com](http://boot3.jeecg.com)
|
- 在线演示:[低代码演示](http://boot3.jeecg.com) | [敲敲云零代码](https://www.qiaoqiaoyun.com)
|
||||||
- 快速入门:[常见问题](http://vue3.jeecg.com/2426559) | [入门视频](https://www.bilibili.com/video/BV1V34y187Y9 "入门视频") | [ 代码生成](http://vue3.jeecg.com/2677352)
|
- 快速入门:[常见问题](http://vue3.jeecg.com/2426559) | [入门视频](https://www.bilibili.com/video/BV1V34y187Y9 "入门视频") | [ 代码生成](http://vue3.jeecg.com/2677352)
|
||||||
- QQ交流群:683903138
|
- QQ交流群:683903138
|
||||||
|
|
||||||
## 安装与使用
|
## 安装与使用
|
||||||
|
|
||||||
|
|
||||||
> 环境要求: Node.js版本要求12.x以上,且不能为13.x版本,这里推荐14.x及以上。
|
> 环境要求: 版本要求Node 14.18+ / 16+ 版本以上,不再支持 Node 12 / 13 / 15。
|
||||||
|
> 建议使用pnpm,如果使用yarn,请用Yarn1.x版本,否则依赖可能安装不上。
|
||||||
|
|
||||||
|
|
||||||
- Get the project code
|
- Get the project code
|
||||||
@@ -173,6 +174,7 @@ VITE_GLOB_DOMAIN_URL=http://jeecg-boot-gateway:9999
|
|||||||
|
|
||||||
* [JeecgBoot-Vue3文档](http://vue3.jeecg.com)
|
* [JeecgBoot-Vue3文档](http://vue3.jeecg.com)
|
||||||
* [Vue3 文档](https://cn.vuejs.org/)
|
* [Vue3 文档](https://cn.vuejs.org/)
|
||||||
|
* [Vben文档](https://doc.vvbin.cn)
|
||||||
* [Ant-Design-Vue](https://www.antdv.com/docs/vue/introduce-cn/)
|
* [Ant-Design-Vue](https://www.antdv.com/docs/vue/introduce-cn/)
|
||||||
* [TypeScript](https://www.typescriptlang.org/)
|
* [TypeScript](https://www.typescriptlang.org/)
|
||||||
* [Vue-router](https://router.vuejs.org/zh)
|
* [Vue-router](https://router.vuejs.org/zh)
|
||||||
@@ -182,7 +184,6 @@ VITE_GLOB_DOMAIN_URL=http://jeecg-boot-gateway:9999
|
|||||||
* [Vue-RFCS](https://github.com/vuejs/rfcs)
|
* [Vue-RFCS](https://github.com/vuejs/rfcs)
|
||||||
* [Vue2 迁移到 3](https://v3.vuejs.org/guide/migration/introduction.html)
|
* [Vue2 迁移到 3](https://v3.vuejs.org/guide/migration/introduction.html)
|
||||||
* [vxetable文档](https://vxetable.cn)
|
* [vxetable文档](https://vxetable.cn)
|
||||||
* [~~Vben文档~~](https://vvbin.cn/doc-next)
|
|
||||||
* [~~WindiCss~~](https://windicss.netlify.app/)
|
* [~~WindiCss~~](https://windicss.netlify.app/)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
"gen:icon": "esno ./build/generate/icon/index.ts"
|
"gen:icon": "esno ./build/generate/icon/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jeecg/online": "3.4.3-GA",
|
"@jeecg/online": "3.4.4-RC",
|
||||||
"@iconify/iconify": "^2.2.1",
|
"@iconify/iconify": "^2.2.1",
|
||||||
"@ant-design/colors": "^6.0.0",
|
"@ant-design/colors": "^6.0.0",
|
||||||
"@ant-design/icons-vue": "^6.1.0",
|
"@ant-design/icons-vue": "^6.1.0",
|
||||||
|
10
pnpm-lock.yaml
generated
10
pnpm-lock.yaml
generated
@@ -11,7 +11,7 @@ specifiers:
|
|||||||
'@commitlint/config-conventional': ^16.2.1
|
'@commitlint/config-conventional': ^16.2.1
|
||||||
'@iconify/iconify': ^2.2.1
|
'@iconify/iconify': ^2.2.1
|
||||||
'@iconify/json': ^2.1.30
|
'@iconify/json': ^2.1.30
|
||||||
'@jeecg/online': 3.4.3-GA
|
'@jeecg/online': 3.4.4-RC
|
||||||
'@logicflow/core': ^1.1.13
|
'@logicflow/core': ^1.1.13
|
||||||
'@logicflow/extension': ^1.1.13
|
'@logicflow/extension': ^1.1.13
|
||||||
'@purge-icons/generated': ^0.8.1
|
'@purge-icons/generated': ^0.8.1
|
||||||
@@ -148,7 +148,7 @@ dependencies:
|
|||||||
'@ant-design/colors': registry.npmmirror.com/@ant-design/colors/6.0.0
|
'@ant-design/colors': registry.npmmirror.com/@ant-design/colors/6.0.0
|
||||||
'@ant-design/icons-vue': registry.npmmirror.com/@ant-design/icons-vue/6.1.0_vue@3.2.43
|
'@ant-design/icons-vue': registry.npmmirror.com/@ant-design/icons-vue/6.1.0_vue@3.2.43
|
||||||
'@iconify/iconify': registry.npmmirror.com/@iconify/iconify/2.2.1
|
'@iconify/iconify': registry.npmmirror.com/@iconify/iconify/2.2.1
|
||||||
'@jeecg/online': registry.npmmirror.com/@jeecg/online/3.4.3-GA
|
'@jeecg/online': registry.npmmirror.com/@jeecg/online/3.4.4-RC
|
||||||
'@logicflow/core': registry.npmmirror.com/@logicflow/core/1.1.30
|
'@logicflow/core': registry.npmmirror.com/@logicflow/core/1.1.30
|
||||||
'@logicflow/extension': registry.npmmirror.com/@logicflow/extension/1.1.30
|
'@logicflow/extension': registry.npmmirror.com/@logicflow/extension/1.1.30
|
||||||
'@vue/runtime-core': registry.npmmirror.com/@vue/runtime-core/3.2.43
|
'@vue/runtime-core': registry.npmmirror.com/@vue/runtime-core/3.2.43
|
||||||
@@ -2306,10 +2306,10 @@ packages:
|
|||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
registry.npmmirror.com/@jeecg/online/3.4.3-GA:
|
registry.npmmirror.com/@jeecg/online/3.4.4-RC:
|
||||||
resolution: {integrity: sha512-MtZD7ue8gLB8d0HSclzMwpyzHLbBlhYw5hOCSQBAPjbySFAXj+ajKtZgvcl1uk7loTaK2pPJWmoUPBP/CUPWbw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jeecg/online/-/online-3.4.3-GA.tgz}
|
resolution: {integrity: sha512-EjibCo++GszsWuLn3+kqaxt12Zim7f0XWSiHzypef4aAqBKYDnG30Z5K3j5W1g4g22fjVUkrb1rQ8rSLTlPdBw==, registry: http://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@jeecg/online/-/online-3.4.4-RC.tgz}
|
||||||
name: '@jeecg/online'
|
name: '@jeecg/online'
|
||||||
version: 3.4.3-GA
|
version: 3.4.4-RC
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
registry.npmmirror.com/@jest/console/27.5.1:
|
registry.npmmirror.com/@jest/console/27.5.1:
|
||||||
|
@@ -113,15 +113,28 @@
|
|||||||
const getSchema = computed((): FormSchema[] => {
|
const getSchema = computed((): FormSchema[] => {
|
||||||
const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any);
|
const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any);
|
||||||
for (const schema of schemas) {
|
for (const schema of schemas) {
|
||||||
const { defaultValue, component } = schema;
|
const { defaultValue, component, componentProps } = schema;
|
||||||
// handle date type
|
// handle date type
|
||||||
if (defaultValue && dateItemType.includes(component)) {
|
if (defaultValue && dateItemType.includes(component)) {
|
||||||
|
const { valueFormat } = componentProps
|
||||||
if (!Array.isArray(defaultValue)) {
|
if (!Array.isArray(defaultValue)) {
|
||||||
schema.defaultValue = dateUtil(defaultValue);
|
//update-begin---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
||||||
|
if(valueFormat){
|
||||||
|
schema.defaultValue = dateUtil(defaultValue).format(valueFormat);
|
||||||
|
}else{
|
||||||
|
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) => {
|
||||||
def.push(dateUtil(item));
|
//update-begin---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
||||||
|
if(valueFormat){
|
||||||
|
def.push(dateUtil(item).format(valueFormat));
|
||||||
|
}else{
|
||||||
|
def.push(dateUtil(item));
|
||||||
|
}
|
||||||
|
//update-end---author:wangshuai ---date:20221124 for:[issues/215]列表页查询框(日期选择框)设置初始时间,一进入页面时,后台报日期转换类型错误的------------
|
||||||
});
|
});
|
||||||
schema.defaultValue = def;
|
schema.defaultValue = def;
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,7 @@ import JSearchSelect from './jeecg/components/JSearchSelect.vue';
|
|||||||
import JAddInput from './jeecg/components/JAddInput.vue';
|
import JAddInput from './jeecg/components/JAddInput.vue';
|
||||||
import { Time } from '/@/components/Time';
|
import { Time } from '/@/components/Time';
|
||||||
import JRangeNumber from './jeecg/components/JRangeNumber.vue';
|
import JRangeNumber from './jeecg/components/JRangeNumber.vue';
|
||||||
|
import JRangeDate from './jeecg/components/JRangeDate.vue'
|
||||||
|
|
||||||
const componentMap = new Map<ComponentType, Component>();
|
const componentMap = new Map<ComponentType, Component>();
|
||||||
|
|
||||||
@@ -125,6 +126,7 @@ componentMap.set('JUpload', JUpload);
|
|||||||
componentMap.set('JSearchSelect', JSearchSelect);
|
componentMap.set('JSearchSelect', JSearchSelect);
|
||||||
componentMap.set('JAddInput', JAddInput);
|
componentMap.set('JAddInput', JAddInput);
|
||||||
componentMap.set('JRangeNumber', JRangeNumber);
|
componentMap.set('JRangeNumber', JRangeNumber);
|
||||||
|
componentMap.set('RangeDate', JRangeDate);
|
||||||
|
|
||||||
export function add(compName: ComponentType, component: Component) {
|
export function add(compName: ComponentType, component: Component) {
|
||||||
componentMap.set(compName, component);
|
componentMap.set(compName, component);
|
||||||
|
@@ -97,7 +97,12 @@ export function useForm(props?: Props): UseFormReturnType {
|
|||||||
if(values){
|
if(values){
|
||||||
Object.keys(values).map(key=>{
|
Object.keys(values).map(key=>{
|
||||||
if (values[key] instanceof Array) {
|
if (values[key] instanceof Array) {
|
||||||
values[key] = values[key].join(',');
|
// update-begin-author:sunjianlei date:20221205 for: 【issues/4330】判断如果是对象数组,则不拼接
|
||||||
|
let isObject = typeof (values[key][0] || '') === 'object';
|
||||||
|
if (!isObject) {
|
||||||
|
values[key] = values[key].join(',');
|
||||||
|
}
|
||||||
|
// update-end-author:sunjianlei date:20221205 for: 【issues/4330】判断如果是对象数组,则不拼接
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,11 @@
|
|||||||
if (Array.isArray(state.value)) {
|
if (Array.isArray(state.value)) {
|
||||||
state.value = state.value.filter((item) => item != null && item !== '');
|
state.value = state.value.filter((item) => item != null && item !== '');
|
||||||
}
|
}
|
||||||
|
//update-begin---author:wangshuai ---date:20221123 for:单选模式要改成字符串------------
|
||||||
|
if(mode !== 'multiple' && state.value && state.value.length>0){
|
||||||
|
state.value = state.value[0];
|
||||||
|
}
|
||||||
|
//update-end---author:wangshuai ---date:20221123 for:单选模式要改成字符串--------------
|
||||||
// nextTick(() => formItemContext.onFieldChange());
|
// nextTick(() => formItemContext.onFieldChange());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -182,6 +182,9 @@
|
|||||||
if (file.status != 'uploading') {
|
if (file.status != 'uploading') {
|
||||||
fileList.forEach((file) => {
|
fileList.forEach((file) => {
|
||||||
if (file.status === 'done') {
|
if (file.status === 'done') {
|
||||||
|
//update-begin---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||||
|
initTag.value = true;
|
||||||
|
//update-end---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||||
fileUrls.push(file.response.message);
|
fileUrls.push(file.response.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
65
src/components/Form/src/jeecg/components/JRangeDate.vue
Normal file
65
src/components/Form/src/jeecg/components/JRangeDate.vue
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<template>
|
||||||
|
<a-range-picker v-model:value="rangeValue" @change="handleChange" :show-time="datetime" :placeholder="placeholder" :valueFormat="valueFormat"/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { defineComponent, ref, watch, computed } from 'vue';
|
||||||
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const placeholder = ['最小值', '最大值']
|
||||||
|
/**
|
||||||
|
* 用于范围查询
|
||||||
|
*/
|
||||||
|
export default defineComponent({
|
||||||
|
name: "JRangeDate",
|
||||||
|
props:{
|
||||||
|
value: propTypes.string.def(''),
|
||||||
|
datetime: propTypes.bool.def(false),
|
||||||
|
placeholder: propTypes.string.def(''),
|
||||||
|
},
|
||||||
|
emits:['change', 'update:value'],
|
||||||
|
setup(props, {emit}){
|
||||||
|
const rangeValue = ref([])
|
||||||
|
const formItemContext = Form.useInjectFormItemContext();
|
||||||
|
|
||||||
|
watch(()=>props.value, (val)=>{
|
||||||
|
if(val){
|
||||||
|
rangeValue.value = val.split(',')
|
||||||
|
}else{
|
||||||
|
rangeValue.value = []
|
||||||
|
}
|
||||||
|
}, {immediate: true});
|
||||||
|
|
||||||
|
const valueFormat = computed(()=>{
|
||||||
|
if(props.datetime === true){
|
||||||
|
return 'YYYY-MM-DD HH:mm:ss'
|
||||||
|
}else{
|
||||||
|
return 'YYYY-MM-DD'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleChange(arr){
|
||||||
|
let str = ''
|
||||||
|
if(arr && arr.length>0){
|
||||||
|
if(arr[1] && arr[0]){
|
||||||
|
str = arr.join(',')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
emit('change', str);
|
||||||
|
emit('update:value', str);
|
||||||
|
formItemContext.onFieldChange();
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
rangeValue,
|
||||||
|
placeholder,
|
||||||
|
valueFormat,
|
||||||
|
handleChange
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-input-group>
|
<a-input-group>
|
||||||
<a-input :value="beginValue" style="width: calc(50% - 15px)" placeholder="请输入最小值" @change="handleChangeBegin" />
|
<a-input :value="beginValue" style="width: calc(50% - 15px)" placeholder="最小值" @change="handleChangeBegin" />
|
||||||
<a-input style="width: 30px; border-left: 0; pointer-events: none; background-color: #fff" placeholder="~" disabled />
|
<a-input style="width: 30px; border-left: 0; pointer-events: none; background-color: #fff" placeholder="~" disabled />
|
||||||
<a-input :value="endValue" style="width: calc(50% - 15px); border-left: 0" placeholder="请输入最大值" @change="handleChangeEnd" />
|
<a-input :value="endValue" style="width: calc(50% - 15px); border-left: 0" placeholder="最大值" @change="handleChangeEnd" />
|
||||||
</a-input-group>
|
</a-input-group>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -11,19 +11,20 @@
|
|||||||
* 查询条件用-数值范围查询
|
* 查询条件用-数值范围查询
|
||||||
*/
|
*/
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JRangeNumber',
|
name: 'JRangeNumber',
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||||
type: Array,
|
|
||||||
default: ['', ''],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
emits: ['change'],
|
emits: ['change', 'update:value'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const beginValue = ref('');
|
const beginValue = ref('');
|
||||||
const endValue = ref('');
|
const endValue = ref('');
|
||||||
|
const formItemContext = Form.useInjectFormItemContext();
|
||||||
|
|
||||||
function handleChangeBegin(e) {
|
function handleChangeBegin(e) {
|
||||||
beginValue.value = e.target.value;
|
beginValue.value = e.target.value;
|
||||||
emitArray();
|
emitArray();
|
||||||
@@ -41,19 +42,21 @@
|
|||||||
arr.push(begin);
|
arr.push(begin);
|
||||||
arr.push(end);
|
arr.push(end);
|
||||||
emit('change', arr);
|
emit('change', arr);
|
||||||
|
emit('update:value', arr);
|
||||||
|
formItemContext.onFieldChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val.length == 2) {
|
if (val && val.length == 2) {
|
||||||
beginValue.value = val[0];
|
beginValue.value = val[0];
|
||||||
endValue.value = val[1];
|
endValue.value = val[1];
|
||||||
} else {
|
} else {
|
||||||
beginValue.value = '';
|
beginValue.value = '';
|
||||||
endValue.value = '';
|
endValue.value = '';
|
||||||
}
|
}
|
||||||
}
|
}, {immediate: true}
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@@ -48,6 +48,10 @@
|
|||||||
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方法未生效
|
||||||
|
url: propTypes.string.def(''),
|
||||||
|
params: propTypes.object.def({})
|
||||||
|
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
});
|
});
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
const emit = defineEmits(['change', 'update:value']);
|
const emit = defineEmits(['change', 'update:value']);
|
||||||
@@ -103,17 +107,23 @@
|
|||||||
treeValue.value = null;
|
treeValue.value = null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let params = { key: props.value };
|
//update-begin-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
let result = await defHttp.get({ url: `${Api.view}${props.dict}`, params }, { isTransformResponse: false });
|
if(props.url){
|
||||||
if (result.success) {
|
getItemFromTreeData();
|
||||||
let values = props.value.split(',');
|
}else{
|
||||||
treeValue.value = result.result.map((item, index) => ({
|
let params = { key: props.value };
|
||||||
key: values[index],
|
let result = await defHttp.get({ url: `${Api.view}${props.dict}`, params }, { isTransformResponse: false });
|
||||||
value: values[index],
|
if (result.success) {
|
||||||
label: item,
|
let values = props.value.split(',');
|
||||||
}));
|
treeValue.value = result.result.map((item, index) => ({
|
||||||
onLoadTriggleChange(result.result[0]);
|
key: values[index],
|
||||||
|
value: values[index],
|
||||||
|
label: item,
|
||||||
|
}));
|
||||||
|
onLoadTriggleChange(result.result[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,6 +177,9 @@
|
|||||||
if (treeNode.dataRef.children) {
|
if (treeNode.dataRef.children) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
if(props.url){
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
let pid = treeNode.dataRef.key;
|
let pid = treeNode.dataRef.key;
|
||||||
let params = {
|
let params = {
|
||||||
pid: pid,
|
pid: pid,
|
||||||
@@ -262,6 +275,67 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//update-begin-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
|
watch(()=>props.url, async (val)=>{
|
||||||
|
if(val){
|
||||||
|
await loadRootByUrl();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据自定义的请求地址加载数据
|
||||||
|
*/
|
||||||
|
async function loadRootByUrl(){
|
||||||
|
let url = props.url;
|
||||||
|
let params = props.params;
|
||||||
|
let res = await defHttp.get({ url, params }, { isTransformResponse: false });
|
||||||
|
if (res.success && res.result) {
|
||||||
|
for (let i of res.result) {
|
||||||
|
i.key = i.value;
|
||||||
|
i.isLeaf = !!i.leaf;
|
||||||
|
}
|
||||||
|
treeData.value = [...res.result];
|
||||||
|
} else {
|
||||||
|
console.log('数根节点查询结果异常', res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据已有的树数据 翻译选项
|
||||||
|
*/
|
||||||
|
function getItemFromTreeData(){
|
||||||
|
let data = treeData.value;
|
||||||
|
let arr = []
|
||||||
|
findChildrenNode(data, arr);
|
||||||
|
if(arr.length>0){
|
||||||
|
treeValue.value = arr
|
||||||
|
onLoadTriggleChange(arr[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归找子节点
|
||||||
|
* @param data
|
||||||
|
* @param arr
|
||||||
|
*/
|
||||||
|
function findChildrenNode(data, arr){
|
||||||
|
let val = props.value;
|
||||||
|
if(data && data.length){
|
||||||
|
for(let item of data){
|
||||||
|
if(val===item.value){
|
||||||
|
arr.push({
|
||||||
|
key: item.key,
|
||||||
|
value: item.value,
|
||||||
|
label: item.label||item.title
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
findChildrenNode(item.children, arr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//update-end-author:taoyan date:2022-11-8 for: issues/4173 Online JTreeSelect控件changeOptions方法未生效
|
||||||
|
|
||||||
// onCreated
|
// onCreated
|
||||||
validateProp().then(() => {
|
validateProp().then(() => {
|
||||||
initDictInfo();
|
initDictInfo();
|
||||||
|
@@ -141,4 +141,6 @@ export type ComponentType =
|
|||||||
| 'JSearchSelect'
|
| 'JSearchSelect'
|
||||||
| 'JAddInput'
|
| 'JAddInput'
|
||||||
| 'Time'
|
| 'Time'
|
||||||
|
| 'RangeDate'
|
||||||
|
| 'RangeNumber'
|
||||||
| 'JRangeNumber';
|
| 'JRangeNumber';
|
||||||
|
@@ -22,4 +22,6 @@ export async function registerJVxeCustom() {
|
|||||||
await registerAsyncComponent(JVxeTypes.userSelect, import('./src/components/JVxeUserSelectCell.vue'));
|
await registerAsyncComponent(JVxeTypes.userSelect, import('./src/components/JVxeUserSelectCell.vue'));
|
||||||
// 注册【部门选择】组件
|
// 注册【部门选择】组件
|
||||||
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'));
|
||||||
}
|
}
|
||||||
|
77
src/components/JVxeCustom/src/components/JVxePcaCell.vue
Normal file
77
src/components/JVxeCustom/src/components/JVxePcaCell.vue
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
<template>
|
||||||
|
<a-cascader v-bind="getProps" class="pca-select" @change="handleChange" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { computed, defineComponent } from 'vue';
|
||||||
|
import { regionData, getRealCode } from '/@/components/Form/src/utils/areaDataUtil';
|
||||||
|
import { JVxeComponent } from '/@/components/jeecg/JVxeTable/types';
|
||||||
|
import { useJVxeComponent, useJVxeCompProps } from '/@/components/jeecg/JVxeTable/hooks';
|
||||||
|
import { dispatchEvent } from '/@/components/jeecg/JVxeTable/utils';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'JVxePcaCell',
|
||||||
|
props: useJVxeCompProps(),
|
||||||
|
setup(props: JVxeComponent.Props) {
|
||||||
|
const { innerValue, cellProps, handleChangeCommon } = useJVxeComponent(props);
|
||||||
|
|
||||||
|
const selectedValue = computed(() => {
|
||||||
|
let val: any = innerValue.value;
|
||||||
|
if (!val) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
let arr = getRealCode(val, 3);
|
||||||
|
return arr;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getProps = computed(() => {
|
||||||
|
return {
|
||||||
|
...cellProps.value,
|
||||||
|
options: regionData,
|
||||||
|
showOverflow: false,
|
||||||
|
value: selectedValue.value,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleChange(arr) {
|
||||||
|
let str = '';
|
||||||
|
if(arr && arr.length==3){
|
||||||
|
str = arr[2];
|
||||||
|
}
|
||||||
|
handleChangeCommon(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
handleChange,
|
||||||
|
selectedValue,
|
||||||
|
getProps
|
||||||
|
};
|
||||||
|
},
|
||||||
|
// 【组件增强】注释详见:JVxeComponent.Enhanced
|
||||||
|
enhanced: {
|
||||||
|
switches: {
|
||||||
|
visible: true,
|
||||||
|
},
|
||||||
|
translate: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
aopEvents: {
|
||||||
|
editActived({ $event }) {
|
||||||
|
dispatchEvent({
|
||||||
|
$event,
|
||||||
|
props: this.props,
|
||||||
|
className: '.ant-select .ant-select-selection-search-input',
|
||||||
|
isClick: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
} as JVxeComponent.EnhancedPartial,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.pca-select{
|
||||||
|
.ant-select-selection-placeholder{
|
||||||
|
color: #bfbfbf !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@@ -149,7 +149,10 @@
|
|||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
/* update-begin-author:taoyan date:2022-11-18 for: 表格默认行高比官方示例多出2px*/
|
||||||
|
height: 22px;
|
||||||
|
/* update-end-author:taoyan date:2022-11-18 for: 表格默认行高比官方示例多出2px*/
|
||||||
|
|
||||||
.action-divider {
|
.action-divider {
|
||||||
display: table;
|
display: table;
|
||||||
}
|
}
|
||||||
|
@@ -447,6 +447,8 @@ export interface BasicColumn extends ColumnProps {
|
|||||||
auth?: RoleEnum | RoleEnum[] | string | string[];
|
auth?: RoleEnum | RoleEnum[] | string | string[];
|
||||||
// 业务控制是否显示
|
// 业务控制是否显示
|
||||||
ifShow?: boolean | ((column: BasicColumn) => boolean);
|
ifShow?: boolean | ((column: BasicColumn) => boolean);
|
||||||
|
//compType-用于记录类型
|
||||||
|
compType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ColumnChangeParam = {
|
export type ColumnChangeParam = {
|
||||||
|
@@ -44,6 +44,8 @@ export enum JVxeTypes {
|
|||||||
radio = 'radio',
|
radio = 'radio',
|
||||||
image = 'image',
|
image = 'image',
|
||||||
file = 'file',
|
file = 'file',
|
||||||
|
// 省市区
|
||||||
|
pca = 'pca',
|
||||||
}
|
}
|
||||||
|
|
||||||
// 为了防止和 vxe 内置的类型冲突,所以加上一个前缀
|
// 为了防止和 vxe 内置的类型冲突,所以加上一个前缀
|
||||||
|
@@ -44,7 +44,7 @@ export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs,
|
|||||||
getAllTable()
|
getAllTable()
|
||||||
.then((tables) => {
|
.then((tables) => {
|
||||||
let values = formRef.value.getFieldsValue();
|
let values = formRef.value.getFieldsValue();
|
||||||
return validateFormModelAndTables(formRef.value.validate, values, tables, formRef.value.getProps);
|
return validateFormModelAndTables(formRef.value.validate, values, tables, formRef.value.getProps, false);
|
||||||
})
|
})
|
||||||
.then((allValues) => {
|
.then((allValues) => {
|
||||||
/** 一次性验证一对一的所有子表 */
|
/** 一次性验证一对一的所有子表 */
|
||||||
@@ -61,7 +61,13 @@ export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs,
|
|||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
if (e.error === VALIDATE_FAILED) {
|
if (e.error === VALIDATE_FAILED) {
|
||||||
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|
||||||
activeKey.value = e.index == null ? unref(activeKey) : refKeys.value[e.index];
|
//update-begin-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
|
||||||
|
if(e.paneKey){
|
||||||
|
activeKey.value = e.paneKey
|
||||||
|
}else{
|
||||||
|
activeKey.value = e.index == null ? unref(activeKey) : refKeys.value[e.index];
|
||||||
|
}
|
||||||
|
//update-end-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
|
||||||
} else {
|
} else {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,9 @@
|
|||||||
<template #dargVerify="{ model, field }">
|
<template #dargVerify="{ model, field }">
|
||||||
<BasicDragVerify v-model:value="model[field]" />
|
<BasicDragVerify v-model:value="model[field]" />
|
||||||
</template>
|
</template>
|
||||||
|
<template #superQuery="{ model, field }">
|
||||||
|
<super-query :config="superQueryConfig" @search="(value)=>handleSuperQuery(value, model, field)"/>
|
||||||
|
</template>
|
||||||
</BasicForm>
|
</BasicForm>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -74,8 +77,22 @@
|
|||||||
function onSearch(value: string) {
|
function onSearch(value: string) {
|
||||||
keyword.value = value;
|
keyword.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const superQueryConfig = {
|
||||||
|
name:{ title: "名称", view: "text", type: "string", order: 1 },
|
||||||
|
birthday:{ title: "生日", view: "date", type: "string", order: 2 },
|
||||||
|
age:{ title: "年龄", view: "number", type: "number", order: 4 },
|
||||||
|
sex:{ title: "性别", view: "list", type: "string", dictCode: "sex", order: 5 },
|
||||||
|
bpmStatus:{ title: "流程状态", view: "list_multi", type: "string", dictCode: "bpm_status", order: 6 },
|
||||||
|
}
|
||||||
|
function handleSuperQuery(value, model, field){
|
||||||
|
if(value){
|
||||||
|
let str = decodeURI(value.superQueryParams)
|
||||||
|
console.log(str)
|
||||||
|
model[field] = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
schemas,
|
schemas,
|
||||||
formElRef,
|
formElRef,
|
||||||
@@ -84,6 +101,7 @@
|
|||||||
submitButtonOptions,
|
submitButtonOptions,
|
||||||
onSearch: useDebounceFn(onSearch, 300),
|
onSearch: useDebounceFn(onSearch, 300),
|
||||||
searchParams,
|
searchParams,
|
||||||
|
superQueryConfig,
|
||||||
handleReset: () => {
|
handleReset: () => {
|
||||||
keyword.value = '';
|
keyword.value = '';
|
||||||
},
|
},
|
||||||
|
@@ -645,4 +645,38 @@ export const schemas: FormSchema[] = [
|
|||||||
label: '选中值',
|
label: '选中值',
|
||||||
colProps: { span: 12 },
|
colProps: { span: 12 },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'radioButtonGroup',
|
||||||
|
component: 'RadioButtonGroup',
|
||||||
|
label: 'RadioButtonGroup',
|
||||||
|
helpMessage: ['component模式'],
|
||||||
|
colProps: { span: 12 },
|
||||||
|
defaultValue: '0',
|
||||||
|
componentProps: {
|
||||||
|
options: [
|
||||||
|
{ value: '0',icon: 'ant-design:setting'},
|
||||||
|
{ label: '停用', value: '1',icon: 'mdi:home' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'radioButtonGroup',
|
||||||
|
component: 'JEllipsis',
|
||||||
|
label: '选中值',
|
||||||
|
colProps: { span: 12 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'superQuery',
|
||||||
|
component: 'Input',
|
||||||
|
label: '高级查询',
|
||||||
|
helpMessage: ['插槽模式'],
|
||||||
|
slot: 'superQuery',
|
||||||
|
colProps: { span: 12 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'superQuery',
|
||||||
|
component: 'JEllipsis',
|
||||||
|
label: '选中值',
|
||||||
|
colProps: { span: 12 },
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user