Compare commits
15 Commits
0555c0e42e
...
dev-cjl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6ed6575c4 | ||
|
|
cab0b3f2eb | ||
|
|
f415e0cfce | ||
|
|
90f7513ca8 | ||
|
|
cad9fbb0e0 | ||
|
|
187c156e88 | ||
| 842e6ea24b | |||
|
|
fb466e207c | ||
|
|
8a857e03af | ||
|
|
7de4adeaad | ||
|
|
3e714a0bc8 | ||
|
|
3678c5fcc4 | ||
|
|
ecc89f47bb | ||
|
|
41e256aabb | ||
|
|
cc5648414e |
@@ -71,3 +71,10 @@ export const getAppInfo = (instanceId: number) => {
|
||||
url: '/admin-api/system/serviceInstance/getInstanceInfo?instanceId=' + instanceId
|
||||
})
|
||||
}
|
||||
|
||||
export const bindWx = (data: any) => {
|
||||
return request.post({
|
||||
url: '/admin-api/system/user/bind/wx',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ export interface NotifyMessageVO {
|
||||
}
|
||||
|
||||
// 查询站内信消息列表
|
||||
export const getNotifyMessagePage = async (params: PageParam) => {
|
||||
export const getNotifyMessagePage = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/page', params })
|
||||
}
|
||||
|
||||
// 获得我的站内信分页
|
||||
export const getMyNotifyMessagePage = async (params: PageParam) => {
|
||||
export const getMyNotifyMessagePage = async (params: any) => {
|
||||
return await request.get({ url: '/admin-api/system/notify-message/my-page', params })
|
||||
}
|
||||
|
||||
|
||||
@@ -205,6 +205,8 @@ service.interceptors.response.use(
|
||||
if (msg === '无效的刷新令牌') {
|
||||
// hard coding:忽略这个提示,直接登出
|
||||
console.log(msg)
|
||||
} else if (code == 18888) {
|
||||
return { data }
|
||||
} else {
|
||||
ElNotification.error({ title: msg })
|
||||
if (code == 403) {
|
||||
|
||||
@@ -101,7 +101,7 @@ onUnmounted(() => {
|
||||
.message-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
padding: 5px 0;
|
||||
border-bottom: 1px solid var(--el-border-color-light);
|
||||
|
||||
&:last-child {
|
||||
|
||||
@@ -17,6 +17,7 @@ const { loadStart, loadDone } = usePageLoading()
|
||||
const whiteList = [
|
||||
'/login',
|
||||
'/mp-login',
|
||||
'/nm-detail',
|
||||
'/social-login',
|
||||
'/auth-redirect',
|
||||
'/bind',
|
||||
|
||||
@@ -181,6 +181,16 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/nm-detail',
|
||||
component: () => import('@/views/Profile/NotifyMessageDetail.vue'),
|
||||
name: 'NMDetail',
|
||||
meta: {
|
||||
hidden: true,
|
||||
title: '通知详情',
|
||||
noTagsView: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/403',
|
||||
component: () => import('@/views/Error/403.vue'),
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
<el-table-column prop="name" label="部门名称" />
|
||||
<el-table-column prop="leader" label="负责人" width="120" />
|
||||
<el-table-column prop="sort" label="排序" width="200" />
|
||||
<el-table-column prop="status" label="状态" width="100" />
|
||||
<el-table-column prop="status" label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ ['启用', '禁用'][row.status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" class-name="fixed-width" width="240">
|
||||
<template #default="scope">
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="auto" v-loading="formLoading">
|
||||
<el-form-item label="开启通知">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="1"> 开启 </el-radio>
|
||||
<el-radio :label="0"> 关闭 </el-radio>
|
||||
<el-radio :label="0"> 开启 </el-radio>
|
||||
<el-radio :label="1"> 关闭 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
<template>
|
||||
<div class="head-container">
|
||||
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称">
|
||||
<template #prefix>
|
||||
<Icon icon="ep:search" />
|
||||
</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
ref="treeRef"
|
||||
@@ -26,7 +19,6 @@ import { ElTree } from 'element-plus'
|
||||
import * as DeptApi from '@/api/system/dept'
|
||||
import { defaultProps, handleTree } from '@/utils/tree'
|
||||
|
||||
const deptName = ref('')
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
|
||||
|
||||
@@ -139,7 +139,8 @@ const formData = ref({
|
||||
remark: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: ''
|
||||
hireDate: '',
|
||||
isNewUserConfirm: false
|
||||
})
|
||||
const formRules = ref<any>({
|
||||
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||
@@ -192,8 +193,14 @@ const submitForm = async () => {
|
||||
try {
|
||||
const data = formData.value as unknown as UserApi.UserVO
|
||||
if (formType.value === 'create') {
|
||||
await UserApi.createUser(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
const resp = await UserApi.createUser(data)
|
||||
if (resp.code == 18888) {
|
||||
await message.confirm(resp.msg)
|
||||
formData.value.isNewUserConfirm = true
|
||||
submitForm()
|
||||
} else {
|
||||
message.success(t('common.createSuccess'))
|
||||
}
|
||||
} else {
|
||||
await UserApi.updateUser(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
@@ -220,7 +227,8 @@ const resetForm = () => {
|
||||
remark: '',
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
roleIds: [],
|
||||
hireDate: formatDate(new Date(), 'YYYY-MM-DD')
|
||||
hireDate: formatDate(new Date(), 'YYYY-MM-DD'),
|
||||
isNewUserConfirm: false
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.mobile" placeholder="联系方式" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.state" placeholder="审核状态" clearable style="width: 120px">
|
||||
<el-option label="待审核" :value="1" />
|
||||
@@ -133,8 +136,8 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="180px" />
|
||||
<el-table-column prop="name" label="线索名称" width="150px" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||
<el-table-column prop="name" label="线索名称" width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />companyProfit
|
||||
<el-table-column prop="money" label="回款金额" min-width="120px">
|
||||
<template #default="{ row }">
|
||||
@@ -207,6 +210,12 @@
|
||||
label="转化人"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
prop="area"
|
||||
label="区域"
|
||||
min-width="90"
|
||||
/>
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
@@ -312,7 +321,7 @@ import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -331,6 +340,7 @@ const searchForm = ref({
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
checkTime: [],
|
||||
phone: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
@@ -358,6 +368,7 @@ function handleReset() {
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
checkTime: [],
|
||||
mobile: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -454,7 +465,7 @@ async function handleUpdate(row) {
|
||||
companyProfit: row.companyProfit,
|
||||
personProfit: row.personProfit,
|
||||
isPayoff: row.isPayoffValue,
|
||||
applyTime: row.applyTime
|
||||
applyTime: formatDate(row.applyTime)
|
||||
})
|
||||
.then(() => {
|
||||
message.success('修改成功')
|
||||
|
||||
@@ -9,12 +9,17 @@
|
||||
<el-input v-model="form.password" placeholder="请输入密码" show-password type="password" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button type="primary" class="w-full" @click="onSubmit">授权登陆</el-button>
|
||||
<div v-if="form.code">code: {{ form.code }}</div>
|
||||
<el-button type="primary" :disabled="formLoading" class="w-full" @click="onSubmit">
|
||||
授权登陆
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MPLogin">
|
||||
import { bindWx } from '@/api/login'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const form = ref({
|
||||
code: undefined,
|
||||
username: undefined,
|
||||
@@ -38,13 +43,29 @@ const params = ref({
|
||||
scope: 'snsapi_base' // snsapi_base 静默授权获取 open id ;snsapi_userinfo 需要用户授权,获取详细信息
|
||||
// state:'code', // a-zA-Z0-9的参数值,最多128字节
|
||||
})
|
||||
function onSubmit() {
|
||||
|
||||
const formLoading = ref(false)
|
||||
async function onSubmit() {
|
||||
// 这些需要判断没有 code 情况拉起授权登陆,有就结束放在重复拉起授权登陆
|
||||
if (!form.value.code) {
|
||||
const access_url = WX_AUTH_URL + `${new URLSearchParams(params.value)}` + REDIRECT
|
||||
location.href = access_url
|
||||
} else {
|
||||
alert(`授权成功!`)
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await bindWx(form.value)
|
||||
message.success('绑定成功')
|
||||
window.close()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
@row-dblclick="handleDetail"
|
||||
>
|
||||
<el-table-column type="selection" :selectable="selectable" reserve-selection width="60px" />
|
||||
<el-table-column label="类型" align="left" prop="messageType" width="200px" />
|
||||
<el-table-column label="类型" align="left" prop="messageTypeName" width="200px" />
|
||||
<el-table-column label="标题" align="left" prop="title" />
|
||||
<el-table-column
|
||||
label="时间"
|
||||
@@ -80,6 +80,8 @@ import * as NotifyMessageApi from '@/api/system/notify/message'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getGeneralSysDictData } from '@/api/system/dict/dict.data'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息
|
||||
|
||||
@@ -98,7 +100,10 @@ const queryFormRef = ref() // 搜索的表单
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await NotifyMessageApi.getNotifyMessagePage(queryParams)
|
||||
const data = await NotifyMessageApi.getMyNotifyMessagePage({
|
||||
...queryParams,
|
||||
roleId: userStore.getUser?.currentRole
|
||||
})
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -117,15 +122,28 @@ const handleQuery = () => {
|
||||
getList()
|
||||
}
|
||||
|
||||
function handleDetail(row: any) {
|
||||
async function handleDetail(row: any) {
|
||||
if (!row.readStatus) {
|
||||
handleReadOne(row.id)
|
||||
await handleReadOne(row.id)
|
||||
}
|
||||
const url = router.resolve({
|
||||
path: '/nm-detail',
|
||||
query: { id: row.id }
|
||||
})
|
||||
window.open(url.href, '_blank')
|
||||
}
|
||||
|
||||
const tableRef = ref() // 表格的 Ref
|
||||
const selectedIds = ref<number[]>([]) // 表格的选中 ID 数组
|
||||
|
||||
/** 标记一条站内信已读 */
|
||||
const handleReadOne = async (id: number) => {
|
||||
await NotifyMessageApi.updateNotifyMessageRead({
|
||||
ids: [id]
|
||||
})
|
||||
await getList()
|
||||
}
|
||||
|
||||
/** 标记全部站内信已读 **/
|
||||
const handleUpdateAll = async () => {
|
||||
await NotifyMessageApi.updateAllNotifyMessageRead({
|
||||
@@ -150,15 +168,6 @@ const handleUpdateList = async () => {
|
||||
await getList()
|
||||
}
|
||||
|
||||
/** 标记一条站内信已读 */
|
||||
const handleReadOne = async (id: number) => {
|
||||
await NotifyMessageApi.updateNotifyMessageRead({
|
||||
ids: [id],
|
||||
roleId: userStore.getUser?.currentRole
|
||||
})
|
||||
await getList()
|
||||
}
|
||||
|
||||
/** 当表格选择项发生变化时会触发该事件 */
|
||||
const handleSelectionChange = (array: NotifyMessageApi.NotifyMessageVO[]) => {
|
||||
selectedIds.value = []
|
||||
|
||||
89
src/views/Profile/NotifyMessageDetail.vue
Normal file
89
src/views/Profile/NotifyMessageDetail.vue
Normal file
@@ -0,0 +1,89 @@
|
||||
<!--
|
||||
* @Author: riverQiu
|
||||
* @Date: 2024-09-11 18:42:37
|
||||
* @LastEditors: riverQiu
|
||||
* @LastEditTime: 2024-09-11 19:03:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="container">
|
||||
<ContentWrap style="max-width: 1000px; margin: 0 auto">
|
||||
<div class="text-center">
|
||||
<div class="mb-10px" style="font-size: 24px; letter-spacing: 2px">
|
||||
{{ info.title }}
|
||||
</div>
|
||||
<el-text>
|
||||
{{ formatDate(info.createTime, 'YYYY-MM-DD hh:mm:ss') }}
|
||||
</el-text>
|
||||
</div>
|
||||
<el-divider direction="horizontal" />
|
||||
|
||||
<div v-dompurify-html="info.content"></div>
|
||||
</ContentWrap>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="NMDetail">
|
||||
import { getNotifyMessageDetail, updateNotifyMessageRead } from '@/api/system/notify/message'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const route = useRoute()
|
||||
const info = ref({})
|
||||
|
||||
function init() {
|
||||
getNotifyMessageDetail(route.query.id).then((data) => {
|
||||
info.value = data
|
||||
if (!data.readStatus) {
|
||||
handleReadOne(data.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/** 标记一条站内信已读 */
|
||||
const handleReadOne = async (id) => {
|
||||
await updateNotifyMessageRead({
|
||||
ids: [id]
|
||||
// roleId: userStore.getUser?.currentRole
|
||||
})
|
||||
await getList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding: 20px;
|
||||
max-height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
:deep(p) {
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(table) {
|
||||
margin-top: 10px;
|
||||
border-collapse: separate;
|
||||
text-indent: initial;
|
||||
border-spacing: 1px;
|
||||
text-align: left;
|
||||
border-width: 1px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
:deep(th) {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
border-width: 1px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
:deep(td) {
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
border-width: 1px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
:deep(.el-card__body) {
|
||||
padding: 20px 10px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user