first commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue';
|
||||
import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, nextTick, toRaw } from 'vue';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { FormItemContext } from 'ant-design-vue/es/form/FormItemContext';
|
||||
|
||||
import { isEqual } from 'lodash-es';
|
||||
export function useRuleFormItem<T extends Recordable, K extends keyof T, V = UnwrapRef<T[K]>>(
|
||||
props: T,
|
||||
key?: K,
|
||||
changeEvent?,
|
||||
emitData?: Ref<any[] | undefined>
|
||||
): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>, FormItemContext];
|
||||
export function useRuleFormItem<T extends Recordable>(props: T, key: keyof T = 'value', changeEvent = 'change', emitData?: Ref<any[]>) {
|
||||
const instance = getCurrentInstance();
|
||||
const emit = instance?.emit;
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
|
||||
const innerState = reactive({
|
||||
value: props[key],
|
||||
});
|
||||
|
||||
const defaultState = readonly(innerState);
|
||||
|
||||
const setState = (val: UnwrapRef<T[keyof T]>): void => {
|
||||
innerState.value = val as T[keyof T];
|
||||
};
|
||||
|
||||
watchEffect(() => {
|
||||
innerState.value = props[key];
|
||||
});
|
||||
|
||||
const state: any = computed({
|
||||
get() {
|
||||
//修复多选时空值显示问题(兼容值为0的情况)
|
||||
return innerState.value == null || innerState.value === '' ? [] : innerState.value;
|
||||
},
|
||||
set(value) {
|
||||
if (isEqual(value, defaultState.value)) return;
|
||||
|
||||
innerState.value = value as T[keyof T];
|
||||
nextTick(() => {
|
||||
emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []));
|
||||
// https://antdv.com/docs/vue/migration-v3-cn
|
||||
// antDv3升级后需要调用这个方法更新校验的值
|
||||
nextTick(() => formItemContext.onFieldChange());
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return [state, setState, defaultState, formItemContext];
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import type { UnwrapRef, Ref, WritableComputedRef, DeepReadonly } from 'vue';
|
||||
import { reactive, readonly, computed, getCurrentInstance, watchEffect, unref, nextTick, toRaw } from 'vue';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { FormItemContext } from 'ant-design-vue/es/form/FormItemContext';
|
||||
|
||||
import { isEqual } from 'lodash-es';
|
||||
export function useRuleFormItem<T extends Recordable, K extends keyof T, V = UnwrapRef<T[K]>>(
|
||||
props: T,
|
||||
key?: K,
|
||||
changeEvent?,
|
||||
emitData?: Ref<any[] | undefined>
|
||||
): [WritableComputedRef<V>, (val: V) => void, DeepReadonly<V>, FormItemContext];
|
||||
export function useRuleFormItem<T extends Recordable>(props: T, key: keyof T = 'value', changeEvent = 'change', emitData?: Ref<any[]>) {
|
||||
const instance = getCurrentInstance();
|
||||
const emit = instance?.emit;
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
|
||||
const innerState = reactive({
|
||||
value: props[key],
|
||||
});
|
||||
|
||||
const defaultState = readonly(innerState);
|
||||
|
||||
const setState = (val: UnwrapRef<T[keyof T]>): void => {
|
||||
innerState.value = val as T[keyof T];
|
||||
};
|
||||
|
||||
watchEffect(() => {
|
||||
innerState.value = props[key];
|
||||
});
|
||||
|
||||
const state: any = computed({
|
||||
get() {
|
||||
return innerState.value == null ? "" : innerState.value;
|
||||
},
|
||||
set(value) {
|
||||
if (isEqual(value, defaultState.value)) return;
|
||||
|
||||
innerState.value = value as T[keyof T];
|
||||
nextTick(() => {
|
||||
emit?.(changeEvent, value, ...(toRaw(unref(emitData)) || []));
|
||||
// https://antdv.com/docs/vue/migration-v3-cn
|
||||
// antDv3升级后需要调用这个方法更新校验的值
|
||||
nextTick(() => formItemContext.onFieldChange());
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
return [state, setState, defaultState, formItemContext];
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import type { InjectionKey, ComputedRef, Ref } from 'vue';
|
||||
import { createContext, useContext } from '/@/hooks/core/useContext';
|
||||
|
||||
export interface PageContextProps {
|
||||
contentHeight: ComputedRef<number>;
|
||||
pageHeight: Ref<number>;
|
||||
setPageHeight: (height: number) => Promise<void>;
|
||||
}
|
||||
|
||||
const key: InjectionKey<PageContextProps> = Symbol();
|
||||
|
||||
export function createPageContext(context: PageContextProps) {
|
||||
return createContext<PageContextProps>(context, key, { native: true });
|
||||
}
|
||||
|
||||
export function usePageContext() {
|
||||
return useContext<PageContextProps>(key);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { nextTick, onMounted, onActivated } from 'vue';
|
||||
|
||||
type HookArgs = {
|
||||
type: 'mounted' | 'activated';
|
||||
}
|
||||
|
||||
export function onMountedOrActivated(hook: Fn<HookArgs, any>) {
|
||||
let mounted: boolean;
|
||||
|
||||
onMounted(() => {
|
||||
hook({type: 'mounted'});
|
||||
nextTick(() => {
|
||||
mounted = true;
|
||||
});
|
||||
});
|
||||
|
||||
onActivated(() => {
|
||||
if (mounted) {
|
||||
hook({type: 'activated'});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import { getCurrentInstance, reactive, shallowRef, watchEffect } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
interface Params {
|
||||
excludeListeners?: boolean;
|
||||
excludeKeys?: string[];
|
||||
excludeDefaultKeys?: boolean;
|
||||
}
|
||||
|
||||
const DEFAULT_EXCLUDE_KEYS = ['class', 'style'];
|
||||
const LISTENER_PREFIX = /^on[A-Z]/;
|
||||
|
||||
export function entries<T>(obj: Recordable<T>): [string, T][] {
|
||||
return Object.keys(obj).map((key: string) => [key, obj[key]]);
|
||||
}
|
||||
|
||||
export function useAttrs(params: Params = {}): Ref<Recordable> | {} {
|
||||
const instance = getCurrentInstance();
|
||||
if (!instance) return {};
|
||||
|
||||
const { excludeListeners = false, excludeKeys = [], excludeDefaultKeys = true } = params;
|
||||
const attrs = shallowRef({});
|
||||
const allExcludeKeys = excludeKeys.concat(excludeDefaultKeys ? DEFAULT_EXCLUDE_KEYS : []);
|
||||
|
||||
// Since attrs are not reactive, make it reactive instead of doing in `onUpdated` hook for better performance
|
||||
instance.attrs = reactive(instance.attrs);
|
||||
|
||||
watchEffect(() => {
|
||||
const res = entries(instance.attrs).reduce((acm, [key, val]) => {
|
||||
if (!allExcludeKeys.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))) {
|
||||
acm[key] = val;
|
||||
}
|
||||
|
||||
return acm;
|
||||
}, {} as Recordable);
|
||||
|
||||
attrs.value = res;
|
||||
});
|
||||
|
||||
return attrs;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import {
|
||||
InjectionKey,
|
||||
provide,
|
||||
inject,
|
||||
reactive,
|
||||
readonly as defineReadonly,
|
||||
// defineComponent,
|
||||
UnwrapRef,
|
||||
} from 'vue';
|
||||
|
||||
export interface CreateContextOptions {
|
||||
readonly?: boolean;
|
||||
createProvider?: boolean;
|
||||
native?: boolean;
|
||||
}
|
||||
|
||||
type ShallowUnwrap<T> = {
|
||||
[P in keyof T]: UnwrapRef<T[P]>;
|
||||
};
|
||||
|
||||
export function createContext<T>(context: any, key: InjectionKey<T> = Symbol(), options: CreateContextOptions = {}) {
|
||||
const { readonly = true, createProvider = false, native = false } = options;
|
||||
|
||||
const state = reactive(context);
|
||||
const provideData = readonly ? defineReadonly(state) : state;
|
||||
!createProvider && provide(key, native ? context : provideData);
|
||||
|
||||
return {
|
||||
state,
|
||||
};
|
||||
}
|
||||
|
||||
export function useContext<T>(key: InjectionKey<T>, native?: boolean): T;
|
||||
export function useContext<T>(key: InjectionKey<T>, defaultValue?: any, native?: boolean): T;
|
||||
|
||||
export function useContext<T>(key: InjectionKey<T> = Symbol(), defaultValue?: any): ShallowUnwrap<T> {
|
||||
return inject(key, defaultValue || {});
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { ref, unref } from 'vue';
|
||||
|
||||
export function useLockFn<P extends any[] = any[], V extends any = any>(fn: (...args: P) => Promise<V>) {
|
||||
const lockRef = ref(false);
|
||||
return async function (...args: P) {
|
||||
if (unref(lockRef)) return;
|
||||
lockRef.value = true;
|
||||
try {
|
||||
const ret = await fn(...args);
|
||||
lockRef.value = false;
|
||||
return ret;
|
||||
} catch (e) {
|
||||
lockRef.value = false;
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { Ref } from 'vue';
|
||||
import { ref, onBeforeUpdate } from 'vue';
|
||||
|
||||
export function useRefs(): [Ref<HTMLElement[]>, (index: number) => (el: HTMLElement) => void] {
|
||||
const refs = ref([]) as Ref<HTMLElement[]>;
|
||||
|
||||
onBeforeUpdate(() => {
|
||||
refs.value = [];
|
||||
});
|
||||
|
||||
const setRefs = (index: number) => (el: HTMLElement) => {
|
||||
refs.value[index] = el;
|
||||
};
|
||||
|
||||
return [refs, setRefs];
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import { tryOnUnmounted } from '@vueuse/core';
|
||||
import { isFunction } from '/@/utils/is';
|
||||
|
||||
export function useTimeoutFn(handle: Fn<any>, wait: number, native = false) {
|
||||
if (!isFunction(handle)) {
|
||||
throw new Error('handle is not Function!');
|
||||
}
|
||||
|
||||
const { readyRef, stop, start } = useTimeoutRef(wait);
|
||||
if (native) {
|
||||
handle();
|
||||
} else {
|
||||
watch(
|
||||
readyRef,
|
||||
(maturity) => {
|
||||
maturity && handle();
|
||||
},
|
||||
{ immediate: false }
|
||||
);
|
||||
}
|
||||
return { readyRef, stop, start };
|
||||
}
|
||||
|
||||
export function useTimeoutRef(wait: number) {
|
||||
const readyRef = ref(false);
|
||||
|
||||
let timer: TimeoutHandle;
|
||||
function stop(): void {
|
||||
readyRef.value = false;
|
||||
timer && window.clearTimeout(timer);
|
||||
}
|
||||
function start(): void {
|
||||
stop();
|
||||
timer = setTimeout(() => {
|
||||
readyRef.value = true;
|
||||
}, wait);
|
||||
}
|
||||
|
||||
start();
|
||||
|
||||
tryOnUnmounted(stop);
|
||||
|
||||
return { readyRef, stop, start };
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
import { ref, computed, ComputedRef, unref } from 'vue';
|
||||
import { useEventListener } from '/@/hooks/event/useEventListener';
|
||||
import { screenMap, sizeEnum, screenEnum } from '/@/enums/breakpointEnum';
|
||||
|
||||
let globalScreenRef: ComputedRef<sizeEnum | undefined>;
|
||||
let globalWidthRef: ComputedRef<number>;
|
||||
let globalRealWidthRef: ComputedRef<number>;
|
||||
|
||||
export interface CreateCallbackParams {
|
||||
screen: ComputedRef<sizeEnum | undefined>;
|
||||
width: ComputedRef<number>;
|
||||
realWidth: ComputedRef<number>;
|
||||
screenEnum: typeof screenEnum;
|
||||
screenMap: Map<sizeEnum, number>;
|
||||
sizeEnum: typeof sizeEnum;
|
||||
}
|
||||
|
||||
export function useBreakpoint() {
|
||||
return {
|
||||
screenRef: computed(() => unref(globalScreenRef)),
|
||||
widthRef: globalWidthRef,
|
||||
screenEnum,
|
||||
realWidthRef: globalRealWidthRef,
|
||||
};
|
||||
}
|
||||
|
||||
// Just call it once
|
||||
export function createBreakpointListen(fn?: (opt: CreateCallbackParams) => void) {
|
||||
const screenRef = ref<sizeEnum>(sizeEnum.XL);
|
||||
const realWidthRef = ref(window.innerWidth);
|
||||
|
||||
function getWindowWidth() {
|
||||
const width = document.body.clientWidth;
|
||||
const xs = screenMap.get(sizeEnum.XS)!;
|
||||
const sm = screenMap.get(sizeEnum.SM)!;
|
||||
const md = screenMap.get(sizeEnum.MD)!;
|
||||
const lg = screenMap.get(sizeEnum.LG)!;
|
||||
const xl = screenMap.get(sizeEnum.XL)!;
|
||||
if (width < xs) {
|
||||
screenRef.value = sizeEnum.XS;
|
||||
} else if (width < sm) {
|
||||
screenRef.value = sizeEnum.SM;
|
||||
} else if (width < md) {
|
||||
screenRef.value = sizeEnum.MD;
|
||||
} else if (width < lg) {
|
||||
screenRef.value = sizeEnum.LG;
|
||||
} else if (width < xl) {
|
||||
screenRef.value = sizeEnum.XL;
|
||||
} else {
|
||||
screenRef.value = sizeEnum.XXL;
|
||||
}
|
||||
realWidthRef.value = width;
|
||||
}
|
||||
|
||||
useEventListener({
|
||||
el: window,
|
||||
name: 'resize',
|
||||
|
||||
listener: () => {
|
||||
getWindowWidth();
|
||||
resizeFn();
|
||||
},
|
||||
// wait: 100,
|
||||
});
|
||||
|
||||
getWindowWidth();
|
||||
globalScreenRef = computed(() => unref(screenRef));
|
||||
globalWidthRef = computed((): number => screenMap.get(unref(screenRef)!)!);
|
||||
globalRealWidthRef = computed((): number => unref(realWidthRef));
|
||||
|
||||
function resizeFn() {
|
||||
fn?.({
|
||||
screen: globalScreenRef,
|
||||
width: globalWidthRef,
|
||||
realWidth: globalRealWidthRef,
|
||||
screenEnum,
|
||||
screenMap,
|
||||
sizeEnum,
|
||||
});
|
||||
}
|
||||
|
||||
resizeFn();
|
||||
return {
|
||||
screenRef: globalScreenRef,
|
||||
screenEnum,
|
||||
widthRef: globalWidthRef,
|
||||
realWidthRef: globalRealWidthRef,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import type { Ref } from 'vue';
|
||||
import { ref, watch, unref } from 'vue';
|
||||
import { useThrottleFn, useDebounceFn } from '@vueuse/core';
|
||||
|
||||
export type RemoveEventFn = () => void;
|
||||
export interface UseEventParams {
|
||||
el?: Element | Ref<Element | undefined> | Window | any;
|
||||
name: string;
|
||||
listener: EventListener;
|
||||
options?: boolean | AddEventListenerOptions;
|
||||
autoRemove?: boolean;
|
||||
isDebounce?: boolean;
|
||||
wait?: number;
|
||||
}
|
||||
export function useEventListener({ el = window, name, listener, options, autoRemove = true, isDebounce = true, wait = 80 }: UseEventParams): {
|
||||
removeEvent: RemoveEventFn;
|
||||
} {
|
||||
/* eslint-disable-next-line */
|
||||
let remove: RemoveEventFn = () => {};
|
||||
const isAddRef = ref(false);
|
||||
|
||||
if (el) {
|
||||
const element = ref(el as Element) as Ref<Element>;
|
||||
|
||||
const handler = isDebounce ? useDebounceFn(listener, wait) : useThrottleFn(listener, wait);
|
||||
const realHandler = wait ? handler : listener;
|
||||
const removeEventListener = (e: Element) => {
|
||||
isAddRef.value = true;
|
||||
e.removeEventListener(name, realHandler, options);
|
||||
};
|
||||
const addEventListener = (e: Element) => e.addEventListener(name, realHandler, options);
|
||||
|
||||
const removeWatch = watch(
|
||||
element,
|
||||
(v, _ov, cleanUp) => {
|
||||
if (v) {
|
||||
!unref(isAddRef) && addEventListener(v);
|
||||
cleanUp(() => {
|
||||
autoRemove && removeEventListener(v);
|
||||
});
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
remove = () => {
|
||||
removeEventListener(element.value);
|
||||
removeWatch();
|
||||
};
|
||||
}
|
||||
return { removeEvent: remove };
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Ref, watchEffect, ref } from 'vue';
|
||||
|
||||
interface IntersectionObserverProps {
|
||||
target: Ref<Element | null | undefined>;
|
||||
root?: Ref<any>;
|
||||
onIntersect: IntersectionObserverCallback;
|
||||
rootMargin?: string;
|
||||
threshold?: number;
|
||||
}
|
||||
|
||||
export function useIntersectionObserver({ target, root, onIntersect, rootMargin = '0px', threshold = 0.1 }: IntersectionObserverProps) {
|
||||
let cleanup = () => {};
|
||||
const observer: Ref<Nullable<IntersectionObserver>> = ref(null);
|
||||
const stopEffect = watchEffect(() => {
|
||||
cleanup();
|
||||
|
||||
observer.value = new IntersectionObserver(onIntersect, {
|
||||
root: root ? root.value : null,
|
||||
rootMargin,
|
||||
threshold,
|
||||
});
|
||||
|
||||
const current = target.value;
|
||||
|
||||
current && observer.value.observe(current);
|
||||
|
||||
cleanup = () => {
|
||||
if (observer.value) {
|
||||
observer.value.disconnect();
|
||||
target.value && observer.value.unobserve(target.value);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
observer,
|
||||
stop: () => {
|
||||
cleanup();
|
||||
stopEffect();
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import { ref, onMounted, watch, onUnmounted } from 'vue';
|
||||
import { isWindow, isObject } from '/@/utils/is';
|
||||
import { useThrottleFn } from '@vueuse/core';
|
||||
|
||||
export function useScroll(
|
||||
refEl: Ref<Element | Window | null>,
|
||||
options?: {
|
||||
wait?: number;
|
||||
leading?: boolean;
|
||||
trailing?: boolean;
|
||||
}
|
||||
) {
|
||||
const refX = ref(0);
|
||||
const refY = ref(0);
|
||||
let handler = () => {
|
||||
if (isWindow(refEl.value)) {
|
||||
refX.value = refEl.value.scrollX;
|
||||
refY.value = refEl.value.scrollY;
|
||||
} else if (refEl.value) {
|
||||
refX.value = (refEl.value as Element).scrollLeft;
|
||||
refY.value = (refEl.value as Element).scrollTop;
|
||||
}
|
||||
};
|
||||
|
||||
if (isObject(options)) {
|
||||
let wait = 0;
|
||||
if (options.wait && options.wait > 0) {
|
||||
wait = options.wait;
|
||||
Reflect.deleteProperty(options, 'wait');
|
||||
}
|
||||
|
||||
handler = useThrottleFn(handler, wait);
|
||||
}
|
||||
|
||||
let stopWatch: () => void;
|
||||
onMounted(() => {
|
||||
stopWatch = watch(
|
||||
refEl,
|
||||
(el, prevEl, onCleanup) => {
|
||||
if (el) {
|
||||
el.addEventListener('scroll', handler);
|
||||
} else if (prevEl) {
|
||||
prevEl.removeEventListener('scroll', handler);
|
||||
}
|
||||
onCleanup(() => {
|
||||
refX.value = refY.value = 0;
|
||||
el && el.removeEventListener('scroll', handler);
|
||||
});
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
refEl.value && refEl.value.removeEventListener('scroll', handler);
|
||||
});
|
||||
|
||||
function stop() {
|
||||
stopWatch && stopWatch();
|
||||
}
|
||||
|
||||
return { refX, refY, stop };
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { isFunction, isUnDef } from '/@/utils/is';
|
||||
import { ref, unref } from 'vue';
|
||||
|
||||
export interface ScrollToParams {
|
||||
el: any;
|
||||
to: number;
|
||||
duration?: number;
|
||||
callback?: () => any;
|
||||
}
|
||||
|
||||
const easeInOutQuad = (t: number, b: number, c: number, d: number) => {
|
||||
t /= d / 2;
|
||||
if (t < 1) {
|
||||
return (c / 2) * t * t + b;
|
||||
}
|
||||
t--;
|
||||
return (-c / 2) * (t * (t - 2) - 1) + b;
|
||||
};
|
||||
const move = (el: HTMLElement, amount: number) => {
|
||||
el.scrollTop = amount;
|
||||
};
|
||||
|
||||
const position = (el: HTMLElement) => {
|
||||
return el.scrollTop;
|
||||
};
|
||||
export function useScrollTo({ el, to, duration = 500, callback }: ScrollToParams) {
|
||||
const isActiveRef = ref(false);
|
||||
const start = position(el);
|
||||
const change = to - start;
|
||||
const increment = 20;
|
||||
let currentTime = 0;
|
||||
duration = isUnDef(duration) ? 500 : duration;
|
||||
|
||||
const animateScroll = function () {
|
||||
if (!unref(isActiveRef)) {
|
||||
return;
|
||||
}
|
||||
currentTime += increment;
|
||||
const val = easeInOutQuad(currentTime, start, change, duration);
|
||||
move(el, val);
|
||||
if (currentTime < duration && unref(isActiveRef)) {
|
||||
requestAnimationFrame(animateScroll);
|
||||
} else {
|
||||
if (callback && isFunction(callback)) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
};
|
||||
const run = () => {
|
||||
isActiveRef.value = true;
|
||||
animateScroll();
|
||||
};
|
||||
|
||||
const stop = () => {
|
||||
isActiveRef.value = false;
|
||||
};
|
||||
|
||||
return { start: run, stop };
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { tryOnMounted, tryOnUnmounted } from '@vueuse/core';
|
||||
import { useDebounceFn } from '@vueuse/core';
|
||||
|
||||
interface WindowSizeOptions {
|
||||
once?: boolean;
|
||||
immediate?: boolean;
|
||||
listenerOptions?: AddEventListenerOptions | boolean;
|
||||
}
|
||||
|
||||
export function useWindowSizeFn<T>(fn: Fn<T>, wait = 150, options?: WindowSizeOptions) {
|
||||
let handler = () => {
|
||||
fn();
|
||||
};
|
||||
const handleSize = useDebounceFn(handler, wait);
|
||||
handler = handleSize;
|
||||
|
||||
const start = () => {
|
||||
if (options && options.immediate) {
|
||||
handler();
|
||||
}
|
||||
window.addEventListener('resize', handler);
|
||||
};
|
||||
|
||||
const stop = () => {
|
||||
window.removeEventListener('resize', handler);
|
||||
};
|
||||
|
||||
tryOnMounted(() => {
|
||||
start();
|
||||
});
|
||||
|
||||
tryOnUnmounted(() => {
|
||||
stop();
|
||||
});
|
||||
return [start, stop];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 测试数据--常用的数据权限
|
||||
*/
|
||||
const aiCommonAuthData = [
|
||||
{
|
||||
ruleName: '只查询自己创建的数据',
|
||||
ruleColumn: 'create_by',
|
||||
ruleOperator: '=',
|
||||
ruleValue: '#{sys_user_code}',
|
||||
status: 1,
|
||||
},
|
||||
{
|
||||
ruleName: '查询本部门及下级部门的数据',
|
||||
ruleColumn: 'sys_org_code',
|
||||
ruleOperator: 'RIGHT_LIKE',
|
||||
ruleValue: '#{sys_org_code}',
|
||||
status: 1,
|
||||
},
|
||||
];
|
||||
export default aiCommonAuthData;
|
||||
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* 测试的表类型
|
||||
* 新增表配置步骤
|
||||
* 1.在此集合中添加一条数据 name为表名 title描述
|
||||
* 2.添加一个ts文件 按照下面注释的模板配置table fields enhanceFormJs enhanceSql等属性的值 参考 one.single.ts
|
||||
* 3.在 useOnlineTest.ts 中 import xxx_config from './data/xxx'
|
||||
* 4. useOnlineTest.ts 的 configMap 中声明 xxx_config 名称均为表名加_config
|
||||
*/
|
||||
export default [
|
||||
/* { title: '单表全字段测试', name: 'ai_single' },
|
||||
{ title: '简单订单主表', name: 'ai_easy_main' },
|
||||
{ title: '简单订单子表', name: 'ai_easy_sub' },
|
||||
{ title: '商品表', name: 'ai_shop_product' },
|
||||
{ title: '商品分类表', name: 'ai_shop_category' },
|
||||
{ title: '商城用户主表', name: 'ai_shop_user' },
|
||||
{ title: '商城用户订单(子)', name: 'ai_shop_order' },
|
||||
{ title: '商城用户商家(子)', name: 'ai_shop_business' },*/
|
||||
|
||||
{
|
||||
title: '单表@表单控件',
|
||||
name: 'ai_control_single',
|
||||
},
|
||||
{
|
||||
title: '单表@表单检验',
|
||||
name: 'ai_rules_single',
|
||||
},
|
||||
{
|
||||
title: '单表@表单默认值',
|
||||
name: 'ai_defval_single',
|
||||
},
|
||||
{
|
||||
title: '单表@默认查询',
|
||||
name: 'ai_query_def_single',
|
||||
},
|
||||
{
|
||||
title: '单表@自定义查询',
|
||||
name: 'ai_query_custom_single',
|
||||
},
|
||||
{
|
||||
title: '树表-商品分类',
|
||||
name: 'ai_shop_category',
|
||||
},
|
||||
{
|
||||
title: '1主表@表单控件',
|
||||
name: 'ai_control_main',
|
||||
},
|
||||
{
|
||||
title: '1一对一子表@表单控件',
|
||||
name: 'ai_control_sub_one',
|
||||
},
|
||||
{
|
||||
title: '1一对多子表@表单控件',
|
||||
name: 'ai_control_sub',
|
||||
},
|
||||
{
|
||||
title: '2主表@表单默认值',
|
||||
name: 'ai_defval_main',
|
||||
},
|
||||
{
|
||||
title: '2一对多子表@表单默认值',
|
||||
name: 'ai_defval_sub',
|
||||
},
|
||||
{
|
||||
title: '2一对一子表@表单默认值',
|
||||
name: 'ai_defval_subone',
|
||||
},
|
||||
{
|
||||
title: '3主表@表单检验',
|
||||
name: 'ai_rules_main',
|
||||
},
|
||||
{
|
||||
title: '3一对一子表@表单检验',
|
||||
name: 'ai_rules_sub_one',
|
||||
},
|
||||
{
|
||||
title: '3一对多子表@表单检验',
|
||||
name: 'ai_rules_sub',
|
||||
},
|
||||
{
|
||||
title: '4主表@自定义查询',
|
||||
name: 'ai_query_custom_main',
|
||||
},
|
||||
{
|
||||
title: '4一对一子表@自定义查询',
|
||||
name: 'ai_query_custom_sub_one',
|
||||
},
|
||||
{
|
||||
title: '4一对多子表@自定义查询',
|
||||
name: 'ai_query_custom_sub',
|
||||
},
|
||||
{
|
||||
title: '5主表@默认查询',
|
||||
name: 'ai_query_def_main',
|
||||
},
|
||||
{
|
||||
title: '5一对一子表@默认查询',
|
||||
name: 'ai_query_def_sub_one',
|
||||
},
|
||||
{
|
||||
title: '5一对多子表@默认查询',
|
||||
name: 'ai_query_def_sub',
|
||||
},
|
||||
];
|
||||
|
||||
/*
|
||||
// xxx表配置 描述清楚
|
||||
const table = {}
|
||||
|
||||
// 字段
|
||||
const fields = []
|
||||
|
||||
// 表单js增强
|
||||
const enhanceFormJs = ''
|
||||
|
||||
// sql增强
|
||||
const enhanceSql = ''
|
||||
|
||||
// 索引
|
||||
const indexList = []
|
||||
|
||||
// 组合
|
||||
const tablename_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList
|
||||
}
|
||||
export default tablename_config
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,250 @@
|
||||
/**
|
||||
* 默认字段设置
|
||||
*/
|
||||
const defaultFields = [
|
||||
{
|
||||
dbFieldName: 'id',
|
||||
dbFieldTxt: '主键',
|
||||
dbIsKey: 1,
|
||||
dbIsNull: 0,
|
||||
dbType: 'string',
|
||||
dbLength: 36,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '1',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 1,
|
||||
queryMode: 'single',
|
||||
queryConfigFlag: '0',
|
||||
orderNum: 1,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'create_by',
|
||||
dbFieldTxt: '创建人',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
queryConfigFlag: '0',
|
||||
sortFlag: '0',
|
||||
orderNum: 2,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'create_time',
|
||||
dbFieldTxt: '创建时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'datetime',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
queryConfigFlag: '0',
|
||||
sortFlag: '0',
|
||||
orderNum: 3,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'update_by',
|
||||
dbFieldTxt: '更新人',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
queryConfigFlag: '0',
|
||||
sortFlag: '0',
|
||||
orderNum: 4,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'update_time',
|
||||
dbFieldTxt: '更新时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'datetime',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
queryConfigFlag: '0',
|
||||
sortFlag: '0',
|
||||
orderNum: 5,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'sys_org_code',
|
||||
dbFieldTxt: '所属部门',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
orderNum: 6,
|
||||
queryConfigFlag: '0',
|
||||
sortFlag: '0',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 自定义按钮
|
||||
*/
|
||||
const customButtons = [
|
||||
{
|
||||
buttonCode: 'one',
|
||||
buttonName: 'js增强button',
|
||||
buttonStyle: 'button',
|
||||
optPosition: '2',
|
||||
optType: 'js',
|
||||
orderNum: 1,
|
||||
buttonStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'two',
|
||||
buttonName: 'action增强button',
|
||||
buttonStyle: 'button',
|
||||
optPosition: '2',
|
||||
optType: 'action',
|
||||
orderNum: 2,
|
||||
buttonStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'three',
|
||||
buttonName: 'js增强link',
|
||||
buttonStyle: 'link',
|
||||
optPosition: '2',
|
||||
optType: 'js',
|
||||
orderNum: 3,
|
||||
buttonStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'four',
|
||||
buttonName: '表单按钮',
|
||||
buttonStyle: 'form',
|
||||
optPosition: '2',
|
||||
optType: 'js',
|
||||
orderNum: 4,
|
||||
buttonStatus: '1',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 列表页js增强
|
||||
*/
|
||||
const customListEnhanceJavascript = `
|
||||
one(){
|
||||
console.log('当前选中行的id', this.selectedRowKeys);
|
||||
}
|
||||
three(row){
|
||||
console.log('当前行数据', row)
|
||||
}
|
||||
beforeDelete(row){
|
||||
return new Promise(resolve=>{
|
||||
console.log('删除数据之前看看数据', row);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* form页js增强
|
||||
* 【TV360X-363】js增强所有表都可生成测试代码
|
||||
*/
|
||||
const customFormEnhanceJavascript = `
|
||||
loaded(){
|
||||
let text = '';
|
||||
if(this.isUpdate.value === true){
|
||||
text = '编辑';
|
||||
} else {
|
||||
text = '新增';
|
||||
}
|
||||
console.log(text);
|
||||
}
|
||||
onlChange(){
|
||||
return {
|
||||
name() {
|
||||
console.log('name字段值改变了:', name);
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* java增强
|
||||
*/
|
||||
const customJavaEnhance = [
|
||||
{
|
||||
buttonCode: 'add',
|
||||
event: 'start',
|
||||
cgJavaType: 'spring',
|
||||
cgJavaValue: 'cgformEnhanceJavaDemo',
|
||||
activeStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'edit',
|
||||
event: 'end',
|
||||
cgJavaType: 'spring',
|
||||
cgJavaValue: 'cgformEnhanceJavaDemo',
|
||||
activeStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'import',
|
||||
event: 'start',
|
||||
cgJavaType: 'spring',
|
||||
cgJavaValue: 'cgformEnhanceImportDemo',
|
||||
activeStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'export',
|
||||
event: 'start',
|
||||
cgJavaType: 'spring',
|
||||
cgJavaValue: 'cgformEnhanceExportDemo',
|
||||
activeStatus: '1',
|
||||
},
|
||||
{
|
||||
buttonCode: 'query',
|
||||
event: 'start',
|
||||
cgJavaType: 'spring',
|
||||
cgJavaValue: 'cgformEnhanceQueryDemo',
|
||||
activeStatus: '1',
|
||||
},
|
||||
];
|
||||
|
||||
export { defaultFields, customButtons, customListEnhanceJavascript, customJavaEnhance, customFormEnhanceJavascript };
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,61 @@
|
||||
import ai_single_config from './one.single';
|
||||
import ai_easy_main_config from './onetomany.easymain';
|
||||
import ai_easy_sub_config from './onetomany.easysub1';
|
||||
import ai_shop_product_config from './one.shopproduct';
|
||||
import ai_shop_category_config from './tree.shopcategory';
|
||||
import ai_shop_user_config from './onetomany.shopuser';
|
||||
import ai_shop_business_config from './onetomany.shopbusiness';
|
||||
import ai_shop_order_config from './onetomany.shoporder';
|
||||
import ai_defval_single_config from './defval/one.defvalsingle';
|
||||
import ai_defval_main_config from './defval/onetomany.defvalmain';
|
||||
import ai_defval_sub_config from './defval/onetomany.defvalsub';
|
||||
import ai_defval_subone_config from './defval/onetomany.defvalsubone';
|
||||
import ai_rules_single_config from './rules/one.rulessingle';
|
||||
import ai_rules_main_config from './rules/onetomany.rulesmain';
|
||||
import ai_rules_sub_one_config from './rules/onetomany.rulessubone';
|
||||
import ai_rules_sub_config from './rules/onetomany.rulessub';
|
||||
import ai_query_custom_single_config from './query/custom/one.querycustomsingle';
|
||||
import ai_query_custom_main_config from './query/custom/onetomany.querycustommain';
|
||||
import ai_query_custom_sub_one_config from './query/custom/onetomany.querycustomsubone';
|
||||
import ai_query_custom_sub_config from './query/custom/onetomany.querycustomsub';
|
||||
import ai_query_def_single_config from './query/def/one.querydefsingle';
|
||||
import ai_query_def_main_config from './query/def/onetomany.querydefmain';
|
||||
import ai_query_def_sub_one_config from './query/def/onetomany.querydefsubone';
|
||||
import ai_query_def_sub_config from './query/def/onetomany.querydefsub';
|
||||
import ai_control_single_config from './control/one.controlsingle';
|
||||
import ai_control_main_config from './control/onetomany.controlmain';
|
||||
import ai_control_sub_one_config from './control/onetomany.controlsubone';
|
||||
import ai_control_sub_config from './control/onetomany.controlsub';
|
||||
import aiCommonAuthData from './auth/common.auth';
|
||||
|
||||
export default {
|
||||
ai_single_config,
|
||||
ai_easy_main_config,
|
||||
ai_easy_sub_config,
|
||||
ai_shop_product_config,
|
||||
ai_shop_category_config,
|
||||
ai_shop_user_config,
|
||||
ai_shop_business_config,
|
||||
ai_shop_order_config,
|
||||
ai_defval_single_config,
|
||||
ai_defval_main_config,
|
||||
ai_defval_sub_config,
|
||||
ai_defval_subone_config,
|
||||
ai_rules_single_config,
|
||||
ai_rules_main_config,
|
||||
ai_rules_sub_one_config,
|
||||
ai_rules_sub_config,
|
||||
ai_query_custom_single_config,
|
||||
ai_query_custom_main_config,
|
||||
ai_query_custom_sub_one_config,
|
||||
ai_query_custom_sub_config,
|
||||
ai_query_def_single_config,
|
||||
ai_query_def_main_config,
|
||||
ai_query_def_sub_one_config,
|
||||
ai_query_def_sub_config,
|
||||
ai_control_single_config,
|
||||
ai_control_main_config,
|
||||
ai_control_sub_one_config,
|
||||
ai_control_sub_config,
|
||||
aiCommonAuthData,
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,548 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const singleTableConfig = {
|
||||
tableName: 'ai_single',
|
||||
tableTxt: 'online测试单表',
|
||||
tableType: 1,
|
||||
formTemplate: '1',
|
||||
showRelationType: false,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
/**
|
||||
* 单表字段
|
||||
*/
|
||||
const singleTableFields = [
|
||||
{
|
||||
dbFieldName: 'name',
|
||||
dbFieldTxt: '商品名称',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '1',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'price',
|
||||
dbFieldTxt: '单价',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'BigDecimal',
|
||||
fieldLength: 120,
|
||||
dbLength: 10,
|
||||
dbPointLength: 2,
|
||||
fieldShowType: 'text',
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'yuanjia',
|
||||
dbFieldTxt: '原价',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 6,
|
||||
dbPointLength: 2,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'geshu',
|
||||
dbFieldTxt: '个数',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'int',
|
||||
dbLength: 9,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'jycs',
|
||||
dbFieldTxt: '校验测试',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'province',
|
||||
dbFieldTxt: '正则校验',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '^[a-z|A-Z]{2,10}$',
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zdmrz',
|
||||
dbFieldTxt: '自定义查询',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
fieldDefaultValue: '1',
|
||||
queryConfigFlag: '1',
|
||||
queryShowType: 'list',
|
||||
queryDefVal: '1',
|
||||
queryDictField: 'sex',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xiala',
|
||||
dbFieldTxt: '下拉',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'list',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
dictField: 'sex',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'danxuan',
|
||||
dbFieldTxt: '单选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'radio',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
dictField: 'sex',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'duoxuan',
|
||||
dbFieldTxt: '多选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'checkbox',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
dictField: 'urgent_level',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'kaiguan',
|
||||
dbFieldTxt: '开关',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'switch',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
fieldExtendJson: '[1,2]',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'riqi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'date',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'group',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shijian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'datetime',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'group',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'wenjian',
|
||||
dbFieldTxt: '文件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 250,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'file',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'tupian',
|
||||
dbFieldTxt: '图片',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 250,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'image',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dhwb',
|
||||
dbFieldTxt: '多行文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 250,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'textarea',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xldx',
|
||||
dbFieldTxt: '下拉多选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 250,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'list_multi',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
dictField: 'urgent_level',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xlss',
|
||||
dbFieldTxt: '下拉搜索',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 50,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'sel_search',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'popup',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
dictField: 'username,realname',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popback',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popback',
|
||||
dbFieldTxt: 'popback',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'text',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'fen_tree',
|
||||
dbFieldTxt: '分类字典',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'cat_tree',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
dictField: 'B02',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'bmxz',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'yhxz',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'sel_user',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'fwb',
|
||||
dbFieldTxt: '富文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Text',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'umeditor',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'markdown',
|
||||
dbFieldTxt: 'markdown',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Blob',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'markdown',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 0,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'pca',
|
||||
dbFieldTxt: '省市区',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
fieldShowType: 'pca',
|
||||
fieldLength: 120,
|
||||
fieldMustInput: '0',
|
||||
isQuery: 1,
|
||||
queryMode: 'single',
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 表单页js增强
|
||||
* @type {string}
|
||||
*/
|
||||
const singleTableFormJs = `
|
||||
four(){
|
||||
this.triggleChangeValue('name', '通过增强设置值')
|
||||
}
|
||||
beforeSubmit(row){
|
||||
return new Promise((resolve, reject)=>{
|
||||
setTimeout(()=>{
|
||||
if(row.name == 'test'){
|
||||
reject('不能提交测试数据');
|
||||
}else{
|
||||
resolve();
|
||||
}
|
||||
},3000)
|
||||
})
|
||||
}
|
||||
onlChange(){
|
||||
return {
|
||||
name(){
|
||||
let value = event.value
|
||||
let row = this.getFieldsValue()
|
||||
let price = row.price
|
||||
let values = {'dhwb':'商品名称:'+value+',单价:'+price}
|
||||
this.triggleChangeValues(values)
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
// sql增强
|
||||
// noinspection SqlDialectInspection,SqlNoDataSourceInspection
|
||||
const singleTableSql = "update ai_single set price = 2.00 where id = '#{id}'";
|
||||
|
||||
/**
|
||||
* 索引配置
|
||||
*/
|
||||
const indexList = [
|
||||
{
|
||||
indexField: 'jycs',
|
||||
indexName: 'index_jycs',
|
||||
indexType: 'unique',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_single_config = {
|
||||
table: singleTableConfig,
|
||||
fields: singleTableFields,
|
||||
enhanceFormJs: singleTableFormJs,
|
||||
enhanceSql: singleTableSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_single_config;
|
||||
@@ -0,0 +1,143 @@
|
||||
/**
|
||||
* 简单订单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_easy_main',
|
||||
tableTxt: '订单测试表',
|
||||
tableType: 2,
|
||||
formTemplate: '2',
|
||||
showRelationType: false,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'order_code',
|
||||
dbFieldTxt: '订单编码',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'String',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: '${order_num_rule}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 6,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'order_date',
|
||||
dbFieldTxt: '下单时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'date',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 7,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'descc',
|
||||
dbFieldTxt: '描述',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'String',
|
||||
dbLength: 100,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'textarea',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 8,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
];
|
||||
|
||||
const ai_easy_main_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: '',
|
||||
enhanceSql: '',
|
||||
};
|
||||
export default ai_easy_main_config;
|
||||
@@ -0,0 +1,256 @@
|
||||
/**
|
||||
* 简单订单产品明细配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_easy_sub',
|
||||
tableTxt: '订单产品明细',
|
||||
tableType: 3,
|
||||
formTemplate: '2',
|
||||
showRelationType: true,
|
||||
relationType: 0,
|
||||
tabOrderNum: 1,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'product_name',
|
||||
dbFieldTxt: '产品名字',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'String',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 6,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'price',
|
||||
dbFieldTxt: '价格',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'n',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 7,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'num',
|
||||
dbFieldTxt: '数量',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'int',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'n',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 8,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'pro_type',
|
||||
dbFieldTxt: '产品类型',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'String',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'radio',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 9,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'order_fk_id',
|
||||
dbFieldTxt: '订单外键ID',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 0,
|
||||
dbType: 'String',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_easy_main',
|
||||
mainField: 'id',
|
||||
orderNum: 10,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'descc',
|
||||
dbFieldTxt: '描述',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'String',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: null,
|
||||
dictTable: null,
|
||||
dictText: null,
|
||||
fieldShowType: 'text',
|
||||
fieldHref: null,
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: null,
|
||||
fieldDefaultValue: null,
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: null,
|
||||
mainField: null,
|
||||
orderNum: 11,
|
||||
converter: null,
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: null,
|
||||
queryDictText: null,
|
||||
queryDictField: null,
|
||||
queryDictTable: null,
|
||||
queryShowType: null,
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
];
|
||||
|
||||
const ai_easy_sub_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: '',
|
||||
enhanceSql: '',
|
||||
};
|
||||
export default ai_easy_sub_config;
|
||||
@@ -0,0 +1,598 @@
|
||||
//商城商家表配置
|
||||
const table = {
|
||||
themeTemplate: 'normal',
|
||||
tableName: 'ai_shop_business',
|
||||
scroll: 1,
|
||||
tableType: 3,
|
||||
tableVersion: 1,
|
||||
tableTxt: '商城商家表',
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
relationType: 1,
|
||||
tabOrderNum: 1,
|
||||
formCategory: 'temp',
|
||||
formTemplate: '1',
|
||||
isDesForm: 'N',
|
||||
};
|
||||
|
||||
//字段
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'business_name',
|
||||
dbFieldTxt: '商家名称',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '北京国炬',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_user',
|
||||
dbFieldTxt: '用户',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '#{sysUserCode}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: 'customDemoConverter',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'business_desc',
|
||||
dbFieldTxt: '商家描述',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Text',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '*6-16',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'business_image',
|
||||
dbFieldTxt: '商家图片',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 1000,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'image',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'business_file',
|
||||
dbFieldTxt: '商家文件(证书)',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 1000,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'file',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'register_date',
|
||||
dbFieldTxt: '注册日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '#{date}',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'date',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_more',
|
||||
dbFieldTxt: '下拉多选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'send_status',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_box',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sports',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popupback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'mall_user_id',
|
||||
dbFieldTxt: '外键',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_shop_user',
|
||||
mainField: 'id',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'integer_test',
|
||||
dbFieldTxt: 'integer测试',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'int',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '{{5*10-5}}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'double_test',
|
||||
dbFieldTxt: 'double测试',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'n6-16',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'js_exceprion',
|
||||
dbFieldTxt: 'js默认表达式',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '{{demoFieldDefVal_getAddress("北京市朝阳区")}}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zhengze',
|
||||
dbFieldTxt: '正则',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'buiss_code',
|
||||
dbFieldTxt: '商家编码',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '${order_num_rule}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 1,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
//组合
|
||||
const ai_shop_business_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_shop_business_config;
|
||||
@@ -0,0 +1,672 @@
|
||||
//商城订单表配置
|
||||
const table = {
|
||||
themeTemplate: 'normal',
|
||||
tableName: 'ai_shop_order',
|
||||
scroll: 1,
|
||||
tableType: 3,
|
||||
tableVersion: 1,
|
||||
tableTxt: '商城订单表',
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
relationType: 0,
|
||||
tabOrderNum: 1,
|
||||
formCategory: 'temp',
|
||||
formTemplate: '1',
|
||||
isDesForm: 'N',
|
||||
};
|
||||
|
||||
//字段
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'mall_name',
|
||||
dbFieldTxt: '商品名称',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Text',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'buy_user',
|
||||
dbFieldTxt: '收货人',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 200,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '#{sysUserCode}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: 'customDemoConverter',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'buy_order',
|
||||
dbFieldTxt: '订单号',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '${order_num_rule}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'transaction_date',
|
||||
dbFieldTxt: '交易日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '*',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '#{date}',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'good_image',
|
||||
dbFieldTxt: '商品图片',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 1000,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'image',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: ' {"uploadnum":1}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'buy_count',
|
||||
dbFieldTxt: '购买数量',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'int',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'cope_with',
|
||||
dbFieldTxt: '单价',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'BigDecimal',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '{{100/50}}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'actual_payment',
|
||||
dbFieldTxt: '实付',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '{{100/50-10}}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'status',
|
||||
dbFieldTxt: '是否已付款',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'yn',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'radio',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '1',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'kaiguan',
|
||||
dbFieldTxt: '开关',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'yn',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'switch',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '1',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'good_file',
|
||||
dbFieldTxt: '文件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 1000,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'file',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: ' {"uploadnum":1}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_more',
|
||||
dbFieldTxt: '下拉多选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'org_category',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popupback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'list',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'mall_user_id',
|
||||
dbFieldTxt: '外键',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_shop_user',
|
||||
mainField: 'id',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'jiequ',
|
||||
dbFieldTxt: '列表显示截取',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '*6-16',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"showLength":5}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'js_expection',
|
||||
dbFieldTxt: 'js默认表单',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: null,
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '{{demoFieldDefVal_getAddress("北京市朝阳区")}}',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zhengze',
|
||||
dbFieldTxt: '正则',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '^[\\u4e00-\\u9fa5]+$',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 23,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
//组合
|
||||
const ai_shop_order_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_shop_order_config;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,654 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_custom_main',
|
||||
tableTxt: '自定义查询@主表',
|
||||
tableType: 2,
|
||||
formTemplate: '1',
|
||||
showRelationType: false,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 36,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '测试',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'date',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shijian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '19:40:25,20:00:00',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'time',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'duo_xuan',
|
||||
dbFieldTxt: '多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'checkbox',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '1',
|
||||
queryDictText: '',
|
||||
queryDictField: 'sex',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'list',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'list_multi',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_sou_suo',
|
||||
dbFieldTxt: '下拉搜索框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'sel_search',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'fen_lei_zi_dian_shu',
|
||||
dbFieldTxt: '分类字典树',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'B01',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'cat_tree',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'f39a06bf9f390ba4a53d11bc4e0018d7',
|
||||
queryDictText: '',
|
||||
queryDictField: 'B01',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'cat_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'popup,popback',
|
||||
queryDictField: 'realname,username',
|
||||
queryDictTable: 'report_user',
|
||||
queryShowType: 'popup',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'jeecg',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_user',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'c6d7cb4deeac411cb3384b1b31278596',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_depart',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'province_area',
|
||||
dbFieldTxt: '省市区下拉',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'pca',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '130303',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'pca',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'custom_tree',
|
||||
dbFieldTxt: '自定义树组件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '0',
|
||||
dictTable: 'sys_category',
|
||||
dictText: 'id,pid,name,has_child',
|
||||
fieldShowType: 'sel_tree',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '5c8f68845e57f68ab93a2c8d82d26ae1',
|
||||
queryDictText: 'id,pid,name,has_child',
|
||||
queryDictField: '0',
|
||||
queryDictTable: 'sys_category',
|
||||
queryShowType: 'sel_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-12-20,2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'date',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shu_zhi',
|
||||
dbFieldTxt: '数值范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '3',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'jeecg',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'list',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-11-29 15:15:30,2021-12-31 15:15:30',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'datetime',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_custom_main_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_custom_main_config;
|
||||
@@ -0,0 +1,655 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_custom_sub',
|
||||
tableTxt: '自定义查询@一对多子表',
|
||||
tableType: 3,
|
||||
formTemplate: '1',
|
||||
showRelationType: true,
|
||||
relationType: 0,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '测试',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '19:42:02',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'time',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'date',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_box',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '1',
|
||||
queryDictText: '',
|
||||
queryDictField: 'sex',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'list',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'select_search',
|
||||
dbFieldTxt: '下拉搜索框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'sel_search',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dict_tree_type',
|
||||
dbFieldTxt: '分类字典树',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'f39a06bf9f390ba4a53d11bc4e0018d7',
|
||||
queryDictText: '',
|
||||
queryDictField: 'B01',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'cat_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'popup,popback',
|
||||
queryDictField: 'realname,username',
|
||||
queryDictTable: 'report_user',
|
||||
queryShowType: 'popup',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'c6d7cb4deeac411cb3384b1b31278596',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_depart',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_user',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'province_area',
|
||||
dbFieldTxt: '省市区组件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '140405',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'pca',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'custom_assembly',
|
||||
dbFieldTxt: '自定义组件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '5c8f68845e57f68ab93a2c8d82d26ae1',
|
||||
queryDictText: 'id,pid,name,has_child',
|
||||
queryDictField: '0',
|
||||
queryDictTable: 'sys_category',
|
||||
queryShowType: 'sel_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'query_main_id',
|
||||
dbFieldTxt: '主表默认查询id',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_query_custom_main',
|
||||
mainField: 'id',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shuzhi',
|
||||
dbFieldTxt: '数值范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '1,200',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'datetime',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-11-28,2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'jeecg',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'list_multi',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'datetime',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_custom_sub_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_custom_sub_config;
|
||||
@@ -0,0 +1,655 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_custom_sub_one',
|
||||
tableTxt: '自定义查询@一对一子表',
|
||||
tableType: 3,
|
||||
formTemplate: '1',
|
||||
showRelationType: true,
|
||||
relationType: 1,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '测试',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'datetime',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '19:40:25',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'time',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'list_multi',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_sou_suo',
|
||||
dbFieldTxt: '下拉搜索框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'realname',
|
||||
queryDictField: 'username',
|
||||
queryDictTable: 'sys_user',
|
||||
queryShowType: 'sel_search',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'fen_lei_zi_dian_shu',
|
||||
dbFieldTxt: '分类字典树',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'B01',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'f39a06bf9f390ba4a53d11bc4e0018d7',
|
||||
queryDictText: '',
|
||||
queryDictField: 'B01',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'cat_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: 'popup,popback',
|
||||
queryDictField: 'username,realname',
|
||||
queryDictTable: 'report_user',
|
||||
queryShowType: 'popup',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'admin',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_user',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: 'c6d7cb4deeac411cb3384b1b31278596',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'sel_depart',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'province_area',
|
||||
dbFieldTxt: '省市区下拉',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '140405',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'pca',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'custom_tree',
|
||||
dbFieldTxt: '自定义树组件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '0',
|
||||
dictTable: 'sys_category',
|
||||
dictText: 'id,pid,name,has_child',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '5c8f68845e57f68ab93a2c8d82d26ae1',
|
||||
queryDictText: 'id,pid,name,has_child',
|
||||
queryDictField: '0',
|
||||
queryDictTable: 'sys_category',
|
||||
queryShowType: 'sel_tree',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '2021-12-24,2021-12-28',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'date',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shu_zhi',
|
||||
dbFieldTxt: '数值范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '1,200',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '1',
|
||||
queryDictText: '',
|
||||
queryDictField: 'sex',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'list',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'custom_main_id',
|
||||
dbFieldTxt: '自定义查询主表外键',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_query_custom_main',
|
||||
mainField: 'id',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '1',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'datetime',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_custom_sub_one_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_custom_sub_one_config;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,730 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_def_main',
|
||||
tableTxt: '默认查询@主表',
|
||||
tableType: 2,
|
||||
formTemplate: '1',
|
||||
showRelationType: false,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dan_xuan',
|
||||
dbFieldTxt: '单选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'duo_xuan',
|
||||
dbFieldTxt: '多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'checkbox',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'kai_guan',
|
||||
dbFieldTxt: '开关',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'switch',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_sou_suo',
|
||||
dbFieldTxt: '下拉搜索',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"popupMulti":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'fen_lei_zi_dian',
|
||||
dbFieldTxt: '分类字典树',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'B01',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'cat_tree',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'sheng_shi_qu',
|
||||
dbFieldTxt: '省市区组件',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'pca',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zi_ding_yi_shu',
|
||||
dbFieldTxt: '自定义树',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '0',
|
||||
dictTable: 'sys_category',
|
||||
dictText: 'id,pid,name,has_child',
|
||||
fieldShowType: 'sel_tree',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shu_zi_fan_wei',
|
||||
dbFieldTxt: '数字范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 23,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'datetime',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 24,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_def_main_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_def_main_config;
|
||||
@@ -0,0 +1,655 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_def_sub',
|
||||
tableTxt: '默认查询@一对多子表',
|
||||
tableType: 3,
|
||||
formTemplate: '1',
|
||||
showRelationType: true,
|
||||
relationType: 0,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dan_xuan',
|
||||
dbFieldTxt: '单选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'radio',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'switch_flag',
|
||||
dbFieldTxt: '开关',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'switch',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_sou_suo',
|
||||
dbFieldTxt: '下拉搜索框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"popupMulti":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'more_text',
|
||||
dbFieldTxt: '多行文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'textarea',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shu_zi_fan_wei',
|
||||
dbFieldTxt: '数字范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'query_main_id',
|
||||
dbFieldTxt: '主表默认值id',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_query_def_main',
|
||||
mainField: 'id',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'datetime',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_def_sub_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_def_sub_config;
|
||||
@@ -0,0 +1,655 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_query_def_sub_one',
|
||||
tableTxt: '默认查询@一对一子表',
|
||||
tableType: 3,
|
||||
formTemplate: '1',
|
||||
showRelationType: true,
|
||||
relationType: 1,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'wen_ben',
|
||||
dbFieldTxt: '文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dan_xuan',
|
||||
dbFieldTxt: '单选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'radio',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'switch_flag',
|
||||
dbFieldTxt: '开关',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'switch',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_duo_xuan',
|
||||
dbFieldTxt: '下拉多选框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'list_multi',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la_sou_suo',
|
||||
dbFieldTxt: '下拉搜索框',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'sel_search',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹窗',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"popupMulti":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'depart_select',
|
||||
dbFieldTxt: '部门选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'user_select',
|
||||
dbFieldTxt: '用户选择',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '{"multiSelect":false}',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'more_text',
|
||||
dbFieldTxt: '多行文本',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'textarea',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi_fan_wei',
|
||||
dbFieldTxt: '日期范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shu_zi_fan_wei',
|
||||
dbFieldTxt: '数字范围',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'double',
|
||||
dbLength: 10,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'query_main_id',
|
||||
dbFieldTxt: '主表默认值id',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_query_def_main',
|
||||
mainField: 'id',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'nyrsfm',
|
||||
dbFieldTxt: '年月日时分秒',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Datetime',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'datetime',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 1,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'group',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_query_def_sub_one_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_query_def_sub_one_config;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,921 @@
|
||||
/**
|
||||
* 全字段单表配置信息
|
||||
*/
|
||||
const table = {
|
||||
tableName: 'ai_rules_sub_one',
|
||||
tableTxt: '表单检验@一对一子表',
|
||||
tableType: 3,
|
||||
formTemplate: '1',
|
||||
showRelationType: true,
|
||||
relationType: 1,
|
||||
showIdSequence: false,
|
||||
themeTemplate: 'normal',
|
||||
scroll: 1,
|
||||
tableVersion: 1,
|
||||
isCheckbox: 'Y',
|
||||
isDbSynch: 'Y',
|
||||
isPage: 'Y',
|
||||
isTree: 'N',
|
||||
idType: 'UUID',
|
||||
queryMode: 'single',
|
||||
formCategory: 'temp',
|
||||
};
|
||||
|
||||
const fields = [
|
||||
{
|
||||
dbFieldName: 'phone',
|
||||
dbFieldTxt: '手机号',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'm',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 7,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'email',
|
||||
dbFieldTxt: '邮箱',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'e',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 8,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'you_bian',
|
||||
dbFieldTxt: '邮编',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'p',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 9,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'six_number',
|
||||
dbFieldTxt: '6到16位数字',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'n6-16',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 10,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'six_char',
|
||||
dbFieldTxt: '6到16位任意字符',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '*6-16',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 11,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'wangzhi',
|
||||
dbFieldTxt: '网址',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'url',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 12,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zimu',
|
||||
dbFieldTxt: '字母',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 's',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 13,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shuzi',
|
||||
dbFieldTxt: '数字',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'n',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 14,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'zhengshu',
|
||||
dbFieldTxt: '整数',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'z',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 15,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'not_null',
|
||||
dbFieldTxt: '非空',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '*',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 16,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'six_string',
|
||||
dbFieldTxt: '6到18位字母',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 's6-18',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 17,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'chinese',
|
||||
dbFieldTxt: '中文正则',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '^[\\u4e00-\\u9fa5]+$',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 18,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'amount',
|
||||
dbFieldTxt: '金额',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'money',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 19,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'only_rule',
|
||||
dbFieldTxt: '唯一检验',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 20,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'rules_main_id',
|
||||
dbFieldTxt: '主表验证规则外键',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'text',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: '',
|
||||
fieldMustInput: '0',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 0,
|
||||
isShowList: 0,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: 'ai_rules_main',
|
||||
mainField: 'id',
|
||||
orderNum: 21,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'dan_xuan',
|
||||
dbFieldTxt: '单选框必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: 'sex',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'radio',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 22,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'kai_guan',
|
||||
dbFieldTxt: '开关必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'switch',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 23,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'ri_qi',
|
||||
dbFieldTxt: '日期必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'Date',
|
||||
dbLength: 0,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'date',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 24,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'shi_jian',
|
||||
dbFieldTxt: '时间必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 32,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'time',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 25,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'xia_la',
|
||||
dbFieldTxt: '下拉框必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'username',
|
||||
dictTable: 'sys_user',
|
||||
dictText: 'realname',
|
||||
fieldShowType: 'list',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 26,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'bmxz',
|
||||
dbFieldTxt: '部门选择必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_depart',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 27,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'yhxz',
|
||||
dbFieldTxt: '用户选择必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: '',
|
||||
dictTable: '',
|
||||
dictText: '',
|
||||
fieldShowType: 'sel_user',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 28,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
{
|
||||
dbFieldName: 'popup',
|
||||
dbFieldTxt: 'popup弹出框必填',
|
||||
dbIsKey: 0,
|
||||
dbIsNull: 1,
|
||||
dbType: 'string',
|
||||
dbLength: 255,
|
||||
dbPointLength: 0,
|
||||
dictField: 'realname,username',
|
||||
dictTable: 'report_user',
|
||||
dictText: 'popup,popback',
|
||||
fieldShowType: 'popup',
|
||||
fieldHref: '',
|
||||
fieldLength: 120,
|
||||
fieldValidType: 'only',
|
||||
fieldMustInput: '1',
|
||||
fieldExtendJson: '',
|
||||
fieldDefaultValue: '',
|
||||
isQuery: 0,
|
||||
isShowForm: 1,
|
||||
isShowList: 1,
|
||||
isReadOnly: 0,
|
||||
queryMode: 'single',
|
||||
mainTable: '',
|
||||
mainField: '',
|
||||
orderNum: 29,
|
||||
converter: '',
|
||||
queryConfigFlag: '0',
|
||||
queryDefVal: '',
|
||||
queryDictText: '',
|
||||
queryDictField: '',
|
||||
queryDictTable: '',
|
||||
queryShowType: 'text',
|
||||
queryValidType: null,
|
||||
queryMustInput: null,
|
||||
sortFlag: '0',
|
||||
alias: null,
|
||||
},
|
||||
];
|
||||
|
||||
//表单js增强
|
||||
const enhanceFormJs = '';
|
||||
|
||||
//sql增强
|
||||
const enhanceSql = '';
|
||||
|
||||
//索引
|
||||
const indexList = [];
|
||||
|
||||
/**
|
||||
* 此对象为最后混入里配置的对象 扩展表类型 属性名需要和此对象保持一致
|
||||
* 命名规则 表名_config
|
||||
*/
|
||||
const ai_rules_sub_one_config = {
|
||||
table: table,
|
||||
fields: fields,
|
||||
enhanceFormJs: enhanceFormJs,
|
||||
enhanceSql: enhanceSql,
|
||||
indexList: indexList,
|
||||
};
|
||||
export default ai_rules_sub_one_config;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 功能开关
|
||||
*/
|
||||
import type { Ref } from 'vue';
|
||||
import { ref, computed, provide, inject } from 'vue';
|
||||
|
||||
// 默认允许的功能列表
|
||||
const DEF_FUNC_LIST = [
|
||||
/** 显示创建按钮 */
|
||||
'SHOW_CREATE_BTN',
|
||||
/** 导入数据 */
|
||||
'IMPORT_DATA',
|
||||
/** 视图导出 */
|
||||
'VIEW_EXPORT',
|
||||
/** 允许批量操作 */
|
||||
'BATCH_ACTION',
|
||||
/** 批量编辑 */
|
||||
'BATCH_EDIT',
|
||||
/** 批量打印 */
|
||||
'BATCH_SYS_PRINT',
|
||||
/** 批量导出 */
|
||||
'BATCH_EXPORT',
|
||||
/** 批量删除 */
|
||||
'BATCH_REMOVE',
|
||||
/** 批量执行自定义动作(按钮) */
|
||||
'BATCH_CUSTOM_BUTTON',
|
||||
/** 记录分享 */
|
||||
'RECORD_SHARE',
|
||||
/** 记录讨论 */
|
||||
'RECORD_COMMENT',
|
||||
/** 记录打印 */
|
||||
'RECORD_SYS_PRINT',
|
||||
/** 记录日志 */
|
||||
'RECORD_LOGS',
|
||||
/** 允许下载附件 */
|
||||
'FILES_DOWNLOAD',
|
||||
] as const;
|
||||
|
||||
export type FuncCodeType = typeof DEF_FUNC_LIST[number];
|
||||
const piSymbol = 'ALLOW_FUNC_LIST';
|
||||
|
||||
/**
|
||||
* 功能开关
|
||||
*/
|
||||
export function useFuncSwitch() {
|
||||
const allowFuncList = inject<Ref<FuncCodeType[]>>(piSymbol, ref([]));
|
||||
|
||||
if (allowFuncList.value.length === 0) {
|
||||
allowFuncList.value = [...DEF_FUNC_LIST];
|
||||
provide(piSymbol, allowFuncList);
|
||||
console.info('注册 useFuncSwitch provided')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取判断是否允许使用某个功能的计算属性
|
||||
* @param code
|
||||
*/
|
||||
function getHasFunc(code: FuncCodeType) {
|
||||
return computed<boolean>(() => {
|
||||
return allowFuncList.value.includes(code);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
getHasFunc,
|
||||
allowFuncList,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* 额外写一份冗余代码,提供给eoa模块调用
|
||||
*/
|
||||
import { ref, unref } from 'vue';
|
||||
import { getQueryVariable } from '/@/utils';
|
||||
import { isUrl } from '/@/utils/is';
|
||||
import {defHttp} from "/@/utils/http/axios";
|
||||
|
||||
/**
|
||||
* 获取流程节点历史信息
|
||||
* @param params
|
||||
*/
|
||||
export const hisProcessNodeInfo = (params) => {
|
||||
return defHttp.get({ url: '/act/process/extActProcessNode/getHisProcessNodeInfo', params }, { isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @param path 路径
|
||||
* @param taskDealRef 弹窗示例
|
||||
*/
|
||||
export function useBpmNodeInfo(path, taskDealRef) {
|
||||
const formData = ref({});
|
||||
/**
|
||||
* 获取流程历史节点信息
|
||||
* @param record
|
||||
*/
|
||||
function getHisProcessNodeInfo(record) {
|
||||
hisProcessNodeInfo({ procInstId: record.processInstanceId }).then((res) => {
|
||||
console.log('获取流程节点信息', res);
|
||||
if (res.success) {
|
||||
let data = {
|
||||
dataId: res.result.dataId,
|
||||
taskId: record.id,
|
||||
taskDefKey: record.taskId,
|
||||
procInsId: record.processInstanceId,
|
||||
tableName: res.result.tableName,
|
||||
vars: res.result.records,
|
||||
};
|
||||
formData.value = data;
|
||||
//update--begin--autor:scott-----date:20191005------for:流程节点配置组件URL的时候也支持传递参数了,解决TASK #3238流程节点无法与online的复制视图对接------
|
||||
console.log('获取流程节点表单URL ', res.result.formUrl);
|
||||
let tempFormUrl = res.result.formUrl;
|
||||
//节点配置表单URL,VUE组件类型对应的拓展参数
|
||||
if (tempFormUrl && tempFormUrl.indexOf('?') != -1 && !isUrl(tempFormUrl) && tempFormUrl.indexOf('{{DOMAIN_URL}}') == -1) {
|
||||
tempFormUrl = res.result.formUrl.split('?')[0];
|
||||
console.log('获取流程节点表单URL(去掉参数)', tempFormUrl);
|
||||
formData.value['extendUrlParams'] = getQueryVariable(res.result.formUrl);
|
||||
}
|
||||
path.value = tempFormUrl;
|
||||
//update--end--autor:scott-----date:20191005------for:流程节点配置组件URL的时候也支持传递参数了,解决TASK #3238流程节点无法与online的复制视图对接------
|
||||
console.log('获取流程节点信息formData', unref(formData));
|
||||
console.log('获取流程节点信息path', unref(path));
|
||||
taskDealRef.value.deal(record);
|
||||
taskDealRef.value.data.title = '流程历史';
|
||||
console.log('taskDealRef', taskDealRef.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return { getHisProcessNodeInfo, formData };
|
||||
}
|
||||
@@ -0,0 +1,527 @@
|
||||
/**
|
||||
* 额外写一份冗余代码,提供给eoa模块调用
|
||||
*/
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||
|
||||
/**
|
||||
* 接口地址定义
|
||||
*/
|
||||
const URL = {
|
||||
run: {
|
||||
list: '/act/task/list',
|
||||
claim: '/act/task/claim',
|
||||
taskEntrust: '/act/task/taskEntrust',
|
||||
getProcessNodeInfo: '/act/process/extActProcessNode/getProcessNodeInfo',
|
||||
getProcessTaskTransInfo: '/act/task/getProcessTaskTransInfo',
|
||||
},
|
||||
history: {
|
||||
list: '/act/task/taskHistoryList',
|
||||
getProcessNodeInfo: '/act/process/extActProcessNode/getHisProcessNodeInfo',
|
||||
getProcessTaskTransInfo: '/act/task/getHisProcessTaskTransInfo',
|
||||
},
|
||||
group: {
|
||||
list: '/act/task/taskGroupList',
|
||||
claim: '/act/task/claim',
|
||||
getProcessTaskTransInfo: '/act/task/getProcessTaskTransInfo',
|
||||
},
|
||||
processComplete: '/act/task/processComplete',
|
||||
processHistoryList: '/act/task/processHistoryList',
|
||||
taskEntrust: '/act/task/taskEntrust',
|
||||
taskComplaint: '/act/task/taskComplaint',
|
||||
afterAddSignTask: '/act/task/afterAddSignTask',
|
||||
beforeAddSignTask: '/act/task/beforeAddSignTask',
|
||||
claim: '/act/task/claim',
|
||||
notifyMeList: '/act/process/extActTaskNotification/list',
|
||||
};
|
||||
export enum TaskType {
|
||||
RUN = 'run',
|
||||
HIS = 'history',
|
||||
GROUP = 'group',
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表 列--running
|
||||
*/
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '业务标题',
|
||||
align: 'center',
|
||||
dataIndex: 'bpmBizTitle',
|
||||
slots: { customRender: 'bpmBizTitle' },
|
||||
},
|
||||
{
|
||||
title: '当前环节',
|
||||
align: 'center',
|
||||
width: 130,
|
||||
dataIndex: 'taskName',
|
||||
},
|
||||
{
|
||||
title: '流程名称',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionName',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '流程实例',
|
||||
align: 'center',
|
||||
dataIndex: 'processInstanceId',
|
||||
},
|
||||
{
|
||||
title: '发起人',
|
||||
width: 110,
|
||||
align: 'center',
|
||||
dataIndex: 'processApplyUserName',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: 'center',
|
||||
dataIndex: 'taskBeginTime',
|
||||
},
|
||||
{
|
||||
title: '流程编号',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionId',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '任务ID',
|
||||
align: 'center',
|
||||
dataIndex: 'taskId',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 列表 列--group
|
||||
*/
|
||||
export const columns_group: BasicColumn[] = [
|
||||
{
|
||||
title: '业务标题',
|
||||
align: 'center',
|
||||
dataIndex: 'bpmBizTitle',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '流程编号',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionId',
|
||||
},
|
||||
{
|
||||
title: '流程名称',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionName',
|
||||
},
|
||||
{
|
||||
title: '流程实例',
|
||||
align: 'center',
|
||||
dataIndex: 'processInstanceId',
|
||||
},
|
||||
{
|
||||
title: '任务ID',
|
||||
align: 'center',
|
||||
dataIndex: 'taskId',
|
||||
},
|
||||
{
|
||||
title: '发起人',
|
||||
align: 'center',
|
||||
dataIndex: 'processApplyUserName',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: 'center',
|
||||
dataIndex: 'taskBeginTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align: 'center',
|
||||
dataIndex: 'taskEndTime',
|
||||
},
|
||||
{
|
||||
title: '当前环节',
|
||||
align: 'center',
|
||||
dataIndex: 'taskName',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 列表 列-history
|
||||
*/
|
||||
export const columns_history: BasicColumn[] = [
|
||||
{
|
||||
title: '业务标题',
|
||||
align: 'center',
|
||||
dataIndex: 'bpmBizTitle',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '流程编号',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionId',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '流程名称',
|
||||
align: 'center',
|
||||
dataIndex: 'processDefinitionName',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '流程实例',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'processInstanceId',
|
||||
},
|
||||
{
|
||||
title: '任务ID',
|
||||
align: 'center',
|
||||
dataIndex: 'taskId',
|
||||
},
|
||||
{
|
||||
title: '发起人',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'processApplyUserName',
|
||||
},
|
||||
{
|
||||
title: '办理人',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'taskAssigneeName',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
align: 'center',
|
||||
dataIndex: 'taskBeginTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
align: 'center',
|
||||
dataIndex: 'taskEndTime',
|
||||
},
|
||||
{
|
||||
title: '耗时',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
dataIndex: 'durationStr',
|
||||
},
|
||||
// {
|
||||
// title: '当前环节',
|
||||
// align: 'center',
|
||||
// width: 120,
|
||||
// dataIndex: 'taskName',
|
||||
// },
|
||||
];
|
||||
/**
|
||||
* 获取流程节点信息
|
||||
* @param params
|
||||
*/
|
||||
export const taskNodeInfo = (type, params) => {
|
||||
return defHttp.get({ url: URL[type].getProcessNodeInfo, params });
|
||||
};
|
||||
/**
|
||||
* 获取流程列表信息
|
||||
* @param params
|
||||
*/
|
||||
export const list = (type, params) => {
|
||||
return defHttp.get({ url: URL[type].list, params });
|
||||
};
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: '业务标题',
|
||||
field: 'bpmBizTitle',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '流程名',
|
||||
field: 'processDefinitionName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '发起人',
|
||||
field: 'userName',
|
||||
component: 'JSelectUserByDept',
|
||||
componentProps: {
|
||||
labelKey: 'realname',
|
||||
rowKey: 'username',
|
||||
showButton: false,
|
||||
isRadioSelection: true,
|
||||
},
|
||||
buss: 'run',
|
||||
},
|
||||
{
|
||||
label: '流程编号',
|
||||
field: 'processDefinitionId',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 列表 流程历史跟踪
|
||||
*/
|
||||
export const taskTraceColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
customRender: function ({ text }) {
|
||||
if (text == 'start1') {
|
||||
return '开始';
|
||||
} else if (text == 'end') {
|
||||
return '结束';
|
||||
} else {
|
||||
return text;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '流程实例ID',
|
||||
dataIndex: 'processInstanceId',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
dataIndex: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
dataIndex: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
dataIndex: 'assigneeName',
|
||||
},
|
||||
{
|
||||
title: '处理结果',
|
||||
dataIndex: 'deleteReason',
|
||||
},
|
||||
{
|
||||
title: '处理意见',
|
||||
fixed: 'right',
|
||||
width: 350,
|
||||
dataIndex: 'remarks',
|
||||
slots: { customRender: 'remarks' },
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 提醒我的列表(催办)
|
||||
*/
|
||||
export const notifyMeColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '流程名称',
|
||||
align: 'center',
|
||||
dataIndex: 'procName',
|
||||
},
|
||||
{
|
||||
title: '任务名称',
|
||||
align: 'center',
|
||||
dataIndex: 'taskName',
|
||||
},
|
||||
{
|
||||
title: '催办时间',
|
||||
align: 'center',
|
||||
dataIndex: 'opTime',
|
||||
},
|
||||
{
|
||||
title: '催办类型',
|
||||
align: 'center',
|
||||
dataIndex: 'notifyType',
|
||||
customRender: function ({ text }) {
|
||||
if (!text) {
|
||||
return '';
|
||||
}
|
||||
const srtArr = text.split(',');
|
||||
let value = '';
|
||||
if (srtArr.includes('1')) {
|
||||
value += ',页面通知';
|
||||
}
|
||||
if (srtArr.includes('2')) {
|
||||
value += ',邮件';
|
||||
}
|
||||
return value.substring(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '催办说明',
|
||||
align: 'center',
|
||||
dataIndex: 'remarks',
|
||||
},
|
||||
];
|
||||
|
||||
/**
|
||||
* 用于列表渲染
|
||||
* @param urlObject
|
||||
*/
|
||||
export function useMyRunningTaskList(type) {
|
||||
const { tableContext } = useListPage({
|
||||
designScope: 'process-design',
|
||||
pagination: true,
|
||||
tableProps: {
|
||||
title: '',
|
||||
api: getDataList,
|
||||
columns: getColumns(),
|
||||
showIndexColumn: true,
|
||||
showTableSetting: false,
|
||||
canResize: false,
|
||||
scroll: { x: 1800 },
|
||||
actionColumn: { dataIndex: 'action', fixed: 'right', width: 150 },
|
||||
useSearchForm: TaskType.GROUP != type,
|
||||
formConfig: {
|
||||
schemas: getSearchFormSchema(),
|
||||
autoAdvancedCol: 3,
|
||||
baseColProps: { xs: 24, sm: 12, md: 6, lg: 6, xl: 6, xxl: 6 },
|
||||
actionColOptions: { xs: 24, sm: 12, md: 6, lg: 6, xl: 6, xxl: 6 },
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload }] = tableContext;
|
||||
|
||||
/**
|
||||
* 数据请求接口
|
||||
* @param params
|
||||
*/
|
||||
function getDataList(params) {
|
||||
return list(type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列
|
||||
* 不同类型 列表列有少许差别
|
||||
*/
|
||||
function getColumns() {
|
||||
if (TaskType.RUN == type) {
|
||||
return columns;
|
||||
} else if (TaskType.GROUP == type) {
|
||||
return columns_group;
|
||||
} else {
|
||||
return columns_history;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*/
|
||||
function getSearchFormSchema() {
|
||||
return searchFormSchema.filter((item) => !item.buss || item.buss === type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取流程节点信息
|
||||
*/
|
||||
async function getTaskNodeInfo(record) {
|
||||
//查询条件
|
||||
const params = { taskId: record.id };
|
||||
const result = await taskNodeInfo(type, params);
|
||||
console.log('获取流程节点信息', result);
|
||||
const procInsId = record.processInstanceId || (result.records ? result.records.BPM_INST_ID : '');
|
||||
const formData: any = {
|
||||
taskId: record.id,
|
||||
taskDefKey: result.taskDefKey,
|
||||
procInsId: procInsId,
|
||||
dataId: result.dataId,
|
||||
tableName: result.tableName,
|
||||
permissionList: result.permissionList,
|
||||
subPermissionList: result.subPermissionList,
|
||||
vars: result.records,
|
||||
};
|
||||
let tempFormUrl = result.formUrl;
|
||||
console.log('获取流程节点表单URL', tempFormUrl);
|
||||
//节点配置表单URL,VUE组件类型对应的拓展参数
|
||||
if (tempFormUrl && tempFormUrl.indexOf('?') != -1 && !isURL(tempFormUrl) && tempFormUrl.indexOf('{{DOMAIN_URL}}') == -1) {
|
||||
tempFormUrl = result.formUrl.split('?')[0];
|
||||
console.log('获取流程节点表单URL(去掉参数)', tempFormUrl);
|
||||
const qv: any = getQueryVariable(result.formUrl);
|
||||
if (qv.edit == 1) {
|
||||
formData['disabled'] = false;
|
||||
}
|
||||
formData.extendUrlParams = qv;
|
||||
}
|
||||
//如果没有taskId参数,程序自动追加,用于设计器表单节点权限
|
||||
if (tempFormUrl != null && tempFormUrl.indexOf('{{DOMAIN_URL}}/desform/') != -1 && tempFormUrl.indexOf('taskId') == -1) {
|
||||
tempFormUrl = tempFormUrl.trim();
|
||||
if (tempFormUrl.endsWith('?')) {
|
||||
tempFormUrl = tempFormUrl + 'taskId=' + result.taskDefKey;
|
||||
} else {
|
||||
tempFormUrl = tempFormUrl + '&taskId=' + result.taskDefKey;
|
||||
}
|
||||
}
|
||||
return {
|
||||
formData,
|
||||
formUrl: tempFormUrl,
|
||||
isSignTask: result.isSignTask,
|
||||
assignee: result.assignee,
|
||||
taskIsHandel: result.taskIsHandel || false,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取历史任务信息
|
||||
*/
|
||||
async function getHistoryTaskInfo(record) {
|
||||
return await getTaskInfoForHistory(record);
|
||||
}
|
||||
|
||||
return {
|
||||
registerTable,
|
||||
reload,
|
||||
getTaskNodeInfo,
|
||||
getHistoryTaskInfo,
|
||||
};
|
||||
}
|
||||
|
||||
export async function getTaskInfoForHistory(record) {
|
||||
//查询条件
|
||||
const params = { procInstId: record.processInstanceId };
|
||||
const result = await taskNodeInfo('history', params);
|
||||
console.log('获取历史任务信息', result);
|
||||
const formData: any = {
|
||||
dataId: result.dataId,
|
||||
taskId: record.id,
|
||||
taskDefKey: record.taskId,
|
||||
procInsId: record.processInstanceId,
|
||||
tableName: result.tableName,
|
||||
vars: result.records,
|
||||
};
|
||||
let tempFormUrl = result.formUrl;
|
||||
console.log('获取流程节点表单URL', tempFormUrl);
|
||||
//节点配置表单URL,VUE组件类型对应的拓展参数
|
||||
if (tempFormUrl && tempFormUrl.indexOf('?') != -1 && !isURL(tempFormUrl) && tempFormUrl.indexOf('{{DOMAIN_URL}}') == -1) {
|
||||
tempFormUrl = result.formUrl.split('?')[0];
|
||||
console.log('获取流程节点表单URL(去掉参数)', tempFormUrl);
|
||||
formData.extendUrlParams = getQueryVariable(result.formUrl);
|
||||
}
|
||||
return {
|
||||
formData,
|
||||
formUrl: tempFormUrl,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取URL上参数
|
||||
* @param url
|
||||
*/
|
||||
function getQueryVariable(url) {
|
||||
if (!url) return;
|
||||
|
||||
let t,
|
||||
n,
|
||||
r,
|
||||
i = url.split('?')[1],
|
||||
s = {};
|
||||
(t = i.split('&')), (r = null), (n = null);
|
||||
for (const o in t) {
|
||||
const u = t[o].indexOf('=');
|
||||
u !== -1 && ((r = t[o].substr(0, u)), (n = t[o].substr(u + 1)), (s[r] = n));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL地址
|
||||
* @param {*} s
|
||||
*/
|
||||
function isURL(s) {
|
||||
return /^http[s]?:\/\/.*/.test(s);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 自适应宽度构造器
|
||||
*
|
||||
* @time 2022-4-8
|
||||
* @author sunjianlei
|
||||
*/
|
||||
import { ref } from 'vue';
|
||||
import { useDebounceFn, tryOnUnmounted } from '@vueuse/core';
|
||||
import { useEventListener } from '/@/hooks/event/useEventListener';
|
||||
|
||||
// key = js运算符+数字
|
||||
const defWidthConfig: configType = {
|
||||
'<=565': '100%',
|
||||
'<=1366': '800px',
|
||||
'<=1600': '600px',
|
||||
'<=1920': '600px',
|
||||
'>1920': '500px',
|
||||
};
|
||||
|
||||
type configType = Record<string, string | number>;
|
||||
|
||||
/**
|
||||
* 自适应宽度
|
||||
*
|
||||
* @param widthConfig 宽度配置,可参考 defWidthConfig 配置
|
||||
* @param assign 是否合并默认配置
|
||||
* @param debounce 去抖毫秒数
|
||||
*/
|
||||
export function useAdaptiveWidth(widthConfig = defWidthConfig, assign = true, debounce = 50) {
|
||||
const widthConfigAssign = assign ? Object.assign({}, defWidthConfig, widthConfig) : widthConfig;
|
||||
const configKeys = Object.keys(widthConfigAssign);
|
||||
|
||||
const adaptiveWidth = ref<string | number>();
|
||||
|
||||
/**
|
||||
* 进行计算宽度
|
||||
* @param innerWidth
|
||||
*/
|
||||
function calcWidth(innerWidth) {
|
||||
let width;
|
||||
for (const key of configKeys) {
|
||||
try {
|
||||
// 通过js运算
|
||||
let flag = new Function(`return ${innerWidth} ${key}`)();
|
||||
if (flag) {
|
||||
width = widthConfigAssign[key];
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
if (width) {
|
||||
adaptiveWidth.value = width;
|
||||
} else {
|
||||
console.warn('没有找到匹配的自适应宽度');
|
||||
}
|
||||
}
|
||||
|
||||
// 初始计算
|
||||
calcWidth(window.innerWidth);
|
||||
|
||||
// 监听 resize 事件
|
||||
const { removeEvent } = useEventListener({
|
||||
el: window,
|
||||
name: 'resize',
|
||||
listener: useDebounceFn(() => calcWidth(window.innerWidth), debounce),
|
||||
});
|
||||
// 卸载组件时取消监听事件
|
||||
tryOnUnmounted(() => removeEvent());
|
||||
|
||||
return { adaptiveWidth };
|
||||
}
|
||||
|
||||
/**
|
||||
* 抽屉自适应宽度
|
||||
*/
|
||||
export function useDrawerAdaptiveWidth() {
|
||||
return useAdaptiveWidth(
|
||||
{
|
||||
'<=620': '100%',
|
||||
'<=1600': 600,
|
||||
'<=1920': 650,
|
||||
'>1920': 700,
|
||||
},
|
||||
false
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import type { GlobConfig } from '/#/config';
|
||||
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
|
||||
export const useGlobSetting = (): Readonly<GlobConfig> => {
|
||||
const {
|
||||
VITE_GLOB_APP_TITLE,
|
||||
VITE_GLOB_API_URL,
|
||||
VITE_GLOB_APP_SHORT_NAME,
|
||||
VITE_GLOB_API_URL_PREFIX,
|
||||
VITE_GLOB_APP_CAS_BASE_URL,
|
||||
VITE_GLOB_APP_OPEN_SSO,
|
||||
VITE_GLOB_APP_OPEN_QIANKUN,
|
||||
VITE_GLOB_DOMAIN_URL,
|
||||
VITE_GLOB_ONLINE_VIEW_URL,
|
||||
VITE_GLOB_RUN_PLATFORM,
|
||||
|
||||
// 【JEECG作为乾坤子应用】
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_NAME,
|
||||
VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
|
||||
} = getAppEnvConfig();
|
||||
|
||||
// if (!/[a-zA-Z\_]*/.test(VITE_GLOB_APP_SHORT_NAME)) {
|
||||
// warn(
|
||||
// `VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`
|
||||
// );
|
||||
// }
|
||||
|
||||
// 短标题:替换shortName的下划线为空格
|
||||
const shortTitle = VITE_GLOB_APP_SHORT_NAME.replace(/_/g, " ");
|
||||
// Take global configuration
|
||||
const glob: Readonly<GlobConfig> = {
|
||||
title: VITE_GLOB_APP_TITLE,
|
||||
domainUrl: VITE_GLOB_DOMAIN_URL,
|
||||
apiUrl: VITE_GLOB_API_URL,
|
||||
shortName: VITE_GLOB_APP_SHORT_NAME,
|
||||
shortTitle: shortTitle,
|
||||
openSso: VITE_GLOB_APP_OPEN_SSO,
|
||||
openQianKun: VITE_GLOB_APP_OPEN_QIANKUN,
|
||||
casBaseUrl: VITE_GLOB_APP_CAS_BASE_URL,
|
||||
urlPrefix: VITE_GLOB_API_URL_PREFIX,
|
||||
uploadUrl: VITE_GLOB_DOMAIN_URL,
|
||||
viewUrl: VITE_GLOB_ONLINE_VIEW_URL,
|
||||
// 当前是否运行在 electron 平台
|
||||
isElectronPlatform: VITE_GLOB_RUN_PLATFORM === 'electron',
|
||||
|
||||
// 【JEECG作为乾坤子应用】是否以乾坤子应用模式启动
|
||||
isQiankunMicro: VITE_GLOB_QIANKUN_MICRO_APP_NAME != null && VITE_GLOB_QIANKUN_MICRO_APP_NAME !== '',
|
||||
// 【JEECG作为乾坤子应用】乾坤子应用入口
|
||||
qiankunMicroAppEntry: VITE_GLOB_QIANKUN_MICRO_APP_ENTRY,
|
||||
};
|
||||
|
||||
// 【JEECG作为乾坤子应用】乾坤子应用下,需要定义一下
|
||||
if (!window['_CONFIG']) {
|
||||
window['_CONFIG'] = {}
|
||||
}
|
||||
|
||||
// update-begin--author:sunjianlei---date:220250115---for:【QQYUN-10956】配置了自定义前缀,外部连接打不开,需要兼容处理
|
||||
let domainURL = VITE_GLOB_DOMAIN_URL;
|
||||
|
||||
// 如果不是以http(s)开头的,也不是以域名开头的,那么就是拼接当前域名
|
||||
if (!/^http(s)?/.test(domainURL) && !/^(\/\/)?(.*\.)?.+\..+/.test(domainURL)) {
|
||||
if (!domainURL.startsWith('/')) {
|
||||
domainURL = '/' + domainURL;
|
||||
}
|
||||
domainURL = window.location.origin + domainURL;
|
||||
}
|
||||
// update-end--author:sunjianlei---date:220250115---for:【QQYUN-10956】配置了自定义前缀,外部连接打不开,需要兼容处理
|
||||
|
||||
// @ts-ignore
|
||||
window._CONFIG['domianURL'] = domainURL;
|
||||
|
||||
return glob as Readonly<GlobConfig>;
|
||||
};
|
||||
@@ -0,0 +1,90 @@
|
||||
import type { HeaderSetting } from '/#/config';
|
||||
|
||||
import { computed, unref } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
|
||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||
import { useFullContent } from '/@/hooks/web/useFullContent';
|
||||
import { MenuModeEnum } from '/@/enums/menuEnum';
|
||||
|
||||
export function useHeaderSetting() {
|
||||
const { getFullContent } = useFullContent();
|
||||
const appStore = useAppStore();
|
||||
|
||||
const getShowFullHeaderRef = computed(() => {
|
||||
return !unref(getFullContent) && unref(getShowMixHeaderRef) && unref(getShowHeader) && !unref(getIsTopMenu) && !unref(getIsMixSidebar);
|
||||
});
|
||||
|
||||
const getUnFixedAndFull = computed(() => !unref(getFixed) && !unref(getShowFullHeaderRef));
|
||||
|
||||
const getShowInsetHeaderRef = computed(() => {
|
||||
const need = !unref(getFullContent) && unref(getShowHeader);
|
||||
return (need && !unref(getShowMixHeaderRef)) || (need && unref(getIsTopMenu)) || (need && unref(getIsMixSidebar));
|
||||
});
|
||||
|
||||
const { getMenuMode, getSplit, getShowHeaderTrigger, getIsSidebarType, getIsMixSidebar, getIsTopMenu } = useMenuSetting();
|
||||
const { getShowBreadCrumb, getShowLogo } = useRootSetting();
|
||||
|
||||
const getShowMixHeaderRef = computed(() => !unref(getIsSidebarType) && unref(getShowHeader));
|
||||
|
||||
const getShowDoc = computed(() => appStore.getHeaderSetting.showDoc);
|
||||
|
||||
const getHeaderTheme = computed(() => appStore.getHeaderSetting.theme);
|
||||
|
||||
const getShowHeader = computed(() => appStore.getHeaderSetting.show);
|
||||
|
||||
const getFixed = computed(() => appStore.getHeaderSetting.fixed);
|
||||
|
||||
const getHeaderBgColor = computed(() => appStore.getHeaderSetting.bgColor);
|
||||
|
||||
const getShowSearch = computed(() => appStore.getHeaderSetting.showSearch);
|
||||
|
||||
const getUseLockPage = computed(() => appStore.getHeaderSetting.useLockPage);
|
||||
|
||||
const getShowFullScreen = computed(() => appStore.getHeaderSetting.showFullScreen);
|
||||
|
||||
const getShowNotice = computed(() => appStore.getHeaderSetting.showNotice);
|
||||
|
||||
const getShowBread = computed(() => {
|
||||
return unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && unref(getShowBreadCrumb) && !unref(getSplit);
|
||||
});
|
||||
const getShowBreadTitle = computed(() => {
|
||||
return unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && !unref(getShowBreadCrumb) && !unref(getSplit);
|
||||
});
|
||||
|
||||
const getShowHeaderLogo = computed(() => {
|
||||
return unref(getShowLogo) && !unref(getIsSidebarType) && !unref(getIsMixSidebar);
|
||||
});
|
||||
|
||||
const getShowContent = computed(() => {
|
||||
return unref(getShowBread) || unref(getShowHeaderTrigger);
|
||||
});
|
||||
|
||||
// Set header configuration
|
||||
function setHeaderSetting(headerSetting: Partial<HeaderSetting>) {
|
||||
appStore.setProjectConfig({ headerSetting });
|
||||
}
|
||||
return {
|
||||
setHeaderSetting,
|
||||
|
||||
getShowDoc,
|
||||
getShowSearch,
|
||||
getHeaderTheme,
|
||||
getUseLockPage,
|
||||
getShowFullScreen,
|
||||
getShowNotice,
|
||||
getShowBread,
|
||||
getShowContent,
|
||||
getShowHeaderLogo,
|
||||
getShowHeader,
|
||||
getFixed,
|
||||
getShowMixHeaderRef,
|
||||
getShowFullHeaderRef,
|
||||
getShowInsetHeaderRef,
|
||||
getUnFixedAndFull,
|
||||
getHeaderBgColor,
|
||||
getShowBreadTitle
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
import type { MenuSetting } from '/#/config';
|
||||
|
||||
import { computed, unref, ref } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
import { SIDE_BAR_MINI_WIDTH, SIDE_BAR_SHOW_TIT_MINI_WIDTH } from '/@/enums/appEnum';
|
||||
import { MenuModeEnum, MenuTypeEnum, TriggerEnum } from '/@/enums/menuEnum';
|
||||
import { useFullContent } from '/@/hooks/web/useFullContent';
|
||||
|
||||
const mixSideHasChildren = ref(false);
|
||||
|
||||
export function useMenuSetting() {
|
||||
const { getFullContent: fullContent } = useFullContent();
|
||||
const appStore = useAppStore();
|
||||
|
||||
const getShowSidebar = computed(() => {
|
||||
return unref(getSplit) || (unref(getShowMenu) && unref(getMenuMode) !== MenuModeEnum.HORIZONTAL && !unref(fullContent));
|
||||
});
|
||||
|
||||
const getCollapsed = computed(() => appStore.getMenuSetting.collapsed);
|
||||
|
||||
const getMenuType = computed(() => appStore.getMenuSetting.type);
|
||||
|
||||
const getMenuMode = computed(() => appStore.getMenuSetting.mode);
|
||||
|
||||
const getMenuFixed = computed(() => appStore.getMenuSetting.fixed);
|
||||
|
||||
const getShowMenu = computed(() => appStore.getMenuSetting.show);
|
||||
|
||||
const getMenuHidden = computed(() => appStore.getMenuSetting.hidden);
|
||||
|
||||
const getMenuWidth = computed(() => appStore.getMenuSetting.menuWidth);
|
||||
|
||||
const getTrigger = computed(() => appStore.getMenuSetting.trigger);
|
||||
|
||||
const getMenuTheme = computed(() => appStore.getMenuSetting.theme);
|
||||
|
||||
const getSplit = computed(() => appStore.getMenuSetting.split);
|
||||
|
||||
const getMenuBgColor = computed(() => appStore.getMenuSetting.bgColor);
|
||||
|
||||
const getMixSideTrigger = computed(() => appStore.getMenuSetting.mixSideTrigger);
|
||||
|
||||
const getCanDrag = computed(() => appStore.getMenuSetting.canDrag);
|
||||
|
||||
const getAccordion = computed(() => appStore.getMenuSetting.accordion);
|
||||
|
||||
const getMixSideFixed = computed(() => appStore.getMenuSetting.mixSideFixed);
|
||||
|
||||
const getTopMenuAlign = computed(() => appStore.getMenuSetting.topMenuAlign);
|
||||
|
||||
const getCloseMixSidebarOnChange = computed(() => appStore.getMenuSetting.closeMixSidebarOnChange);
|
||||
|
||||
const getIsSidebarType = computed(() => unref(getMenuType) === MenuTypeEnum.SIDEBAR);
|
||||
|
||||
const getIsTopMenu = computed(() => unref(getMenuType) === MenuTypeEnum.TOP_MENU);
|
||||
|
||||
const getCollapsedShowTitle = computed(() => appStore.getMenuSetting.collapsedShowTitle);
|
||||
|
||||
const getShowTopMenu = computed(() => {
|
||||
return unref(getMenuMode) === MenuModeEnum.HORIZONTAL || unref(getSplit);
|
||||
});
|
||||
|
||||
const getShowHeaderTrigger = computed(() => {
|
||||
if (unref(getMenuType) === MenuTypeEnum.TOP_MENU || !unref(getShowMenu) || unref(getMenuHidden)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return unref(getTrigger) === TriggerEnum.HEADER;
|
||||
});
|
||||
|
||||
const getIsHorizontal = computed(() => {
|
||||
return unref(getMenuMode) === MenuModeEnum.HORIZONTAL;
|
||||
});
|
||||
|
||||
const getIsMixSidebar = computed(() => {
|
||||
return unref(getMenuType) === MenuTypeEnum.MIX_SIDEBAR;
|
||||
});
|
||||
|
||||
const getIsMixMode = computed(() => {
|
||||
return unref(getMenuMode) === MenuModeEnum.INLINE && unref(getMenuType) === MenuTypeEnum.MIX;
|
||||
});
|
||||
|
||||
const getRealWidth = computed(() => {
|
||||
if (unref(getIsMixSidebar)) {
|
||||
// update-begin--author:liaozhiyang---date:20240407---for:【QQYUN-8774】侧边混合导航菜单宽度调整
|
||||
return unref(getCollapsed) && !unref(getMixSideFixed) ? unref(getMiniWidthNumber) : unref(getMenuWidth) - 60;
|
||||
// update-end--author:liaozhiyang---date:20240407---for:【QQYUN-8774】侧边混合导航菜单宽度调整
|
||||
}
|
||||
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
|
||||
});
|
||||
|
||||
const getMiniWidthNumber = computed(() => {
|
||||
const { collapsedShowTitle } = appStore.getMenuSetting;
|
||||
return collapsedShowTitle ? SIDE_BAR_SHOW_TIT_MINI_WIDTH : SIDE_BAR_MINI_WIDTH;
|
||||
});
|
||||
|
||||
const getCalcContentWidth = computed(() => {
|
||||
const width =
|
||||
unref(getIsTopMenu) || !unref(getShowMenu) || (unref(getSplit) && unref(getMenuHidden))
|
||||
? 0
|
||||
: unref(getIsMixSidebar)
|
||||
? (unref(getCollapsed) ? SIDE_BAR_MINI_WIDTH : SIDE_BAR_SHOW_TIT_MINI_WIDTH) +
|
||||
(unref(getMixSideFixed) && unref(mixSideHasChildren) ? unref(getRealWidth) : 0)
|
||||
: unref(getRealWidth);
|
||||
|
||||
return `calc(100% - ${unref(width)}px)`;
|
||||
});
|
||||
|
||||
// Set menu configuration
|
||||
function setMenuSetting(menuSetting: Partial<MenuSetting>): void {
|
||||
appStore.setProjectConfig({ menuSetting });
|
||||
}
|
||||
|
||||
function toggleCollapsed() {
|
||||
setMenuSetting({
|
||||
collapsed: !unref(getCollapsed),
|
||||
});
|
||||
}
|
||||
return {
|
||||
setMenuSetting,
|
||||
|
||||
toggleCollapsed,
|
||||
|
||||
getMenuFixed,
|
||||
getRealWidth,
|
||||
getMenuType,
|
||||
getMenuMode,
|
||||
getShowMenu,
|
||||
getCollapsed,
|
||||
getMiniWidthNumber,
|
||||
getCalcContentWidth,
|
||||
getMenuWidth,
|
||||
getTrigger,
|
||||
getSplit,
|
||||
getMenuTheme,
|
||||
getCanDrag,
|
||||
getCollapsedShowTitle,
|
||||
getIsHorizontal,
|
||||
getIsSidebarType,
|
||||
getAccordion,
|
||||
getShowTopMenu,
|
||||
getShowHeaderTrigger,
|
||||
getTopMenuAlign,
|
||||
getMenuHidden,
|
||||
getIsTopMenu,
|
||||
getMenuBgColor,
|
||||
getShowSidebar,
|
||||
getIsMixMode,
|
||||
getIsMixSidebar,
|
||||
getCloseMixSidebarOnChange,
|
||||
getMixSideTrigger,
|
||||
getMixSideFixed,
|
||||
mixSideHasChildren,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import type { MultiTabsSetting } from '/#/config';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
export function useMultipleTabSetting() {
|
||||
const appStore = useAppStore();
|
||||
|
||||
const getShowMultipleTab = computed(() => appStore.getMultiTabsSetting.show);
|
||||
|
||||
const getShowQuick = computed(() => appStore.getMultiTabsSetting.showQuick);
|
||||
|
||||
const getShowRedo = computed(() => appStore.getMultiTabsSetting.showRedo);
|
||||
|
||||
const getShowFold = computed(() => appStore.getMultiTabsSetting.showFold);
|
||||
|
||||
// 获取标签页样式
|
||||
const getTabsTheme = computed(() => appStore.getMultiTabsSetting.theme);
|
||||
|
||||
function setMultipleTabSetting(multiTabsSetting: Partial<MultiTabsSetting>) {
|
||||
appStore.setProjectConfig({ multiTabsSetting });
|
||||
}
|
||||
return {
|
||||
setMultipleTabSetting,
|
||||
getShowMultipleTab,
|
||||
getShowQuick,
|
||||
getShowRedo,
|
||||
getShowFold,
|
||||
getTabsTheme,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
import type { ProjectConfig } from '/#/config';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
import { ContentEnum, ThemeEnum } from '/@/enums/appEnum';
|
||||
|
||||
type RootSetting = Omit<ProjectConfig, 'locale' | 'headerSetting' | 'menuSetting' | 'multiTabsSetting'>;
|
||||
|
||||
export function useRootSetting() {
|
||||
const appStore = useAppStore();
|
||||
|
||||
const getPageLoading = computed(() => appStore.getPageLoading);
|
||||
|
||||
const getOpenKeepAlive = computed(() => appStore.getProjectConfig.openKeepAlive);
|
||||
|
||||
const getSettingButtonPosition = computed(() => appStore.getProjectConfig.settingButtonPosition);
|
||||
|
||||
const getCanEmbedIFramePage = computed(() => appStore.getProjectConfig.canEmbedIFramePage);
|
||||
|
||||
const getPermissionMode = computed(() => appStore.getProjectConfig.permissionMode);
|
||||
|
||||
const getShowLogo = computed(() => appStore.getProjectConfig.showLogo);
|
||||
|
||||
const getContentMode = computed(() => appStore.getProjectConfig.contentMode);
|
||||
|
||||
const getUseOpenBackTop = computed(() => appStore.getProjectConfig.useOpenBackTop);
|
||||
|
||||
const getShowSettingButton = computed(() => appStore.getProjectConfig.showSettingButton);
|
||||
|
||||
const getUseErrorHandle = computed(() => appStore.getProjectConfig.useErrorHandle);
|
||||
|
||||
const getShowFooter = computed(() => appStore.getProjectConfig.showFooter);
|
||||
|
||||
const getShowBreadCrumb = computed(() => appStore.getProjectConfig.showBreadCrumb);
|
||||
|
||||
const getThemeColor = computed(() => appStore.getProjectConfig.themeColor);
|
||||
|
||||
const getShowBreadCrumbIcon = computed(() => appStore.getProjectConfig.showBreadCrumbIcon);
|
||||
|
||||
const getFullContent = computed(() => appStore.getProjectConfig.fullContent);
|
||||
|
||||
const getColorWeak = computed(() => appStore.getProjectConfig.colorWeak);
|
||||
|
||||
const getGrayMode = computed(() => appStore.getProjectConfig.grayMode);
|
||||
// update-begin--author:liaozhiyang---date:20250407---for:【QQYUN-10952】AI助手支持通过设置来配置是否显示
|
||||
const getAiIconShow = computed(() => appStore.getProjectConfig.aiIconShow);
|
||||
// update-end--author:liaozhiyang---date:20250407---for:【QQYUN-10952】AI助手支持通过设置来配置是否显示
|
||||
const getLockTime = computed(() => appStore.getProjectConfig.lockTime);
|
||||
|
||||
const getShowDarkModeToggle = computed(() => appStore.getProjectConfig.showDarkModeToggle);
|
||||
|
||||
const getDarkMode = computed(() => appStore.getDarkMode);
|
||||
|
||||
const getLayoutContentMode = computed(() => (appStore.getProjectConfig.contentMode === ContentEnum.FULL ? ContentEnum.FULL : ContentEnum.FIXED));
|
||||
|
||||
function setRootSetting(setting: Partial<RootSetting>) {
|
||||
appStore.setProjectConfig(setting);
|
||||
}
|
||||
|
||||
function setDarkMode(mode: ThemeEnum) {
|
||||
appStore.setDarkMode(mode);
|
||||
}
|
||||
return {
|
||||
setRootSetting,
|
||||
|
||||
getSettingButtonPosition,
|
||||
getFullContent,
|
||||
getColorWeak,
|
||||
getGrayMode,
|
||||
getLayoutContentMode,
|
||||
getPageLoading,
|
||||
getOpenKeepAlive,
|
||||
getCanEmbedIFramePage,
|
||||
getPermissionMode,
|
||||
getShowLogo,
|
||||
getUseErrorHandle,
|
||||
getShowBreadCrumb,
|
||||
getShowBreadCrumbIcon,
|
||||
getUseOpenBackTop,
|
||||
getShowSettingButton,
|
||||
getShowFooter,
|
||||
getContentMode,
|
||||
getLockTime,
|
||||
getThemeColor,
|
||||
getDarkMode,
|
||||
setDarkMode,
|
||||
getShowDarkModeToggle,
|
||||
getAiIconShow,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { TransitionSetting } from '/#/config';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
export function useTransitionSetting() {
|
||||
const appStore = useAppStore();
|
||||
|
||||
const getEnableTransition = computed(() => appStore.getTransitionSetting?.enable);
|
||||
|
||||
const getOpenNProgress = computed(() => appStore.getTransitionSetting?.openNProgress);
|
||||
|
||||
const getOpenPageLoading = computed((): boolean => {
|
||||
return !!appStore.getTransitionSetting?.openPageLoading;
|
||||
});
|
||||
|
||||
const getBasicTransition = computed(() => appStore.getTransitionSetting?.basicTransition);
|
||||
|
||||
function setTransitionSetting(transitionSetting: Partial<TransitionSetting>) {
|
||||
appStore.setProjectConfig({ transitionSetting });
|
||||
}
|
||||
return {
|
||||
setTransitionSetting,
|
||||
|
||||
getEnableTransition,
|
||||
getOpenNProgress,
|
||||
getOpenPageLoading,
|
||||
getBasicTransition,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { ref } from 'vue';
|
||||
import { ScreenSizeEnum } from '/@/enums/sizeEnum';
|
||||
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
|
||||
// 定义 useAdapt 方法参数
|
||||
interface AdaptOptions {
|
||||
// xl>1200
|
||||
xl?: string | number;
|
||||
// xl>992
|
||||
lg?: string | number;
|
||||
// xl>768
|
||||
md?: string | number;
|
||||
// xl>576
|
||||
sm?: string | number;
|
||||
// xl>480
|
||||
xs?: string | number;
|
||||
//xl<480默认值
|
||||
mindef?: string | number;
|
||||
//默认值
|
||||
def?: string | number;
|
||||
}
|
||||
export function useAdapt(props?: AdaptOptions) {
|
||||
//默认宽度
|
||||
const width = ref<string | number>(props?.def || '600px');
|
||||
//获取宽度
|
||||
useWindowSizeFn(calcWidth, 100, { immediate: true });
|
||||
//计算宽度
|
||||
function calcWidth() {
|
||||
let windowWidth = document.documentElement.clientWidth;
|
||||
switch (true) {
|
||||
case windowWidth > ScreenSizeEnum.XL:
|
||||
width.value = props?.xl || '600px';
|
||||
break;
|
||||
case windowWidth > ScreenSizeEnum.LG:
|
||||
width.value = props?.lg || '600px';
|
||||
break;
|
||||
case windowWidth > ScreenSizeEnum.MD:
|
||||
width.value = props?.md || '600px';
|
||||
break;
|
||||
case windowWidth > ScreenSizeEnum.SM:
|
||||
width.value = props?.sm || '500px';
|
||||
break;
|
||||
case windowWidth > ScreenSizeEnum.XS:
|
||||
width.value = props?.xs || '400px';
|
||||
break;
|
||||
default:
|
||||
width.value = props?.mindef || '300px';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return { width, calcWidth };
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { ref, unref } from 'vue';
|
||||
import { VALIDATE_FAILED, validateFormModelAndTables } from '/@/utils/common/vxeUtils';
|
||||
|
||||
export function useJvxeMethod(requestAddOrEdit, classifyIntoFormData, tableRefs, activeKey, refKeys, validateSubForm?) {
|
||||
const formRef = ref();
|
||||
/** 查询某个tab的数据 */
|
||||
function requestSubTableData(url, params, tab, success) {
|
||||
tab.loading = true;
|
||||
defHttp
|
||||
.get({ url, params }, { isTransformResponse: false })
|
||||
.then((res) => {
|
||||
let { result } = res;
|
||||
if (res.success && result) {
|
||||
if (Array.isArray(result)) {
|
||||
tab.dataSource = result;
|
||||
} else if (Array.isArray(result.records)) {
|
||||
tab.dataSource = result.records;
|
||||
}
|
||||
}
|
||||
typeof success === 'function' ? success(res) : '';
|
||||
})
|
||||
.finally(() => {
|
||||
tab.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
/* --- handle 事件 --- */
|
||||
|
||||
/** ATab 选项卡切换事件 */
|
||||
function handleChangeTabs(key) {
|
||||
// 自动重置scrollTop状态,防止出现白屏
|
||||
tableRefs[key]?.value?.resetScrollTop(0);
|
||||
}
|
||||
|
||||
/** 获取所有的editableTable实例*/
|
||||
function getAllTable() {
|
||||
let values = Object.values(tableRefs);
|
||||
return Promise.all(values);
|
||||
}
|
||||
/** 确定按钮点击事件 */
|
||||
function handleSubmit() {
|
||||
/** 触发表单验证 */
|
||||
getAllTable()
|
||||
.then((tables) => {
|
||||
let values = formRef.value.getFieldsValue();
|
||||
return validateFormModelAndTables(formRef.value.validate, values, tables, formRef.value.getProps, false);
|
||||
})
|
||||
.then((allValues) => {
|
||||
/** 一次性验证一对一的所有子表 */
|
||||
return validateSubForm && typeof validateSubForm === 'function' ? validateSubForm(allValues) : validateAllSubOne(allValues);
|
||||
})
|
||||
.then((allValues) => {
|
||||
if (typeof classifyIntoFormData !== 'function') {
|
||||
throw throwNotFunction('classifyIntoFormData');
|
||||
}
|
||||
let formData = classifyIntoFormData(allValues);
|
||||
// 发起请求
|
||||
return requestAddOrEdit(formData);
|
||||
})
|
||||
.catch((e) => {
|
||||
if (e.error === VALIDATE_FAILED) {
|
||||
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|
||||
//update-begin-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
|
||||
if(e.paneKey){
|
||||
activeKey.value = e.paneKey
|
||||
}else{
|
||||
//update-begin-author:liusq date:2024-06-12 for: TV360X-478 一对多tab,校验未通过时,tab没有跳转
|
||||
activeKey.value = e.subIndex == null ? (e.index == null ? unref(activeKey) : refKeys.value[e.index]) : Object.keys(tableRefs)[e.subIndex];
|
||||
//update-end-author:liusq date:2024-06-12 for: TV360X-478 一对多tab,校验未通过时,tab没有跳转
|
||||
}
|
||||
//update-end-author:taoyan date:2022-11-22 for: VUEN-2866【代码生成】Tab风格 一对多子表校验不通过时,点击提交表单空白了,流程附加页面也有此问题
|
||||
//update-begin---author:wangshuai---date:2024-06-17---for:【TV360X-1064】非原生提交表单滚动校验没通过的项---
|
||||
if (e?.errorFields) {
|
||||
const firstField = e.errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'end' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(e?.errorFields);
|
||||
//update-end---author:wangshuai---date:2024-06-17---for:【TV360X-1064】非原生提交表单滚动校验没通过的项---
|
||||
} else {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
//校验所有子表表单
|
||||
function validateAllSubOne(allValues) {
|
||||
return new Promise((resolve) => {
|
||||
resolve(allValues);
|
||||
});
|
||||
}
|
||||
/* --- throw --- */
|
||||
|
||||
/** not a function */
|
||||
function throwNotFunction(name) {
|
||||
return `${name} 未定义或不是一个函数`;
|
||||
}
|
||||
|
||||
/** not a array */
|
||||
function throwNotArray(name) {
|
||||
return `${name} 未定义或不是一个数组`;
|
||||
}
|
||||
return [handleChangeTabs, handleSubmit, requestSubTableData, formRef];
|
||||
}
|
||||
|
||||
//update-begin-author:taoyan date:2022-6-16 for: 代码生成-原生表单用
|
||||
/**
|
||||
* 校验多个表单和子表table,用于原生的antd-vue的表单
|
||||
* @param activeKey 子表表单/vxe-table 所在tabs的 activeKey
|
||||
* @param refMap 子表表单/vxe-table对应的ref对象 map结构
|
||||
* 示例:
|
||||
* useValidateAntFormAndTable(activeKey, {
|
||||
* 'tableA': tableARef,
|
||||
* 'formB': formBRef
|
||||
* })
|
||||
*/
|
||||
export function useValidateAntFormAndTable(activeKey, refMap) {
|
||||
/**
|
||||
* 获取所有子表数据
|
||||
*/
|
||||
async function getSubFormAndTableData() {
|
||||
let formData = {};
|
||||
let all = Object.keys(refMap);
|
||||
let key = '';
|
||||
for (let i = 0; i < all.length; i++) {
|
||||
key = all[i];
|
||||
let instance = refMap[key].value;
|
||||
if (instance.isForm) {
|
||||
let subFormData = await validateFormAndGetData(instance, key);
|
||||
if (subFormData) {
|
||||
formData[key + 'List'] = [subFormData];
|
||||
}
|
||||
} else {
|
||||
let arr = await validateTableAndGetData(instance, key);
|
||||
if (arr && arr.length > 0) {
|
||||
formData[key + 'List'] = arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return formData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换数据用 如果有数组转成逗号分割的格式
|
||||
* @param data
|
||||
*/
|
||||
function transformData(data) {
|
||||
if (data) {
|
||||
Object.keys(data).map((k) => {
|
||||
if (data[k] instanceof Array) {
|
||||
data[k] = data[k].join(',');
|
||||
}
|
||||
});
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 子表table
|
||||
* @param instance
|
||||
* @param key
|
||||
*/
|
||||
async function validateTableAndGetData(instance, key) {
|
||||
const errors = await instance.validateTable();
|
||||
if (!errors) {
|
||||
return instance.getTableData();
|
||||
} else {
|
||||
activeKey.value = key;
|
||||
// 自动重置scrollTop状态,防止出现白屏
|
||||
instance.resetScrollTop(0);
|
||||
return Promise.reject(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 子表表单
|
||||
* @param instance
|
||||
* @param key
|
||||
*/
|
||||
async function validateFormAndGetData(instance, key) {
|
||||
try {
|
||||
let data = await instance.getFormData();
|
||||
transformData(data);
|
||||
return data;
|
||||
} catch (e) {
|
||||
activeKey.value = key;
|
||||
return Promise.reject(e);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
getSubFormAndTableData,
|
||||
transformData,
|
||||
};
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-16 for: 代码生成-原生表单用
|
||||
@@ -0,0 +1,365 @@
|
||||
import { reactive, ref, Ref, unref } from 'vue';
|
||||
import { merge } from 'lodash-es';
|
||||
import { DynamicProps } from '/#/utils';
|
||||
import { BasicTableProps, TableActionType, useTable } from '/@/components/Table';
|
||||
import { ColEx } from '/@/components/Form/src/types';
|
||||
import { FormActionType } from '/@/components/Form';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useMethods } from '/@/hooks/system/useMethods';
|
||||
import { useDesign } from '/@/hooks/web/useDesign';
|
||||
import { filterObj } from '/@/utils/common/compUtils';
|
||||
import { isFunction } from '@/utils/is';
|
||||
const { handleExportXls, handleImportXls } = useMethods();
|
||||
|
||||
// 定义 useListPage 方法所需参数
|
||||
interface ListPageOptions {
|
||||
// 样式作用域范围
|
||||
designScope?: string;
|
||||
// 【必填】表格参数配置
|
||||
tableProps: TableProps;
|
||||
// 是否分页
|
||||
pagination?: boolean;
|
||||
// 导出配置
|
||||
exportConfig?: {
|
||||
url: string | (() => string);
|
||||
// 导出文件名
|
||||
name?: string | (() => string);
|
||||
//导出参数
|
||||
params?: object | (() => object);
|
||||
};
|
||||
// 导入配置
|
||||
importConfig?: {
|
||||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
|
||||
url: string | (() => string);
|
||||
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
|
||||
// 导出成功后的回调
|
||||
success?: (fileInfo?: any) => void;
|
||||
};
|
||||
}
|
||||
|
||||
interface IDoRequestOptions {
|
||||
// 是否显示确认对话框,默认 true
|
||||
confirm?: boolean;
|
||||
// 是否自动刷新表格,默认 true
|
||||
reload?: boolean;
|
||||
// 是否自动清空选择,默认 true
|
||||
clearSelection?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* listPage页面公共方法
|
||||
*
|
||||
* @param options
|
||||
*/
|
||||
export function useListPage(options: ListPageOptions) {
|
||||
const $message = useMessage();
|
||||
let $design = {} as ReturnType<typeof useDesign>;
|
||||
if (options.designScope) {
|
||||
$design = useDesign(options.designScope);
|
||||
}
|
||||
|
||||
const tableContext = useListTable(options.tableProps);
|
||||
|
||||
const [, { getForm, reload, setLoading }, { selectedRowKeys }] = tableContext;
|
||||
|
||||
// 导出 excel
|
||||
async function onExportXls() {
|
||||
//update-begin---author:wangshuai ---date:20220411 for:导出新增自定义参数------------
|
||||
let { url, name, params } = options?.exportConfig ?? {};
|
||||
let realUrl = typeof url === 'function' ? url() : url;
|
||||
if (realUrl) {
|
||||
let title = typeof name === 'function' ? name() : name;
|
||||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
|
||||
let paramsForm:any = {};
|
||||
try {
|
||||
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
//当useSearchFor不等于false的时候,才去触发validate
|
||||
if (options?.tableProps?.useSearchForm !== false) {
|
||||
paramsForm = await getForm().validate();
|
||||
console.log('paramsForm', paramsForm);
|
||||
}
|
||||
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
}
|
||||
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
|
||||
|
||||
//update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
|
||||
if(!paramsForm?.column){
|
||||
Object.assign(paramsForm,{column:'createTime',order:'desc'});
|
||||
}
|
||||
//update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
|
||||
|
||||
//如果参数不为空,则整合到一起
|
||||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
|
||||
if (params) {
|
||||
//update-begin-author:liusq---date:2025-03-20--for: [QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
const realParams = isFunction(params) ? await params() : { ...(params || {}) };
|
||||
//update-end-author:liusq---date:2025-03-20--for:[QQYUN-11627]代码生成原生表单,数据导出,前端报错,并且范围参数没有转换 #7962
|
||||
Object.keys(realParams).map((k) => {
|
||||
let temp = (realParams as object)[k];
|
||||
if (temp) {
|
||||
paramsForm[k] = unref(temp);
|
||||
}
|
||||
});
|
||||
}
|
||||
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
|
||||
if (selectedRowKeys.value && selectedRowKeys.value.length > 0) {
|
||||
paramsForm['selections'] = selectedRowKeys.value.join(',');
|
||||
}
|
||||
console.log()
|
||||
return handleExportXls(title as string, realUrl, filterObj(paramsForm));
|
||||
//update-end---author:wangshuai ---date:20220411 for:导出新增自定义参数--------------
|
||||
} else {
|
||||
$message.createMessage.warn('没有传递 exportConfig.url 参数');
|
||||
return Promise.reject();
|
||||
}
|
||||
}
|
||||
|
||||
// 导入 excel
|
||||
function onImportXls(file) {
|
||||
let { url, success } = options?.importConfig ?? {};
|
||||
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
|
||||
let realUrl = typeof url === 'function' ? url() : url;
|
||||
if (realUrl) {
|
||||
return handleImportXls(file, realUrl, success || reload);
|
||||
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
|
||||
} else {
|
||||
$message.createMessage.warn('没有传递 importConfig.url 参数');
|
||||
return Promise.reject();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用请求处理方法,可自动刷新表格,自动清空选择
|
||||
* @param api 请求api
|
||||
* @param options 是否显示确认框
|
||||
*/
|
||||
function doRequest(api: () => Promise<any>, options?: IDoRequestOptions) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const execute = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const res = await api();
|
||||
if (options?.reload ?? true) {
|
||||
reload();
|
||||
}
|
||||
if (options?.clearSelection ?? true) {
|
||||
selectedRowKeys.value = [];
|
||||
}
|
||||
resolve(res);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
if (options?.confirm ?? true) {
|
||||
$message.createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '删除',
|
||||
content: '确定要删除吗?',
|
||||
onOk: () => execute(),
|
||||
onCancel: () => reject(),
|
||||
});
|
||||
} else {
|
||||
execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 执行单个删除操作 */
|
||||
function doDeleteRecord(api: () => Promise<any>) {
|
||||
return doRequest(api, { confirm: false, clearSelection: false });
|
||||
}
|
||||
|
||||
return {
|
||||
...$design,
|
||||
...$message,
|
||||
onExportXls,
|
||||
onImportXls,
|
||||
doRequest,
|
||||
doDeleteRecord,
|
||||
tableContext,
|
||||
};
|
||||
}
|
||||
|
||||
// 定义表格所需参数
|
||||
type TableProps = Partial<DynamicProps<BasicTableProps>>;
|
||||
type UseTableMethod = TableActionType & {
|
||||
getForm: () => FormActionType;
|
||||
};
|
||||
|
||||
/**
|
||||
* useListTable 列表页面标准表格参数
|
||||
*
|
||||
* @param tableProps 表格参数
|
||||
*/
|
||||
export function useListTable(tableProps: TableProps): [
|
||||
(instance: TableActionType, formInstance: UseTableMethod) => void,
|
||||
TableActionType & {
|
||||
getForm: () => FormActionType;
|
||||
},
|
||||
{
|
||||
rowSelection: any;
|
||||
selectedRows: Ref<Recordable[]>;
|
||||
selectedRowKeys: Ref<any[]>;
|
||||
}
|
||||
] {
|
||||
// 自适应列配置
|
||||
const adaptiveColProps: Partial<ColEx> = {
|
||||
xs: 24, // <576px
|
||||
sm: 12, // ≥576px
|
||||
md: 12, // ≥768px
|
||||
lg: 8, // ≥992px
|
||||
xl: 8, // ≥1200px
|
||||
xxl: 6, // ≥1600px
|
||||
};
|
||||
const defaultTableProps: TableProps = {
|
||||
rowKey: 'id',
|
||||
// 使用查询条件区域
|
||||
useSearchForm: true,
|
||||
// 查询条件区域配置
|
||||
formConfig: {
|
||||
// 紧凑模式
|
||||
compact: true,
|
||||
// label默认宽度
|
||||
// labelWidth: 120,
|
||||
// 按下回车后自动提交
|
||||
autoSubmitOnEnter: true,
|
||||
// 默认 row 配置
|
||||
rowProps: { gutter: 8 },
|
||||
// 默认 col 配置
|
||||
baseColProps: {
|
||||
...adaptiveColProps,
|
||||
},
|
||||
labelCol: {
|
||||
xs: 24,
|
||||
sm: 8,
|
||||
md: 6,
|
||||
lg: 8,
|
||||
xl: 6,
|
||||
xxl: 6,
|
||||
},
|
||||
wrapperCol: {},
|
||||
// 是否显示 展开/收起 按钮
|
||||
showAdvancedButton: true,
|
||||
// 超过指定列数默认折叠
|
||||
autoAdvancedCol: 3,
|
||||
// 操作按钮配置
|
||||
actionColOptions: {
|
||||
...adaptiveColProps,
|
||||
style: { textAlign: 'left' },
|
||||
},
|
||||
},
|
||||
// 斑马纹
|
||||
striped: false,
|
||||
// 是否可以自适应高度
|
||||
canResize: true,
|
||||
// 表格最小高度
|
||||
// update-begin--author:liaozhiyang---date:20240603---for【TV360X-861】列表查询区域不可往上滚动
|
||||
minHeight: 300,
|
||||
// update-end--author:liaozhiyang---date:20240603---for【TV360X-861】列表查询区域不可往上滚动
|
||||
// 点击行选中
|
||||
clickToRowSelect: false,
|
||||
// 是否显示边框
|
||||
bordered: true,
|
||||
// 是否显示序号列
|
||||
showIndexColumn: false,
|
||||
// 显示表格设置
|
||||
showTableSetting: true,
|
||||
// 表格全屏设置
|
||||
tableSetting: {
|
||||
fullScreen: false,
|
||||
},
|
||||
// 是否显示操作列
|
||||
showActionColumn: true,
|
||||
// 操作列
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
title: '操作',
|
||||
//是否锁定操作列取值 right ,left,false
|
||||
fixed: false,
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
};
|
||||
// 合并用户个性化配置
|
||||
if (tableProps) {
|
||||
//update-begin---author:wangshuai---date:2024-04-28---for:【issues/6180】前端代码配置表变查询条件显示列不生效---
|
||||
if(tableProps.formConfig){
|
||||
setTableProps(tableProps.formConfig);
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-04-28---for:【issues/6180】前端代码配置表变查询条件显示列不生效---
|
||||
// merge 方法可深度合并对象
|
||||
merge(defaultTableProps, tableProps);
|
||||
}
|
||||
|
||||
// 发送请求之前调用的方法
|
||||
function beforeFetch(params) {
|
||||
// 默认以 createTime 降序排序
|
||||
return Object.assign({ column: 'createTime', order: 'desc' }, params);
|
||||
}
|
||||
|
||||
// 合并方法
|
||||
Object.assign(defaultTableProps, { beforeFetch });
|
||||
if (typeof tableProps.beforeFetch === 'function') {
|
||||
defaultTableProps.beforeFetch = function (params) {
|
||||
params = beforeFetch(params);
|
||||
// @ts-ignore
|
||||
tableProps.beforeFetch(params);
|
||||
return params;
|
||||
};
|
||||
}
|
||||
|
||||
// 当前选择的行
|
||||
const selectedRowKeys = ref<any[]>([]);
|
||||
// 选择的行记录
|
||||
const selectedRows = ref<Recordable[]>([]);
|
||||
|
||||
// 表格选择列配置
|
||||
const rowSelection: any = tableProps?.rowSelection ?? {};
|
||||
const defaultRowSelection = reactive({
|
||||
...rowSelection,
|
||||
type: rowSelection.type ?? 'checkbox',
|
||||
// 选择列宽度,默认 50
|
||||
columnWidth: rowSelection.columnWidth ?? 50,
|
||||
selectedRows: selectedRows,
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange(...args) {
|
||||
selectedRowKeys.value = args[0];
|
||||
selectedRows.value = args[1];
|
||||
if (typeof rowSelection.onChange === 'function') {
|
||||
rowSelection.onChange(...args);
|
||||
}
|
||||
},
|
||||
});
|
||||
delete defaultTableProps.rowSelection;
|
||||
|
||||
/**
|
||||
* 设置表格参数
|
||||
*
|
||||
* @param formConfig
|
||||
*/
|
||||
function setTableProps(formConfig: any) {
|
||||
const replaceAttributeArray: string[] = ['baseColProps','labelCol'];
|
||||
for (let item of replaceAttributeArray) {
|
||||
if(formConfig && formConfig[item]){
|
||||
if(defaultTableProps.formConfig){
|
||||
let defaultFormConfig:any = defaultTableProps.formConfig;
|
||||
defaultFormConfig[item] = formConfig[item];
|
||||
}
|
||||
formConfig[item] = {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
...useTable(defaultTableProps),
|
||||
{
|
||||
selectedRows,
|
||||
selectedRowKeys,
|
||||
rowSelection: defaultRowSelection,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
|
||||
const { createMessage, createWarningModal } = useMessage();
|
||||
const glob = useGlobSetting();
|
||||
|
||||
/**
|
||||
* 导出文件xlsx的mime-type
|
||||
*/
|
||||
export const XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
||||
/**
|
||||
* 导出文件xlsx的文件后缀
|
||||
*/
|
||||
export const XLSX_FILE_SUFFIX = '.xlsx';
|
||||
|
||||
export function useMethods() {
|
||||
/**
|
||||
* 导出xls
|
||||
* @param name
|
||||
* @param url
|
||||
*/
|
||||
async function exportXls(name, url, params, isXlsx = false) {
|
||||
//update-begin---author:wangshuai---date:2024-01-25---for:【QQYUN-8118】导出超时时间设置长点---
|
||||
const data = await defHttp.get({ url: url, params: params, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
||||
//update-end---author:wangshuai---date:2024-01-25---for:【QQYUN-8118】导出超时时间设置长点---
|
||||
if (!data) {
|
||||
createMessage.warning('文件下载失败');
|
||||
return;
|
||||
}
|
||||
//update-begin---author:wangshuai---date:2024-04-18---for: 导出excel失败提示,不进行导出---
|
||||
let reader = new FileReader()
|
||||
reader.readAsText(data, 'utf-8')
|
||||
reader.onload = async () => {
|
||||
if(reader.result){
|
||||
if(reader.result.toString().indexOf("success") !=-1){
|
||||
// update-begin---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 ---
|
||||
try {
|
||||
const { success, message } = JSON.parse(reader.result.toString());
|
||||
if (!success) {
|
||||
createMessage.warning('导出失败,失败原因:' + message);
|
||||
} else {
|
||||
exportExcel(name, isXlsx, data);
|
||||
}
|
||||
return;
|
||||
} catch (error) {
|
||||
exportExcel(name, isXlsx, data);
|
||||
}
|
||||
// update-end---author:liaozhiyang---date:2025-02-11---for:【issues/7738】文件中带"success"导出报错 ---
|
||||
}
|
||||
}
|
||||
exportExcel(name, isXlsx, data);
|
||||
//update-end---author:wangshuai---date:2024-04-18---for: 导出excel失败提示,不进行导出---
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入xls
|
||||
* @param data 导入的数据
|
||||
* @param url
|
||||
* @param success 成功后的回调
|
||||
*/
|
||||
async function importXls(data, url, success) {
|
||||
const isReturn = (fileInfo) => {
|
||||
try {
|
||||
if (fileInfo.code === 201) {
|
||||
let {
|
||||
message,
|
||||
result: { msg, fileUrl, fileName },
|
||||
} = fileInfo;
|
||||
let href = glob.uploadUrl + fileUrl;
|
||||
createWarningModal({
|
||||
title: message,
|
||||
centered: false,
|
||||
content: `<div>
|
||||
<span>${msg}</span><br/>
|
||||
<span>具体详情请<a href = ${href} download = ${fileName}> 点击下载 </a> </span>
|
||||
</div>`,
|
||||
});
|
||||
//update-begin---author:wangshuai ---date:20221121 for:[VUEN-2827]导入无权限,提示图标错误------------
|
||||
} else if (fileInfo.code === 500 || fileInfo.code === 510) {
|
||||
createMessage.error(fileInfo.message || `${data.file.name} 导入失败`);
|
||||
//update-end---author:wangshuai ---date:20221121 for:[VUEN-2827]导入无权限,提示图标错误------------
|
||||
} else {
|
||||
createMessage.success(fileInfo.message || `${data.file.name} 文件上传成功`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('导入的数据异常', error);
|
||||
} finally {
|
||||
typeof success === 'function' ? success(fileInfo) : '';
|
||||
}
|
||||
};
|
||||
await defHttp.uploadFile({ url }, { file: data.file }, { success: isReturn });
|
||||
}
|
||||
|
||||
return {
|
||||
handleExportXls: (name: string, url: string, params?: object) => exportXls(name, url, params),
|
||||
handleImportXls: (data, url, success) => importXls(data, url, success),
|
||||
handleExportXlsx: (name: string, url: string, params?: object) => exportXls(name, url, params, true),
|
||||
};
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
* @param name
|
||||
* @param isXlsx
|
||||
* @param data
|
||||
*/
|
||||
function exportExcel(name, isXlsx, data) {
|
||||
if (!name || typeof name != 'string') {
|
||||
name = '导出文件';
|
||||
}
|
||||
let blobOptions = { type: 'application/vnd.ms-excel' };
|
||||
let fileSuffix = '.xls';
|
||||
if (isXlsx) {
|
||||
blobOptions['type'] = XLSX_MIME_TYPE;
|
||||
fileSuffix = XLSX_FILE_SUFFIX;
|
||||
}
|
||||
if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
||||
window.navigator.msSaveBlob(new Blob([data], blobOptions), name + fileSuffix);
|
||||
} else {
|
||||
let url = window.URL.createObjectURL(new Blob([data], blobOptions));
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
link.setAttribute('download', name + fileSuffix);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link); //下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); //释放掉blob对象
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
import { ref, unref } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { setThirdCaptcha, getCaptcha } from '/@/api/sys/user';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
|
||||
export function useThirdLogin() {
|
||||
const { createMessage, notification } = useMessage();
|
||||
const { t } = useI18n();
|
||||
const glob = useGlobSetting();
|
||||
const userStore = useUserStore();
|
||||
//第三方类型
|
||||
const thirdType = ref('');
|
||||
//第三方登录相关信息
|
||||
const thirdLoginInfo = ref<any>({});
|
||||
//状态
|
||||
const thirdLoginState = ref(false);
|
||||
//绑定手机号弹窗
|
||||
const bindingPhoneModal = ref(false);
|
||||
//第三方用户UUID
|
||||
const thirdUserUuid = ref('');
|
||||
//提示窗
|
||||
const thirdConfirmShow = ref(false);
|
||||
//绑定密码弹窗
|
||||
const thirdPasswordShow = ref(false);
|
||||
//绑定密码
|
||||
const thirdLoginPassword = ref('');
|
||||
//绑定用户
|
||||
const thirdLoginUser = ref('');
|
||||
//加载中
|
||||
const thirdCreateUserLoding = ref(false);
|
||||
//绑定手机号
|
||||
const thirdPhone = ref('');
|
||||
//验证码
|
||||
const thirdCaptcha = ref('');
|
||||
//第三方登录
|
||||
function onThirdLogin(source) {
|
||||
let url = `${glob.uploadUrl}/sys/thirdLogin/render/${source}`;
|
||||
const openWin = window.open(
|
||||
url,
|
||||
`login ${source}`,
|
||||
'height=500, width=500, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no'
|
||||
);
|
||||
thirdType.value = source;
|
||||
thirdLoginInfo.value = {};
|
||||
thirdLoginState.value = false;
|
||||
let receiveMessage = function (event) {
|
||||
let token = event.data;
|
||||
if (typeof token === 'string') {
|
||||
//如果是字符串类型 说明是token信息
|
||||
if (token === '登录失败') {
|
||||
createMessage.warning(token);
|
||||
} else if (token.includes('绑定手机号')) {
|
||||
bindingPhoneModal.value = true;
|
||||
let strings = token.split(',');
|
||||
thirdUserUuid.value = strings[1];
|
||||
} else {
|
||||
doThirdLogin(token);
|
||||
}
|
||||
} else if (typeof token === 'object') {
|
||||
//对象类型 说明需要提示是否绑定现有账号
|
||||
if (token['isObj'] === true) {
|
||||
thirdConfirmShow.value = true;
|
||||
thirdLoginInfo.value = { ...token };
|
||||
}
|
||||
} else {
|
||||
createMessage.warning('不识别的信息传递');
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20240717---for:【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
|
||||
if (openWin?.closed) {
|
||||
window.removeEventListener('message', receiveMessage, false);
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20240717---for:【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
|
||||
};
|
||||
// update-begin--author:liaozhiyang---date:20240717---for:【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
|
||||
window.removeEventListener('message', receiveMessage, false);
|
||||
// update-end--author:liaozhiyang---date:20240717---for:【TV360X-1827】mac系统谷歌浏览器企业微信第三方登录成功后没有弹出绑定手机弹窗
|
||||
window.addEventListener('message', receiveMessage, false);
|
||||
}
|
||||
// 根据token执行登录
|
||||
function doThirdLogin(token) {
|
||||
if (unref(thirdLoginState) === false) {
|
||||
thirdLoginState.value = true;
|
||||
userStore.ThirdLogin({ token, thirdType: unref(thirdType) }).then((res) => {
|
||||
console.log('res====>doThirdLogin', res);
|
||||
if (res && res.userInfo) {
|
||||
notification.success({
|
||||
message: t('sys.login.loginSuccessTitle'),
|
||||
description: `${t('sys.login.loginSuccessDesc')}: ${res.userInfo.realname}`,
|
||||
duration: 3,
|
||||
});
|
||||
} else {
|
||||
requestFailed(res);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function requestFailed(err) {
|
||||
notification.error({
|
||||
message: '登录失败',
|
||||
description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
|
||||
duration: 4,
|
||||
});
|
||||
}
|
||||
// 绑定已有账号 需要输入密码
|
||||
function thirdLoginUserBind() {
|
||||
thirdLoginPassword.value = '';
|
||||
thirdLoginUser.value = thirdLoginInfo.value.uuid;
|
||||
thirdConfirmShow.value = false;
|
||||
thirdPasswordShow.value = true;
|
||||
}
|
||||
//创建新账号
|
||||
function thirdLoginUserCreate() {
|
||||
thirdCreateUserLoding.value = true;
|
||||
// 账号名后面添加两位随机数
|
||||
thirdLoginInfo.value.suffix = parseInt(Math.random() * 98 + 1);
|
||||
defHttp
|
||||
.post({ url: '/sys/third/user/create', params: { thirdLoginInfo: unref(thirdLoginInfo) } }, { isTransformResponse: false })
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
let token = res.result;
|
||||
doThirdLogin(token);
|
||||
thirdConfirmShow.value = false;
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
thirdCreateUserLoding.value = false;
|
||||
});
|
||||
}
|
||||
// 核实密码
|
||||
function thirdLoginCheckPassword() {
|
||||
let params = Object.assign({}, unref(thirdLoginInfo), { password: unref(thirdLoginPassword) });
|
||||
defHttp.post({ url: '/sys/third/user/checkPassword', params }, { isTransformResponse: false }).then((res) => {
|
||||
if (res.success) {
|
||||
thirdLoginNoPassword();
|
||||
doThirdLogin(res.result);
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 没有密码 取消操作
|
||||
function thirdLoginNoPassword() {
|
||||
thirdPasswordShow.value = false;
|
||||
thirdLoginPassword.value = '';
|
||||
thirdLoginUser.value = '';
|
||||
}
|
||||
|
||||
//倒计时执行前的函数
|
||||
function sendCodeApi() {
|
||||
//return setThirdCaptcha({mobile:unref(thirdPhone)});
|
||||
return getCaptcha({ mobile: unref(thirdPhone), smsmode: '0' });
|
||||
}
|
||||
//绑定手机号点击确定按钮
|
||||
function thirdHandleOk() {
|
||||
if (!unref(thirdPhone)) {
|
||||
cmsFailed('请输入手机号');
|
||||
}
|
||||
if (!unref(thirdCaptcha)) {
|
||||
cmsFailed('请输入验证码');
|
||||
}
|
||||
let params = {
|
||||
mobile: unref(thirdPhone),
|
||||
captcha: unref(thirdCaptcha),
|
||||
thirdUserUuid: unref(thirdUserUuid),
|
||||
};
|
||||
defHttp.post({ url: '/sys/thirdLogin/bindingThirdPhone', params }, { isTransformResponse: false }).then((res) => {
|
||||
if (res.success) {
|
||||
bindingPhoneModal.value = false;
|
||||
doThirdLogin(res.result);
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
function cmsFailed(err) {
|
||||
notification.error({
|
||||
message: '登录失败',
|
||||
description: err,
|
||||
duration: 4,
|
||||
});
|
||||
return;
|
||||
}
|
||||
//返回数据和方法
|
||||
return {
|
||||
thirdPasswordShow,
|
||||
thirdLoginCheckPassword,
|
||||
thirdLoginNoPassword,
|
||||
thirdLoginPassword,
|
||||
thirdConfirmShow,
|
||||
thirdCreateUserLoding,
|
||||
thirdLoginUserCreate,
|
||||
thirdLoginUserBind,
|
||||
bindingPhoneModal,
|
||||
thirdHandleOk,
|
||||
thirdPhone,
|
||||
thirdCaptcha,
|
||||
onThirdLogin,
|
||||
sendCodeApi,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { useAppProviderContext } from '/@/components/Application';
|
||||
import { computed, unref } from 'vue';
|
||||
|
||||
export function useAppInject() {
|
||||
const values = useAppProviderContext();
|
||||
|
||||
return {
|
||||
getIsMobile: computed(() => unref(values.isMobile)),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
import { ComputedRef, isRef, nextTick, Ref, ref, unref, watch } from 'vue';
|
||||
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
|
||||
import { useWindowSizeFn } from '/@/hooks/event/useWindowSizeFn';
|
||||
import { useLayoutHeight } from '/@/layouts/default/content/useContentViewHeight';
|
||||
import { getViewportOffset } from '/@/utils/domUtils';
|
||||
import { isNumber, isString } from '/@/utils/is';
|
||||
|
||||
export interface CompensationHeight {
|
||||
// 使用 layout Footer 高度作为判断补偿高度的条件
|
||||
useLayoutFooter: boolean;
|
||||
// refs HTMLElement
|
||||
elements?: Ref[];
|
||||
}
|
||||
|
||||
type Upward = number | string | null | undefined;
|
||||
|
||||
/**
|
||||
* 动态计算内容高度,根据锚点dom最下坐标到屏幕最下坐标,根据传入dom的高度、padding、margin等值进行动态计算
|
||||
* 最终获取合适的内容高度
|
||||
*
|
||||
* @param flag 用于开启计算的响应式标识
|
||||
* @param anchorRef 锚点组件 Ref<ElRef | ComponentRef>
|
||||
* @param subtractHeightRefs 待减去高度的组件列表 Ref<ElRef | ComponentRef>
|
||||
* @param substractSpaceRefs 待减去空闲空间(margins/paddings)的组件列表 Ref<ElRef | ComponentRef>
|
||||
* @param offsetHeightRef 计算偏移的响应式高度,计算高度时将直接减去此值
|
||||
* @param upwardSpace 向上递归减去空闲空间的 层级 或 直到指定class为止 数值为2代表向上递归两次|数值为ant-layout表示向上递归直到碰见.ant-layout为止
|
||||
* @returns 响应式高度
|
||||
*/
|
||||
export function useContentHeight(
|
||||
flag: ComputedRef<Boolean>,
|
||||
anchorRef: Ref,
|
||||
subtractHeightRefs: Ref[],
|
||||
substractSpaceRefs: Ref[],
|
||||
upwardSpace: Ref<Upward> | ComputedRef<Upward> | Upward = 0,
|
||||
offsetHeightRef: Ref<number> = ref(0)
|
||||
) {
|
||||
const contentHeight: Ref<Nullable<number>> = ref(null);
|
||||
const { footerHeightRef: layoutFooterHeightRef } = useLayoutHeight();
|
||||
let compensationHeight: CompensationHeight = {
|
||||
useLayoutFooter: true,
|
||||
};
|
||||
|
||||
const setCompensation = (params: CompensationHeight) => {
|
||||
compensationHeight = params;
|
||||
};
|
||||
|
||||
function redoHeight() {
|
||||
nextTick(() => {
|
||||
calcContentHeight();
|
||||
});
|
||||
}
|
||||
|
||||
function calcSubtractSpace(element: Element | null | undefined, direction: 'all' | 'top' | 'bottom' = 'all'): number {
|
||||
function numberPx(px: string) {
|
||||
return Number(px.replace(/[^\d]/g, ''));
|
||||
}
|
||||
let subtractHeight = 0;
|
||||
const ZERO_PX = '0px';
|
||||
if (element) {
|
||||
const cssStyle = getComputedStyle(element);
|
||||
const marginTop = numberPx(cssStyle?.marginTop ?? ZERO_PX);
|
||||
const marginBottom = numberPx(cssStyle?.marginBottom ?? ZERO_PX);
|
||||
const paddingTop = numberPx(cssStyle?.paddingTop ?? ZERO_PX);
|
||||
const paddingBottom = numberPx(cssStyle?.paddingBottom ?? ZERO_PX);
|
||||
if (direction === 'all') {
|
||||
subtractHeight += marginTop;
|
||||
subtractHeight += marginBottom;
|
||||
subtractHeight += paddingTop;
|
||||
subtractHeight += paddingBottom;
|
||||
} else if (direction === 'top') {
|
||||
subtractHeight += marginTop;
|
||||
subtractHeight += paddingTop;
|
||||
} else {
|
||||
subtractHeight += marginBottom;
|
||||
subtractHeight += paddingBottom;
|
||||
}
|
||||
}
|
||||
return subtractHeight;
|
||||
}
|
||||
|
||||
function getEl(element: any): Nullable<HTMLDivElement> {
|
||||
if (element == null) {
|
||||
return null;
|
||||
}
|
||||
return (element instanceof HTMLDivElement ? element : element.$el) as HTMLDivElement;
|
||||
}
|
||||
|
||||
async function calcContentHeight() {
|
||||
if (!flag.value) {
|
||||
return;
|
||||
}
|
||||
// Add a delay to get the correct height
|
||||
await nextTick();
|
||||
|
||||
const anchorEl = getEl(unref(anchorRef));
|
||||
if (!anchorEl) {
|
||||
return;
|
||||
}
|
||||
const { bottomIncludeBody } = getViewportOffset(anchorEl);
|
||||
|
||||
// substract elements height
|
||||
let substractHeight = 0;
|
||||
subtractHeightRefs.forEach((item) => {
|
||||
substractHeight += getEl(unref(item))?.offsetHeight ?? 0;
|
||||
});
|
||||
|
||||
// subtract margins / paddings
|
||||
let substractSpaceHeight = calcSubtractSpace(anchorEl) ?? 0;
|
||||
substractSpaceRefs.forEach((item) => {
|
||||
substractSpaceHeight += calcSubtractSpace(getEl(unref(item)));
|
||||
});
|
||||
|
||||
// upwardSpace
|
||||
let upwardSpaceHeight = 0;
|
||||
function upward(element: Element | null, upwardLvlOrClass: number | string | null | undefined) {
|
||||
if (element && upwardLvlOrClass) {
|
||||
const parent = element.parentElement;
|
||||
if (parent) {
|
||||
if (isString(upwardLvlOrClass)) {
|
||||
if (!parent.classList.contains(upwardLvlOrClass)) {
|
||||
upwardSpaceHeight += calcSubtractSpace(parent, 'bottom');
|
||||
upward(parent, upwardLvlOrClass);
|
||||
} else {
|
||||
upwardSpaceHeight += calcSubtractSpace(parent, 'bottom');
|
||||
}
|
||||
} else if (isNumber(upwardLvlOrClass)) {
|
||||
if (upwardLvlOrClass > 0) {
|
||||
upwardSpaceHeight += calcSubtractSpace(parent, 'bottom');
|
||||
upward(parent, --upwardLvlOrClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isRef(upwardSpace)) {
|
||||
upward(anchorEl, unref(upwardSpace));
|
||||
} else {
|
||||
upward(anchorEl, upwardSpace);
|
||||
}
|
||||
|
||||
let height =
|
||||
bottomIncludeBody - unref(layoutFooterHeightRef) - unref(offsetHeightRef) - substractHeight - substractSpaceHeight - upwardSpaceHeight;
|
||||
|
||||
// compensation height
|
||||
const calcCompensationHeight = () => {
|
||||
compensationHeight.elements?.forEach((item) => {
|
||||
height += getEl(unref(item))?.offsetHeight ?? 0;
|
||||
});
|
||||
};
|
||||
if (compensationHeight.useLayoutFooter && unref(layoutFooterHeightRef) > 0) {
|
||||
calcCompensationHeight();
|
||||
} else {
|
||||
calcCompensationHeight();
|
||||
}
|
||||
|
||||
contentHeight.value = height;
|
||||
}
|
||||
|
||||
onMountedOrActivated(() => {
|
||||
nextTick(() => {
|
||||
calcContentHeight();
|
||||
});
|
||||
});
|
||||
useWindowSizeFn(
|
||||
() => {
|
||||
calcContentHeight();
|
||||
},
|
||||
50,
|
||||
{ immediate: true }
|
||||
);
|
||||
watch(
|
||||
() => [layoutFooterHeightRef.value],
|
||||
() => {
|
||||
calcContentHeight();
|
||||
},
|
||||
{
|
||||
flush: 'post',
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
return { redoHeight, setCompensation, contentHeight };
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { onUnmounted, getCurrentInstance } from 'vue';
|
||||
import { createContextMenu, destroyContextMenu } from '/@/components/ContextMenu';
|
||||
import type { ContextMenuItem } from '/@/components/ContextMenu';
|
||||
export type { ContextMenuItem };
|
||||
export function useContextMenu(authRemove = true) {
|
||||
if (getCurrentInstance() && authRemove) {
|
||||
onUnmounted(() => {
|
||||
destroyContextMenu();
|
||||
});
|
||||
}
|
||||
return [createContextMenu, destroyContextMenu];
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import { isRef, unref, watch, Ref, ComputedRef } from 'vue';
|
||||
import Clipboard from 'clipboard';
|
||||
import { ModalOptionsEx, useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
/** 带复制按钮的弹窗 */
|
||||
interface IOptions extends ModalOptionsEx {
|
||||
// 要复制的文本,可以是一个 ref 对象,动态更新
|
||||
copyText: string | Ref<string> | ComputedRef<string>;
|
||||
}
|
||||
|
||||
const COPY_CLASS = 'copy-this-text';
|
||||
const CLIPBOARD_TEXT = 'data-clipboard-text';
|
||||
|
||||
export function useCopyModal() {
|
||||
return { createCopyModal };
|
||||
}
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
|
||||
/** 创建复制弹窗 */
|
||||
function createCopyModal(options: Partial<IOptions>) {
|
||||
let modal = createConfirm({
|
||||
...options,
|
||||
iconType: options.iconType ?? 'info',
|
||||
width: options.width ?? 500,
|
||||
title: options.title ?? '复制',
|
||||
maskClosable: options.maskClosable ?? true,
|
||||
okText: options.okText ?? '复制',
|
||||
okButtonProps: {
|
||||
...options.okButtonProps,
|
||||
class: COPY_CLASS,
|
||||
[CLIPBOARD_TEXT]: unref(options.copyText),
|
||||
} as any,
|
||||
onOk() {
|
||||
return new Promise((resolve: any) => {
|
||||
const clipboard = new Clipboard('.' + COPY_CLASS);
|
||||
clipboard.on('success', () => {
|
||||
clipboard.destroy();
|
||||
createMessage.success('复制成功');
|
||||
resolve();
|
||||
});
|
||||
clipboard.on('error', () => {
|
||||
createMessage.error('该浏览器不支持自动复制');
|
||||
clipboard.destroy();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// 动态更新 copyText
|
||||
if (isRef(options.copyText)) {
|
||||
watch(options.copyText, (copyText) => {
|
||||
modal.update({
|
||||
okButtonProps: {
|
||||
...options.okButtonProps,
|
||||
class: COPY_CLASS,
|
||||
[CLIPBOARD_TEXT]: copyText,
|
||||
} as any,
|
||||
});
|
||||
});
|
||||
}
|
||||
return modal;
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
import { isDef } from '/@/utils/is';
|
||||
interface Options {
|
||||
target?: HTMLElement;
|
||||
}
|
||||
export function useCopyToClipboard(initial?: string) {
|
||||
const clipboardRef = ref(initial || '');
|
||||
const isSuccessRef = ref(false);
|
||||
const copiedRef = ref(false);
|
||||
|
||||
watch(
|
||||
clipboardRef,
|
||||
(str?: string) => {
|
||||
if (isDef(str)) {
|
||||
copiedRef.value = true;
|
||||
isSuccessRef.value = copyTextToClipboard(str);
|
||||
}
|
||||
},
|
||||
{ immediate: !!initial, flush: 'sync' }
|
||||
);
|
||||
|
||||
return { clipboardRef, isSuccessRef, copiedRef };
|
||||
}
|
||||
|
||||
export function copyTextToClipboard(input: string, { target = document.body }: Options = {}) {
|
||||
const element = document.createElement('textarea');
|
||||
const previouslyFocusedElement = document.activeElement;
|
||||
|
||||
element.value = input;
|
||||
|
||||
element.setAttribute('readonly', '');
|
||||
|
||||
(element.style as any).contain = 'strict';
|
||||
element.style.position = 'absolute';
|
||||
element.style.left = '-9999px';
|
||||
element.style.fontSize = '12pt';
|
||||
|
||||
const selection = document.getSelection();
|
||||
let originalRange;
|
||||
if (selection && selection.rangeCount > 0) {
|
||||
originalRange = selection.getRangeAt(0);
|
||||
}
|
||||
|
||||
target.append(element);
|
||||
element.select();
|
||||
|
||||
element.selectionStart = 0;
|
||||
element.selectionEnd = input.length;
|
||||
|
||||
let isSuccess = false;
|
||||
try {
|
||||
isSuccess = document.execCommand('copy');
|
||||
} catch (e) {
|
||||
throw new Error(e);
|
||||
}
|
||||
|
||||
element.remove();
|
||||
|
||||
if (originalRange && selection) {
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(originalRange);
|
||||
}
|
||||
|
||||
if (previouslyFocusedElement) {
|
||||
(previouslyFocusedElement as HTMLElement).focus();
|
||||
}
|
||||
return isSuccess;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { useAppProviderContext } from '/@/components/Application';
|
||||
// import { computed } from 'vue';
|
||||
// import { lowerFirst } from 'lodash-es';
|
||||
export function useDesign(scope: string) {
|
||||
const values = useAppProviderContext();
|
||||
// const $style = cssModule ? useCssModule() : {};
|
||||
|
||||
// const style: Record<string, string> = {};
|
||||
// if (cssModule) {
|
||||
// Object.keys($style).forEach((key) => {
|
||||
// // const moduleCls = $style[key];
|
||||
// const k = key.replace(new RegExp(`^${values.prefixCls}-?`, 'ig'), '');
|
||||
// style[lowerFirst(k)] = $style[key];
|
||||
// });
|
||||
// }
|
||||
return {
|
||||
// prefixCls: computed(() => `${values.prefixCls}-${scope}`),
|
||||
prefixCls: `${values.prefixCls}-${scope}`,
|
||||
prefixVar: values.prefixCls,
|
||||
// style,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
import type { EChartsOption } from 'echarts';
|
||||
import type { Ref } from 'vue';
|
||||
import { useTimeoutFn } from '/@/hooks/core/useTimeout';
|
||||
import { tryOnUnmounted } from '@vueuse/core';
|
||||
import { unref, nextTick, watch, computed, ref } from 'vue';
|
||||
import { useDebounceFn } from '@vueuse/core';
|
||||
import { useEventListener } from '/@/hooks/event/useEventListener';
|
||||
import { useBreakpoint } from '/@/hooks/event/useBreakpoint';
|
||||
import echarts from '/@/utils/lib/echarts';
|
||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||
|
||||
export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') {
|
||||
console.log("---useECharts---初始化加载---")
|
||||
|
||||
const { getDarkMode: getSysDarkMode } = useRootSetting();
|
||||
|
||||
const getDarkMode = computed(() => {
|
||||
return theme === 'default' ? getSysDarkMode.value : theme;
|
||||
});
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
let resizeFn: Fn = resize;
|
||||
const cacheOptions = ref({}) as Ref<EChartsOption>;
|
||||
let removeResizeFn: Fn = () => {};
|
||||
|
||||
resizeFn = useDebounceFn(resize, 200);
|
||||
|
||||
const getOptions = computed(() => {
|
||||
if (getDarkMode.value !== 'dark') {
|
||||
return cacheOptions.value as EChartsOption;
|
||||
}
|
||||
return {
|
||||
backgroundColor: 'transparent',
|
||||
...cacheOptions.value,
|
||||
} as EChartsOption;
|
||||
});
|
||||
|
||||
function initCharts(t = theme) {
|
||||
const el = unref(elRef);
|
||||
if (!el || !unref(el)) {
|
||||
return;
|
||||
}
|
||||
|
||||
chartInstance = echarts.init(el, t);
|
||||
const { removeEvent } = useEventListener({
|
||||
el: window,
|
||||
name: 'resize',
|
||||
listener: resizeFn,
|
||||
});
|
||||
removeResizeFn = removeEvent;
|
||||
const { widthRef, screenEnum } = useBreakpoint();
|
||||
if (unref(widthRef) <= screenEnum.MD || el.offsetHeight === 0) {
|
||||
useTimeoutFn(() => {
|
||||
resizeFn();
|
||||
}, 30);
|
||||
}
|
||||
}
|
||||
|
||||
function setOptions(options: EChartsOption, clear = true) {
|
||||
cacheOptions.value = options;
|
||||
if (unref(elRef)?.offsetHeight === 0) {
|
||||
useTimeoutFn(() => {
|
||||
setOptions(unref(getOptions));
|
||||
}, 30);
|
||||
return;
|
||||
}
|
||||
nextTick(() => {
|
||||
useTimeoutFn(() => {
|
||||
if (!chartInstance) {
|
||||
initCharts(getDarkMode.value as 'default');
|
||||
|
||||
if (!chartInstance) return;
|
||||
}
|
||||
clear && chartInstance?.clear();
|
||||
|
||||
chartInstance?.setOption(unref(getOptions));
|
||||
}, 30);
|
||||
});
|
||||
}
|
||||
|
||||
function resize() {
|
||||
chartInstance?.resize();
|
||||
}
|
||||
|
||||
watch(
|
||||
() => getDarkMode.value,
|
||||
(theme) => {
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
initCharts(theme as 'default');
|
||||
setOptions(cacheOptions.value);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
tryOnUnmounted(() => {
|
||||
if (!chartInstance) return;
|
||||
removeResizeFn();
|
||||
chartInstance.dispose();
|
||||
chartInstance = null;
|
||||
});
|
||||
|
||||
function getInstance(): echarts.ECharts | null {
|
||||
if (!chartInstance) {
|
||||
initCharts(getDarkMode.value as 'default');
|
||||
}
|
||||
return chartInstance;
|
||||
}
|
||||
|
||||
return {
|
||||
setOptions,
|
||||
resize,
|
||||
echarts,
|
||||
getInstance,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import { computed, unref } from 'vue';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
/**
|
||||
* @description: Full screen display content
|
||||
*/
|
||||
export const useFullContent = () => {
|
||||
const appStore = useAppStore();
|
||||
const router = useRouter();
|
||||
const { currentRoute } = router;
|
||||
|
||||
// Whether to display the content in full screen without displaying the menu
|
||||
const getFullContent = computed(() => {
|
||||
// Query parameters, the full screen is displayed when the address bar has a full parameter
|
||||
const route = unref(currentRoute);
|
||||
const query = route.query;
|
||||
if (query && Reflect.has(query, '__full__')) {
|
||||
return true;
|
||||
}
|
||||
// Return to the configuration in the configuration file
|
||||
return appStore.getProjectConfig.fullContent;
|
||||
});
|
||||
|
||||
return { getFullContent };
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
import { i18n } from '/@/locales/setupI18n';
|
||||
|
||||
type I18nGlobalTranslation = {
|
||||
(key: string): string;
|
||||
(key: string, locale: string): string;
|
||||
(key: string, locale: string, list: unknown[]): string;
|
||||
(key: string, locale: string, named: Record<string, unknown>): string;
|
||||
(key: string, list: unknown[]): string;
|
||||
(key: string, named: Record<string, unknown>): string;
|
||||
};
|
||||
|
||||
type I18nTranslationRestParameters = [string, any];
|
||||
|
||||
function getKey(namespace: string | undefined, key: string) {
|
||||
if (!namespace) {
|
||||
return key;
|
||||
}
|
||||
if (key.startsWith(namespace)) {
|
||||
return key;
|
||||
}
|
||||
return `${namespace}.${key}`;
|
||||
}
|
||||
|
||||
export function useI18n(namespace?: string): {
|
||||
t: I18nGlobalTranslation;
|
||||
} {
|
||||
const normalFn = {
|
||||
t: (key: string) => {
|
||||
return getKey(namespace, key);
|
||||
},
|
||||
};
|
||||
|
||||
if (!i18n) {
|
||||
return normalFn;
|
||||
}
|
||||
|
||||
const { t, ...methods } = i18n.global;
|
||||
|
||||
const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => {
|
||||
if (!key) return '';
|
||||
if (!key.includes('.') && !namespace) return key;
|
||||
return t(getKey(namespace, key), ...(arg as I18nTranslationRestParameters));
|
||||
};
|
||||
return {
|
||||
...methods,
|
||||
t: tFn,
|
||||
};
|
||||
}
|
||||
|
||||
// Why write this function?
|
||||
// Mainly to configure the vscode i18nn ally plugin. This function is only used for routing and menus. Please use useI18n for other places
|
||||
|
||||
// 为什么要编写此函数?
|
||||
// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n
|
||||
export const t = (key: string) => key;
|
||||
@@ -0,0 +1,72 @@
|
||||
import { computed, onUnmounted, unref, watchEffect } from 'vue';
|
||||
import { useThrottleFn } from '@vueuse/core';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
import { useLockStore } from '/@/store/modules/lock';
|
||||
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useRootSetting } from '../setting/useRootSetting';
|
||||
|
||||
export function useLockPage() {
|
||||
const { getLockTime } = useRootSetting();
|
||||
const lockStore = useLockStore();
|
||||
const userStore = useUserStore();
|
||||
const appStore = useAppStore();
|
||||
|
||||
let timeId: TimeoutHandle;
|
||||
|
||||
function clear(): void {
|
||||
window.clearTimeout(timeId);
|
||||
}
|
||||
|
||||
function resetCalcLockTimeout(): void {
|
||||
// not login
|
||||
if (!userStore.getToken) {
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
const lockTime = appStore.getProjectConfig.lockTime;
|
||||
if (!lockTime || lockTime < 1) {
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
clear();
|
||||
|
||||
timeId = setTimeout(() => {
|
||||
lockPage();
|
||||
}, lockTime * 60 * 1000);
|
||||
}
|
||||
|
||||
function lockPage(): void {
|
||||
lockStore.setLockInfo({
|
||||
isLock: true,
|
||||
pwd: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
watchEffect((onClean) => {
|
||||
if (userStore.getToken) {
|
||||
resetCalcLockTimeout();
|
||||
} else {
|
||||
clear();
|
||||
}
|
||||
onClean(() => {
|
||||
clear();
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clear();
|
||||
});
|
||||
|
||||
const keyupFn = useThrottleFn(resetCalcLockTimeout, 2000);
|
||||
|
||||
return computed(() => {
|
||||
if (unref(getLockTime)) {
|
||||
return { onKeyup: keyupFn, onMousemove: keyupFn };
|
||||
} else {
|
||||
clear();
|
||||
return {};
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
import type { ModalFunc, ModalFuncProps } from 'ant-design-vue/lib/modal/Modal';
|
||||
|
||||
import { Modal, message as Message, notification } from 'ant-design-vue';
|
||||
import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons-vue';
|
||||
|
||||
import { NotificationArgsProps, ConfigProps } from 'ant-design-vue/lib/notification';
|
||||
import { useI18n } from './useI18n';
|
||||
import { isString } from '/@/utils/is';
|
||||
import { h } from 'vue';
|
||||
|
||||
export interface NotifyApi {
|
||||
info(config: NotificationArgsProps): void;
|
||||
success(config: NotificationArgsProps): void;
|
||||
error(config: NotificationArgsProps): void;
|
||||
warn(config: NotificationArgsProps): void;
|
||||
warning(config: NotificationArgsProps): void;
|
||||
open(args: NotificationArgsProps): void;
|
||||
close(key: String): void;
|
||||
config(options: ConfigProps): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
||||
export declare type IconType = 'success' | 'info' | 'error' | 'warning';
|
||||
export interface ModalOptionsEx extends Omit<ModalFuncProps, 'iconType'> {
|
||||
iconType: 'warning' | 'success' | 'error' | 'info';
|
||||
}
|
||||
export type ModalOptionsPartial = Partial<ModalOptionsEx> & Pick<ModalOptionsEx, 'content'>;
|
||||
|
||||
interface ConfirmOptions {
|
||||
info: ModalFunc;
|
||||
success: ModalFunc;
|
||||
error: ModalFunc;
|
||||
warn: ModalFunc;
|
||||
warning: ModalFunc;
|
||||
}
|
||||
|
||||
function getIcon(iconType: string) {
|
||||
try {
|
||||
if (iconType === 'warning') {
|
||||
return h(InfoCircleFilled,{"class":"modal-icon-warning"})
|
||||
} else if (iconType === 'success') {
|
||||
return h(CheckCircleFilled,{"class": "modal-icon-success"});
|
||||
} else if (iconType === 'info') {
|
||||
return h(InfoCircleFilled,{"class": "modal-icon-info"});
|
||||
} else {
|
||||
return h(CloseCircleFilled,{"class":"modal-icon-error"});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
function renderContent({ content }: Pick<ModalOptionsEx, 'content'>) {
|
||||
try {
|
||||
if (isString(content)) {
|
||||
return h('div', h('div', {'innerHTML':content as string}));
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Create confirmation box
|
||||
*/
|
||||
function createConfirm(options: ModalOptionsEx): ReturnType<ModalFunc> {
|
||||
const iconType = options.iconType || 'warning';
|
||||
Reflect.deleteProperty(options, 'iconType');
|
||||
const opt: ModalFuncProps = {
|
||||
centered: true,
|
||||
icon: getIcon(iconType),
|
||||
...options,
|
||||
content: renderContent(options),
|
||||
};
|
||||
return Modal.confirm(opt);
|
||||
}
|
||||
|
||||
const getBaseOptions = () => {
|
||||
const { t } = useI18n();
|
||||
return {
|
||||
okText: t('common.okText'),
|
||||
centered: true,
|
||||
};
|
||||
};
|
||||
|
||||
function createModalOptions(options: ModalOptionsPartial, icon: string): ModalOptionsPartial {
|
||||
//update-begin-author:taoyan date:2023-1-10 for: 可以自定义图标
|
||||
let titleIcon:any = ''
|
||||
if(options.icon){
|
||||
titleIcon = options.icon;
|
||||
}else{
|
||||
titleIcon = getIcon(icon)
|
||||
}
|
||||
//update-end-author:taoyan date:2023-1-10 for: 可以自定义图标
|
||||
return {
|
||||
...getBaseOptions(),
|
||||
...options,
|
||||
content: renderContent(options),
|
||||
icon: titleIcon
|
||||
};
|
||||
}
|
||||
|
||||
function createSuccessModal(options: ModalOptionsPartial) {
|
||||
return Modal.success(createModalOptions(options, 'success'));
|
||||
}
|
||||
|
||||
function createErrorModal(options: ModalOptionsPartial) {
|
||||
return Modal.error(createModalOptions(options, 'close'));
|
||||
}
|
||||
|
||||
function createInfoModal(options: ModalOptionsPartial) {
|
||||
return Modal.info(createModalOptions(options, 'info'));
|
||||
}
|
||||
|
||||
function createWarningModal(options: ModalOptionsPartial) {
|
||||
return Modal.warning(createModalOptions(options, 'warning'));
|
||||
}
|
||||
|
||||
interface MOE extends Omit<ModalOptionsEx, 'iconType'> {
|
||||
iconType?: ModalOptionsEx['iconType'];
|
||||
}
|
||||
|
||||
// 提示框,无需传入iconType,默认为warning
|
||||
function createConfirmSync(options: MOE) {
|
||||
return new Promise((resolve) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
...options,
|
||||
onOk: () => resolve(true),
|
||||
onCancel: () => resolve(false),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
notification.config({
|
||||
placement: 'topRight',
|
||||
duration: 3,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description: message
|
||||
*/
|
||||
export function useMessage() {
|
||||
return {
|
||||
createMessage: Message,
|
||||
notification: notification as NotifyApi,
|
||||
createConfirm: createConfirm,
|
||||
createConfirmSync,
|
||||
createSuccessModal,
|
||||
createErrorModal,
|
||||
createInfoModal,
|
||||
createWarningModal,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
import type { ModalFunc, ModalFuncProps } from 'ant-design-vue/lib/modal/Modal';
|
||||
|
||||
import { Modal, message as Message, notification } from 'ant-design-vue';
|
||||
import { InfoCircleFilled, CheckCircleFilled, CloseCircleFilled } from '@ant-design/icons-vue';
|
||||
|
||||
import { NotificationArgsProps, ConfigProps } from 'ant-design-vue/lib/notification';
|
||||
import { useI18n } from './useI18n';
|
||||
import { isString } from '/@/utils/is';
|
||||
|
||||
export interface NotifyApi {
|
||||
info(config: NotificationArgsProps): void;
|
||||
success(config: NotificationArgsProps): void;
|
||||
error(config: NotificationArgsProps): void;
|
||||
warn(config: NotificationArgsProps): void;
|
||||
warning(config: NotificationArgsProps): void;
|
||||
open(args: NotificationArgsProps): void;
|
||||
close(key: String): void;
|
||||
config(options: ConfigProps): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export declare type NotificationPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
||||
export declare type IconType = 'success' | 'info' | 'error' | 'warning';
|
||||
export interface ModalOptionsEx extends Omit<ModalFuncProps, 'iconType'> {
|
||||
iconType: 'warning' | 'success' | 'error' | 'info';
|
||||
}
|
||||
export type ModalOptionsPartial = Partial<ModalOptionsEx> & Pick<ModalOptionsEx, 'content'>;
|
||||
|
||||
interface ConfirmOptions {
|
||||
info: ModalFunc;
|
||||
success: ModalFunc;
|
||||
error: ModalFunc;
|
||||
warn: ModalFunc;
|
||||
warning: ModalFunc;
|
||||
}
|
||||
|
||||
function getIcon(iconType: string) {
|
||||
if (iconType === 'warning') {
|
||||
return <InfoCircleFilled class="modal-icon-warning" />;
|
||||
} else if (iconType === 'success') {
|
||||
return <CheckCircleFilled class="modal-icon-success" />;
|
||||
} else if (iconType === 'info') {
|
||||
return <InfoCircleFilled class="modal-icon-info" />;
|
||||
} else {
|
||||
return <CloseCircleFilled class="modal-icon-error" />;
|
||||
}
|
||||
}
|
||||
|
||||
function renderContent({ content }: Pick<ModalOptionsEx, 'content'>) {
|
||||
if (isString(content)) {
|
||||
return <div innerHTML={`<div>${content as string}</div>`}></div>;
|
||||
} else {
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: Create confirmation box
|
||||
*/
|
||||
function createConfirm(options: ModalOptionsEx): ReturnType<ModalFunc> {
|
||||
const iconType = options.iconType || 'warning';
|
||||
Reflect.deleteProperty(options, 'iconType');
|
||||
const opt: ModalFuncProps = {
|
||||
centered: true,
|
||||
icon: getIcon(iconType),
|
||||
...options,
|
||||
content: renderContent(options),
|
||||
};
|
||||
return Modal.confirm(opt);
|
||||
}
|
||||
|
||||
const getBaseOptions = () => {
|
||||
const { t } = useI18n();
|
||||
return {
|
||||
okText: t('common.okText'),
|
||||
centered: true,
|
||||
};
|
||||
};
|
||||
|
||||
function createModalOptions(options: ModalOptionsPartial, icon: string): ModalOptionsPartial {
|
||||
return {
|
||||
...getBaseOptions(),
|
||||
...options,
|
||||
content: renderContent(options),
|
||||
icon: getIcon(icon),
|
||||
};
|
||||
}
|
||||
|
||||
function createSuccessModal(options: ModalOptionsPartial) {
|
||||
return Modal.success(createModalOptions(options, 'success'));
|
||||
}
|
||||
|
||||
function createErrorModal(options: ModalOptionsPartial) {
|
||||
return Modal.error(createModalOptions(options, 'close'));
|
||||
}
|
||||
|
||||
function createInfoModal(options: ModalOptionsPartial) {
|
||||
return Modal.info(createModalOptions(options, 'info'));
|
||||
}
|
||||
|
||||
function createWarningModal(options: ModalOptionsPartial) {
|
||||
return Modal.warning(createModalOptions(options, 'warning'));
|
||||
}
|
||||
|
||||
notification.config({
|
||||
placement: 'topRight',
|
||||
duration: 3,
|
||||
});
|
||||
|
||||
/**
|
||||
* @description: message
|
||||
*/
|
||||
export function useMessage() {
|
||||
return {
|
||||
createMessage: Message,
|
||||
notification: notification as NotifyApi,
|
||||
createConfirm: createConfirm,
|
||||
createSuccessModal,
|
||||
createErrorModal,
|
||||
createInfoModal,
|
||||
createWarningModal,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
import type { RouteLocationRaw, Router } from 'vue-router';
|
||||
|
||||
import { PageEnum } from '/@/enums/pageEnum';
|
||||
import { isString } from '/@/utils/is';
|
||||
import { unref } from 'vue';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
import { REDIRECT_NAME } from '/@/router/constant';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
|
||||
export type RouteLocationRawEx = Omit<RouteLocationRaw, 'path'> & { path: PageEnum };
|
||||
|
||||
function handleError(e: Error) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
// page switch
|
||||
export function useGo(_router?: Router) {
|
||||
// update-begin--author:liaozhiyang---date:20230908---for:【issues/694】404返回首页问题
|
||||
const userStore = useUserStore();
|
||||
const homePath = userStore.getUserInfo.homePath || PageEnum.BASE_HOME;
|
||||
// update-end--author:liaozhiyang---date:20230908---for:【issues/694】404返回首页问题
|
||||
let router;
|
||||
if (!_router) {
|
||||
router = useRouter();
|
||||
}
|
||||
const { push, replace } = _router || router;
|
||||
function go(opt: PageEnum | RouteLocationRawEx | string = homePath, isReplace = false) {
|
||||
if (!opt) {
|
||||
return;
|
||||
}
|
||||
if (isString(opt)) {
|
||||
isReplace ? replace(opt).catch(handleError) : push(opt).catch(handleError);
|
||||
} else {
|
||||
const o = opt as RouteLocationRaw;
|
||||
isReplace ? replace(o).catch(handleError) : push(o).catch(handleError);
|
||||
}
|
||||
}
|
||||
return go;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: redo current page
|
||||
*/
|
||||
export const useRedo = (_router?: Router) => {
|
||||
const { push, currentRoute } = _router || useRouter();
|
||||
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
|
||||
function redo(): Promise<boolean> {
|
||||
return new Promise((resolve) => {
|
||||
if (name === REDIRECT_NAME) {
|
||||
resolve(false);
|
||||
return;
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20231123---for:【QQYUN-7099】动态路由匹配右键重新加载404
|
||||
const tabStore = useMultipleTabStore();
|
||||
if (name && Object.keys(params).length > 0) {
|
||||
tabStore.setRedirectPageParam({
|
||||
redirect_type: 'name',
|
||||
name: String(name),
|
||||
params,
|
||||
query,
|
||||
});
|
||||
params['path'] = String(name);
|
||||
} else {
|
||||
tabStore.setRedirectPageParam({
|
||||
redirect_type: 'path',
|
||||
path: fullPath,
|
||||
query,
|
||||
});
|
||||
params['path'] = fullPath;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231123---for:【QQYUN-7099】动态路由匹配右键重新加载404
|
||||
push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true));
|
||||
});
|
||||
}
|
||||
return redo;
|
||||
};
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { Ref } from 'vue';
|
||||
import { ref, unref, computed } from 'vue';
|
||||
|
||||
function pagination<T = any>(list: T[], pageNo: number, pageSize: number): T[] {
|
||||
const offset = (pageNo - 1) * Number(pageSize);
|
||||
const ret = offset + Number(pageSize) >= list.length ? list.slice(offset, list.length) : list.slice(offset, offset + Number(pageSize));
|
||||
return ret;
|
||||
}
|
||||
|
||||
export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
|
||||
const currentPage = ref(1);
|
||||
const pageSizeRef = ref(pageSize);
|
||||
|
||||
const getPaginationList = computed(() => {
|
||||
return pagination(unref(list), unref(currentPage), unref(pageSizeRef));
|
||||
});
|
||||
|
||||
const getTotal = computed(() => {
|
||||
return unref(list).length;
|
||||
});
|
||||
|
||||
function setCurrentPage(page: number) {
|
||||
currentPage.value = page;
|
||||
}
|
||||
|
||||
function setPageSize(pageSize: number) {
|
||||
pageSizeRef.value = pageSize;
|
||||
}
|
||||
|
||||
return { setCurrentPage, getTotal, setPageSize, getPaginationList };
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
import { usePermissionStore } from '/@/store/modules/permission';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
import { useTabs } from './useTabs';
|
||||
|
||||
import { router, resetRouter } from '/@/router';
|
||||
// import { RootRoute } from '/@/router/routes';
|
||||
|
||||
import projectSetting from '/@/settings/projectSetting';
|
||||
import { PermissionModeEnum } from '/@/enums/appEnum';
|
||||
import { RoleEnum } from '/@/enums/roleEnum';
|
||||
|
||||
import { intersection } from 'lodash-es';
|
||||
import { isArray } from '/@/utils/is';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
|
||||
// User permissions related operations
|
||||
export function usePermission() {
|
||||
const userStore = useUserStore();
|
||||
const appStore = useAppStore();
|
||||
const permissionStore = usePermissionStore();
|
||||
//动态加载流程节点表单权限
|
||||
let formData: any = {};
|
||||
function initBpmFormData(_bpmFormData) {
|
||||
formData = _bpmFormData;
|
||||
}
|
||||
const { closeAll } = useTabs(router);
|
||||
|
||||
//==================================工作流权限判断-begin=========================================
|
||||
function hasBpmPermission(code, type) {
|
||||
// 禁用-type=2
|
||||
// 显示-type=1
|
||||
let codeList: string[] = [];
|
||||
let permissionList = formData.permissionList;
|
||||
if (permissionList && permissionList.length > 0) {
|
||||
for (let item of permissionList) {
|
||||
if (item.type == type) {
|
||||
codeList.push(item.action);
|
||||
}
|
||||
}
|
||||
}
|
||||
return codeList.indexOf(code) >= 0;
|
||||
}
|
||||
//==================================工作流权限判断-end=========================================
|
||||
|
||||
/**
|
||||
* Change permission mode
|
||||
*/
|
||||
async function togglePermissionMode() {
|
||||
appStore.setProjectConfig({
|
||||
permissionMode: projectSetting.permissionMode === PermissionModeEnum.BACK ? PermissionModeEnum.ROUTE_MAPPING : PermissionModeEnum.BACK,
|
||||
});
|
||||
location.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset and regain authority resource information
|
||||
* @param id
|
||||
*/
|
||||
async function resume() {
|
||||
const tabStore = useMultipleTabStore();
|
||||
tabStore.clearCacheTabs();
|
||||
resetRouter();
|
||||
const routes = await permissionStore.buildRoutesAction();
|
||||
routes.forEach((route) => {
|
||||
router.addRoute(route as unknown as RouteRecordRaw);
|
||||
});
|
||||
permissionStore.setLastBuildMenuTime();
|
||||
closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定是否存在权限
|
||||
*/
|
||||
function hasPermission(value?: RoleEnum | RoleEnum[] | string | string[], def = true): boolean {
|
||||
// Visible by default
|
||||
if (!value) {
|
||||
return def;
|
||||
}
|
||||
|
||||
const permMode = projectSetting.permissionMode;
|
||||
|
||||
if ([PermissionModeEnum.ROUTE_MAPPING, PermissionModeEnum.ROLE].includes(permMode)) {
|
||||
if (!isArray(value)) {
|
||||
return userStore.getRoleList?.includes(value as RoleEnum);
|
||||
}
|
||||
return (intersection(value, userStore.getRoleList) as RoleEnum[]).length > 0;
|
||||
}
|
||||
|
||||
if (PermissionModeEnum.BACK === permMode) {
|
||||
const allCodeList = permissionStore.getPermCodeList as string[];
|
||||
if (!isArray(value) && allCodeList && allCodeList.length > 0) {
|
||||
//=============================工作流权限判断-显示-begin==============================================
|
||||
if (formData) {
|
||||
let code = value as string;
|
||||
if (hasBpmPermission(code, '1') === true) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//=============================工作流权限判断-显示-end==============================================
|
||||
return allCodeList.includes(value);
|
||||
}
|
||||
return (intersection(value, allCodeList) as string[]).length > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* 是否禁用组件
|
||||
*/
|
||||
function isDisabledAuth(value?: RoleEnum | RoleEnum[] | string | string[], def = true): boolean {
|
||||
//=============================工作流权限判断-禁用-begin==============================================
|
||||
if (formData) {
|
||||
let code = value as string;
|
||||
if (hasBpmPermission(code, '2') === true) {
|
||||
return true;
|
||||
}
|
||||
//update-begin-author:taoyan date:2022-6-17 for: VUEN-1342【流程】编码方式 节点权限配置好后,未生效
|
||||
if (isCodingButNoConfig(code) == true) {
|
||||
return false;
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-17 for: VUEN-1342【流程】编码方式 节点权限配置好后,未生效
|
||||
}
|
||||
//=============================工作流权限判断-禁用-end==============================================
|
||||
return !hasPermission(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change roles
|
||||
* @param roles
|
||||
*/
|
||||
async function changeRole(roles: RoleEnum | RoleEnum[]): Promise<void> {
|
||||
if (projectSetting.permissionMode !== PermissionModeEnum.ROUTE_MAPPING) {
|
||||
throw new Error('Please switch PermissionModeEnum to ROUTE_MAPPING mode in the configuration to operate!');
|
||||
}
|
||||
|
||||
if (!isArray(roles)) {
|
||||
roles = [roles];
|
||||
}
|
||||
userStore.setRoleList(roles);
|
||||
await resume();
|
||||
}
|
||||
|
||||
/**
|
||||
* refresh menu data
|
||||
*/
|
||||
async function refreshMenu() {
|
||||
resume();
|
||||
}
|
||||
|
||||
//update-begin-author:taoyan date:2022-6-17 for: VUEN-1342【流程】编码方式 节点权限配置好后,未生效
|
||||
/**
|
||||
* 判断是不是 代码里写了逻辑但是没有配置权限这种情况
|
||||
*/
|
||||
function isCodingButNoConfig(code) {
|
||||
let all = permissionStore.allAuthList;
|
||||
if (all && all instanceof Array) {
|
||||
let temp = all.filter((item) => item.action == code);
|
||||
if (temp && temp.length > 0) {
|
||||
if (temp[0].status == '0') {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// update-begin--author:liaozhiyang---date:20240705---for:【TV360X-1604】按钮禁用权限在接口中查不到也禁用
|
||||
return false;
|
||||
// update-end--author:liaozhiyang---date:20240705---for:【TV360X-1604】按钮禁用权限在接口中查不到也禁用
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//update-end-author:taoyan date:2022-6-17 for: VUEN-1342【流程】编码方式 节点权限配置好后,未生效
|
||||
|
||||
return { changeRole, hasPermission, togglePermissionMode, refreshMenu, isDisabledAuth, initBpmFormData };
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { nextTick } from 'vue';
|
||||
import $printJS, { Configuration } from 'print-js';
|
||||
import Print from 'vue-print-nb-jeecg/src/printarea';
|
||||
|
||||
/**
|
||||
* 调用 printJS,如果type = html,就走 printNB 的方法
|
||||
*/
|
||||
export function printJS(configuration: Configuration) {
|
||||
if (configuration?.type === 'html') {
|
||||
printNb(configuration.printable);
|
||||
} else {
|
||||
return $printJS(configuration);
|
||||
}
|
||||
}
|
||||
|
||||
/** 调用 printNB 打印 */
|
||||
export function printNb(domId) {
|
||||
if (domId) {
|
||||
localPrint(domId);
|
||||
} else {
|
||||
window.print();
|
||||
}
|
||||
}
|
||||
|
||||
let closeBtn = true;
|
||||
|
||||
function localPrint(domId) {
|
||||
if (typeof domId === 'string' && !domId.startsWith('#')) {
|
||||
domId = '#' + domId;
|
||||
}
|
||||
nextTick(() => {
|
||||
if (closeBtn) {
|
||||
closeBtn = false;
|
||||
new Print({
|
||||
el: domId,
|
||||
endCallback() {
|
||||
closeBtn = true;
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
|
||||
interface ScriptOptions {
|
||||
src: string;
|
||||
}
|
||||
|
||||
export function useScript(opts: ScriptOptions) {
|
||||
const isLoading = ref(false);
|
||||
const error = ref(false);
|
||||
const success = ref(false);
|
||||
let script: HTMLScriptElement;
|
||||
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
onMounted(() => {
|
||||
script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.onload = function () {
|
||||
isLoading.value = false;
|
||||
success.value = true;
|
||||
error.value = false;
|
||||
resolve('');
|
||||
};
|
||||
|
||||
script.onerror = function (err) {
|
||||
isLoading.value = false;
|
||||
success.value = false;
|
||||
error.value = true;
|
||||
reject(err);
|
||||
};
|
||||
|
||||
script.src = opts.src;
|
||||
document.head.appendChild(script);
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
script && script.remove();
|
||||
});
|
||||
|
||||
return {
|
||||
isLoading,
|
||||
error,
|
||||
success,
|
||||
toPromise: () => promise,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { nextTick, unref } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import type { Options } from 'sortablejs';
|
||||
|
||||
export function useSortable(el: HTMLElement | Ref<HTMLElement>, options?: Options) {
|
||||
function initSortable() {
|
||||
nextTick(async () => {
|
||||
if (!el) return;
|
||||
|
||||
const Sortable = (await import('sortablejs')).default;
|
||||
Sortable.create(unref(el), {
|
||||
animation: 500,
|
||||
delay: 400,
|
||||
delayOnTouchOnly: true,
|
||||
...options,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return { initSortable };
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// 单点登录核心类
|
||||
import { getToken } from '/@/utils/auth';
|
||||
import { getUrlParam } from '/@/utils';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { validateCasLogin } from '/@/api/sys/user';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const globSetting = useGlobSetting();
|
||||
const openSso = globSetting.openSso;
|
||||
export function useSso() {
|
||||
//update-begin---author:wangshuai---date:2024-01-03---for:【QQYUN-7805】SSO登录强制用http #957---
|
||||
let locationUrl = document.location.protocol +"//" + window.location.host + '/';
|
||||
//update-end---author:wangshuai---date:2024-01-03---for:【QQYUN-7805】SSO登录强制用http #957---
|
||||
|
||||
/**
|
||||
* 单点登录
|
||||
*/
|
||||
async function ssoLogin() {
|
||||
if (openSso == 'true') {
|
||||
let token = getToken();
|
||||
let ticket = getUrlParam('ticket');
|
||||
if (!token) {
|
||||
if (ticket) {
|
||||
await validateCasLogin({
|
||||
ticket: ticket,
|
||||
service: locationUrl,
|
||||
}).then((res) => {
|
||||
const userStore = useUserStore();
|
||||
userStore.setToken(res.token);
|
||||
return userStore.afterLoginAction(true, {});
|
||||
});
|
||||
} else {
|
||||
window.location.href = globSetting.casBaseUrl + '/login?service=' + encodeURIComponent(locationUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
*/
|
||||
async function ssoLoginOut() {
|
||||
window.location.href = globSetting.casBaseUrl + '/logout?service=' + encodeURIComponent(locationUrl);
|
||||
}
|
||||
return { ssoLogin, ssoLoginOut };
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
import type { RouteLocationNormalized, Router } from 'vue-router';
|
||||
|
||||
import { useRouter } from 'vue-router';
|
||||
import { unref } from 'vue';
|
||||
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
import { useAppStore } from '/@/store/modules/app';
|
||||
|
||||
enum TableActionEnum {
|
||||
REFRESH,
|
||||
CLOSE_ALL,
|
||||
CLOSE_LEFT,
|
||||
CLOSE_RIGHT,
|
||||
CLOSE_OTHER,
|
||||
CLOSE_CURRENT,
|
||||
CLOSE,
|
||||
}
|
||||
|
||||
export function useTabs(_router?: Router) {
|
||||
const appStore = useAppStore();
|
||||
|
||||
function canIUseTabs(): boolean {
|
||||
const { show } = appStore.getMultiTabsSetting;
|
||||
if (!show) {
|
||||
throw new Error('The multi-tab page is currently not open, please open it in the settings!');
|
||||
}
|
||||
return !!show;
|
||||
}
|
||||
|
||||
const tabStore = useMultipleTabStore();
|
||||
const router = _router || useRouter();
|
||||
|
||||
const { currentRoute } = router;
|
||||
|
||||
function getCurrentTab() {
|
||||
const route = unref(currentRoute);
|
||||
return tabStore.getTabList.find((item) => item.path === route.path)!;
|
||||
}
|
||||
|
||||
async function updateTabTitle(title: string, tab?: RouteLocationNormalized) {
|
||||
const canIUse = canIUseTabs;
|
||||
if (!canIUse) {
|
||||
return;
|
||||
}
|
||||
const targetTab = tab || getCurrentTab();
|
||||
await tabStore.setTabTitle(title, targetTab);
|
||||
}
|
||||
|
||||
async function updateTabPath(path: string, tab?: RouteLocationNormalized) {
|
||||
const canIUse = canIUseTabs;
|
||||
if (!canIUse) {
|
||||
return;
|
||||
}
|
||||
const targetTab = tab || getCurrentTab();
|
||||
await tabStore.updateTabPath(path, targetTab);
|
||||
}
|
||||
|
||||
async function handleTabAction(action: TableActionEnum, tab?: RouteLocationNormalized) {
|
||||
const canIUse = canIUseTabs;
|
||||
if (!canIUse) {
|
||||
return;
|
||||
}
|
||||
const currentTab = getCurrentTab();
|
||||
switch (action) {
|
||||
case TableActionEnum.REFRESH:
|
||||
await tabStore.refreshPage(router);
|
||||
break;
|
||||
|
||||
case TableActionEnum.CLOSE_ALL:
|
||||
await tabStore.closeAllTab(router);
|
||||
break;
|
||||
|
||||
case TableActionEnum.CLOSE_LEFT:
|
||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
await tabStore.closeLeftTabs(tab || currentTab, router);
|
||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
break;
|
||||
|
||||
case TableActionEnum.CLOSE_RIGHT:
|
||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
await tabStore.closeRightTabs(tab || currentTab, router);
|
||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
break;
|
||||
|
||||
case TableActionEnum.CLOSE_OTHER:
|
||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
await tabStore.closeOtherTabs(tab || currentTab, router);
|
||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
break;
|
||||
|
||||
case TableActionEnum.CLOSE_CURRENT:
|
||||
case TableActionEnum.CLOSE:
|
||||
await tabStore.closeTab(tab || currentTab, router);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭相同的路由
|
||||
* @param path
|
||||
*/
|
||||
function closeSameRoute(path) {
|
||||
if(path.indexOf('?')>0){
|
||||
path = path.split('?')[0];
|
||||
}
|
||||
let tab = tabStore.getTabList.find((item) => item.path.indexOf(path)>=0)!;
|
||||
if(tab){
|
||||
tabStore.closeTab(tab, router);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
refreshPage: () => handleTabAction(TableActionEnum.REFRESH),
|
||||
// update-begin--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
closeAll: (tab) => handleTabAction(TableActionEnum.CLOSE_ALL, tab),
|
||||
closeLeft: (tab) => handleTabAction(TableActionEnum.CLOSE_LEFT, tab),
|
||||
closeRight: (tab) => handleTabAction(TableActionEnum.CLOSE_RIGHT, tab),
|
||||
closeOther: (tab) => handleTabAction(TableActionEnum.CLOSE_OTHER, tab),
|
||||
// update-end--author:liaozhiyang---date:20240605---for:【TV360X-732】非当前页右键关闭左侧、关闭右侧、关闭其它功能正常使用
|
||||
closeCurrent: () => handleTabAction(TableActionEnum.CLOSE_CURRENT),
|
||||
close: (tab?: RouteLocationNormalized) => handleTabAction(TableActionEnum.CLOSE, tab),
|
||||
setTitle: (title: string, tab?: RouteLocationNormalized) => updateTabTitle(title, tab),
|
||||
updatePath: (fullPath: string, tab?: RouteLocationNormalized) => updateTabPath(fullPath, tab),
|
||||
closeSameRoute
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import type {Menu} from "@/router/types";
|
||||
import { ref, watch, unref } from 'vue';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useTitle as usePageTitle } from '@vueuse/core';
|
||||
import { useGlobSetting } from '/@/hooks/setting';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useLocaleStore } from '/@/store/modules/locale';
|
||||
import { REDIRECT_NAME } from '/@/router/constant';
|
||||
import { getMenus } from '/@/router/menus';
|
||||
|
||||
/**
|
||||
* Listening to page changes and dynamically changing site titles
|
||||
*/
|
||||
export function useTitle() {
|
||||
const { title } = useGlobSetting();
|
||||
const { t } = useI18n();
|
||||
const { currentRoute } = useRouter();
|
||||
const localeStore = useLocaleStore();
|
||||
|
||||
const pageTitle = usePageTitle();
|
||||
|
||||
const menus = ref<Menu[] | null>(null)
|
||||
|
||||
watch(
|
||||
[() => currentRoute.value.path, () => localeStore.getLocale],
|
||||
async () => {
|
||||
const route = unref(currentRoute);
|
||||
|
||||
if (route.name === REDIRECT_NAME) {
|
||||
return;
|
||||
}
|
||||
// update-begin--author:liaozhiyang---date:20231110---for:【QQYUN-6938】online菜单名字和页面title不一致
|
||||
if (route.params && Object.keys(route.params).length) {
|
||||
if (!menus.value) {
|
||||
menus.value = await getMenus();
|
||||
}
|
||||
const getTitle = getMatchingRouterName(menus.value, route.fullPath);
|
||||
let tTitle = '';
|
||||
if (getTitle) {
|
||||
tTitle = t(getTitle);
|
||||
} else {
|
||||
tTitle = t(route?.meta?.title as string);
|
||||
}
|
||||
pageTitle.value = tTitle ? ` ${tTitle} - ${title} ` : `${title}`;
|
||||
} else {
|
||||
const tTitle = t(route?.meta?.title as string);
|
||||
pageTitle.value = tTitle ? ` ${tTitle} - ${title} ` : `${title}`;
|
||||
}
|
||||
// update-end--author:liaozhiyang---date:20231110---for:【QQYUN-6938】online菜单名字和页面title不一致
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
}
|
||||
/**
|
||||
2023-11-09
|
||||
liaozhiyang
|
||||
获取路由匹配模式的真实页面名字
|
||||
*/
|
||||
function getMatchingRouterName(menus, path) {
|
||||
for (let i = 0, len = menus.length; i < len; i++) {
|
||||
const item = menus[i];
|
||||
if (item.path === path && !item.redirect && !item.paramPath) {
|
||||
return item.meta?.title;
|
||||
} else if (item.children?.length) {
|
||||
const result = getMatchingRouterName(item.children, path);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import { getCurrentInstance, onBeforeUnmount, ref, Ref, shallowRef, unref } from 'vue';
|
||||
import { useRafThrottle } from '/@/utils/domUtils';
|
||||
import { addResizeListener, removeResizeListener } from '/@/utils/event';
|
||||
import { isDef } from '/@/utils/is';
|
||||
|
||||
const domSymbol = Symbol('watermark-dom');
|
||||
|
||||
export function useWatermark(appendEl: Ref<HTMLElement | null> = ref(document.body) as Ref<HTMLElement>) {
|
||||
const func = useRafThrottle(function () {
|
||||
const el = unref(appendEl);
|
||||
if (!el) return;
|
||||
const { clientHeight: height, clientWidth: width } = el;
|
||||
updateWatermark({ height, width });
|
||||
});
|
||||
const id = domSymbol.toString();
|
||||
const watermarkEl = shallowRef<HTMLElement>();
|
||||
|
||||
const clear = () => {
|
||||
const domId = unref(watermarkEl);
|
||||
watermarkEl.value = undefined;
|
||||
const el = unref(appendEl);
|
||||
if (!el) return;
|
||||
domId && el.removeChild(domId);
|
||||
removeResizeListener(el, func);
|
||||
};
|
||||
|
||||
function createBase64(str: string) {
|
||||
const can = document.createElement('canvas');
|
||||
const width = 300;
|
||||
const height = 240;
|
||||
Object.assign(can, { width, height });
|
||||
|
||||
const cans = can.getContext('2d');
|
||||
if (cans) {
|
||||
cans.rotate((-20 * Math.PI) / 120);
|
||||
cans.font = '15px Vedana';
|
||||
cans.fillStyle = 'rgba(0, 0, 0, 0.15)';
|
||||
cans.textAlign = 'left';
|
||||
cans.textBaseline = 'middle';
|
||||
cans.fillText(str, width / 20, height);
|
||||
}
|
||||
return can.toDataURL('image/png');
|
||||
}
|
||||
|
||||
function updateWatermark(
|
||||
options: {
|
||||
width?: number;
|
||||
height?: number;
|
||||
str?: string;
|
||||
} = {}
|
||||
) {
|
||||
const el = unref(watermarkEl);
|
||||
if (!el) return;
|
||||
if (isDef(options.width)) {
|
||||
el.style.width = `${options.width}px`;
|
||||
}
|
||||
if (isDef(options.height)) {
|
||||
el.style.height = `${options.height}px`;
|
||||
}
|
||||
if (isDef(options.str)) {
|
||||
el.style.background = `url(${createBase64(options.str)}) left top repeat`;
|
||||
}
|
||||
}
|
||||
|
||||
const createWatermark = (str: string) => {
|
||||
if (unref(watermarkEl)) {
|
||||
updateWatermark({ str });
|
||||
return id;
|
||||
}
|
||||
const div = document.createElement('div');
|
||||
watermarkEl.value = div;
|
||||
div.id = id;
|
||||
div.style.pointerEvents = 'none';
|
||||
div.style.top = '0px';
|
||||
div.style.left = '0px';
|
||||
div.style.position = 'absolute';
|
||||
div.style.zIndex = '100000';
|
||||
const el = unref(appendEl);
|
||||
if (!el) return id;
|
||||
const { clientHeight: height, clientWidth: width } = el;
|
||||
updateWatermark({ str, width, height });
|
||||
el.appendChild(div);
|
||||
return id;
|
||||
};
|
||||
|
||||
function setWatermark(str: string) {
|
||||
createWatermark(str);
|
||||
addResizeListener(document.documentElement, func);
|
||||
const instance = getCurrentInstance();
|
||||
if (instance) {
|
||||
onBeforeUnmount(() => {
|
||||
clear();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return { setWatermark, clear };
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
|
||||
import { unref } from 'vue';
|
||||
import { useWebSocket, WebSocketResult } from '@vueuse/core';
|
||||
import { getToken } from '/@/utils/auth';
|
||||
|
||||
let result: WebSocketResult<any>;
|
||||
const listeners = new Map();
|
||||
|
||||
/**
|
||||
* 开启 WebSocket 链接,全局只需执行一次
|
||||
* @param url
|
||||
*/
|
||||
export function connectWebSocket(url: string) {
|
||||
//update-begin-author:taoyan date:2022-4-24 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
const token = (getToken() || '') as string;
|
||||
result = useWebSocket(url, {
|
||||
// 自动重连 (遇到错误最多重复连接10次)
|
||||
autoReconnect: {
|
||||
retries: 10,
|
||||
// TODO 服务器压力暂改成50秒
|
||||
delay: 50000,
|
||||
},
|
||||
// 心跳检测
|
||||
heartbeat: {
|
||||
message: 'ping',
|
||||
// TODO 服务器压力暂改成50秒
|
||||
interval: 50000,
|
||||
},
|
||||
protocols: [token],
|
||||
// update-begin--author:liaozhiyang---date:20240726---for:[issues/6662] 演示系统socket总断,换一个写法
|
||||
onConnected: function (ws) {
|
||||
console.log('[WebSocket] 连接成功', ws);
|
||||
},
|
||||
onDisconnected: function (ws, event) {
|
||||
console.log('[WebSocket] 连接断开:', ws, event);
|
||||
},
|
||||
onError: function (ws, event) {
|
||||
console.log('[WebSocket] 连接发生错误: ', ws, event);
|
||||
},
|
||||
onMessage: function (_ws, e) {
|
||||
console.debug('[WebSocket] -----接收消息-------', e.data);
|
||||
try {
|
||||
//update-begin---author:wangshuai---date:2024-05-07---for:【issues/1161】前端websocket因心跳导致监听不起作用---
|
||||
if (e.data === 'ping') {
|
||||
return;
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-05-07---for:【issues/1161】前端websocket因心跳导致监听不起作用---
|
||||
const data = JSON.parse(e.data);
|
||||
for (const callback of listeners.keys()) {
|
||||
try {
|
||||
callback(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[WebSocket] data解析失败:', err);
|
||||
}
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20240726---for:[issues/6662] 演示系统socket总断,换一个写法
|
||||
});
|
||||
// update-begin--author:liaozhiyang---date:20240726---for:[issues/6662] 演示系统socket总断,换一个写法
|
||||
//update-end-author:taoyan date:2022-4-24 for: v2.4.6 的 websocket 服务端,存在性能和安全问题。 #3278
|
||||
// if (result) {
|
||||
// result.open = onOpen;
|
||||
// result.close = onClose;
|
||||
|
||||
// const ws = unref(result.ws);
|
||||
// if(ws!=null){
|
||||
// ws.onerror = onError;
|
||||
// ws.onmessage = onMessage;
|
||||
// //update-begin---author:wangshuai---date:2024-04-30---for:【issues/1217】发送测试消息后,铃铛数字没有变化---
|
||||
// ws.onopen = onOpen;
|
||||
// ws.onclose = onClose;
|
||||
// //update-end---author:wangshuai---date:2024-04-30---for:【issues/1217】发送测试消息后,铃铛数字没有变化---
|
||||
// }
|
||||
// }
|
||||
// update-end--author:liaozhiyang---date:20240726---for:[issues/6662] 演示系统socket总断,换一个写法
|
||||
}
|
||||
|
||||
function onOpen() {
|
||||
console.log('[WebSocket] 连接成功');
|
||||
}
|
||||
|
||||
function onClose(e) {
|
||||
console.log('[WebSocket] 连接断开:', e);
|
||||
}
|
||||
|
||||
function onError(e) {
|
||||
console.log('[WebSocket] 连接发生错误: ', e);
|
||||
}
|
||||
|
||||
function onMessage(e) {
|
||||
console.debug('[WebSocket] -----接收消息-------', e.data);
|
||||
try {
|
||||
//update-begin---author:wangshuai---date:2024-05-07---for:【issues/1161】前端websocket因心跳导致监听不起作用---
|
||||
if(e==='ping'){
|
||||
return;
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-05-07---for:【issues/1161】前端websocket因心跳导致监听不起作用---
|
||||
const data = JSON.parse(e.data);
|
||||
for (const callback of listeners.keys()) {
|
||||
try {
|
||||
callback(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[WebSocket] data解析失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加 WebSocket 消息监听
|
||||
* @param callback
|
||||
*/
|
||||
export function onWebSocket(callback: (data: object) => any) {
|
||||
if (!listeners.has(callback)) {
|
||||
if (typeof callback === 'function') {
|
||||
listeners.set(callback, null);
|
||||
} else {
|
||||
console.debug('[WebSocket] 添加 WebSocket 消息监听失败:传入的参数不是一个方法');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解除 WebSocket 消息监听
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
export function offWebSocket(callback: (data: object) => any) {
|
||||
listeners.delete(callback);
|
||||
}
|
||||
|
||||
export function useMyWebSocket() {
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user