chore: 修复日期选择器无法清除问题,其他模块添加日期筛选
This commit is contained in:
parent
d293682d4e
commit
74f2191aae
2
.env.dev
2
.env.dev
@ -1,5 +1,5 @@
|
|||||||
# backend service base url, test environment
|
# backend service base url, test environment
|
||||||
VITE_SERVICE_BASE_URL=http://127.0.0.1:8080
|
VITE_SERVICE_BASE_URL=https://ruoyi.xlsea.cn/prod-api
|
||||||
|
|
||||||
VITE_APP_BASE_API=/dev-api
|
VITE_APP_BASE_API=/dev-api
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ const {
|
|||||||
// the value can not be undefined, otherwise the property in Form will not be reactive
|
// the value can not be undefined, otherwise the property in Form will not be reactive
|
||||||
userName: null,
|
userName: null,
|
||||||
ipaddr: null,
|
ipaddr: null,
|
||||||
status: null
|
status: null,
|
||||||
|
params: {}
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
import { useNaiveForm } from '@/hooks/common/form';
|
import { useNaiveForm } from '@/hooks/common/form';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
@ -15,15 +16,22 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
|
|
||||||
|
const dateRangeLoginTime = ref<[string, string] | null>(null);
|
||||||
|
|
||||||
const model = defineModel<Api.Monitor.LoginInforSearchParams>('model', { required: true });
|
const model = defineModel<Api.Monitor.LoginInforSearchParams>('model', { required: true });
|
||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
|
dateRangeLoginTime.value = null;
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
await validate();
|
await validate();
|
||||||
|
if (dateRangeLoginTime.value?.length) {
|
||||||
|
model.value.params!.beginTime = dateRangeLoginTime.value[0];
|
||||||
|
model.value.params!.endTime = dateRangeLoginTime.value[1];
|
||||||
|
}
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -48,6 +56,14 @@ async function search() {
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
|
<NFormItemGi span="24 s:12 m:6" label="登录时间" path="loginTime" class="pr-24px">
|
||||||
|
<NDatePicker
|
||||||
|
v-model:formatted-value="dateRangeLoginTime"
|
||||||
|
type="datetimerange"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24" class="pr-24px">
|
<NFormItemGi span="24" class="pr-24px">
|
||||||
<NSpace class="w-full" justify="end">
|
<NSpace class="w-full" justify="end">
|
||||||
<NButton @click="reset">
|
<NButton @click="reset">
|
||||||
|
@ -45,7 +45,7 @@ const {
|
|||||||
operName: null,
|
operName: null,
|
||||||
operIp: null,
|
operIp: null,
|
||||||
status: null,
|
status: null,
|
||||||
operTime: null
|
params: {}
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
import { useNaiveForm } from '@/hooks/common/form';
|
import { useNaiveForm } from '@/hooks/common/form';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
@ -15,15 +16,22 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
|
|
||||||
|
const dateRangeOperTime = ref<[string, string] | null>(null);
|
||||||
|
|
||||||
const model = defineModel<Api.Monitor.OperLogSearchParams>('model', { required: true });
|
const model = defineModel<Api.Monitor.OperLogSearchParams>('model', { required: true });
|
||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
|
dateRangeOperTime.value = null;
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
await validate();
|
await validate();
|
||||||
|
if (dateRangeOperTime.value?.length) {
|
||||||
|
model.value.params!.beginTime = dateRangeOperTime.value[0];
|
||||||
|
model.value.params!.endTime = dateRangeOperTime.value[1];
|
||||||
|
}
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -51,7 +59,7 @@ async function search() {
|
|||||||
<NFormItemGi span="24 s:12 m:6" label="操作IP" path="operIp" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:6" label="操作IP" path="operIp" class="pr-24px">
|
||||||
<NInput v-model:value="model.operIp" placeholder="请输入操作IP" />
|
<NInput v-model:value="model.operIp" placeholder="请输入操作IP" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24 s:12 m:6" label="操作状态" path="status" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:8" label="操作状态" path="status" class="pr-24px">
|
||||||
<DictSelect
|
<DictSelect
|
||||||
v-model:value="model.status"
|
v-model:value="model.status"
|
||||||
placeholder="请选择操作状态"
|
placeholder="请选择操作状态"
|
||||||
@ -59,7 +67,15 @@ async function search() {
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:8" label="操作时间" path="operTime" class="pr-24px">
|
||||||
|
<NDatePicker
|
||||||
|
v-model:formatted-value="dateRangeOperTime"
|
||||||
|
type="datetimerange"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</NFormItemGi>
|
||||||
|
<NFormItemGi span="24 s:12 m:8" class="pr-24px">
|
||||||
<NSpace class="w-full" justify="end">
|
<NSpace class="w-full" justify="end">
|
||||||
<NButton @click="reset">
|
<NButton @click="reset">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
@ -42,7 +42,7 @@ const {
|
|||||||
configName: null,
|
configName: null,
|
||||||
configKey: null,
|
configKey: null,
|
||||||
configType: null,
|
configType: null,
|
||||||
createTime: null
|
params: {}
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
import { useNaiveForm } from '@/hooks/common/form';
|
import { useNaiveForm } from '@/hooks/common/form';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
@ -15,15 +16,22 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
|
|
||||||
|
const dateRangeCreateTime = ref<[string, string] | null>(null);
|
||||||
|
|
||||||
const model = defineModel<Api.System.ConfigSearchParams>('model', { required: true });
|
const model = defineModel<Api.System.ConfigSearchParams>('model', { required: true });
|
||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
|
dateRangeCreateTime.value = null;
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function search() {
|
async function search() {
|
||||||
await validate();
|
await validate();
|
||||||
|
if (dateRangeCreateTime.value?.length) {
|
||||||
|
model.value.params!.beginTime = dateRangeCreateTime.value[0];
|
||||||
|
model.value.params!.endTime = dateRangeCreateTime.value[1];
|
||||||
|
}
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -35,7 +43,7 @@ async function search() {
|
|||||||
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
|
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
|
||||||
<NGrid responsive="screen" item-responsive>
|
<NGrid responsive="screen" item-responsive>
|
||||||
<NFormItemGi
|
<NFormItemGi
|
||||||
span="6 s:12 m:6"
|
span="24 s:12 m:6"
|
||||||
:label="$t('page.system.config.configName')"
|
:label="$t('page.system.config.configName')"
|
||||||
path="configName"
|
path="configName"
|
||||||
class="pr-24px"
|
class="pr-24px"
|
||||||
@ -45,11 +53,16 @@ async function search() {
|
|||||||
:placeholder="$t('page.system.config.form.configName.required')"
|
:placeholder="$t('page.system.config.form.configName.required')"
|
||||||
/>
|
/>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="6 s:12 m:6" :label="$t('page.system.config.configKey')" path="configKey" class="pr-24px">
|
<NFormItemGi
|
||||||
|
span="24 s:12 m:6"
|
||||||
|
:label="$t('page.system.config.configKey')"
|
||||||
|
path="configKey"
|
||||||
|
class="pr-24px"
|
||||||
|
>
|
||||||
<NInput v-model:value="model.configKey" :placeholder="$t('page.system.config.form.configKey.required')" />
|
<NInput v-model:value="model.configKey" :placeholder="$t('page.system.config.form.configKey.required')" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi
|
<NFormItemGi
|
||||||
span="6 s:12 m:6"
|
span="24 s:12 m:6"
|
||||||
:label="$t('page.system.config.configType')"
|
:label="$t('page.system.config.configType')"
|
||||||
path="configType"
|
path="configType"
|
||||||
class="pr-24px"
|
class="pr-24px"
|
||||||
@ -61,7 +74,15 @@ async function search() {
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="6" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:12" label="创建时间" path="createTime" class="pr-24px">
|
||||||
|
<NDatePicker
|
||||||
|
v-model:formatted-value="dateRangeCreateTime"
|
||||||
|
type="datetimerange"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</NFormItemGi>
|
||||||
|
<NFormItemGi span="24 s:12 m:12" class="pr-24px">
|
||||||
<NSpace class="w-full" justify="end">
|
<NSpace class="w-full" justify="end">
|
||||||
<NButton @click="reset">
|
<NButton @click="reset">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
@ -33,13 +33,13 @@ async function search() {
|
|||||||
<NCollapseItem :title="$t('common.search')" name="user-search">
|
<NCollapseItem :title="$t('common.search')" name="user-search">
|
||||||
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
|
<NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
|
||||||
<NGrid responsive="screen" item-responsive>
|
<NGrid responsive="screen" item-responsive>
|
||||||
<NFormItemGi span="24 s:12 m:6" label="公告标题" path="noticeTitle" class="pr-24px">
|
<NFormItemGi span="8" label="公告标题" path="noticeTitle" class="pr-24px">
|
||||||
<NInput v-model:value="model.noticeTitle" placeholder="请输入公告标题" />
|
<NInput v-model:value="model.noticeTitle" placeholder="请输入公告标题" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24 s:12 m:6" label="公告类型" path="noticeType" class="pr-24px">
|
<NFormItemGi span="8" label="公告类型" path="noticeType" class="pr-24px">
|
||||||
<DictSelect v-model:value="model.noticeType" dict-code="sys_notice_type" placeholder="请选择公告类型" />
|
<DictSelect v-model:value="model.noticeType" dict-code="sys_notice_type" placeholder="请选择公告类型" />
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi span="24" class="pr-24px">
|
<NFormItemGi span="8" class="pr-24px">
|
||||||
<NSpace class="w-full" justify="end">
|
<NSpace class="w-full" justify="end">
|
||||||
<NButton @click="reset">
|
<NButton @click="reset">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
|
@ -48,7 +48,8 @@ const {
|
|||||||
fileName: null,
|
fileName: null,
|
||||||
originalName: null,
|
originalName: null,
|
||||||
fileSuffix: null,
|
fileSuffix: null,
|
||||||
service: null
|
service: null,
|
||||||
|
params: {}
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
{
|
{
|
||||||
|
@ -16,12 +16,12 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
|
|
||||||
const dateRangeCreateTime = ref<[string, string]>();
|
const dateRangeCreateTime = ref<[string, string] | null>(null);
|
||||||
|
|
||||||
const model = defineModel<Api.System.OssSearchParams>('model', { required: true });
|
const model = defineModel<Api.System.OssSearchParams>('model', { required: true });
|
||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
dateRangeCreateTime.value = undefined;
|
dateRangeCreateTime.value = null;
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ async function search() {
|
|||||||
await validate();
|
await validate();
|
||||||
if (dateRangeCreateTime.value?.length) {
|
if (dateRangeCreateTime.value?.length) {
|
||||||
model.value.params!.beginCreateTime = dateRangeCreateTime.value[0];
|
model.value.params!.beginCreateTime = dateRangeCreateTime.value[0];
|
||||||
model.value.params!.endCreateTime = dateRangeCreateTime.value[0];
|
model.value.params!.endCreateTime = dateRangeCreateTime.value[1];
|
||||||
}
|
}
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ const { options: sysNormalDisableOptions } = useDict('sys_normal_disable');
|
|||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
dateRangeCreateTime.value = null;
|
dateRangeCreateTime.value = null;
|
||||||
Object.assign(model.value.params!, {});
|
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { NDatePicker } from 'naive-ui';
|
||||||
import { useNaiveForm } from '@/hooks/common/form';
|
import { useNaiveForm } from '@/hooks/common/form';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
|
|
||||||
@ -16,12 +17,14 @@ const emit = defineEmits<Emits>();
|
|||||||
|
|
||||||
const { formRef, validate, restoreValidation } = useNaiveForm();
|
const { formRef, validate, restoreValidation } = useNaiveForm();
|
||||||
|
|
||||||
const dateRangeCreateTime = ref<[string, string]>();
|
const dateRangeCreateTime = ref<[string, string] | null>(null);
|
||||||
|
|
||||||
|
const datePickerRef = ref<InstanceType<typeof NDatePicker>>();
|
||||||
|
|
||||||
const model = defineModel<Api.System.UserSearchParams>('model', { required: true });
|
const model = defineModel<Api.System.UserSearchParams>('model', { required: true });
|
||||||
|
|
||||||
async function reset() {
|
async function reset() {
|
||||||
dateRangeCreateTime.value = undefined;
|
dateRangeCreateTime.value = null;
|
||||||
await restoreValidation();
|
await restoreValidation();
|
||||||
emit('reset');
|
emit('reset');
|
||||||
}
|
}
|
||||||
@ -29,8 +32,8 @@ async function reset() {
|
|||||||
async function search() {
|
async function search() {
|
||||||
await validate();
|
await validate();
|
||||||
if (dateRangeCreateTime.value?.length) {
|
if (dateRangeCreateTime.value?.length) {
|
||||||
model.value.params!.beginCreateTime = dateRangeCreateTime.value[0];
|
model.value.params!.beginTime = dateRangeCreateTime.value[0];
|
||||||
model.value.params!.endCreateTime = dateRangeCreateTime.value[0];
|
model.value.params!.endTime = dateRangeCreateTime.value[1];
|
||||||
}
|
}
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
@ -74,6 +77,7 @@ async function search() {
|
|||||||
class="pr-24px"
|
class="pr-24px"
|
||||||
>
|
>
|
||||||
<NDatePicker
|
<NDatePicker
|
||||||
|
ref="datePickerRef"
|
||||||
v-model:formatted-value="dateRangeCreateTime"
|
v-model:formatted-value="dateRangeCreateTime"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
Loading…
Reference in New Issue
Block a user