Browse Source

feat: doc文档中的相关问题处理

luoyali 1 year ago
parent
commit
953c2b046d

+ 5 - 5
src/components/FormConfig/index.vue

@@ -506,12 +506,12 @@ const FormConfig = defineComponent({
 			const createFooter = () => {
 				return (
 					<div class="footer">
-						{showCancelBtn && (
-							<el-button class="cancel-button" size={size} onClick={cancelHandler}>
-								{t(cancelBtnText)}
-							</el-button>
-						)}
 						<div class="right-actions">
+							{showCancelBtn && (
+								<el-button class="cancel-button" size={size} onClick={cancelHandler}>
+									{t(cancelBtnText)}
+								</el-button>
+							)}
 							{showResetBtn && (
 								<el-button class="reset-button" plain size={size} onClick={resetHandler.bind(null, undefined)}>
 									{t(resetBtnText)}

+ 20 - 1
src/layout/components/Header/components/Message.vue

@@ -12,7 +12,7 @@
 				<template #label> {{ v.label }}({{ v.list.length }}) </template>
 				<template v-if="v.list.length">
 					<div class="message-list">
-						<div v-for="item of v.list" :key="item.id" class="message-item">
+						<div v-for="item of v.list" :key="item.id" class="message-item" @click="jumpMessageDetail(item.id)">
 							<!--<img src="" alt="" class="message-icon" />-->
 							<div class="message-content">
 								<div class="message-title">
@@ -22,6 +22,7 @@
 								<span class="message-txt">{{ item.content }}</span>
 							</div>
 						</div>
+						<div class="message-fix-item" @click="jumpMessageInfo">查看更多</div>
 					</div>
 				</template>
 				<template v-else>
@@ -35,6 +36,7 @@
 <script setup lang="ts">
 import { ref, reactive } from 'vue'
 import { getMessage } from '@/api/system/message'
+import router from '@/router'
 // noticeList  通知     messageList   消息     todoList   待办
 const tabsConfig = reactive({
 	noticeList: {
@@ -68,6 +70,14 @@ getMessage().then(res => {
 	})
 	total.value = _total
 })
+
+const jumpMessageInfo = () => {
+	router.push('/message/list')
+}
+
+const jumpMessageDetail = (id: any) => {
+	router.push('/message/list?id=' + id)
+}
 </script>
 
 <style scoped lang="scss">
@@ -81,6 +91,7 @@ getMessage().then(res => {
 		align-items: center;
 		padding: 8px 0;
 		border-bottom: 1px solid var(--el-border-color-light);
+		cursor: pointer;
 		&:last-child {
 			border: none;
 		}
@@ -109,5 +120,13 @@ getMessage().then(res => {
 			}
 		}
 	}
+	.message-fix-item {
+		// flex 居中
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		height: 40px;
+		cursor: pointer;
+	}
 }
 </style>

+ 1 - 1
src/router/index.ts

@@ -19,7 +19,7 @@ type RouteMeta = {
 	// type: string;
 }
 // 是否展示示例相关菜单
-const showDemoRoutes = true
+const showDemoRoutes = !!import.meta.env.DEV
 export const constantRoutes: Array<AppRouteRecordRaw> = [
 	{
 		path: '/redirect',

+ 5 - 0
src/styles/project_normal.scss

@@ -39,6 +39,11 @@ body {
 	}
 }
 
+// icon-图标变小手
+.ibt0 {
+	cursor: pointer;
+}
+
 // 全局滚动条样式
 ::-webkit-scrollbar{width:6px;height:6px}
 ::-webkit-scrollbar-track{border-radius:6px;background: $le-bg-color_1;}

+ 1 - 0
src/views/configure/index.vue

@@ -121,6 +121,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/demo/adminManage/index.vue

@@ -64,6 +64,7 @@ const state: any = reactive({
 			formConfig: {
 				labelWidth: 80,
 				itemWidth: '100%',
+				showCancelBtn: true,
 				submitLoading: false
 			}
 			// isEdit: false

+ 1 - 0
src/views/demo/pageConfig/index.vue

@@ -359,6 +359,7 @@ const formOptions = ref({
 	span,
 	showResetBtn,
 	formConfig: {
+		showCancelBtn: true,
 		submitLoading: false
 	}
 })

+ 1 - 0
src/views/flow/form/index.vue

@@ -93,6 +93,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/flow/group/index1.vue

@@ -172,6 +172,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 6 - 1
src/views/message/list/detail.vue

@@ -6,7 +6,11 @@
 				<div class="content-title">{{ formOptions.title }}</div>
 				<span>发布人:{{ formOptions.createBy }} 发布时间: {{ formOptions.createTime }}</span>
 
-				<div class="content-title mbt20">{{ formOptions.category ? '通知公告' : '系统消息' }}</div>
+				<div class="content-title mbt20">
+					<el-tag v-if="formOptions.category === 0" size="small" effect="plain">通知公告</el-tag>
+					<el-tag v-if="formOptions.category === 1" size="small" type="info" effect="plain">系统消息</el-tag>
+					<el-tag v-if="formOptions.category === 2" size="small" type="warning" effect="plain">待办通知</el-tag>
+				</div>
 				<span>通知时间: - </span>
 				<br />
 				<br />
@@ -47,6 +51,7 @@ const getMessageInfoDetail = async () => {
 }
 
 getMessageInfoDetail()
+
 // computed
 const visibleDialog = computed({
 	get() {

+ 19 - 4
src/views/message/list/index.vue

@@ -18,8 +18,9 @@
 				</template>
 
 				<template #categorySlot="scope">
-					<el-tag v-if="scope.row.category">通知公告</el-tag>
-					<el-tag v-else type="info">系统消息</el-tag>
+					<el-tag v-if="scope.row.category === 0" size="small" effect="plain">通知公告</el-tag>
+					<el-tag v-if="scope.row.category === 1" size="small" type="info" effect="plain">系统消息</el-tag>
+					<el-tag v-if="scope.row.category === 2" size="small" type="warning" effect="plain">待办通知</el-tag>
 				</template>
 
 				<template #actionSlot="scope">
@@ -28,14 +29,16 @@
 			</LeTable>
 		</div>
 
-		<message-detail v-if="visibleDetail" v-model="visibleDetail" @closed="visibleDetail = false" :messageId="currentId"> </message-detail>
+		<message-detail v-if="visibleDetail" v-model="visibleDetail" :message-id="currentId" @closed="visibleDetail = false"> </message-detail>
 	</div>
 </template>
 <script lang="tsx" setup>
 import { getMessageInfo } from '@/api/system/message'
-import { nextTick, ref } from 'vue'
+import { nextTick, ref, watch } from 'vue'
 import { useTablePage } from '@/hooks/useTablePage'
 import MessageDetail from './detail.vue'
+import { useRoute } from 'vue-router'
+const route = useRoute()
 
 const visibleDetail = ref(false) // 权限设置弹窗显示隐藏
 const currentId = ref(null)
@@ -136,6 +139,18 @@ const openDetail = (row: any) => {
 nextTick(() => {
 	queryList()
 })
+
+watch(
+	() => route.query,
+	(newPath, oldPath) => {
+		if (JSON.stringify(newPath) !== '{}') {
+			nextTick(() => {
+				openDetail(newPath)
+			})
+		}
+	},
+	{ immediate: true }
+)
 </script>
 <style scoped lang="scss">
 .pageWrap {

+ 1 - 0
src/views/setting/app/index.vue

@@ -121,6 +121,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/configure/index.vue

@@ -111,6 +111,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/department/index.vue

@@ -126,6 +126,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/dict/index.vue

@@ -165,6 +165,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/post/index.vue

@@ -111,6 +111,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/region/index.vue

@@ -113,6 +113,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 1 - 0
src/views/setting/role/index.vue

@@ -125,6 +125,7 @@ const formOptions = computed(() => {
 		span: 30,
 		showResetBtn: true,
 		formConfig: {
+			showCancelBtn: true,
 			submitLoading: false
 		}
 	}

+ 0 - 1
src/views/setting/user/index.vue

@@ -190,7 +190,6 @@ const formOptions = computed(() => {
 		labelWidth: 120,
 		span: 30,
 		formConfig: {
-			showResetBtn: true,
 			showCancelBtn: true,
 			submitLoading: false
 		}