no message

pull/44/head
DESKTOP-ELFHO53\zqx 2024-09-04 17:48:50 +08:00
parent 1e3bf62b89
commit 7e752dc83a
7 changed files with 64 additions and 108 deletions

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

@ -40,6 +40,7 @@ export function getDictOpts(dictType: string) {
}
export function getDictOptions(dictType: string, valueType?: 'string' | 'number' | 'boolean') {
debugger
const dictOption: DictDataType[] = []
const dictOptions: DictDataType[] = getDictDatas(dictType)
if (dictOptions && dictOptions.length > 0) {

View File

@ -299,7 +299,7 @@ export class VAxios {
reject(err || new Error('request error!'))
return
}
// return
}
resolve(res as unknown as Promise<T>)
// download file

View File

@ -1,6 +1,6 @@
import type { BasicColumn, FormSchema } from '@/components/Table'
import { useRender } from '@/components/Table'
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
// {
@ -64,46 +64,46 @@ export const searchFormSchema: FormSchema[] = [
label: '姓名',
field: 'name',
component: 'Input',
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '性别',
field: 'sex',
component: 'Radio',
component: 'Select',
componentProps: {
options: [],
options: getDictOptions(DICT_TYPE.SYSTEM_USER_SEX)
},
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '移动电话',
field: 'phone',
component: 'Input',
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '电子邮箱',
field: 'email',
component: 'Input',
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '最高学历',
field: 'educationLevel',
component: 'Input',
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '是否接受岗位调剂',
field: 'jobAdjustment',
component: 'Radio',
component: 'Select',
componentProps: {
options: [],
options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean')
},
colProps: { span: 8 },
colProps: { span: 4 },
},
{
label: '创建时间',
label: '投递时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 },

View File

@ -33,9 +33,9 @@ function handleCreate() {
openModal(true, { isUpdate: false })
}
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true })
}
// function handleEdit(record: Recordable) {
// openModal(true, { record, isUpdate: true })
// }
async function handleExport() {
createConfirm({
@ -57,6 +57,7 @@ async function handleDelete(record: Recordable) {
</script>
<template>
<div>
<!-- 表格 -->
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" v-auth="['recruit:applicant:create']" :preIcon="IconEnum.ADD" @click="handleCreate">
@ -69,7 +70,7 @@ async function handleDelete(record: Recordable) {
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction :actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), auth: 'recruit:applicant:update', onClick: handleEdit.bind(null, record) },
// { icon: IconEnum.EDIT, label: t('action.edit'), auth: 'recruit:applicant:update', onClick: handleEdit.bind(null, record) },
{
icon: IconEnum.DELETE,
danger: true,