Pre Merge pull request !44 from kuxiao/master

pull/44/MERGE
kuxiao 2024-09-04 11:32:03 +00:00 committed by Gitee
commit 7a5085f64f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 7704 additions and 8402 deletions

File diff suppressed because it is too large Load Diff

View File

@ -88,9 +88,9 @@ const getSchema = computed((): FormSchema[] => {
// handle date type // handle date type
if ( if (
isHandleDateDefaultValue isHandleDateDefaultValue
&& defaultValue && defaultValue
&& component && component
&& dateItemType.includes(component) && dateItemType.includes(component)
) { ) {
if (!Array.isArray(defaultValue)) { if (!Array.isArray(defaultValue)) {
schema.defaultValue = valueFormat schema.defaultValue = valueFormat
@ -222,7 +222,7 @@ function setFormModel(key: string, value: any, schema: FormSchema) {
emit('field-value-change', key, value) emit('field-value-change', key, value)
// TODO autoLink=false // TODO autoLink=false
if (schema && schema.itemProps && !schema.itemProps.autoLink) if (schema && schema.itemProps && !schema.itemProps.autoLink)
validateFields([key]).catch((_) => {}) validateFields([key]).catch((_) => { })
} }
function handleEnterPress(e: KeyboardEvent) { function handleEnterPress(e: KeyboardEvent) {
@ -261,37 +261,21 @@ const getFormActionBindProps = computed(() => ({ ...getProps.value, ...advanceSt
</script> </script>
<template> <template>
<Form <Form v-bind="getBindValue" ref="formElRef" :class="getFormClass" :model="formModel"
v-bind="getBindValue" @keypress.enter="handleEnterPress">
ref="formElRef"
:class="getFormClass"
:model="formModel"
@keypress.enter="handleEnterPress"
>
<Row v-bind="getRow"> <Row v-bind="getRow">
<slot name="formHeader" /> <slot name="formHeader" />
<template v-for="schema in getSchema" :key="schema.field"> <template v-for="schema in getSchema" :key="schema.field">
<FormItem <FormItem :is-advanced="fieldsIsAdvancedMap[schema.field]" :table-action="tableAction"
:is-advanced="fieldsIsAdvancedMap[schema.field]" :form-action-type="formActionType" :schema="schema" :form-props="getProps"
:table-action="tableAction" :all-default-values="defaultValueRef" :form-model="formModel" :set-form-model="setFormModel">
:form-action-type="formActionType"
:schema="schema"
:form-props="getProps"
:all-default-values="defaultValueRef"
:form-model="formModel"
:set-form-model="setFormModel"
>
<template v-for="item in Object.keys($slots)" #[item]="data"> <template v-for="item in Object.keys($slots)" #[item]="data">
<slot :name="item" v-bind="data || {}" /> <slot :name="item" v-bind="data || {}" />
</template> </template>
</FormItem> </FormItem>
</template> </template>
<FormAction v-bind="getFormActionBindProps" @toggle-advanced="handleToggleAdvanced"> <FormAction v-bind="getFormActionBindProps" @toggle-advanced="handleToggleAdvanced">
<template <template v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']" #[item]="data">
v-for="item in ['resetBefore', 'submitBefore', 'advanceBefore', 'advanceAfter']"
#[item]="data"
>
<slot :name="item" v-bind="data || {}" /> <slot :name="item" v-bind="data || {}" />
</template> </template>
</FormAction> </FormAction>

View File

@ -80,43 +80,26 @@ function toggleAdvanced() {
</script> </script>
<template> <template>
<Col v-if="showActionButtonGroup" v-bind="actionColOpt"> <Col v-if="showActionButtonGroup" v-bind="actionColOpt" :span="24">
<div style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }"> <div style="width: 100%" :style="{ textAlign: actionColOpt.style.textAlign }">
<FormItem> <FormItem>
<slot name="resetBefore" /> <slot name="resetBefore" />
<Button <Button v-if="showResetButton" type="default" class="mr-2" v-bind="getResetBtnOptions" @click="resetAction">
v-if="showResetButton" {{ getResetBtnOptions.text }}
type="default" </Button>
class="mr-2" <slot name="submitBefore" />
v-bind="getResetBtnOptions"
@click="resetAction"
>
{{ getResetBtnOptions.text }}
</Button>
<slot name="submitBefore" />
<Button <Button v-if="showSubmitButton" type="primary" class="mr-2" v-bind="getSubmitBtnOptions" @click="submitAction">
v-if="showSubmitButton" {{ getSubmitBtnOptions.text }}
type="primary" </Button>
class="mr-2"
v-bind="getSubmitBtnOptions"
@click="submitAction"
>
{{ getSubmitBtnOptions.text }}
</Button>
<slot name="advanceBefore" /> <slot name="advanceBefore" />
<Button <Button v-if="showAdvancedButton && !hideAdvanceBtn" type="link" size="small" @click="toggleAdvanced">
v-if="showAdvancedButton && !hideAdvanceBtn" {{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }}
type="link" <BasicArrow class="ml-1" :expand="!isAdvanced" up />
size="small" </Button>
@click="toggleAdvanced" <slot name="advanceAfter" />
> </FormItem>
{{ isAdvanced ? t('component.form.putAway') : t('component.form.unfold') }} </div>
<BasicArrow class="ml-1" :expand="!isAdvanced" up />
</Button>
<slot name="advanceAfter" />
</FormItem>
</div>
</Col> </Col>
</template> </template>

View File

@ -309,13 +309,8 @@ function updateSortOption(column: BasicColumn) {
<template #title> <template #title>
<span>{{ t('component.table.settingColumn') }}</span> <span>{{ t('component.table.settingColumn') }}</span>
</template> </template>
<Popover <Popover placement="bottomLeft" trigger="click" :overlay-class-name="`${prefixCls}__cloumn-list`"
placement="bottomLeft" :get-popup-container="getPopupContainer" @open-change="handleOpenChange">
trigger="click"
:overlay-class-name="`${prefixCls}__cloumn-list`"
:get-popup-container="getPopupContainer"
@open-change="handleOpenChange"
>
<template #title> <template #title>
<div :class="`${prefixCls}__popover-title`"> <div :class="`${prefixCls}__popover-title`">
<Checkbox v-model:checked="state.checkAll" :indeterminate="indeterminate" @change="onCheckAllChange"> <Checkbox v-model:checked="state.checkAll" :indeterminate="indeterminate" @change="onCheckAllChange">
@ -350,34 +345,26 @@ function updateSortOption(column: BasicColumn) {
<template #title> <template #title>
{{ t('component.table.settingFixedLeft') }} {{ t('component.table.settingFixedLeft') }}
</template> </template>
<Icon <Icon icon="line-md:arrow-align-left" :class="[
icon="line-md:arrow-align-left" `${prefixCls}__fixed-left`,
:class="[ {
`${prefixCls}__fixed-left`, active: item.fixed === 'left',
{ disabled: !state.checkedList.includes(item.value),
active: item.fixed === 'left', },
disabled: !state.checkedList.includes(item.value), ]" @click="handleColumnFixed(item, 'left')" />
},
]"
@click="handleColumnFixed(item, 'left')"
/>
</Tooltip> </Tooltip>
<Divider type="vertical" /> <Divider type="vertical" />
<Tooltip placement="bottomLeft" :mouse-leave-delay="0.4" :get-popup-container="getPopupContainer"> <Tooltip placement="bottomLeft" :mouse-leave-delay="0.4" :get-popup-container="getPopupContainer">
<template #title> <template #title>
{{ t('component.table.settingFixedRight') }} {{ t('component.table.settingFixedRight') }}
</template> </template>
<Icon <Icon icon="line-md:arrow-align-left" :class="[
icon="line-md:arrow-align-left" `${prefixCls}__fixed-right`,
:class="[ {
`${prefixCls}__fixed-right`, active: item.fixed === 'right',
{ disabled: !state.checkedList.includes(item.value),
active: item.fixed === 'right', },
disabled: !state.checkedList.includes(item.value), ]" @click="handleColumnFixed(item, 'right')" />
},
]"
@click="handleColumnFixed(item, 'right')"
/>
</Tooltip> </Tooltip>
</div> </div>
</template> </template>

View File

@ -9,6 +9,7 @@ const about: AppRouteModule = {
component: LAYOUT, component: LAYOUT,
redirect: '/about/index', redirect: '/about/index',
meta: { meta: {
hideMenu: true,
hideChildrenInMenu: true, hideChildrenInMenu: true,
icon: 'ant-design:pushpin-filled', icon: 'ant-design:pushpin-filled',
title: t('routes.dashboard.about'), title: t('routes.dashboard.about'),

View File

@ -10,6 +10,7 @@ const dashboard: AppRouteModule = {
parentId: 0, parentId: 0,
redirect: '/dashboard/analysis', redirect: '/dashboard/analysis',
meta: { meta: {
hideMenu:true,//隐藏首页、分析页、工作台
orderNo: 10, orderNo: 10,
icon: 'ant-design:home-outlined', icon: 'ant-design:home-outlined',
title: t('routes.dashboard.dashboard'), title: t('routes.dashboard.dashboard'),

View File

@ -39,7 +39,24 @@ export function getDictOpts(dictType: string) {
return getDictDatas(dictType) return getDictDatas(dictType)
} }
/**
*
* @param dictType
*/
function determineType(dictType) {
if (dictType === "true" || dictType === "false") {
return "boolean";
} else if (!isNaN(parseFloat(dictType)) && parseFloat(input).toString() === input) {
return "number";
} else {
return "string";
}
}
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') { export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {
// if(!valueType){
// valueType = determineType(dictType);
// }
const dictOption: DictDataType[] = [] const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictDatas(dictType) const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) { if (dictOptions && dictOptions.length > 0) {

View File

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { Card, Tag } from 'ant-design-vue' import { Card, Tag } from 'ant-design-vue'
import { growCardList } from '../data' import { growCardList } from '../data'
import { CountTo } from '@/components/CountTo' import { CountTo } from '@/components/CountTo'
import { Icon } from '@/components/Icon' import { Icon } from '@/components/Icon'

View File

@ -7,37 +7,41 @@ export interface GrowCardItem {
action: string action: string
} }
// export const growCardList: GrowCardItem[] = [
// {
// title: '访问数',
// icon: 'visit-count|svg',
// value: 2000,
// total: 120000,
// color: 'green',
// action: '月',
// },
// {
// title: '成交额',
// icon: 'total-sales|svg',
// value: 20000,
// total: 500000,
// color: 'blue',
// action: '月',
// },
// {
// title: '下载数',
// icon: 'download-count|svg',
// value: 8000,
// total: 120000,
// color: 'orange',
// action: '周',
// },
// {
// title: '成交数',
// icon: 'transaction|svg',
// value: 5000,
// total: 50000,
// color: 'purple',
// action: '年',
// },
// ]
export const growCardList: GrowCardItem[] = [ export const growCardList: GrowCardItem[] = [
{
title: '访问数',
icon: 'visit-count|svg',
value: 2000,
total: 120000,
color: 'green',
action: '月',
},
{
title: '成交额',
icon: 'total-sales|svg',
value: 20000,
total: 500000,
color: 'blue',
action: '月',
},
{
title: '下载数',
icon: 'download-count|svg',
value: 8000,
total: 120000,
color: 'orange',
action: '周',
},
{
title: '成交数',
icon: 'transaction|svg',
value: 5000,
total: 50000,
color: 'purple',
action: '年',
},
] ]

View File

@ -0,0 +1,129 @@
import type { BasicColumn, FormSchema } from '@/components/Table'
import { useRender } from '@/components/Table'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
// {
// title: '编号',
// dataIndex: 'id',
// width: 160,
// },
{
title: '姓名',
dataIndex: 'name',
width: 160,
},
{
title: '性别',
dataIndex: 'sex',
width: 160,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.SYSTEM_USER_SEX)
}
},
{
title: '移动电话',
dataIndex: 'phone',
width: 160,
},
{
title: '电子邮箱',
dataIndex: 'email',
width: 160,
},
{
title: '最高学历',
dataIndex: 'educationLevel',
width: 160,
},
{
title: '是否接受岗位调剂',
dataIndex: 'jobAdjustment',
width: 160,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.INFRA_BOOLEAN_STRING)
}
},
{
title: '简历附件URL',
dataIndex: 'resumeUrl',
width: 160,
},
{
title: '投递时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
},
},
]
export const searchFormSchema: FormSchema[] = [
{
label: '姓名',
field: 'name',
component: 'Input',
colProps: { span: 4 },
},
{
label: '性别',
field: 'sex',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX)
},
colProps: { span: 4 },
},
{
label: '移动电话',
field: 'phone',
component: 'Input',
colProps: { span: 4 },
},
{
label: '电子邮箱',
field: 'email',
component: 'Input',
colProps: { span: 4 },
},
{
label: '最高学历',
field: 'educationLevel',
component: 'Input',
colProps: { span: 4 },
},
{
label: '是否接受岗位调剂',
field: 'jobAdjustment',
component: 'Select',
componentProps: {
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)
},
colProps: { span: 4 },
},
{
label: '投递时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 },
},
]
export const createFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input',
},
]
export const updateFormSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input',
},
]