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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,7 +39,24 @@ export function getDictOpts(dictType: string) {
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') {
// if(!valueType){
// valueType = determineType(dictType);
// }
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) {

View File

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

View File

@ -7,37 +7,41 @@ export interface GrowCardItem {
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[] = [
{
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',
},
]