mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-02 16:45:24 +08:00
3.7.1版本发布
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
:formProps="getProps"
|
||||
:allDefaultValues="defaultValueRef"
|
||||
:formModel="formModel"
|
||||
:formName="getBindValue.name"
|
||||
:setFormModel="setFormModel"
|
||||
:validateFields="validateFields"
|
||||
:clearValidate="clearValidate"
|
||||
@ -213,6 +214,7 @@
|
||||
getFieldsValue,
|
||||
updateSchema,
|
||||
resetSchema,
|
||||
getSchemaByField,
|
||||
appendSchemaByField,
|
||||
removeSchemaByFiled,
|
||||
resetFields,
|
||||
@ -308,6 +310,7 @@
|
||||
resetSchema,
|
||||
setProps,
|
||||
getProps,
|
||||
getSchemaByField,
|
||||
removeSchemaByFiled,
|
||||
appendSchemaByField,
|
||||
clearValidate,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<a-col v-bind="actionColOpt" v-if="showActionButtonGroup">
|
||||
<div style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
|
||||
<div class="btnArea" style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
|
||||
<FormItem>
|
||||
<!-- update-begin-author:zyf Date:20211213 for:调换按钮前后位置-->
|
||||
<slot name="submitBefore"></slot>
|
||||
@ -126,3 +126,16 @@
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
// update-begin--author:liaozhiyang---date:20240617---for:【TV360X-999】在1753px宽度下 流程设计页面查询的展开换行了
|
||||
.btnArea {
|
||||
:deep(.ant-form-item-control-input-content) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.ant-btn-link {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240617---for:【TV360X-999】在1753px宽度下 流程设计页面查询的展开换行了
|
||||
</style>
|
||||
|
||||
@ -18,6 +18,8 @@
|
||||
import { useAppInject } from '/@/hooks/web/useAppInject';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import Middleware from './Middleware.vue';
|
||||
import { useLocaleStoreWithOut } from '/@/store/modules/locale';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'BasicFormItem',
|
||||
inheritAttrs: false,
|
||||
@ -58,10 +60,16 @@
|
||||
default: null,
|
||||
},
|
||||
// update-end-author:liaozhiyang---date:20240605---for:【TV360X-857】解决禁用状态下触发校验
|
||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
formName: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
},
|
||||
setup(props, { slots }) {
|
||||
const { t } = useI18n();
|
||||
|
||||
const localeStore = useLocaleStoreWithOut();
|
||||
const { schema, formProps } = toRefs(props) as {
|
||||
schema: Ref<FormSchema>;
|
||||
formProps: Ref<FormProps>;
|
||||
@ -306,7 +314,7 @@
|
||||
}
|
||||
|
||||
function renderComponent() {
|
||||
const { renderComponentContent, component, field, changeEvent = 'change', valueField, componentProps, dynamicRules } = props.schema;
|
||||
const { renderComponentContent, component, field, changeEvent = 'change', valueField, componentProps, dynamicRules, rules:defRules = [] } = props.schema;
|
||||
|
||||
const isCheck = component && ['Switch', 'Checkbox'].includes(component);
|
||||
// update-begin--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
||||
@ -316,6 +324,10 @@
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
||||
const eventKey = `on${upperFirst(changeEvent)}`;
|
||||
const getRules = (): ValidationRule[] => {
|
||||
const dyRules = isFunction(dynamicRules) ? dynamicRules(unref(getValues)) : [];
|
||||
return [...dyRules, ...defRules];
|
||||
};
|
||||
// update-begin--author:liaozhiyang---date:20230922---for:【issues/752】表单校验dynamicRules 无法 使用失去焦点后校验 trigger: 'blur'
|
||||
const on = {
|
||||
[eventKey]: (...args: Nullable<Recordable>[]) => {
|
||||
@ -337,9 +349,14 @@
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231013---for:【QQYUN-6679】input去空格
|
||||
props.setFormModel(field, value);
|
||||
// update-begin--author:liaozhiyang---date:20240522---for:【TV360X-341】有值之后必填校验不消失
|
||||
props.validateFields([field]).catch((_) => {});
|
||||
// update-end--author:liaozhiyang---date:20240522--for:【TV360X-341】有值之后必填校验不消失
|
||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
const findItem = getRules().find((item) => item?.trigger === 'blur');
|
||||
if (!findItem) {
|
||||
// update-begin--author:liaozhiyang---date:20240522---for:【TV360X-341】有值之后必填校验不消失
|
||||
props.validateFields([field]).catch((_) => {});
|
||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-341】有值之后必填校验不消失
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
},
|
||||
// onBlur: () => {
|
||||
// props.validateFields([field], { triggerName: 'blur' }).catch((_) => {});
|
||||
@ -366,11 +383,21 @@
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240308---for:【QQYUN-8377】formSchema props支持动态修改
|
||||
|
||||
const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
||||
// update-begin--author:sunjianlei---date:20240725---for:【TV360X-972】控件禁用时统一占位内容
|
||||
// const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
|
||||
const isCreatePlaceholder = !!autoSetPlaceHolder;
|
||||
// update-end----author:sunjianlei---date:20240725---for:【TV360X-972】控件禁用时统一占位内容
|
||||
|
||||
// RangePicker place是一个数组
|
||||
if (isCreatePlaceholder && component !== 'RangePicker' && component) {
|
||||
//自动设置placeholder
|
||||
propsData.placeholder = unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component) + props.schema.label;
|
||||
// update-begin--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||
let label = isFunction(props.schema.label) ? props.schema.label() : props.schema.label;
|
||||
if (localeStore.getLocale === 'en' && !(/^\s/.test(label))) {
|
||||
label = ' ' + label;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||
propsData.placeholder = unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component) + label;
|
||||
}
|
||||
propsData.codeField = field;
|
||||
propsData.formValues = unref(getValues);
|
||||
@ -403,7 +430,10 @@
|
||||
function renderLabelHelpMessage() {
|
||||
//update-begin-author:taoyan date:2022-9-7 for: VUEN-2061【样式】online表单超出4个 .. 省略显示
|
||||
//label宽度支持自定义
|
||||
const { label, 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里面的值不能正常切换
|
||||
const label = isFunction(itemLabel) ? itemLabel() : itemLabel;
|
||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||
let showLabel: string = label + '';
|
||||
// update-begin--author:liaozhiyang---date:20240517---for:【TV360X-98】label展示的文字必须和labelLength配置一致
|
||||
if (labelLength) {
|
||||
@ -469,7 +499,7 @@
|
||||
<div style="display:flex">
|
||||
{/* author: sunjianlei for: 【VUEN-744】此处加上 width: 100%; 因为要防止组件宽度超出 FormItem */}
|
||||
{/* update-begin--author:liaozhiyang---date:20240510---for:【TV360X-719】表单校验不通过项滚动到可视区内 */}
|
||||
<Middleware>{getContent()}</Middleware>
|
||||
<Middleware formName={props.formName} fieldName={field}>{getContent()}</Middleware>
|
||||
{/* update-end--author:liaozhiyang---date:20240510---for:【TV360X-719】表单校验不通过项滚动到可视区内 */}
|
||||
{showSuffix && <span class="suffix">{getSuffix}</span>}
|
||||
</div>
|
||||
|
||||
@ -5,12 +5,20 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { computed } from 'vue';
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
const formItemId = computed(() => {
|
||||
return formItemContext.id.value;
|
||||
});
|
||||
import { ref } from 'vue';
|
||||
// update-begin--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
const formItemId = ref(null);
|
||||
const props = defineProps(['formName', 'fieldName']);
|
||||
if (props.formName && props.fieldName) {
|
||||
formItemId.value = `${props.formName}_${props.fieldName}`;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240625---for:【TV360X-1511】blur不生效
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
<style lang="less" scoped>
|
||||
// update-begin--author:liaozhiyang---date:20240617---for:【TV360X-1253】代码生成查询区域和新增组件没撑满
|
||||
div > :deep(.ant-picker) {
|
||||
width: 100%;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240617---for:【TV360X-1253】代码生成查询区域和新增组件没撑满
|
||||
</style>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="formDisabled ? 'jeecg-form-container-disabled jeecg-form-detail-effect' : ''">
|
||||
<div :class="formDisabled ? 'jeecg-form-container-disabled jeecg-form-detail-effect' : 'jeecg-and-modal-form'">
|
||||
<fieldset :disabled="formDisabled">
|
||||
<slot name="detail"></slot>
|
||||
</fieldset>
|
||||
@ -39,6 +39,23 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
// update-begin--author:liaozhiyang---date:20240719---for:【TV360X-1090】表单label超长省略显示
|
||||
.jeecg-and-modal-form {
|
||||
:deep(.ant-form-item-label) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-right: 6px;
|
||||
> label {
|
||||
line-height: 32px;
|
||||
display: inline;
|
||||
&::after {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240719---for:【TV360X-1090】表单label超长省略显示
|
||||
.jeecg-form-container-disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import { handleRangeValue } from '../utils/formUtils';
|
||||
import { ref, onUnmounted, unref, nextTick, watch } from 'vue';
|
||||
import { isProdMode } from '/@/utils/env';
|
||||
import { error } from '/@/utils/log';
|
||||
import { getDynamicProps, getValueType } from '/@/utils';
|
||||
import { getDynamicProps, getValueType, getValueTypeBySchema } from '/@/utils';
|
||||
import { add } from "/@/components/Form/src/componentMap";
|
||||
//集成online专用控件
|
||||
import { OnlineSelectCascade, LinkTableCard, LinkTableSelect } from '@jeecg/online';
|
||||
@ -137,7 +137,7 @@ export function useForm(props?: Props): UseFormReturnType {
|
||||
let values = form.validate(nameList).then((values) => {
|
||||
for (let key in values) {
|
||||
if (values[key] instanceof Array) {
|
||||
let valueType = getValueType(getProps, key);
|
||||
let valueType = getValueTypeBySchema(form.getSchemaByField(key)!);
|
||||
if (valueType === 'string') {
|
||||
values[key] = values[key].join(',');
|
||||
}
|
||||
|
||||
@ -94,6 +94,23 @@ export function useFormEvents({
|
||||
});
|
||||
validateFields(validKeys).catch((_) => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字段名获取schema
|
||||
* @param field
|
||||
*/
|
||||
function getSchemaByField(field: string): Nullable<FormSchema> {
|
||||
if (!isString(field)) {
|
||||
return null
|
||||
}
|
||||
const schemaList: FormSchema[] = unref(getSchema);
|
||||
const index = schemaList.findIndex((schema) => schema.field === field);
|
||||
if (index !== -1) {
|
||||
return cloneDeep(schemaList[index]);
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Delete based on field name
|
||||
*/
|
||||
@ -270,6 +287,7 @@ export function useFormEvents({
|
||||
getFieldsValue,
|
||||
updateSchema,
|
||||
resetSchema,
|
||||
getSchemaByField,
|
||||
appendSchemaByField,
|
||||
removeSchemaByFiled,
|
||||
resetFields,
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
showArea: propTypes.bool.def(true),
|
||||
//是否是全部
|
||||
showAll: propTypes.bool.def(false),
|
||||
// 存储数据
|
||||
// 存储数据 (all时:传递到外面的是数组;province, city, region传递外面的是字符串)
|
||||
saveCode: propTypes.oneOf(['province', 'city', 'region', 'all']).def('all'),
|
||||
},
|
||||
emits: ['options-change', 'change', 'update:value'],
|
||||
@ -97,6 +97,25 @@
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* liaozhiyang
|
||||
* 2024-06-17
|
||||
* 【TV360X-1224】省市区组件默认传到外面的值是字符串逗号分隔
|
||||
* */
|
||||
const send = (data) => {
|
||||
let result = data;
|
||||
if (result) {
|
||||
if (props.saveCode === 'all') {
|
||||
// 传递的是数组
|
||||
} else {
|
||||
// 传递的是字符串
|
||||
result = data.join(',');
|
||||
}
|
||||
}
|
||||
emit('change', result);
|
||||
emit('update:value', result);
|
||||
};
|
||||
|
||||
function handleChange(arr, ...args) {
|
||||
// update-begin--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
||||
if (arr?.length) {
|
||||
@ -111,11 +130,9 @@
|
||||
} else {
|
||||
result = arr;
|
||||
}
|
||||
emit('change', result);
|
||||
emit('update:value', result);
|
||||
send(result);
|
||||
} else {
|
||||
emit('change', arr);
|
||||
emit('update:value', arr);
|
||||
send(arr);
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240607---for:【TV360X-501】省市区换新组件
|
||||
// emitData.value = args;
|
||||
@ -124,6 +141,7 @@
|
||||
// state.value = result;
|
||||
//update-end-author:taoyan date:2022-6-27 for: VUEN-1424【vue3】树表、单表、jvxe、erp 、内嵌子表省市县 选择不上
|
||||
}
|
||||
|
||||
return {
|
||||
cascaderValue,
|
||||
attrs,
|
||||
|
||||
@ -84,7 +84,9 @@
|
||||
() => {
|
||||
loadItemByCode();
|
||||
},
|
||||
{ deep: true }
|
||||
//update-begin---author:wangshuai---date:2024-06-17---for:【TV360X-480】封装表单和原生表单,默认值生成有问题的字段:分类字典树附默认值不生效---
|
||||
{ deep: true, immediate: true }
|
||||
//update-end---author:wangshuai---date:2024-06-17---for:【TV360X-480】封装表单和原生表单,默认值生成有问题的字段:分类字典树附默认值不生效---
|
||||
);
|
||||
watch(
|
||||
() => props.pcode,
|
||||
@ -124,6 +126,7 @@
|
||||
treeValue.value = { value: null, label: null };
|
||||
}
|
||||
} else {
|
||||
console.log("props.value:::",props.value)
|
||||
loadDictItem({ ids: props.value }).then((res) => {
|
||||
let values = props.value.split(',');
|
||||
treeValue.value = res.map((item, index) => ({
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
import { defineComponent, computed, watch, watchEffect, ref, unref } from 'vue';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { initDictOptions } from '/@/utils/dict/index';
|
||||
import {getDictItems} from "@/api/common/api";
|
||||
|
||||
export default defineComponent({
|
||||
name: 'JCheckbox',
|
||||
@ -67,21 +67,30 @@
|
||||
}
|
||||
//根据字典Code, 初始化选项
|
||||
if (props.dictCode) {
|
||||
const dictData = await initDictOptions(props.dictCode);
|
||||
checkOptions.value = dictData.reduce((prev, next) => {
|
||||
if (next) {
|
||||
const value = next['value'];
|
||||
prev.push({
|
||||
label: next['text'],
|
||||
value: value,
|
||||
color: next['color'],
|
||||
});
|
||||
}
|
||||
return prev;
|
||||
}, []);
|
||||
loadDictOptions()
|
||||
}
|
||||
}
|
||||
|
||||
// 根据字典code查询字典项
|
||||
function loadDictOptions() {
|
||||
//update-begin-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
let temp = props.dictCode || '';
|
||||
if (temp.indexOf(',') > 0 && temp.indexOf(' ') > 0) {
|
||||
// 编码后 是不包含空格的
|
||||
temp = encodeURI(temp);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-21 for: 字典数据请求前将参数编码处理,但是不能直接编码,因为可能之前已经编码过了
|
||||
getDictItems(temp).then((res) => {
|
||||
if (res) {
|
||||
checkOptions.value = res.map((item) => ({value: item.value, label: item.text, color: item.color}));
|
||||
//console.info('res', dictOptions.value);
|
||||
} else {
|
||||
console.error('getDictItems error: : ', res);
|
||||
checkOptions.value = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* change事件
|
||||
* @param $event
|
||||
|
||||
@ -44,6 +44,9 @@
|
||||
import 'codemirror/addon/hint/anyword-hint.js';
|
||||
// 匹配括号
|
||||
import 'codemirror/addon/edit/matchbrackets';
|
||||
// 占位符
|
||||
import 'codemirror/addon/display/placeholder.js';
|
||||
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { isJsonObjectString } from '/@/utils/is.ts';
|
||||
@ -356,6 +359,10 @@
|
||||
.CodeMirror{
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.CodeMirror pre.CodeMirror-placeholder {
|
||||
color: #cacaca;
|
||||
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
|
||||
}
|
||||
}
|
||||
.CodeMirror-hints.idea,
|
||||
.CodeMirror-hints.monokai {
|
||||
|
||||
@ -17,6 +17,8 @@
|
||||
props: {
|
||||
value: propTypes.string.def(''),
|
||||
disabled: propTypes.bool.def(false),
|
||||
//是否聚焦
|
||||
autoFocus: propTypes.bool.def(true),
|
||||
},
|
||||
emits: ['change', 'update:value'],
|
||||
setup(props, { emit, attrs }) {
|
||||
|
||||
@ -183,6 +183,16 @@
|
||||
if (file.status === 'error') {
|
||||
createMessage.error(`${file.name} 上传失败.`);
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
||||
if (file.status === 'done' && file.response.success === false) {
|
||||
const failIndex = uploadFileList.value.findIndex((item) => item.uid === file.uid);
|
||||
if (failIndex != -1) {
|
||||
uploadFileList.value.splice(failIndex, 1);
|
||||
}
|
||||
createMessage.warning(file.response.message);
|
||||
return;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
||||
let fileUrls = [];
|
||||
let noUploadingFileCount = 0;
|
||||
if (file.status != 'uploading') {
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
v-if="selectLocation === 'right'"
|
||||
v-model:value="selectVal"
|
||||
@change="handleSelectChange"
|
||||
:style="{width:props.selectWidth}"
|
||||
>
|
||||
<a-select-option v-for="item in options" :key="item.value">{{ item.label }}</a-select-option>
|
||||
</a-select>
|
||||
@ -33,6 +34,7 @@
|
||||
selectLocation: propTypes.oneOf(['left', 'right']).def('right'),
|
||||
selectPlaceholder: propTypes.string.def(''),
|
||||
inputPlaceholder: propTypes.string.def(''),
|
||||
selectWidth:propTypes.string.def('auto'),
|
||||
});
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
const selectVal = ref<string>();
|
||||
|
||||
@ -23,8 +23,9 @@
|
||||
:groupId="uniqGroupId"
|
||||
:param="param"
|
||||
:showAdvancedButton="showAdvancedButton"
|
||||
@ok="callBack"
|
||||
:getContainer="getContainer"
|
||||
:getFormValues="getFormValues"
|
||||
@ok="callBack"
|
||||
></JPopupOnlReportModal>
|
||||
</a-form-item>
|
||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
||||
@ -56,6 +57,7 @@
|
||||
groupId: propTypes.string.def(''),
|
||||
formElRef: propTypes.object,
|
||||
setFieldsValue: propTypes.func,
|
||||
getFormValues: propTypes.func,
|
||||
getContainer: propTypes.func,
|
||||
fieldConfig: {
|
||||
type: Array,
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
:sorter="sorter"
|
||||
:groupId="''"
|
||||
:param="param"
|
||||
@ok="callBack"
|
||||
:getFormValues="getFormValues"
|
||||
:getContainer="getContainer"
|
||||
:showAdvancedButton="showAdvancedButton"
|
||||
@ok="callBack"
|
||||
/>
|
||||
</a-form-item>
|
||||
<!-- update-end--author:liaozhiyang---date:20240515---for:【QQYUN-9260】必填模式下会影响到弹窗内antd组件的样式 -->
|
||||
@ -56,6 +57,7 @@
|
||||
multi: propTypes.bool.def(false),
|
||||
param: propTypes.object.def({}),
|
||||
spliter: propTypes.string.def(','),
|
||||
getFormValues: propTypes.func,
|
||||
getContainer: propTypes.func,
|
||||
showAdvancedButton: propTypes.bool.def(true),
|
||||
},
|
||||
|
||||
@ -39,8 +39,10 @@
|
||||
|
||||
function emitArray() {
|
||||
let arr = [];
|
||||
let begin = beginValue.value || '';
|
||||
let end = endValue.value || '';
|
||||
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1749】数量0输入不了,输入清空了
|
||||
let begin = beginValue.value ?? '';
|
||||
let end = endValue.value ?? '';
|
||||
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1749】数量0输入不了,输入清空了
|
||||
arr.push(begin);
|
||||
arr.push(end);
|
||||
emit('change', arr);
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
@focus="handleAsyncFocus"
|
||||
@search="loadData"
|
||||
@change="handleAsyncChange"
|
||||
@popupScroll="handlePopupScroll"
|
||||
>
|
||||
<template #notFoundContent>
|
||||
<a-spin size="small" />
|
||||
</template>
|
||||
<a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
|
||||
<a-select-option v-for="d in options" :key="d?.value" :value="d?.value">{{ d?.text }}</a-select-option>
|
||||
</a-select>
|
||||
<!--字典下拉搜素-->
|
||||
<a-select
|
||||
@ -36,7 +37,7 @@
|
||||
<template #notFoundContent>
|
||||
<a-spin v-if="loading" size="small" />
|
||||
</template>
|
||||
<a-select-option v-for="d in options" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
|
||||
<a-select-option v-for="d in options" :key="d?.value" :value="d?.value">{{ d?.text }}</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
@ -95,6 +96,11 @@
|
||||
const lastLoad = ref(0);
|
||||
// 是否根据value加载text
|
||||
const loadSelectText = ref(true);
|
||||
// 异步(字典表) - 滚动加载时会用到
|
||||
let isHasData = true;
|
||||
let scrollLoading = false;
|
||||
let pageNo = 1;
|
||||
let searchKeyword = '';
|
||||
|
||||
// 是否是字典表
|
||||
const isDictTable = computed(() => {
|
||||
@ -152,6 +158,12 @@
|
||||
if (!isDictTable.value) {
|
||||
return;
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo = 1;
|
||||
isHasData = true;
|
||||
searchKeyword = value;
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
|
||||
lastLoad.value += 1;
|
||||
const currentLoad = unref(lastLoad);
|
||||
options.value = [];
|
||||
@ -164,7 +176,7 @@
|
||||
defHttp
|
||||
.get({
|
||||
url: `/sys/dict/loadDict/${props.dict}`,
|
||||
params: { keyword: keywordInfo, pageSize: props.pageSize },
|
||||
params: { keyword: keywordInfo, pageSize: props.pageSize, pageNo },
|
||||
})
|
||||
.then((res) => {
|
||||
loading.value = false;
|
||||
@ -173,6 +185,13 @@
|
||||
return;
|
||||
}
|
||||
options.value = res;
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo++;
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo == 1 && (isHasData = false);
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
@ -195,10 +214,12 @@
|
||||
key: value,
|
||||
label: res,
|
||||
};
|
||||
selectedAsyncValue.value = { ...obj };
|
||||
if (props.value == value) {
|
||||
selectedAsyncValue.value = { ...obj };
|
||||
}
|
||||
//update-begin-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online关联记录配置页面
|
||||
if(props.immediateChange == true){
|
||||
emit('change', value);
|
||||
emit('change', props.value);
|
||||
}
|
||||
//update-end-author:taoyan date:2022-8-11 for: 值改变触发change事件--用于online关联记录配置页面
|
||||
}
|
||||
@ -243,18 +264,31 @@
|
||||
if (!dict) {
|
||||
console.error('搜索组件未配置字典项');
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo = 1;
|
||||
isHasData = true;
|
||||
searchKeyword = '';
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
|
||||
//异步一开始也加载一点数据
|
||||
loading.value = true;
|
||||
let keywordInfo = getKeywordParam('');
|
||||
defHttp
|
||||
.get({
|
||||
url: `/sys/dict/loadDict/${dict}`,
|
||||
params: { pageSize: pageSize, keyword: keywordInfo },
|
||||
params: { pageSize: pageSize, keyword: keywordInfo, pageNo },
|
||||
})
|
||||
.then((res) => {
|
||||
loading.value = false;
|
||||
if (res && res.length > 0) {
|
||||
options.value = res;
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo++;
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
pageNo == 1 && (isHasData = false);
|
||||
// update-end--author:liaozhiyang---date:20240731---for:【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -355,11 +389,57 @@
|
||||
// update-begin--author:liaozhiyang---date:20240523---for:【TV360X-26】下拉搜索控件选中选项后再次点击下拉应该显示初始的下拉选项,而不是只展示选中结果
|
||||
const handleAsyncFocus = () => {
|
||||
// update-begin--author:liaozhiyang---date:20240709---for:【issues/6681】异步查询不生效
|
||||
(isObject(selectedAsyncValue.value) || selectedAsyncValue.value?.length) && isDictTable.value && props.async && initDictTableData();
|
||||
if ((isObject(selectedAsyncValue.value) || selectedAsyncValue.value?.length) && isDictTable.value && props.async) {
|
||||
// update-begin--author:liaozhiyang---date:20240809---for:【TV360X-2062】下拉搜索选择第二页数据后,第一次点击时(得到焦点)滚动条没复原到初始位置且数据会加载第二页数据(应该只加载第一页数据)
|
||||
options.value = [];
|
||||
// update-end--author:liaozhiyang---date:20240809---for:【TV360X-2062】下拉搜索选择第二页数据后,第一次点击时(得到焦点)滚动条没复原到初始位置且数据会加载第二页数据(应该只加载第一页数据)
|
||||
initDictTableData();
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240709---for:【issues/6681】异步查询不生效
|
||||
attrs.onFocus?.();
|
||||
};
|
||||
// update-end--author:liaozhiyang---date:20240523---for:【TV360X-26】下拉搜索控件选中选项后再次点击下拉应该显示初始的下拉选项,而不是只展示选中结果
|
||||
|
||||
/**
|
||||
* 2024-07-30
|
||||
* liaozhiyang
|
||||
* 【TV360X-1898】JsearchSelect组件传入字典表格式则支持滚动加载
|
||||
* */
|
||||
const handlePopupScroll = async (e) => {
|
||||
// 字典表才才支持滚动加载
|
||||
if (isDictTable.value) {
|
||||
const { target } = e;
|
||||
const { scrollTop, scrollHeight, clientHeight } = target;
|
||||
if (!scrollLoading && isHasData && scrollTop + clientHeight >= scrollHeight - 10) {
|
||||
scrollLoading = true;
|
||||
let keywordInfo = getKeywordParam(searchKeyword);
|
||||
|
||||
defHttp
|
||||
.get({ url: `/sys/dict/loadDict/${props.dict}`, params: { pageSize: props.pageSize, keyword: keywordInfo, pageNo } })
|
||||
.then((res) => {
|
||||
loading.value = false;
|
||||
if (res?.length > 0) {
|
||||
// 防止开源只更新了前端代码没更新后端代码(第一页和第二页面的第一条数据相同则是后端代码没更新,没分页)
|
||||
if (JSON.stringify(res[0]) === JSON.stringify(options.value[0])) {
|
||||
isHasData = false;
|
||||
return;
|
||||
}
|
||||
options.value.push(...res);
|
||||
pageNo++;
|
||||
} else {
|
||||
isHasData = false;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
scrollLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
pageNo != 1 && pageNo--;
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
attrs,
|
||||
options,
|
||||
@ -373,6 +453,7 @@
|
||||
handleChange,
|
||||
handleAsyncChange,
|
||||
handleAsyncFocus,
|
||||
handlePopupScroll,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@ -152,6 +152,11 @@
|
||||
let result = typeof props.value == 'string' ? values.join(',') : values;
|
||||
emit('update:value', result);
|
||||
emit('change', result);
|
||||
// update-begin--author:liaozhiyang---date:20240627---for:【TV360X-1648】用户编辑界面“所属部门”与“负责部门”联动出错(同步之前丢的代码)
|
||||
if (!values || values.length == 0) {
|
||||
emit('select', null, null);
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240627---for:【TV360X-1648】用户编辑界面“所属部门”与“负责部门”联动出错(同步之前丢的代码)
|
||||
};
|
||||
// update-end--author:liaozhiyang---date:20240527---for:【TV360X-414】部门设置了默认值,查询重置变成空了(同步JSelectUser组件改法)
|
||||
|
||||
|
||||
@ -91,6 +91,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.dictCode,
|
||||
() => {
|
||||
if (props.dictCode) {
|
||||
loadDictOptions();
|
||||
} else {
|
||||
dictOptions.value = props.options;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
|
||||
@ -305,7 +305,10 @@
|
||||
} else if (info.file.status === 'error') {
|
||||
createMessage.error(`${info.file.name} 上传失败.`);
|
||||
}
|
||||
fileList.value = fileListTemp;
|
||||
// update-begin--author:liaozhiyang---date:20240628---for:【issues/1273】上传组件JUpload配置beforeUpload阻止了上传,前端页面中还是显示缩略图
|
||||
// beforeUpload 返回false,则没有status
|
||||
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') {
|
||||
//returnUrl为true时仅返回文件路径
|
||||
if (props.returnUrl) {
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row class="j-select-row" type="flex" :gutter="8">
|
||||
<div v-if="isDetailsMode">
|
||||
<p class="detailStr" :title="detailStr">{{ detailStr }}</p>
|
||||
</div>
|
||||
<a-row v-else class="j-select-row" type="flex" :gutter="8">
|
||||
<a-col class="left" :class="{ full: !showButton }">
|
||||
<!-- 显示加载效果 -->
|
||||
<a-input v-if="loading" readOnly placeholder="加载中…">
|
||||
@ -32,7 +35,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, inject, reactive } from 'vue';
|
||||
import { defineComponent, ref, inject, reactive, watch } from 'vue';
|
||||
import { propTypes } from '/@/utils/propTypes';
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { LoadingOutlined } from '@ant-design/icons-vue';
|
||||
@ -59,6 +62,8 @@
|
||||
maxTagCount: propTypes.number,
|
||||
// buttonIcon
|
||||
buttonIcon: propTypes.string.def(''),
|
||||
// 【TV360X-1002】是否是详情模式
|
||||
isDetailsMode: propTypes.bool.def(false),
|
||||
},
|
||||
emits: ['handleOpen', 'change'],
|
||||
setup(props, { emit, refs }) {
|
||||
@ -67,7 +72,7 @@
|
||||
//接收选择的值
|
||||
const selectValues = inject('selectValues') || ref({});
|
||||
const attrs = useAttrs();
|
||||
|
||||
const detailStr = ref('');
|
||||
/**
|
||||
* 打开弹出框
|
||||
*/
|
||||
@ -89,12 +94,28 @@
|
||||
emit('change', value);
|
||||
}
|
||||
|
||||
// -update-begin--author:liaozhiyang---date:20240617---for:【TV360X-1002】详情页面行编辑用户组件和部门组件显示方式优化
|
||||
watch(
|
||||
[selectValues, options],
|
||||
() => {
|
||||
if (props.isDetailsMode) {
|
||||
if (Array.isArray(selectValues.value) && Array.isArray(options.value)) {
|
||||
const result = options.value.map((item) => item.label);
|
||||
detailStr.value = result.join(',');
|
||||
}
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
// -update-end--author:liaozhiyang---date:20240617---for:【TV360X-1002】详情页面行编辑用户组件和部门组件显示方式优化
|
||||
|
||||
return {
|
||||
attrs,
|
||||
selectValues,
|
||||
options,
|
||||
handleChange,
|
||||
openModal,
|
||||
detailStr,
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -119,4 +140,10 @@
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
.detailStr {
|
||||
margin: 0;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
const queryUrl = getQueryUrl();
|
||||
const [{ visibleChange, checkedKeys, getCheckStrictly, getSelectTreeData, onCheck, onLoadData, treeData, checkALL, expandAll, onSelect }] =
|
||||
useTreeBiz(treeRef, queryUrl, getBindValue, props);
|
||||
useTreeBiz(treeRef, queryUrl, getBindValue, props, emit);
|
||||
const searchInfo = ref(props.params);
|
||||
const tree = ref([]);
|
||||
//替换treeNode中key字段为treeData中对应的字段
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
wrapClassName="j-popup-modal"
|
||||
@visible-change="visibleChange"
|
||||
>
|
||||
<div class="jeecg-basic-table-form-container" v-if="showSearchFlag">
|
||||
<a-form ref="formRef" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol" @keyup.enter.native="searchQuery">
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" v-if="showSearchFlag" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<template v-for="(item, index) in queryInfo">
|
||||
<template v-if="item.hidden === '1'">
|
||||
@ -31,8 +31,8 @@
|
||||
<a-col :md="8" :sm="8" v-if="showAdvancedButton">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset">重置</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery" style="margin-left: 8px">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
<a @click="handleToggleSearch" style="margin-left: 8px">
|
||||
{{ toggleSearchStatus ? '收起' : '展开' }}
|
||||
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
|
||||
@ -59,6 +59,12 @@
|
||||
@change="handleChangeInTable"
|
||||
>
|
||||
<template #tableTitle></template>
|
||||
<template #bodyCell="{text, column}">
|
||||
<template v-if="column.fieldType === 'Image'">
|
||||
<span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
|
||||
<img v-else :src="getImgView(text)" alt="图片不存在" class="cellIamge" @click="viewOnlineCellImage($event, text)" />
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</BasicModal>
|
||||
</div>
|
||||
@ -71,6 +77,8 @@
|
||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||
import { usePopBiz } from '/@/components/jeecg/OnLine/hooks/usePopBiz';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { createImgPreview } from '/@/components/Preview/index';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'JPopupOnlReportModal',
|
||||
@ -82,9 +90,9 @@
|
||||
loading: true,
|
||||
}),
|
||||
},
|
||||
props: ['multi', 'code', 'sorter', 'groupId', 'param','showAdvancedButton'],
|
||||
props: ['multi', 'code', 'sorter', 'groupId', 'param','showAdvancedButton', 'getFormValues'],
|
||||
emits: ['ok', 'register'],
|
||||
setup(props, { emit, refs }) {
|
||||
setup(props, { emit }) {
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
@ -242,6 +250,41 @@
|
||||
queryParam.value = {};
|
||||
loadData(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 2024-07-24
|
||||
* liaozhiyang
|
||||
* 【TV360X-1756】报表添加图片类型
|
||||
* 图片
|
||||
* @param text
|
||||
*/
|
||||
function getImgView(text) {
|
||||
if (text && text.indexOf(',') > 0) {
|
||||
text = text.substring(0, text.indexOf(','));
|
||||
}
|
||||
return getFileAccessHttpUrl(text);
|
||||
}
|
||||
/**
|
||||
* 2024-07-24
|
||||
* liaozhiyang
|
||||
* 【TV360X-1756】报表添加图片类型
|
||||
* 预览列表 cell 图片
|
||||
* @param text
|
||||
*/
|
||||
function viewOnlineCellImage(e, text) {
|
||||
e.stopPropagation();
|
||||
if (text) {
|
||||
let imgList: any = [];
|
||||
let arr = text.split(',');
|
||||
for (let str of arr) {
|
||||
if (str) {
|
||||
imgList.push(getFileAccessHttpUrl(str));
|
||||
}
|
||||
}
|
||||
createImgPreview({ imageList: imgList });
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
attrs,
|
||||
register,
|
||||
@ -272,6 +315,8 @@
|
||||
handleToggleSearch,
|
||||
searchQuery,
|
||||
searchReset,
|
||||
getImgView,
|
||||
viewOnlineCellImage,
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -290,4 +335,12 @@
|
||||
:deep(.jeecg-basic-table .ant-table-wrapper .ant-table-title){
|
||||
min-height: 0;
|
||||
}
|
||||
.cellIamge {
|
||||
height: 25px !important;
|
||||
margin: 0 auto;
|
||||
max-width: 80px;
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
:rowSelection="rowSelection"
|
||||
:indexColumnProps="indexColumnProps"
|
||||
:afterFetch="afterFetch"
|
||||
:beforeFetch="beforeFetch"
|
||||
>
|
||||
<!-- update-begin-author:taoyan date:2022-5-25 for: VUEN-1112一对多 用户选择 未显示选择条数,及清空 -->
|
||||
<template #tableTitle></template>
|
||||
@ -267,6 +268,17 @@
|
||||
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】用户选择组件不是根据创建时间正序排序的---
|
||||
/**
|
||||
* 请求之前根据创建时间排序
|
||||
*
|
||||
* @param params
|
||||
*/
|
||||
function beforeFetch(params) {
|
||||
return Object.assign({ column: 'createTime', order: 'desc' }, params);
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-07-03---for:【TV360X-1629】用户选择组件不是根据创建时间正序排序的---
|
||||
|
||||
return {
|
||||
//config,
|
||||
handleOk,
|
||||
@ -287,6 +299,7 @@
|
||||
afterFetch,
|
||||
handleCancel,
|
||||
maxHeight,
|
||||
beforeFetch,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@ -39,12 +39,22 @@ export const useCodeHinting = (CodeMirror, keywords, language) => {
|
||||
// 查找.前面是否有定义的关键词
|
||||
const curLineCode = cm.getLine(cur.line);
|
||||
for (let i = 0, len = customKeywords.length; i < len; i++) {
|
||||
const k = curLineCode.substring(-1, customKeywords[i].length);
|
||||
const k = curLineCode.slice(-(customKeywords[i].length + 1), -1);
|
||||
if (customKeywords.includes(k)) {
|
||||
recordKeyword = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 查找单词前面是否有.this(.关键词)
|
||||
const curLineCode = cm.getLine(cur.line);
|
||||
for (let i = 0, len = customKeywords.length; i < len; i++) {
|
||||
const k = curLineCode.slice(start - (customKeywords[i].length + 1), start);
|
||||
if (k.substr(-1) === '.' && customKeywords.includes(k.replace('.', ''))) {
|
||||
recordKeyword = k.replace('.', '');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const findIdx = (a, b) => a.toLowerCase().indexOf(b.toLowerCase());
|
||||
let list = currentKeywords.filter((item) => {
|
||||
|
||||
@ -2,7 +2,7 @@ import { inject, reactive, ref, watch, unref, Ref } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { isEmpty } from '@/utils/is';
|
||||
|
||||
export function useSelectBiz(getList, props, emit) {
|
||||
export function useSelectBiz(getList, props, emit?) {
|
||||
//接收下拉框选项
|
||||
const selectOptions = inject('selectOptions', ref<Array<object>>([]));
|
||||
//接收已选择的值
|
||||
@ -120,7 +120,7 @@ export function useSelectBiz(getList, props, emit) {
|
||||
props.showSelected && initSelectRows();
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
||||
emit('close');
|
||||
emit?.('close');
|
||||
// update-end--author:liaozhiyang---date:20240517---for:【QQYUN-9366】用户选择组件取消和关闭会把选择数据带入
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ export interface FormActionType {
|
||||
resetSchema: (data: Partial<FormSchema> | Partial<FormSchema>[]) => Promise<void>;
|
||||
setProps: (formProps: Partial<FormProps>) => Promise<void>;
|
||||
getProps: ComputedRef<Partial<FormProps>>;
|
||||
getSchemaByField: (field: string) => Nullable<FormSchema>;
|
||||
removeSchemaByFiled: (field: string | string[]) => Promise<void>;
|
||||
appendSchemaByField: (schema: FormSchema, prefixField: string | undefined, first?: boolean | undefined) => Promise<void>;
|
||||
validateFields: (nameList?: NamePath[], options?: ValidateOptions) => Promise<any>;
|
||||
@ -131,7 +132,9 @@ export interface FormSchema {
|
||||
// Variable name bound to v-model Default value
|
||||
valueField?: string;
|
||||
// Label name
|
||||
label: string | VNode;
|
||||
// update-begin--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||
label: string | VNode | Fn;
|
||||
// update-end--author:liaozhiyang---date:20240724---for:【issues/6908】多语言无刷新切换时,BasicColumn和FormSchema里面的值不能正常切换
|
||||
// Auxiliary text
|
||||
subLabel?: string;
|
||||
// Help text on the right side of the text
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import REGION_DATA from 'china-area-data';
|
||||
import {pcaa as REGION_DATA} from "@/utils/areaData/pcaUtils";
|
||||
|
||||
/**
|
||||
* Area 属性all的类型
|
||||
@ -18,7 +18,7 @@ class Area {
|
||||
|
||||
/**
|
||||
* 构造器
|
||||
* @param express
|
||||
* @param pcaa
|
||||
*/
|
||||
constructor(pcaa?) {
|
||||
if (!pcaa) {
|
||||
@ -101,6 +101,11 @@ const jeecgAreaData = new Area();
|
||||
// 根据code找文本
|
||||
const getAreaTextByCode = function (code) {
|
||||
let index = 3;
|
||||
// update-begin--author:liaozhiyang---date:20240617---for:【TV360X-1210】online列表香港、澳门没翻译(香港、澳门只有两级其它省份是三级)
|
||||
if (code && ['82', '81'].includes(code.substring(0, 2))) {
|
||||
index = 2;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240617---for:【TV360X-1210】online列表香港、澳门没翻译(香港、澳门只有两级其它省份是三级)
|
||||
//update-begin-author:liusq---date:20220531--for: 判断code是否是多code逗号分割的字符串,是的话,获取最后一位的code ---
|
||||
if (code && code.includes(',')) {
|
||||
index = code.split(",").length;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import REGION_DATA from 'china-area-data';
|
||||
import {pcaa as REGION_DATA} from "@/utils/areaData/pcaUtils";
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
// code转汉字大对象
|
||||
|
||||
Reference in New Issue
Block a user