1. 统一化代码 2. 增加 DocAlert 关联文档

This commit is contained in:
shizhong 2023-06-13 11:24:37 +08:00
parent e17913d038
commit 47eac89d1e
7 changed files with 59 additions and 22 deletions

View File

@ -11,27 +11,32 @@ export interface NoticeVO {
createTime: Date createTime: Date
} }
export interface NoticePageReqVO extends PageParam {
title?: string
status?: number
}
// 查询公告列表 // 查询公告列表
export const getNoticePage = (params: PageParam) => { export const getNoticePageApi = (params: NoticePageReqVO) => {
return request.get({ url: '/system/notice/page', params }) return request.get({ url: '/system/notice/page', params })
} }
// 查询公告详情 // 查询公告详情
export const getNotice = (id: number) => { export const getNoticeApi = (id: number) => {
return request.get({ url: '/system/notice/get?id=' + id }) return request.get({ url: '/system/notice/get?id=' + id })
} }
// 新增公告 // 新增公告
export const createNotice = (data: NoticeVO) => { export const createNoticeApi = (data: NoticeVO) => {
return request.post({ url: '/system/notice/create', data }) return request.post({ url: '/system/notice/create', data })
} }
// 修改公告 // 修改公告
export const updateNotice = (data: NoticeVO) => { export const updateNoticeApi = (data: NoticeVO) => {
return request.put({ url: '/system/notice/update', data }) return request.put({ url: '/system/notice/update', data })
} }
// 删除公告 // 删除公告
export const deleteNotice = (id: number) => { export const deleteNoticeApi = (id: number) => {
return request.delete({ url: '/system/notice/delete?id=' + id }) return request.delete({ url: '/system/notice/delete?id=' + id })
} }

View File

@ -48,6 +48,7 @@ export default defineComponent({
? dictData.value?.cssClass ? dictData.value?.cssClass
: '' : ''
} }
disableTransitions={true}
> >
{dictData.value?.label} {dictData.value?.label}
</ElTag> </ElTag>

View File

@ -0,0 +1,32 @@
<template>
<el-alert v-if="getEnable()" type="success" show-icon>
<template #title>
<div @click="goToUrl">{{ '' + title + '文档地址' + url }}</div>
</template>
</el-alert>
</template>
<script setup lang="tsx" name="DocAlert">
import { propTypes } from '@/utils/propTypes'
const props = defineProps({
title: propTypes.string,
url: propTypes.string
})
/** 跳转 URL 链接 */
const goToUrl = () => {
window.open(props.url)
}
/** 是否开启 */
const getEnable = () => {
return import.meta.env.VITE_APP_TENANT_ENABLE === 'true'
}
</script>
<style scoped>
.el-alert--success.is-light {
border: 1px solid green;
margin-bottom: 10px;
cursor: pointer;
}
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<content-wrap> <ContentWrap>
<el-form <el-form
class="-mb-15px" class="-mb-15px"
:model="queryParams" :model="queryParams"
@ -25,10 +25,10 @@
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</content-wrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<content-wrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="名称" align="center" prop="name" /> <el-table-column label="名称" align="center" prop="name" />
<el-table-column label="微信号" align="center" prop="account" width="180" /> <el-table-column label="微信号" align="center" prop="account" width="180" />
@ -86,15 +86,14 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页组件 --> <!-- 分页 -->
<pagination <Pagination
v-show="total > 0"
:total="total" :total="total"
v-model:page="queryParams.pageNo" v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</content-wrap> </ContentWrap>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<AccountForm ref="formRef" @success="getList" /> <AccountForm ref="formRef" @success="getList" />

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<content-wrap> <ContentWrap>
<el-form <el-form
class="-mb-15px" class="-mb-15px"
:model="queryParams" :model="queryParams"
@ -23,10 +23,10 @@
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</content-wrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<content-wrap> <ContentWrap>
<div class="waterfall" v-loading="loading"> <div class="waterfall" v-loading="loading">
<div <div
class="waterfall-item" class="waterfall-item"
@ -54,7 +54,7 @@
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</content-wrap> </ContentWrap>
</template> </template>
<script setup lang="ts" name="freePublish"> <script setup lang="ts" name="freePublish">

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<content-wrap> <ContentWrap>
<el-form class="-mb-15px" ref="queryForm" :inline="true" label-width="68px"> <el-form class="-mb-15px" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="公众号" prop="accountId"> <el-form-item label="公众号" prop="accountId">
<el-select v-model="accountId" @change="getSummary" class="!w-240px"> <el-select v-model="accountId" @change="getSummary" class="!w-240px">
@ -24,10 +24,10 @@
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
</content-wrap> </ContentWrap>
<!-- 图表 --> <!-- 图表 -->
<content-wrap> <ContentWrap>
<el-row> <el-row>
<el-col :span="12" class="card-box"> <el-col :span="12" class="card-box">
<el-card> <el-card>
@ -70,7 +70,7 @@
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</content-wrap> </ContentWrap>
</template> </template>
<script setup lang="ts" name="MpStatistics"> <script setup lang="ts" name="MpStatistics">

View File

@ -1,7 +1,7 @@
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
// 国际化 // 国际化
const { t } = useI18n() const { t } = useI18n()
const validateMobile = (rule: any, value: any, callback: any) => { const validateMobile = (_: any, value: any, callback: any) => {
const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/ const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/
if (value === '') { if (value === '') {
callback(new Error('请输入联系手机')) callback(new Error('请输入联系手机'))
@ -13,7 +13,7 @@ const validateMobile = (rule: any, value: any, callback: any) => {
} }
} }
} }
const validatePassword = (rule: any, value: any, callback: any) => { const validatePassword = (_: any, value: any, callback: any) => {
const reg = /^(?! +$).+/ const reg = /^(?! +$).+/
if (value === '') { if (value === '') {
callback(new Error('请输入用户密码')) callback(new Error('请输入用户密码'))