This commit is contained in:
陈红丽 2024-12-12 15:36:14 +08:00
parent 53bd8f422c
commit de3fb1f344
11 changed files with 51 additions and 31 deletions

View File

@ -124,15 +124,9 @@
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<!--提交 重置 展开 收起 按钮--> <!--提交 重置 展开 收起 按钮-->
<n-gi <n-gi #="{ overflow }" v-if="getProps.showActionButtonGroup">
:suffix="isInline ? true : false"
:span="isInline ? 1 : 24"
#="{ overflow }"
v-if="getProps.showActionButtonGroup"
>
<n-space <n-space
align="center" align="center"
:justify="isInline ? 'end' : 'start'"
:style="{ 'margin-left': `${isInline ? 12 : getProps.labelWidth}px` }" :style="{ 'margin-left': `${isInline ? 12 : getProps.labelWidth}px` }"
> >
<n-button <n-button
@ -140,8 +134,14 @@
v-bind="getSubmitBtnOptions" v-bind="getSubmitBtnOptions"
@click="handleSubmit" @click="handleSubmit"
:loading="loading" :loading="loading"
>{{ getProps.submitButtonText }}</n-button
> >
<template #icon>
<n-icon>
<SearchOutlined />
</n-icon>
</template>
{{ getProps.submitButtonText }}
</n-button>
<n-button <n-button
v-if="getProps.showResetButton" v-if="getProps.showResetButton"
v-bind="getResetBtnOptions" v-bind="getResetBtnOptions"
@ -177,7 +177,7 @@
import { useFormValues } from './hooks/useFormValues'; import { useFormValues } from './hooks/useFormValues';
import { basicProps } from './props'; import { basicProps } from './props';
import { DownOutlined, UpOutlined, QuestionCircleOutlined } from '@vicons/antd'; import { DownOutlined, UpOutlined, QuestionCircleOutlined, SearchOutlined } from '@vicons/antd';
import { BasicSelect } from '@/components/Select'; import { BasicSelect } from '@/components/Select';
import { ImageUpload } from '@/components/Upload'; import { ImageUpload } from '@/components/Upload';

View File

