自动填充组件api搜索
代码生成路径大小写修正 折叠组件样式修改 信息体组件可带出部门 详情页子表样式调整:按钮下移 栅格字段栅格数配置不生效 自动编号页面样式修正、增加编号配置可排序用于修改编号配置生成规则、修正自动编号编辑缺陷 列表页样式修正 详情页按钮间距修正
This commit is contained in:
@ -15,13 +15,13 @@ VITE_DROP_CONSOLE = false
|
|||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
# 如果没有跨域问题,直接在这里配置即可
|
# 如果没有跨域问题,直接在这里配置即可
|
||||||
VITE_GLOB_API_URL=http://192.168.0.139:8080
|
VITE_GLOB_API_URL=http://10.133.96.105:8077
|
||||||
|
|
||||||
# 文件上传接口 可选
|
# 文件上传接口 可选
|
||||||
VITE_GLOB_UPLOAD_URL = /system/oss/upload
|
VITE_GLOB_UPLOAD_URL = /system/oss/upload
|
||||||
|
|
||||||
# 文件预览接口 可选
|
# 文件预览接口 可选
|
||||||
VITE_GLOB_UPLOAD_PREVIEW = http://114.116.210.204:8012/onlinePreview?url=
|
VITE_GLOB_UPLOAD_PREVIEW = http://10.0.252.28:8012/onlinePreview?url=
|
||||||
|
|
||||||
#外部url地址
|
#外部url地址
|
||||||
VITE_GLOB_OUT_LINK_URL = ['http://localhost:4100']
|
VITE_GLOB_OUT_LINK_URL = ['http://localhost:4100']
|
||||||
|
|||||||
@ -16,7 +16,7 @@ VITE_BUILD_COMPRESS = 'gzip'
|
|||||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
||||||
|
|
||||||
# 接口地址 可以由nginx做转发或者直接写实际地址
|
# 接口地址 可以由nginx做转发或者直接写实际地址
|
||||||
VITE_GLOB_API_URL=http://vue.itc.gdyd.com:8080
|
VITE_GLOB_API_URL=http://10.0.252.5:3100/api
|
||||||
|
|
||||||
|
|
||||||
# 文件上传地址 可以由nginx做转发或者直接写实际地址
|
# 文件上传地址 可以由nginx做转发或者直接写实际地址
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
&-normal {
|
&-normal {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-show-span::before {
|
&-show-span::before {
|
||||||
|
|||||||
@ -93,7 +93,7 @@
|
|||||||
height: 32px;
|
height: 32px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-bottom: 1px solid @border-color-light;
|
//border-bottom: 1px solid @border-color-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__footer {
|
&__footer {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="[`${prefixCls}__header pr-2 py-5`, $attrs.class]">
|
<div :class="[`${prefixCls}__header pr-2 py-5`, $attrs.class]">
|
||||||
<BasicTitle :helpMessage="helpMessage" normal>
|
<BasicTitle :helpMessage="helpMessage" normal @click="$emit('expand')" >
|
||||||
<template v-if="title">
|
<template v-if="title">
|
||||||
<div :class="{ 'header-title': hasLeftBorder }">
|
<div :class="{ 'header-title': hasLeftBorder }">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
@ -44,6 +44,6 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
border-left: 6px solid #5e95ff;
|
//border-left: 6px solid #5e95ff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -8,18 +8,22 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, unref, watch } from 'vue';
|
import {inject, ref, unref, watch, watchEffect} from 'vue';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import { isFunction } from '/@/utils/is';
|
import { isFunction } from '/@/utils/is';
|
||||||
import { get } from 'lodash-es';
|
import { get } from 'lodash-es';
|
||||||
import { getDicDetailList } from '/@/api/system/dic';
|
import { getDicDetailList } from '/@/api/system/dic';
|
||||||
import { getDatasourceData } from '/@/api/system/datasource';
|
import { getDatasourceData } from '/@/api/system/datasource';
|
||||||
|
import {apiConfigFunc, camelCaseString, isValidJSON} from "/@/utils/event/design";
|
||||||
|
|
||||||
const options = ref<{ value: string; label: string }[]>([]);
|
const options = ref<{ value: string; label: string }[]>([]);
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const isFirstLoad = ref(true);
|
const isFirstLoad = ref(true);
|
||||||
|
|
||||||
|
const formModel = inject<any>('formModel', null);
|
||||||
|
const isCamelCase = inject<boolean>('isCamelCase', false);
|
||||||
|
|
||||||
const emit = defineEmits(['update:value']);
|
const emit = defineEmits(['update:value']);
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -28,6 +32,7 @@
|
|||||||
type: Function as PropType<(arg?: Recordable) => Promise<{ value: string; text: string }[]>>,
|
type: Function as PropType<(arg?: Recordable) => Promise<{ value: string; text: string }[]>>,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
apiConfig: Object,
|
||||||
// api params
|
// api params
|
||||||
params: {
|
params: {
|
||||||
type: [Array, Object, String, Number],
|
type: [Array, Object, String, Number],
|
||||||
@ -42,8 +47,33 @@
|
|||||||
alwaysLoad: propTypes.bool.def(false),
|
alwaysLoad: propTypes.bool.def(false),
|
||||||
//数据来源 默认为空 如果不为空 则参数 api
|
//数据来源 默认为空 如果不为空 则参数 api
|
||||||
datasourceType: String,
|
datasourceType: String,
|
||||||
|
index: Number,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
if (props.datasourceType === 'api' && props.apiConfig?.apiParams) {
|
||||||
|
props.apiConfig.apiParams.forEach((params) => {
|
||||||
|
params.tableInfo?.forEach((o) => {
|
||||||
|
if (o.bindType == 'data') {
|
||||||
|
let val = isValidJSON(o.value);
|
||||||
|
let field = '';
|
||||||
|
if (val && val.bindTable) {
|
||||||
|
let table = !isCamelCase
|
||||||
|
? val.bindTable + 'List'
|
||||||
|
: camelCaseString(val.bindTable + '_List');
|
||||||
|
field = !isCamelCase ? val.bindField : camelCaseString(val.bindField);
|
||||||
|
formModel &&
|
||||||
|
formModel[table!][props.index || 0] &&
|
||||||
|
formModel[table!][props.index || 0][field];
|
||||||
|
} else if (val && val.bindField) {
|
||||||
|
field = !isCamelCase ? val.bindField : camelCaseString(val.bindField);
|
||||||
|
formModel && formModel[field];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
@ -57,9 +87,12 @@
|
|||||||
if (props.datasourceType) {
|
if (props.datasourceType) {
|
||||||
if (props.datasourceType === 'dic') {
|
if (props.datasourceType === 'dic') {
|
||||||
api = getDicDetailList;
|
api = getDicDetailList;
|
||||||
}
|
}else if (props.datasourceType === 'datasource') {
|
||||||
if (props.datasourceType === 'datasource') {
|
|
||||||
api = getDatasourceData;
|
api = getDatasourceData;
|
||||||
|
}else if(props.datasourceType === 'api' && props.apiConfig?.path) {
|
||||||
|
props.apiConfig.input=_value;
|
||||||
|
options.value = await apiConfigFunc(props.apiConfig, isCamelCase, formModel, props.index);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
api = props.api;
|
api = props.api;
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watchEffect } from 'vue';
|
import {inject, ref, watchEffect} from 'vue';
|
||||||
import { getDepartment } from '/@/api/system/department';
|
import { getDepartment } from '/@/api/system/department';
|
||||||
import { getUser } from '/@/api/system/user';
|
import { getUser } from '/@/api/system/user';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
@ -15,6 +15,10 @@
|
|||||||
value: String,
|
value: String,
|
||||||
size: String,
|
size: String,
|
||||||
infoType: Number,
|
infoType: Number,
|
||||||
|
deptField: {
|
||||||
|
type: String,
|
||||||
|
default: 'deptId'
|
||||||
|
},
|
||||||
bordered: {
|
bordered: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
@ -23,8 +27,12 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
userNameWithDepartment:{
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
const formModel = inject<Recordable>('formModel');
|
||||||
const emit = defineEmits(['update:value']);
|
const emit = defineEmits(['update:value']);
|
||||||
|
|
||||||
const name = ref<string>();
|
const name = ref<string>();
|
||||||
@ -33,9 +41,11 @@
|
|||||||
if (props && props.value) {
|
if (props && props.value) {
|
||||||
//当前用户
|
//当前用户
|
||||||
if (props.infoType === 0) {
|
if (props.infoType === 0) {
|
||||||
|
let deptId=formModel![props.deptField];
|
||||||
|
let deptName=deptId?await getDepartment(deptId):"";
|
||||||
//判断传入的值 是不是当前登录人 或需要二次加载 就不需要发请求获取用户信息了
|
//判断传入的值 是不是当前登录人 或需要二次加载 就不需要发请求获取用户信息了
|
||||||
if (props.value === userStore.getUserInfo.id || props.loadAgain) {
|
if (props.value === userStore.getUserInfo.id || props.loadAgain) {
|
||||||
name.value = userStore.getUserInfo.name;
|
name.value = userStore.getUserInfo.name+(props.userNameWithDepartment&&(deptName||userStore.getUserInfo.departmentName)?("/"+(deptName||userStore.getUserInfo.departmentName)):"");
|
||||||
emit('update:value', userStore.getUserInfo.id);
|
emit('update:value', userStore.getUserInfo.id);
|
||||||
} else {
|
} else {
|
||||||
//如果不是当前登陆人 需要用户id 查询当前用户信息
|
//如果不是当前登陆人 需要用户id 查询当前用户信息
|
||||||
@ -68,8 +78,10 @@
|
|||||||
} else {
|
} else {
|
||||||
//当前用户
|
//当前用户
|
||||||
if (props.infoType === 0) {
|
if (props.infoType === 0) {
|
||||||
|
let deptId=formModel![props.deptField];
|
||||||
|
let deptName=deptId?await getDepartment(deptId):"";
|
||||||
//判断传入的值 是不是当前登录人 就不需要发请求获取用户信息了
|
//判断传入的值 是不是当前登录人 就不需要发请求获取用户信息了
|
||||||
name.value = userStore.getUserInfo.name;
|
name.value = userStore.getUserInfo.name+(props.userNameWithDepartment&&(deptName||userStore.getUserInfo.departmentName)?("/"+(deptName||userStore.getUserInfo.departmentName)):"");
|
||||||
emit('update:value', userStore.getUserInfo.id);
|
emit('update:value', userStore.getUserInfo.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="tbl-toolbar">
|
|
||||||
<a-button v-if="useSelectButton && !disableAddRow" :disabled="disabled" class="select-btn" type="primary" @click="multipleDialog = true">
|
|
||||||
{{ buttonName }}
|
|
||||||
</a-button>
|
|
||||||
<a-button v-if="!disabled && !disableAddRow" type="primary" @click="add">
|
|
||||||
<PlusOutlined />
|
|
||||||
{{ t('新增') }}
|
|
||||||
</a-button>
|
|
||||||
</div>
|
|
||||||
<a-table :bordered="showFormBorder" :columns="headColums.length > 0 ? headColums : columns" :data-source="addDataKey(data)" :pagination="showPagination ? { defaultPageSize: 10 } : false" :scroll="{ x: 'max-content' }">
|
<a-table :bordered="showFormBorder" :columns="headColums.length > 0 ? headColums : columns" :data-source="addDataKey(data)" :pagination="showPagination ? { defaultPageSize: 10 } : false" :scroll="{ x: 'max-content' }">
|
||||||
<template #summary>
|
<template #summary>
|
||||||
<a-table-summary-row v-if="columns.some((x) => x.componentProps?.subTotal)">
|
<a-table-summary-row v-if="columns.some((x) => x.componentProps?.subTotal)">
|
||||||
@ -80,6 +72,17 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
|
|
||||||
|
<div class="tbl-toolbar">
|
||||||
|
<a-button v-if="useSelectButton && !disableAddRow" :disabled="disabled" class="select-btn" type="primary" @click="multipleDialog = true">
|
||||||
|
{{ buttonName }}
|
||||||
|
</a-button>
|
||||||
|
<a-button v-if="!disabled && !disableAddRow && useAddButton" type="primary" @click="add">
|
||||||
|
<PlusOutlined />
|
||||||
|
{{ t('新增') }}
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<FormItemRest>
|
<FormItemRest>
|
||||||
<MultipleSelect
|
<MultipleSelect
|
||||||
ref="MultipleSelectRef"
|
ref="MultipleSelectRef"
|
||||||
@ -173,6 +176,10 @@
|
|||||||
* 是否使用按钮选数据
|
* 是否使用按钮选数据
|
||||||
*/
|
*/
|
||||||
useSelectButton: Boolean,
|
useSelectButton: Boolean,
|
||||||
|
useAddButton: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
// 是否开启分页
|
// 是否开启分页
|
||||||
showPagination: Boolean,
|
showPagination: Boolean,
|
||||||
/**
|
/**
|
||||||
@ -637,6 +644,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tbl-toolbar {
|
.tbl-toolbar {
|
||||||
margin-bottom: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -344,10 +344,10 @@
|
|||||||
// 列宽支持两种模式 labelWidthMode = flex为百分比宽度 fix 为定宽
|
// 列宽支持两种模式 labelWidthMode = flex为百分比宽度 fix 为定宽
|
||||||
const commonLabelCol = unref(itemLabelWidthProp).labelCol;
|
const commonLabelCol = unref(itemLabelWidthProp).labelCol;
|
||||||
const itemLabelCol = unref(getComponentsProps).labelCol;
|
const itemLabelCol = unref(getComponentsProps).labelCol;
|
||||||
const { labelWidthMode, labelFixWidth } = props.schema.componentProps as any;
|
const { labelWidthMode, labelFixWidth, span } = props.schema.componentProps as any;
|
||||||
let labelCol: any = {};
|
let labelCol: any = {};
|
||||||
if (labelWidthMode !== 'fix') {
|
if (labelWidthMode !== 'fix') {
|
||||||
labelCol.span = itemLabelCol?.span || commonLabelCol?.span;
|
labelCol.span = span || itemLabelCol?.span || commonLabelCol?.span;
|
||||||
} else {
|
} else {
|
||||||
labelCol.style = {
|
labelCol.style = {
|
||||||
width: `${labelFixWidth || 120}px`
|
width: `${labelFixWidth || 120}px`
|
||||||
|
|||||||
@ -4,12 +4,12 @@
|
|||||||
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
|
<Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
|
||||||
<PopConfirmButton v-bind="action">
|
<PopConfirmButton v-bind="action">
|
||||||
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
|
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
|
||||||
<template v-if="action.label">{{ action.label }}</template>
|
<template v-if="action.label"><span :style="action.style">{{ action.label }}</span></template>
|
||||||
</PopConfirmButton>
|
</PopConfirmButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<PopConfirmButton v-else placement="leftBottom" v-bind="action">
|
<PopConfirmButton v-else placement="leftBottom" v-bind="action">
|
||||||
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
|
<Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
|
||||||
<template v-if="action.label">{{ action.label }}</template>
|
<template v-if="action.label"><span :style="action.style">{{ action.label }}</span></template>
|
||||||
</PopConfirmButton>
|
</PopConfirmButton>
|
||||||
<Divider
|
<Divider
|
||||||
type="vertical"
|
type="vertical"
|
||||||
|
|||||||
@ -1,17 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="width: 100%" :class="{ flex: toolBarWidth + formWidth + 200 < tableWidth }">
|
<div style="width: 100%;margin:20px;" :class="{ flex: toolBarWidth + formWidth + 200 < tableWidth }">
|
||||||
<div v-if="$slots.headerTop" style="margin: 5px">
|
<div v-if="$slots.headerTop" style="margin: 5px">
|
||||||
<slot name="headerTop"></slot>
|
<slot name="headerTop"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
:class="`${prefixCls}__toolbar float-left`"
|
||||||
|
:style="[toolBarWidth + formWidth + 200 < tableWidth ? 'flex: none' : 'margin: 0']"
|
||||||
|
>
|
||||||
|
<Divider type="vertical" v-if="false&&$slots.toolbar" class="!ml-2 !mr-4" />
|
||||||
|
<slot name="toolbar"></slot>
|
||||||
|
<Divider type="vertical" v-if="false&&$slots.toolbar && showTableSetting" class="!mx-3" />
|
||||||
|
<TableSetting
|
||||||
|
:setting="tableSetting"
|
||||||
|
v-if="showTableSetting"
|
||||||
|
@columns-change="handleColumnChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="flex items-center justify-between"
|
class="flex items-center justify-between"
|
||||||
:style="[toolBarWidth + formWidth + 200 < tableWidth ? 'flex:auto' : '']"
|
:style="[toolBarWidth + formWidth + 200 < tableWidth ? 'flex:auto' : '']"
|
||||||
>
|
>
|
||||||
<slot name="tableTitle" v-if="$slots.tableTitle"></slot>
|
<slot name="tableTitle" v-if="false&&$slots.tableTitle"></slot>
|
||||||
<TableTitle
|
<TableTitle
|
||||||
:helpMessage="titleHelpMessage"
|
:helpMessage="titleHelpMessage"
|
||||||
:title="title"
|
:title="title"
|
||||||
v-if="!$slots.tableTitle && title"
|
v-if="false&&!$slots.tableTitle && title"
|
||||||
/>
|
/>
|
||||||
<div :class="['flex', advanceRight ? 'w-full' : '']">
|
<div :class="['flex', advanceRight ? 'w-full' : '']">
|
||||||
<BasicForm
|
<BasicForm
|
||||||
@ -36,19 +51,7 @@
|
|||||||
</BasicForm>
|
</BasicForm>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
:class="`${prefixCls}__toolbar float-right`"
|
|
||||||
:style="[toolBarWidth + formWidth + 200 < tableWidth ? 'flex: none' : 'margin: -5px 0 8px']"
|
|
||||||
>
|
|
||||||
<Divider type="vertical" v-if="$slots.toolbar" class="!ml-2 !mr-4" />
|
|
||||||
<slot name="toolbar"></slot>
|
|
||||||
<Divider type="vertical" v-if="$slots.toolbar && showTableSetting" class="!mx-3" />
|
|
||||||
<TableSetting
|
|
||||||
:setting="tableSetting"
|
|
||||||
v-if="showTableSetting"
|
|
||||||
@columns-change="handleColumnChange"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div v-if="$slots.headerContent">
|
<div v-if="$slots.headerContent">
|
||||||
<slot name="headerContent"></slot>
|
<slot name="headerContent"></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
const getSetting = computed((): TableSetting => {
|
const getSetting = computed((): TableSetting => {
|
||||||
return {
|
return {
|
||||||
redo: true,
|
redo: false,
|
||||||
size: true,
|
size: true,
|
||||||
setting: true,
|
setting: true,
|
||||||
fullScreen: false,
|
fullScreen: false,
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export async function apiConfigFunc(apiConfig, isCustomForm = false, formModel?,
|
|||||||
//queryString
|
//queryString
|
||||||
if (param.key === '1' && param.tableInfo && param.tableInfo.length) {
|
if (param.key === '1' && param.tableInfo && param.tableInfo.length) {
|
||||||
for (const query of param.tableInfo) {
|
for (const query of param.tableInfo) {
|
||||||
queryParam[query.name] = getParamsValue(query, formModel, isCustomForm, index);
|
queryParam[query.name] = apiConfig.input||getParamsValue(query, formModel, isCustomForm, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//header
|
//header
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import { GeneratorAppModel } from '/@/api/system/generator/model';
|
|||||||
import { buildAppComponentType, setApiConfig } from './designHelper';
|
import { buildAppComponentType, setApiConfig } from './designHelper';
|
||||||
import { getWorkflowPermissionConfig } from '/@/hooks/web/useWorkFlowForm';
|
import { getWorkflowPermissionConfig } from '/@/hooks/web/useWorkFlowForm';
|
||||||
|
|
||||||
|
const isOutputDirLowerName=false;
|
||||||
/**
|
/**
|
||||||
* 构建代码
|
* 构建代码
|
||||||
* @param model 配置
|
* @param model 配置
|
||||||
@ -73,7 +74,7 @@ export function buildAppCode(
|
|||||||
export function buildApiCode(model: GeneratorConfig, _tableInfo: TableInfo[]): string {
|
export function buildApiCode(model: GeneratorConfig, _tableInfo: TableInfo[]): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
// const lowerClassName = lowerCase(className);
|
// const lowerClassName = lowerCase(className);
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
const pascalClassName = upperFirst(camelCase(className));
|
const pascalClassName = upperFirst(camelCase(className));
|
||||||
|
|
||||||
let mainTable;
|
let mainTable;
|
||||||
@ -399,7 +400,7 @@ export function buildListCode(model: GeneratorConfig): string {
|
|||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
const formType = model.formJson.config.formType;
|
const formType = model.formJson.config.formType;
|
||||||
// const lowerClassName = lowerCase(className);
|
// const lowerClassName = lowerCase(className);
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
const pascalClassName = upperFirst(camelCase(className));
|
const pascalClassName = upperFirst(camelCase(className));
|
||||||
|
|
||||||
// //是否有左侧菜单
|
// //是否有左侧菜单
|
||||||
@ -1650,7 +1651,7 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
|||||||
export function buildSimpleFormCode(model: GeneratorConfig, _tableInfo: TableInfo[]): string {
|
export function buildSimpleFormCode(model: GeneratorConfig, _tableInfo: TableInfo[]): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
// const lowerClassName = lowerCase(className);
|
// const lowerClassName = lowerCase(className);
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
let mainTable;
|
let mainTable;
|
||||||
if (model.tableConfigs && model.tableConfigs.length) {
|
if (model.tableConfigs && model.tableConfigs.length) {
|
||||||
//数据优先
|
//数据优先
|
||||||
@ -2167,7 +2168,7 @@ export function buildWorkflowPermissionConfigJsonCode(formProps: FormProps | App
|
|||||||
*/
|
*/
|
||||||
export function buildAppApiCode(model: GeneratorConfig): string {
|
export function buildAppApiCode(model: GeneratorConfig): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
|
|
||||||
let mainTable;
|
let mainTable;
|
||||||
if (model.tableConfigs && model.tableConfigs.length) {
|
if (model.tableConfigs && model.tableConfigs.length) {
|
||||||
@ -2272,7 +2273,7 @@ export function buildAppConfigJsonCode(
|
|||||||
): string {
|
): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
// const lowerClassName = lowerCase(className);
|
// const lowerClassName = lowerCase(className);
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
// const pascalClassName = upperFirst(camelCase(className));
|
// const pascalClassName = upperFirst(camelCase(className));
|
||||||
|
|
||||||
let mainTable;
|
let mainTable;
|
||||||
@ -2524,7 +2525,7 @@ onShow(()=>{
|
|||||||
export function buildAppFormCode(model: GeneratorConfig): string {
|
export function buildAppFormCode(model: GeneratorConfig): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
// const lowerClassName = lowerCase(className);
|
// const lowerClassName = lowerCase(className);
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
// const pascalClassName = upperFirst(camelCase(className));
|
// const pascalClassName = upperFirst(camelCase(className));
|
||||||
let mainTable;
|
let mainTable;
|
||||||
if (model.tableConfigs && model.tableConfigs.length) {
|
if (model.tableConfigs && model.tableConfigs.length) {
|
||||||
@ -2809,7 +2810,7 @@ export function buildAppContainerCode(): string {
|
|||||||
// 生成tag
|
// 生成tag
|
||||||
export function buildTagStringCode(model: GeneratorConfig): string {
|
export function buildTagStringCode(model: GeneratorConfig): string {
|
||||||
const className = model.outputConfig.className;
|
const className = model.outputConfig.className;
|
||||||
const lowerClassName = className?.toLowerCase();
|
const lowerClassName = isOutputDirLowerName?(className?.toLowerCase()):className;
|
||||||
return `
|
return `
|
||||||
<sys-${model.outputConfig.outputValue}-${lowerClassName} ref="systemRef" v-else-if="componentName=='sys-${model.outputConfig.outputValue}-${lowerClassName}'" :disabled="props.disabled" :isWorkFlow="true" :workFlowParams="formConfig.workFlowParams" :formModel="props.formModel"></sys-${model.outputConfig.outputValue}-${lowerClassName}>
|
<sys-${model.outputConfig.outputValue}-${lowerClassName} ref="systemRef" v-else-if="componentName=='sys-${model.outputConfig.outputValue}-${lowerClassName}'" :disabled="props.disabled" :isWorkFlow="true" :workFlowParams="formConfig.workFlowParams" :formModel="props.formModel"></sys-${model.outputConfig.outputValue}-${lowerClassName}>
|
||||||
<!--html-->
|
<!--html-->
|
||||||
|
|||||||
@ -87,12 +87,17 @@
|
|||||||
{
|
{
|
||||||
title: t('步长'),
|
title: t('步长'),
|
||||||
dataIndex: 'stepValue',
|
dataIndex: 'stepValue',
|
||||||
width: 120,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('初始值'),
|
title: t('初始值'),
|
||||||
dataIndex: 'initValue',
|
dataIndex: 'initValue',
|
||||||
width: 120,
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('排序'),
|
||||||
|
dataIndex: 'sortNum',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t('说明'),
|
title: t('说明'),
|
||||||
@ -128,7 +133,13 @@
|
|||||||
setFieldsValue({
|
setFieldsValue({
|
||||||
...record,
|
...record,
|
||||||
});
|
});
|
||||||
setTableData(JSON.parse({ ...record }.formatJson));
|
let datas=JSON.parse({ ...record }.formatJson);
|
||||||
|
datas.forEach((data)=>{
|
||||||
|
if(!data.sortNum){
|
||||||
|
data.sortNum=0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTableData(datas);
|
||||||
} else {
|
} else {
|
||||||
setTableData([]);
|
setTableData([]);
|
||||||
}
|
}
|
||||||
@ -147,6 +158,10 @@
|
|||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
slots: { customRender: 'action' },
|
slots: { customRender: 'action' },
|
||||||
},
|
},
|
||||||
|
formConfig: {
|
||||||
|
showResetButton: false,
|
||||||
|
showSubmitButton: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? t('新增单据编码') : t('编辑单据编码')));
|
const getTitle = computed(() => (!unref(isUpdate) ? t('新增单据编码') : t('编辑单据编码')));
|
||||||
@ -154,7 +169,11 @@
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const values = await validate();
|
const values = await validate();
|
||||||
values.formatJson = JSON.stringify(getDataSource());
|
let data=getDataSource();
|
||||||
|
data.sort((a,b)=>{
|
||||||
|
return a.sortNum-b.sortNum;
|
||||||
|
});
|
||||||
|
values.formatJson = JSON.stringify(data);
|
||||||
setModalProps({ confirmLoading: true });
|
setModalProps({ confirmLoading: true });
|
||||||
if (values.formatJson === '[]') {
|
if (values.formatJson === '[]') {
|
||||||
notification.warning({
|
notification.warning({
|
||||||
|
|||||||
@ -173,6 +173,15 @@
|
|||||||
return values.itemType === '2' ? [{ required: true, message: t('请输入初始') }] : [];
|
return values.itemType === '2' ? [{ required: true, message: t('请输入初始') }] : [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'sortNum',
|
||||||
|
label: t('排序'),
|
||||||
|
component: 'InputNumber',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
componentProps: {
|
||||||
|
allowClear: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'description',
|
field: 'description',
|
||||||
label: t('说明'),
|
label: t('说明'),
|
||||||
@ -206,6 +215,8 @@
|
|||||||
rowId.value = data.record.key;
|
rowId.value = data.record.key;
|
||||||
|
|
||||||
const val = data.record.itemType;
|
const val = data.record.itemType;
|
||||||
|
itemTypeName.value=data.record.itemTypeName;
|
||||||
|
formatStr.value=data.record.formatStr;
|
||||||
if (val !== '0') {
|
if (val !== '0') {
|
||||||
formatStrOptions = val ? formatStrOptionsData[val] : [];
|
formatStrOptions = val ? formatStrOptionsData[val] : [];
|
||||||
updateSchema({
|
updateSchema({
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
gutter: 16,
|
gutter: 16,
|
||||||
},
|
},
|
||||||
schemas: searchFormSchema,
|
schemas: searchFormSchema,
|
||||||
showResetButton: false,
|
showResetButton: false
|
||||||
},
|
},
|
||||||
useSearchForm: true,
|
useSearchForm: true,
|
||||||
striped: false,
|
striped: false,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-bg-wrap">
|
<div class="page-bg-wrap">
|
||||||
<div class="top-toolbar">
|
<div class="top-toolbar">
|
||||||
<a-space :size="10" wrap>
|
<a-space :size="10" wrap style="gap:0">
|
||||||
<a-button style="margin-right: 10px" @click="close">
|
<a-button style="margin-right: 10px" @click="close">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<close-outlined />
|
<close-outlined />
|
||||||
|
|||||||
@ -404,7 +404,7 @@
|
|||||||
circulateConfigs: approvalData.circulateConfigs,
|
circulateConfigs: approvalData.circulateConfigs,
|
||||||
stampId: values.stampId,
|
stampId: values.stampId,
|
||||||
stampPassword: values.password,
|
stampPassword: values.password,
|
||||||
isOldSystem: system,
|
isOldSystem: system
|
||||||
};
|
};
|
||||||
let res = await postApproval(params);
|
let res = await postApproval(params);
|
||||||
// 下一节点审批人
|
// 下一节点审批人
|
||||||
|
|||||||
Reference in New Issue
Block a user