@ -52,7 +52,7 @@ export const basicProps = {
// 确认按钮配置 // 确认按钮配置
submitButtonOptions: Object as PropType<Partial<ButtonProps>>, submitButtonOptions: Object as PropType<Partial<ButtonProps>>,
//展开收起按钮 //展开收起按钮
showAdvancedButton: propTypes.bool.def(true), showAdvancedButton: propTypes.bool.def(false),
// 确认按钮文字 // 确认按钮文字
submitButtonText: { submitButtonText: {
type: String, type: String,

View File

@ -131,7 +131,7 @@
:pagination="pagination" :pagination="pagination"
@update:page="updatePage" @update:page="updatePage"
@update:page-size="updatePageSize" @update:page-size="updatePageSize"
:style="{ minHeight: deviceHeight+45+'px' }" :style="{ minHeight: deviceHeight + 90 + 'px' }"
> >
<template v-for="item in Object.keys($slots)" :key="item" #[item]="data"> <template v-for="item in Object.keys($slots)" :key="item" #[item]="data">
<slot v-bind="data || {}" :name="item"></slot> <slot v-bind="data || {}" :name="item"></slot>
@ -533,7 +533,7 @@
const { bottomIncludeBody } = getViewportOffset(headEl); const { bottomIncludeBody } = getViewportOffset(headEl);
const headerH = 64; const headerH = 64;
let paginationH = 2; let paginationH = 2;
let marginH = 22; let marginH = 27;
if (!isBoolean(pagination)) { if (!isBoolean(pagination)) {
paginationEl = tableEl.querySelector('.n-data-table__pagination') as HTMLElement; paginationEl = tableEl.querySelector('.n-data-table__pagination') as HTMLElement;
if (paginationEl) { if (paginationEl) {

View File

@ -120,7 +120,7 @@
<div class="layout-header-trigger layout-header-trigger-min"> <div class="layout-header-trigger layout-header-trigger-min">
<n-dropdown :options="avatarOptions" trigger="hover" @select="avatarSelect"> <n-dropdown :options="avatarOptions" trigger="hover" @select="avatarSelect">
<div class="avatar"> <div class="avatar">
<n-avatar round :src="userAvatar?userAvatar:schoolboy" /> <n-avatar round :src="userAvatar ? userAvatar : schoolboy" />
</div> </div>
</n-dropdown> </n-dropdown>
</div> </div>
@ -156,7 +156,7 @@
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useDialog, useMessage } from 'naive-ui'; import { useDialog, useMessage } from 'naive-ui';
import { useTabsViewStore } from '@/store/modules/tabsView'; import { useTabsViewStore } from '@/store/modules/tabsView';
import { TABS_ROUTES,FIRST_ROUTE } from '@/store/mutation-types'; import { TABS_ROUTES, FIRST_ROUTE } from '@/store/mutation-types';
import { useUserStore } from '@/store/modules/user'; import { useUserStore } from '@/store/modules/user';
import { useLockscreenStore } from '@/store/modules/lockscreen'; import { useLockscreenStore } from '@/store/modules/lockscreen';
import { AsideMenu } from '@/layout/components/Menu'; import { AsideMenu } from '@/layout/components/Menu';
@ -211,7 +211,7 @@
const drawerSetting = ref(); const drawerSetting = ref();
const amendPwdRef = ref(); const amendPwdRef = ref();
const userAvatar = userStore.getAvatar const userAvatar = userStore.getAvatar;
// const username = userStore?.info ? ref(userStore?.info.username) : ''; // const username = userStore?.info ? ref(userStore?.info.username) : '';
const collapsed = inject('collapsed'); const collapsed = inject('collapsed');
@ -300,6 +300,7 @@
tabsViewStore.closeAllTabs(); tabsViewStore.closeAllTabs();
localStorage.removeItem(TABS_ROUTES); localStorage.removeItem(TABS_ROUTES);
localStorage.removeItem(FIRST_ROUTE); localStorage.removeItem(FIRST_ROUTE);
localStorage.removeItem('adClosed');
asyncRouteStore.setDynamicAddedRoute(false); asyncRouteStore.setDynamicAddedRoute(false);
router.replace({ router.replace({
name: BASE_LOGIN_NAME, name: BASE_LOGIN_NAME,

View File

@ -165,7 +165,7 @@
url: '', url: '',
width: '', width: '',
height: '', height: '',
adTime: [], adTime: null,
startTime: '', startTime: '',
endTime: '', endTime: '',
click: '', click: '',

View File

@ -1,6 +1,6 @@
<template> <template>
<n-drawer v-model:show="props.visible" @after-leave="handleClose" :width="800"> <n-drawer v-model:show="props.visible" :width="800" @update:show="handleUpdate">
<n-drawer-content :title="props.layoutId ? '编辑' : '新增'"> <n-drawer-content :title="props.layoutId ? '编辑' : '新增'" closable>
<template #default> <template #default>
<n-form <n-form
class="ls-form" class="ls-form"
@ -70,10 +70,10 @@
</n-form> </n-form>
</template> </template>
<template #footer> <template #footer>
<span class="dialog-footer"> <n-space>
<n-button @click="handleClose">取消</n-button> <n-button @click="handleClose">取消</n-button>
<n-button :loading="subLoading" type="primary" @click="submit"> 确定 </n-button> <n-button :loading="subLoading" type="primary" @click="submit"> 确定 </n-button>
</span> </n-space>
</template> </template>
</n-drawer-content> </n-drawer-content>
<chooseArticle <chooseArticle
@ -184,7 +184,11 @@
const handleClose = () => { const handleClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
const handleUpdate = (show) => {
if (!show) {
handleClose();
}
};
/** /**
* 设置表单数据 * 设置表单数据
*/ */

View File

@ -194,11 +194,24 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted } from 'vue';
import { ArrowUpOutlined, ArrowDownOutlined } from '@vicons/antd'; import { ArrowUpOutlined, ArrowDownOutlined } from '@vicons/antd';
import { useNotification } from 'naive-ui';
import NewVisitAmount from './components/NewVisitAmount.vue'; import NewVisitAmount from './components/NewVisitAmount.vue';
import VisitSource from './components/VisitSource.vue'; import VisitSource from './components/VisitSource.vue';
import Percent from './components/Percent.vue'; import Percent from './components/Percent.vue';
import AreaRanking from './components/AreaRanking.vue'; import AreaRanking from './components/AreaRanking.vue';
const notification = useNotification();
onMounted(() => {
if (!localStorage.getItem('adClosed')) {
notification.info({
title: '提示',
content: '登录成功',
duration: 5000,
});
localStorage.setItem('adClosed', 'true');
}
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -129,7 +129,7 @@
size: 10, size: 10,
count: configDataList.value.length, count: configDataList.value.length,
}); });
const fwbHeight = document.body.clientHeight - 370; const fwbHeight = document.body.clientHeight - 335;
/** /**
* 执行添加 * 执行添加

View File

@ -94,7 +94,6 @@
sort: 0, sort: 0,
note: '', note: '',
}); });
const fwbHeight = document.body.clientHeight - 400;
const optionsData = ref([]); const optionsData = ref([]);
const [modalRegister, { openModal, setProps, setSubLoading }] = useModal({ const [modalRegister, { openModal, setProps, setSubLoading }] = useModal({
title: props.dictItemId ? '编辑字典项' : '新增字典项', title: props.dictItemId ? '编辑字典项' : '新增字典项',

View File

@ -129,7 +129,7 @@
size: 10, size: 10,
count: dictDataList.value.length, count: dictDataList.value.length,
}); });
const fwbHeight = document.body.clientHeight - 370; const fwbHeight = document.body.clientHeight - 335;
/** /**
* 执行添加 * 执行添加

View File

@ -1,6 +1,6 @@
<template> <template>
<n-drawer v-model:show="props.visible" @after-leave="handleClose" :width="size"> <n-drawer v-model:show="props.visible" :width="size" @update:show="handleUpdate">
<n-drawer-content :title="props.noticeId ? '编辑公告' : '新增公告'"> <n-drawer-content :title="props.noticeId ? '编辑公告' : '新增公告'" closable>
<template #default> <template #default>
<n-form <n-form
class="ls-form" class="ls-form"
@ -62,10 +62,10 @@
</n-form> </n-form>
</template> </template>
<template #footer> <template #footer>
<span class="dialog-footer"> <n-space>
<n-button @click="handleClose">取消</n-button> <n-button @click="handleClose">取消</n-button>
<n-button :loading="subLoading" type="primary" @click="submit"> 确定 </n-button> <n-button :loading="subLoading" type="primary" @click="submit"> 确定 </n-button>
</span> </n-space>
</template> </template>
</n-drawer-content> </n-drawer-content>
</n-drawer> </n-drawer>
@ -140,9 +140,7 @@
emit('update:visible', false); emit('update:visible', false);
emit('success'); emit('success');
}) })
.catch((error) => { .catch((error) => {});
setSubLoading(false);
});
}; };
/** /**
@ -151,6 +149,11 @@
const handleClose = () => { const handleClose = () => {
emit('update:visible', false); emit('update:visible', false);
}; };
const handleUpdate = (show) => {
if (!show) {
handleClose();
}
};
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit); const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);