11 Commits
1.0.1 ... 3.0.1

Author SHA1 Message Date
zzc
e54cecad69 fix: qian kind bug
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-23 23:27:56 +08:00
zzc
712c95de3f fix: qian kind 2026-01-23 23:21:13 +08:00
zzc
1e7de1bf06 feat: bless card
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-20 10:14:08 +08:00
zzc
dbd4140d2c feat: blessing card 2026-01-19 21:45:01 +08:00
zzc
3eebbe5e8b feat: 抽签信息完善 2026-01-19 19:23:43 +08:00
zzc
eaf8197db6 feat: draw card line 2026-01-19 19:13:12 +08:00
zzc
bff9a07ed4 feat: draw card 2026-01-19 18:05:36 +08:00
zzc
693d9673b4 build: api env
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-05 10:44:17 +08:00
zzc
7354dbfab5 build: drone node version npm nginx
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-05 10:15:29 +08:00
zzc
dc682c0c63 build: drone node version npm
All checks were successful
continuous-integration/drone/tag Build is passing
2026-01-05 09:39:30 +08:00
zzc
ad292b5eb8 build: drone node version
Some checks failed
continuous-integration/drone/tag Build is failing
2026-01-05 09:23:19 +08:00
31 changed files with 2402 additions and 15 deletions

View File

@@ -1 +1 @@
VUE_APP_API_BASE_URL=https://apis.lihailezzc.com
VUE_APP_API_BASE_URL=https://api.ai-meng.com

View File

@@ -1,5 +1,5 @@
# 1⃣ 构建阶段
FROM node:18 AS build
FROM images.lihailezzc.com/library/node:20-alpine as build
# 设置工作目录
WORKDIR /app
@@ -10,6 +10,7 @@ COPY . .
ENV CI=true
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm config set registry https://registry.npmmirror.com
RUN npm install pnpm -g
RUN pnpm install --force
@@ -19,7 +20,7 @@ RUN pnpm run build
# 2⃣ 生产部署阶段(用 nginx 托管)
FROM nginx:alpine
FROM images.lihailezzc.com/library/nginx:alpine
# 拷贝构建好的 dist 到 nginx 的 html 目录
COPY --from=build /app/dist /usr/share/nginx/html

8
docker-compose.yml Normal file
View File

@@ -0,0 +1,8 @@
version: "3"
services:
api_client:
container_name: api_client
image: client
ports:
- 5001:80

View File

@@ -0,0 +1,55 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/management/api/spring/blessing/content_template/list',
method: 'get',
params: data,
})
}
export function doAdd(data) {
return request({
url: '/management/api/spring/blessing/content_template',
method: 'post',
data,
})
}
export function doEdit(id, data) {
return request({
url: `/management/api/spring/blessing/content_template/${id}`,
method: 'put',
data,
})
}
export function doDelete(data) {
return request({
url: '/management/api/spring/blessing/content_template/delete',
method: 'put',
data,
})
}
export function doMoveUp(id) {
return request({
url: `/management/api/spring/blessing/content_template/moveUp/${id}`,
method: 'patch',
})
}
export function doMoveDown(id) {
return request({
url: `/management/api/spring/blessing/content_template/moveDown/${id}`,
method: 'patch',
})
}
export function toggleEnable(id, isEnabled) {
return request({
url: `/management/api/spring/blessing/content_template/enable/${id}`,
method: 'patch',
data: { isEnabled },
})
}

View File

@@ -0,0 +1,25 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/management/api/spring/blessing/generate-record/list',
method: 'get',
params: data,
})
}
export function getShareList(data) {
return request({
url: '/management/api/spring/blessing/share-record/list',
method: 'get',
params: data,
})
}
export function getViewList(data) {
return request({
url: '/management/api/spring/blessing/view-record/list',
method: 'get',
params: data,
})
}

View File

@@ -0,0 +1,55 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: '/management/api/spring/blessing/template/list',
method: 'get',
params: data,
})
}
export function doAdd(data) {
return request({
url: '/management/api/spring/blessing/template',
method: 'post',
data,
})
}
export function doEdit(id, data) {
return request({
url: `/management/api/spring/blessing/template/${id}`,
method: 'put',
data,
})
}
export function doDelete(data) {
return request({
url: '/management/api/spring/blessing/template/delete',
method: 'put',
data,
})
}
export function doMoveUp(id) {
return request({
url: `/management/api/spring/blessing/template/moveUp/${id}`,
method: 'patch',
})
}
export function doMoveDown(id) {
return request({
url: `/management/api/spring/blessing/template/moveDown/${id}`,
method: 'patch',
})
}
export function toggleEnable(id, isEnabled) {
return request({
url: `/management/api/spring/blessing/template/enable/${id}`,
method: 'patch',
data: { isEnabled },
})
}

View File

@@ -0,0 +1,33 @@
import request from '@/utils/request'
export function getList(data) {
return request({
url: 'management/api/spring/fortune/card/list',
method: 'get',
params: data,
})
}
export function doAdd(data) {
return request({
url: '/management/api/spring/fortune/card',
method: 'post',
data,
})
}
export function doEdit(id, data) {
return request({
url: `/management/api/spring/fortune/card/${id}`,
method: 'put',
data,
})
}
export function doDelete(data) {
return request({
url: '/management/api/spring/fortune/card/delete',
method: 'put',
data,
})
}

View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getUserList(data) {
return request({
url: '/management/api/spring/user/list',
method: 'get',
params: data,
})
}

9
src/api/system/index.js Normal file
View File

@@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getDeviceList(data) {
return request({
url: 'management/api/system/device/list',
method: 'get',
params: data,
})
}

View File

@@ -76,7 +76,7 @@
if (response.code === 200) {
this.fileUrl = `https://file.lihailezzc.com/${response.data.key}`
this.$message.success('上传成功!')
// this.$emit('input', this.fileUrl)
this.$emit('input', this.fileUrl)
this.$emit('upload-success', this.fileUrl)
} else {
this.$message.error('上传失败,请重试!')

View File

@@ -48,6 +48,105 @@ export const asyncRoutes = [
},
],
},
{
path: '/spring',
component: Layout,
redirect: 'noRedirect',
name: 'SpringMini',
meta: { title: '新春祝福', icon: 'gift', permissions: ['admin'] },
children: [
{
path: 'blessing',
component: EmptyLayout,
alwaysShow: true,
redirect: 'noRedirect',
name: 'Blessing',
meta: {
title: '祝福卡片',
icon: 'clover',
permissions: ['admin'],
},
children: [
{
path: 'template',
name: 'template',
component: () => import('@/views/spring/blessing/template/index'),
meta: { title: '祝福卡模版' },
},
{
path: 'contentTemplate',
name: 'contentTemplate',
component: () => import('@/views/spring/blessing/contentTemplate/index'),
meta: { title: '内容模版' },
},
{
path: 'generateRecord',
name: 'GenerateRecord',
component: () => import('@/views/spring/blessing/generateRecord/index'),
meta: { title: '生成记录' },
},
],
},
{
path: 'fortune',
component: EmptyLayout,
alwaysShow: true,
redirect: 'noRedirect',
name: 'Fortune',
meta: {
title: '抽签',
icon: 'clover',
permissions: ['admin'],
},
children: [
{
path: 'card',
name: 'card',
component: () => import('@/views/spring/fortune/card/index'),
meta: { title: '抽签卡片' },
},
],
},
{
path: 'user',
component: EmptyLayout,
alwaysShow: true,
redirect: 'noRedirect',
name: 'User',
meta: {
title: '用户',
icon: 'user',
permissions: ['admin'],
},
children: [
{
path: 'user',
name: 'User',
component: () => import('@/views/spring/user/user/index'),
meta: { title: '用户' },
},
{
path: 'userChat',
name: 'UserChat',
component: () => import('@/views/spring/user/device/index'),
meta: { title: '设备' },
},
{
path: 'shareRecord',
name: 'ShareRecord',
component: () => import('@/views/spring/blessing/shareRecord/index'),
meta: { title: '分享记录' },
},
{
path: 'viewRecord',
name: 'ViewRecord',
component: () => import('@/views/spring/blessing/viewRecord/index'),
meta: { title: '查看记录' },
},
],
},
],
},
{
path: '/maomaotou',
component: Layout,
@@ -411,6 +510,21 @@ export const asyncRoutes = [
component: () => import('@/views/personnelManagement/roleManagement/index'),
meta: { title: '角色管理' },
},
],
},
{
path: '/systemManagement',
component: Layout,
redirect: 'noRedirect',
name: 'SystemManagement',
meta: { title: '系统', icon: 'users-cog', permissions: ['admin'] },
children: [
{
path: 'deviceManagement',
name: 'DeviceManagement',
component: () => import('@/views/systemManagement/device/index'),
meta: { title: '设备管理' },
},
{
path: 'accessLogManagement',
name: 'AccessLogManagement',
@@ -423,12 +537,6 @@ export const asyncRoutes = [
component: () => import('@/views/personnelManagement/uploadedFileManagement/index'),
meta: { title: '已上传文件' },
},
// {
// path: 'menuManagement',
// name: 'MenuManagement',
// component: () => import('@/views/personnelManagement/menuManagement/index'),
// meta: { title: '菜单管理', badge: 'New' },
// },
],
},
// {

View File

@@ -59,7 +59,7 @@ instance.interceptors.request.use(
config.params = Vue.prototype.$baseLodash.pickBy(config.params, Vue.prototype.$baseLodash.identity)
}
//这里会过滤所有为空、0、false的key如果不需要请自行注释
if (config.data) config.data = Vue.prototype.$baseLodash.pickBy(config.data, Vue.prototype.$baseLodash.identity)
// if (config.data) config.data = Vue.prototype.$baseLodash.pickBy(config.data, Vue.prototype.$baseLodash.identity)
if (config.data && config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8')
config.data = qs.stringify(config.data)
if (debounce.some((item) => config.url.includes(item))) loadingInstance = Vue.prototype.$baseLoading()

View File

@@ -59,6 +59,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -54,6 +54,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -68,6 +68,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -81,6 +81,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -77,6 +77,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -59,6 +59,7 @@
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {

View File

@@ -0,0 +1,87 @@
<template>
<el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" @close="close">
<el-form ref="form" label-width="80px" :model="form" :rules="rules">
<el-form-item label="模版内容" prop="content">
<el-input v-model="form.content" autocomplete="off" :rows="6" type="textarea" />
</el-form-item>
<el-form-item v-if="!form.name" label="是否启用" prop="isEnabled">
<el-switch v-model="form.isEnabled" active-text="启用" :active-value="true" inactive-text="禁用" :inactive-value="false" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { doEdit, doAdd } from '@/api/spring/blessing/contentTemplate'
export default {
name: 'AppManagementEdit',
data() {
return {
id: '',
form: {
content: '',
isEnabled: true,
},
rules: {
name: [{ required: true, trigger: 'blur', message: '请输入卡片名称' }],
isEnabled: [{ required: true, trigger: 'blur', message: '请选择是否启用' }],
},
title: '',
dialogFormVisible: false,
}
},
computed: {
uploadUrl() {
return `${process.env.VUE_APP_API_BASE_URL}/management/api/common/upload`
},
},
created() {},
methods: {
handleUploadSuccess(url) {
this.form.imageUrl = url
},
showEdit(row) {
if (!row) {
this.title = '添加'
} else {
this.title = '编辑'
this.form = {
content: row.content,
isEnabled: row.isEnabled,
}
this.id = row.id
}
this.dialogFormVisible = true
},
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {
this.$refs['form'].validate(async (valid) => {
if (valid) {
if (this.id) {
const { msg } = await doEdit(this.id, this.form)
this.$baseMessage(msg, 'success')
} else {
const { msg } = await doAdd(this.form)
this.$baseMessage(msg, 'success')
}
this.$emit('fetch-data')
this.close()
} else {
return false
}
})
},
},
}
</script>

View File

@@ -0,0 +1,201 @@
<template>
<div class="appManagement-container">
<vab-query-form>
<vab-query-form-left-panel :span="12">
<el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button>
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
</vab-query-form-left-panel>
<vab-query-form-right-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
<el-table-column align="center" label="排序" prop="sort" show-overflow-tooltip />
<el-table-column align="center" label="内容">
<template #default="{ row }">
<div class="content-cell">
{{ row.content }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="使用次数" prop="useCount" show-overflow-tooltip />
<el-table-column align="center" label="是否启用" show-overflow-tooltip>
<template #default="{ row }">
<el-switch active-color="#13ce66" inactive-color="#ff4949" :value="row.isEnabled" @change="handleToggleEnable(row, $event)" />
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button :disabled="!scope.row.isEnabled || isFirstEnabled(scope.row)" type="text" @click="handleMoveUp(scope.row)">
上移
</el-button>
<el-button :disabled="!scope.row.isEnabled || isLastEnabled(scope.row)" type="text" @click="handleMoveDown(scope.row)">
下移
</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<edit ref="edit" @fetch-data="fetchData" />
</div>
</template>
<script>
import { doDelete, getList, toggleEnable, doMoveUp, doMoveDown } from '@/api/spring/blessing/contentTemplate'
import Edit from './components/AppManagementEdit'
export default {
name: 'AppManagement',
components: { Edit },
data() {
return {
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
keyword: '',
fortuneLevel: '',
},
timeOutID: null,
}
},
created() {
const { templateId } = this.$route.query || {}
if (templateId) {
this.queryForm.keyword = templateId
this.queryForm.pageNo = 1
}
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data } = await getList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
async handleToggleEnable(row, val) {
const prev = row.isEnabled
row.isEnabled = val
try {
const { msg } = await toggleEnable(row.id, val)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
row.isEnabled = prev
this.$baseMessage('更新失败', 'error')
}
},
async handleMoveUp(row) {
try {
const { msg } = await doMoveUp(row.id)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
this.$baseMessage('操作失败', 'error')
}
},
async handleMoveDown(row) {
try {
const { msg } = await doMoveDown(row.id)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
this.$baseMessage('操作失败', 'error')
}
},
isFirstEnabled(row) {
if (!this.list || this.list.length === 0) return false
const enabled = this.list.filter((item) => item.isEnabled)
if (enabled.length === 0) return false
return enabled[0].id === row.id
},
isLastEnabled(row) {
if (!this.list || this.list.length === 0) return false
const enabled = this.list.filter((item) => item.isEnabled)
if (enabled.length === 0) return false
return enabled[enabled.length - 1].id === row.id
},
},
}
</script>
<style scoped>
.content-cell {
white-space: pre-wrap;
word-break: break-word;
line-height: 1.6;
}
</style>

View File

@@ -0,0 +1,270 @@
<template>
<div class="gen-record-container">
<vab-query-form>
<!-- <vab-query-form-left-panel :span="12"> -->
<!-- <el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button> -->
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
<!-- </vab-query-form-left-panel> -->
<vab-query-form-left-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-left-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @selection-change="setSelectRows">
<el-table-column align="center" label="生成结果" width="100">
<template slot-scope="scope">
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
<el-image fit="cover" :preview-src-list="[scope.row.imageUrl]" :src="scope.row.imageUrl" style="width: 50px; height: 50px" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="left" label="信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>节日</strong>
{{ row.year }}-{{ row.festival }}
</div>
<div>
<strong>祝福对象</strong>
{{ row.blessingTo || '--' }}
</div>
<div>
<strong>祝福人</strong>
{{ row.blessingFrom || '--' }}
</div>
<div>
<strong>设备</strong>
<template v-if="row.deviceId">
<el-link type="primary" :underline="false" @click="goToDevice(row.deviceId)">{{ row.deviceModel || row.deviceId }}</el-link>
</template>
<template v-else>--</template>
</div>
<div>
<strong>模版id</strong>
<template v-if="row.templateId">
<el-link type="primary" :underline="false" @click="goToTemplate(row.templateId)">{{ row.templateId }}</el-link>
</template>
<template v-else>--</template>
</div>
<div>
<strong>内容id</strong>
<template v-if="row.blessingId">
<el-link type="primary" :underline="false" @click="goToContentTemplate(row.blessingId)">{{ row.blessingId }}</el-link>
</template>
<template v-else>--</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="交互信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>查看数</strong>
{{ row.viewCount }}
</div>
<div>
<strong>分享数</strong>
{{ row.shareCount }}
</div>
<div>
<strong>保存数</strong>
{{ row.saveCount }}
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="作者信息" show-overflow-tooltip>
<template #default="{ row }">
<div class="author-cell">
<img alt="avatar" class="author-avatar" :src="row?.fromUser?.avatar" />
<div class="author-meta">
<div>
<strong>id</strong>
{{ row?.fromUser?.id || '--' }}
</div>
<div>
<strong>昵称</strong>
{{ row?.fromUser?.nickname || '--' }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" show-overflow-tooltip width="200">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getList } from '@/api/spring/blessing/generateRecord'
import { formatTime } from '@/utils'
export default {
name: 'GenerateRecord',
data() {
return {
host: 'https://file.lihailezzc.com/',
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
keyword: '',
},
timeOutID: null,
}
},
created() {
const { id } = this.$route.query || {}
if (id) {
this.queryForm.keyword = id
this.queryForm.pageNo = 1
}
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
goToDevice(deviceId) {
this.$router.push({ path: '/spring/user/userChat', query: { deviceId } })
},
goToTemplate(templateId) {
this.$router.push({ path: '/spring/blessing/template', query: { templateId } })
},
goToContentTemplate(templateId) {
this.$router.push({ path: '/spring/blessing/contentTemplate', query: { templateId } })
},
async fetchData() {
this.listLoading = true
const { data } = await getList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>
<style scoped>
.author-option {
display: flex;
align-items: center;
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
margin-right: 8px;
}
.author-name {
font-size: 14px;
}
.author-cell {
display: flex;
align-items: center;
gap: 12px;
}
.author-avatar {
width: 50px;
height: 50px;
object-fit: cover;
border-radius: 50%;
}
.author-meta {
display: flex;
flex-direction: column;
}
.image-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.grid-image {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 8px;
}
</style>

View File

@@ -0,0 +1,255 @@
<template>
<div class="share-record-container">
<vab-query-form>
<!-- <vab-query-form-left-panel :span="12"> -->
<!-- <el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button> -->
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
<!-- </vab-query-form-left-panel> -->
<vab-query-form-left-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-select v-model="queryForm.type" clearable placeholder="请选择分享类型" @change="queryData">
<el-option label="祝福卡片" :value="1" />
<el-option label="抽签" :value="2" />
<el-option label="壁纸" :value="3" />
<el-option label="头像" :value="4" />
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-left-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @selection-change="setSelectRows">
<el-table-column align="center" label="分享内容" width="100">
<template slot-scope="scope">
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
<el-image fit="cover" :preview-src-list="[scope.row.imageUrl]" :src="scope.row.imageUrl" style="width: 50px; height: 50px" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="center" label="分享类型" show-overflow-tooltip>
<template #default="{ row }">
{{ row.type === 1 ? '祝福卡片' : row.type === 2 ? '抽签' : row.type === 3 ? '壁纸' : '头像' }}
</template>
</el-table-column>
<el-table-column align="left" label="信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>分享Token</strong>
{{ row.shareToken }}
</div>
<div>
<strong>分享渠道</strong>
{{ row.shareChannel || '--' }}
</div>
<div>
<strong>设备</strong>
<template v-if="row.deviceId">
<el-link type="primary" :underline="false" @click="goToDevice(row.deviceId)">{{ row.deviceModel || row.deviceId }}</el-link>
</template>
<template v-else>--</template>
</div>
<div>
<strong>内容id</strong>
<template v-if="row.cardId">
<el-link type="primary" :underline="false" @click="goToContent(row)">{{ row.cardId }}</el-link>
</template>
<template v-else>--</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="作者信息" show-overflow-tooltip>
<template #default="{ row }">
<div class="author-cell">
<img alt="avatar" class="author-avatar" :src="row?.fromUser?.avatar" />
<div class="author-meta">
<div>
<strong>id</strong>
{{ row?.fromUser?.id || '--' }}
</div>
<div>
<strong>昵称</strong>
{{ row?.fromUser?.nickname || '--' }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" show-overflow-tooltip width="200">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getShareList } from '@/api/spring/blessing/generateRecord'
import { formatTime } from '@/utils'
export default {
name: 'GenerateRecord',
data() {
return {
host: 'https://file.lihailezzc.com/',
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
type: '',
keyword: '',
},
timeOutID: null,
}
},
created() {
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
goToDevice(deviceId) {
this.$router.push({ path: '/spring/user/userChat', query: { deviceId } })
},
goToContent(row) {
if (row.type === 1) {
this.$router.push({ path: '/spring/blessing/generateRecord', query: { id: row.cardId } })
} else if (row.type === 2) {
this.$router.push({ path: '/spring/blessing/viewRecord', query: { id: row.cardId } })
} else if (row.type === 3) {
this.$router.push({ path: '/spring/blessing/shareRecord', query: { id: row.cardId } })
} else {
this.$router.push({ path: '/spring/blessing/shareRecord', query: { id: row.cardId } })
}
},
async fetchData() {
this.listLoading = true
const { data } = await getShareList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>
<style scoped>
.author-option {
display: flex;
align-items: center;
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
margin-right: 8px;
}
.author-name {
font-size: 14px;
}
.author-cell {
display: flex;
align-items: center;
gap: 12px;
}
.author-avatar {
width: 50px;
height: 50px;
object-fit: cover;
border-radius: 50%;
}
.author-meta {
display: flex;
flex-direction: column;
}
.image-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.grid-image {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 8px;
}
</style>

View File

@@ -0,0 +1,100 @@
<template>
<el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" @close="close">
<el-form ref="form" label-width="80px" :model="form" :rules="rules">
<el-form-item label="模版名称" prop="name">
<el-input v-model="form.name" autocomplete="off" />
</el-form-item>
<el-form-item label="卡片图片" prop="imageUrl">
<single-upload
v-model="form.imageUrl"
style="width: 100px; height: 100px"
:upload-url="uploadUrl"
@upload-success="handleUploadSuccess"
/>
</el-form-item>
<el-form-item v-if="!form.name" label="是否启用" prop="isEnabled">
<el-switch v-model="form.isEnabled" active-text="启用" :active-value="true" inactive-text="禁用" :inactive-value="false" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { doEdit, doAdd } from '@/api/spring/blessing/template'
import SingleUpload from '@/components/SingleUpload'
export default {
name: 'AppManagementEdit',
components: { SingleUpload },
data() {
return {
id: '',
form: {
name: '',
imageUrl: '',
isEnabled: true,
},
rules: {
name: [{ required: true, trigger: 'blur', message: '请输入卡片名称' }],
imageUrl: [{ required: true, trigger: 'blur', message: '请上传卡片图片' }],
isEnabled: [{ required: true, trigger: 'blur', message: '请选择是否启用' }],
},
title: '',
dialogFormVisible: false,
}
},
computed: {
uploadUrl() {
return `${process.env.VUE_APP_API_BASE_URL}/management/api/common/upload`
},
},
created() {},
methods: {
handleUploadSuccess(url) {
this.form.imageUrl = url
},
showEdit(row) {
if (!row) {
this.title = '添加'
} else {
this.title = '编辑'
this.form = {
name: row.name,
imageUrl: row.imageUrl,
isEnabled: row.isEnabled,
}
this.id = row.id
}
this.dialogFormVisible = true
},
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {
this.$refs['form'].validate(async (valid) => {
if (valid) {
if (this.id) {
const { msg } = await doEdit(this.id, this.form)
this.$baseMessage(msg, 'success')
} else {
const { msg } = await doAdd(this.form)
this.$baseMessage(msg, 'success')
}
this.$emit('fetch-data')
this.close()
} else {
return false
}
})
},
},
}
</script>

View File

@@ -0,0 +1,198 @@
<template>
<div class="appManagement-container">
<vab-query-form>
<vab-query-form-left-panel :span="12">
<el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button>
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
</vab-query-form-left-panel>
<vab-query-form-right-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
<!-- <el-table-column show-overflow-tooltip type="selection" /> -->
<el-table-column align="center" label="排序" prop="sort" show-overflow-tooltip />
<el-table-column align="center" label="模版" width="100">
<template slot-scope="scope">
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
<el-image fit="cover" :preview-src-list="[scope.row.imageUrl]" :src="scope.row.imageUrl" style="width: 50px; height: 50px" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="center" label="标题" prop="name" show-overflow-tooltip />
<el-table-column align="center" label="使用次数" prop="useCount" show-overflow-tooltip />
<el-table-column align="center" label="是否启用" show-overflow-tooltip>
<template #default="{ row }">
<el-switch active-color="#13ce66" inactive-color="#ff4949" :value="row.isEnabled" @change="handleToggleEnable(row, $event)" />
</template>
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button :disabled="!scope.row.isEnabled || isFirstEnabled(scope.row)" type="text" @click="handleMoveUp(scope.row)">
上移
</el-button>
<el-button :disabled="!scope.row.isEnabled || isLastEnabled(scope.row)" type="text" @click="handleMoveDown(scope.row)">
下移
</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<edit ref="edit" @fetch-data="fetchData" />
</div>
</template>
<script>
import { doDelete, getList, toggleEnable, doMoveUp, doMoveDown } from '@/api/spring/blessing/template'
import { formatTime } from '@/utils'
import Edit from './components/AppManagementEdit'
export default {
name: 'AppManagement',
components: { Edit },
data() {
return {
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
keyword: '',
fortuneLevel: '',
},
timeOutID: null,
}
},
created() {
const { templateId } = this.$route.query || {}
if (templateId) {
this.queryForm.keyword = templateId
this.queryForm.pageNo = 1
}
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data } = await getList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
async handleToggleEnable(row, val) {
const prev = row.isEnabled
row.isEnabled = val
try {
const { msg } = await toggleEnable(row.id, val)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
row.isEnabled = prev
this.$baseMessage('更新失败', 'error')
}
},
async handleMoveUp(row) {
try {
const { msg } = await doMoveUp(row.id)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
this.$baseMessage('操作失败', 'error')
}
},
async handleMoveDown(row) {
try {
const { msg } = await doMoveDown(row.id)
if (msg) this.$baseMessage(msg, 'success')
this.fetchData()
} catch (e) {
this.$baseMessage('操作失败', 'error')
}
},
isFirstEnabled(row) {
if (!this.list || this.list.length === 0) return false
const enabled = this.list.filter((item) => item.isEnabled)
if (enabled.length === 0) return false
return enabled[0].id === row.id
},
isLastEnabled(row) {
if (!this.list || this.list.length === 0) return false
const enabled = this.list.filter((item) => item.isEnabled)
if (enabled.length === 0) return false
return enabled[enabled.length - 1].id === row.id
},
},
}
</script>

View File

@@ -0,0 +1,265 @@
<template>
<div class="view-record-container">
<vab-query-form>
<!-- <vab-query-form-left-panel :span="12"> -->
<!-- <el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button> -->
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
<!-- </vab-query-form-left-panel> -->
<vab-query-form-left-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.permission" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-left-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @selection-change="setSelectRows">
<el-table-column align="center" label="生成结果" width="100">
<template slot-scope="scope">
<el-tooltip class="item" :content="scope.row.id" effect="dark" placement="top">
<el-image fit="cover" :preview-src-list="[scope.row.imageUrl]" :src="scope.row.imageUrl" style="width: 50px; height: 50px" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="left" label="信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>节日</strong>
{{ row.year }}-{{ row.festival }}
</div>
<div>
<strong>祝福对象</strong>
{{ row.blessingTo || '--' }}
</div>
<div>
<strong>祝福人</strong>
{{ row.blessingFrom || '--' }}
</div>
<div>
<strong>设备</strong>
<template v-if="row.deviceId">
<el-link type="primary" :underline="false" @click="goToDevice(row.deviceId)">{{ row.deviceModel || row.deviceId }}</el-link>
</template>
<template v-else>--</template>
</div>
<div>
<strong>模版id</strong>
<template v-if="row.templateId">
<el-link type="primary" :underline="false" @click="goToTemplate(row.templateId)">{{ row.templateId }}</el-link>
</template>
<template v-else>--</template>
</div>
<div>
<strong>内容id</strong>
<template v-if="row.blessingId">
<el-link type="primary" :underline="false" @click="goToContentTemplate(row.blessingId)">{{ row.blessingId }}</el-link>
</template>
<template v-else>--</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="交互信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>查看数</strong>
{{ row.viewCount }}
</div>
<div>
<strong>分享数</strong>
{{ row.shareCount }}
</div>
<div>
<strong>保存数</strong>
{{ row.saveCount }}
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="作者信息" show-overflow-tooltip>
<template #default="{ row }">
<div class="author-cell">
<img alt="avatar" class="author-avatar" :src="row?.fromUser?.avatar" />
<div class="author-meta">
<div>
<strong>id</strong>
{{ row?.fromUser?.id || '--' }}
</div>
<div>
<strong>昵称</strong>
{{ row?.fromUser?.nickname || '--' }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" show-overflow-tooltip width="200">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getList } from '@/api/spring/blessing/generateRecord'
import { formatTime } from '@/utils'
export default {
name: 'GenerateRecord',
data() {
return {
host: 'https://file.lihailezzc.com/',
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
permission: '',
},
timeOutID: null,
}
},
created() {
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
goToDevice(deviceId) {
this.$router.push({ path: '/spring/user/userChat', query: { deviceId } })
},
goToTemplate(templateId) {
this.$router.push({ path: '/spring/blessing/template', query: { templateId } })
},
goToContentTemplate(templateId) {
this.$router.push({ path: '/spring/blessing/contentTemplate', query: { templateId } })
},
async fetchData() {
this.listLoading = true
const { data } = await getList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>
<style scoped>
.author-option {
display: flex;
align-items: center;
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
margin-right: 8px;
}
.author-name {
font-size: 14px;
}
.author-cell {
display: flex;
align-items: center;
gap: 12px;
}
.author-avatar {
width: 50px;
height: 50px;
object-fit: cover;
border-radius: 50%;
}
.author-meta {
display: flex;
flex-direction: column;
}
.image-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.grid-image {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 8px;
}
</style>

View File

@@ -0,0 +1,127 @@
<template>
<el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" @close="close">
<el-form ref="form" label-width="80px" :model="form" :rules="rules">
<el-form-item label="卡片标题" prop="title">
<el-input v-model="form.title" autocomplete="off" />
</el-form-item>
<el-form-item label="幸运等级" prop="fortuneLevel">
<el-select v-model="form.fortuneLevel" placeholder="请选择幸运等级">
<el-option label="吉签" value="1" />
<el-option label="中吉签" value="2" />
<el-option label="上吉签" value="3" />
<el-option label="上上签" value="4" />
<el-option label="大吉签" value="5" />
</el-select>
</el-form-item>
<el-form-item label="描述内容" prop="content">
<el-input v-model="form.content" autocomplete="off" />
</el-form-item>
<el-form-item label="卡片图片" prop="imageUrl">
<single-upload
v-model="form.imageUrl"
style="width: 100px; height: 100px"
:upload-url="uploadUrl"
@upload-success="handleUploadSuccess"
/>
</el-form-item>
<el-form-item label="权重" prop="weight">
<el-input v-model="form.weight" autocomplete="off" />
</el-form-item>
<el-form-item label="是否启用" prop="isEnabled">
<el-switch v-model="form.isEnabled" active-text="启用" :active-value="true" inactive-text="禁用" :inactive-value="false" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { doEdit, doAdd } from '@/api/spring/fortune/card'
import SingleUpload from '@/components/SingleUpload'
export default {
name: 'AppManagementEdit',
components: { SingleUpload },
data() {
return {
id: '',
form: {
title: '',
fortuneLevel: '',
content: '',
imageUrl: '',
keywords: '',
weight: 1,
isEnabled: true,
},
rules: {
title: [{ required: true, trigger: 'blur', message: '请输入卡片标题' }],
fortuneLevel: [{ required: true, trigger: 'blur', message: '请选择幸运等级' }],
content: [{ required: true, trigger: 'blur', message: '请输入描述内容' }],
imageUrl: [{ required: true, trigger: 'blur', message: '请上传卡片图片' }],
weight: [{ required: true, trigger: 'blur', message: '请输入权重' }],
isEnabled: [{ required: true, trigger: 'blur', message: '请选择是否启用' }],
},
title: '',
dialogFormVisible: false,
}
},
computed: {
uploadUrl() {
return `${process.env.VUE_APP_API_BASE_URL}/management/api/common/upload`
},
},
created() {},
methods: {
handleUploadSuccess(url) {
this.form.imageUrl = url
},
showEdit(row) {
if (!row) {
this.title = '添加'
} else {
this.title = '编辑'
this.form = {
title: row.title,
fortuneLevel: row.fortuneLevel,
content: row.content,
imageUrl: row.imageUrl,
type: row.type,
keywords: row.keywords,
weight: row.weight,
isEnabled: row.isEnabled,
}
this.id = row.id
}
this.dialogFormVisible = true
},
close() {
this.$refs['form'].resetFields()
this.form = this.$options.data().form
this.id = ''
this.dialogFormVisible = false
},
save() {
this.$refs['form'].validate(async (valid) => {
if (valid) {
if (this.id) {
const { msg } = await doEdit(this.id, this.form)
this.$baseMessage(msg, 'success')
} else {
const { msg } = await doAdd(this.form)
this.$baseMessage(msg, 'success')
}
this.$emit('fetch-data')
this.close()
} else {
return false
}
})
},
},
}
</script>

View File

@@ -0,0 +1,155 @@
<template>
<div class="appManagement-container">
<vab-query-form>
<vab-query-form-left-panel :span="12">
<el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button>
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
</vab-query-form-left-panel>
<vab-query-form-right-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-select v-model="queryForm.fortuneLevel" clearable placeholder="请选择幸运等级" @change="queryData">
<el-option label="吉祥" value="1" />
<el-option label="大吉" value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
<!-- <el-table-column show-overflow-tooltip type="selection" /> -->
<el-table-column align="center" label="卡片" width="100">
<template slot-scope="scope">
<el-tooltip class="item" :content="scope.row.title" effect="dark" placement="top">
<el-image fit="cover" :preview-src-list="[scope.row.imageUrl]" :src="scope.row.imageUrl" style="width: 50px; height: 50px" />
</el-tooltip>
</template>
</el-table-column>
<el-table-column align="center" label="标题" prop="title" show-overflow-tooltip />
<el-table-column align="center" label="幸运等级" show-overflow-tooltip>
<template #default="{ row }">
{{ row.fortuneLevel === '1' ? '吉祥' : row.fortuneLevel === '2' ? '大吉' : '普通' }}
</template>
</el-table-column>
<el-table-column align="center" label="是否启用" show-overflow-tooltip>
<template #default="{ row }">
{{ row.isEnabled ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column align="center" label="描述" prop="content" show-overflow-tooltip />
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
<edit ref="edit" @fetch-data="fetchData" />
</div>
</template>
<script>
import { doDelete, getList } from '@/api/spring/fortune/card'
import { formatTime } from '@/utils'
import Edit from './components/AppManagementEdit'
export default {
name: 'AppManagement',
components: { Edit },
data() {
return {
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
keyword: '',
fortuneLevel: '',
},
timeOutID: null,
}
},
created() {
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data } = await getList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>

View File

@@ -0,0 +1,107 @@
<template>
<div class="sfg-device-container">
<vab-query-form>
<vab-query-form-right-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.deviceId" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
<el-table-column align="center" label="品牌" prop="brand" show-overflow-tooltip />
<el-table-column align="center" label="型号" prop="model" show-overflow-tooltip />
<el-table-column align="center" label="系统版本" prop="system" show-overflow-tooltip />
<el-table-column align="center" label="屏幕宽度px" prop="screenWidth" show-overflow-tooltip />
<el-table-column align="center" label="屏幕高度px" prop="screenHeight" show-overflow-tooltip />
<el-table-column align="center" label="像素比" prop="pixelRatio" show-overflow-tooltip />
<el-table-column align="center" label="语言" prop="language" show-overflow-tooltip />
<el-table-column align="center" label="版本号" prop="version" show-overflow-tooltip />
<el-table-column align="center" label="基础库版本" prop="SDKVersion" show-overflow-tooltip />
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getDeviceList } from '@/api/system'
import { formatTime } from '@/utils'
export default {
name: 'SFGDeviceManagement',
data() {
return {
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
deviceId: '',
appId: '69665538a49b8ae3be50fe5d',
},
timeOutID: null,
}
},
created() {
const { deviceId } = this.$route.query || {}
if (deviceId) {
this.queryForm.deviceId = deviceId
this.queryForm.pageNo = 1
}
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data } = await getDeviceList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>

View File

@@ -0,0 +1,207 @@
<template>
<div class="cat-user-container">
<vab-query-form>
<!-- <vab-query-form-left-panel :span="12"> -->
<!-- <el-button icon="el-icon-plus" type="primary" @click="handleEdit">添加</el-button> -->
<!-- <el-button icon="el-icon-delete" type="danger" @click="handleDelete">批量删除</el-button> -->
<!-- </vab-query-form-left-panel> -->
<vab-query-form-left-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.permission" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-left-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" @selection-change="setSelectRows">
<el-table-column align="center" label="头像" show-overflow-tooltip>
<template #default="{ row }">
<img alt="image" :src="row.avatar" style="width: 50px; height: 50px; object-fit: cover; border-radius: 50%" />
</template>
</el-table-column>
<el-table-column align="left" label="信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>名称</strong>
{{ row.nickname }}
</div>
<div>
<strong>平台</strong>
{{ row.platform }}
</div>
<div>
<strong>设备 id</strong>
<template v-if="row.deviceId">
<el-link type="primary" :underline="false" @click="goToDevice(row.deviceId)">{{ row.deviceId }}</el-link>
</template>
<template v-else>--</template>
</div>
</div>
</template>
</el-table-column>
<el-table-column align="left" label="小程序信息" show-overflow-tooltip>
<template #default="{ row }">
<div>
<div>
<strong>粉丝</strong>
{{ row.followers }}
</div>
<div>
<strong>关注数</strong>
{{ row.followings }}
</div>
<div>
<strong>好友</strong>
{{ row.friends }}
</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
<!-- <el-table-column label="操作" show-overflow-tooltip width="200">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column> -->
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getUserList } from '@/api/spring/user'
import { formatTime } from '@/utils'
export default {
name: 'User',
data() {
return {
host: 'https://file.lihailezzc.com/',
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
permission: '',
},
timeOutID: null,
}
},
created() {
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleEdit(row) {
if (row.id) {
this.$refs['edit'].showEdit(row)
} else {
this.$refs['edit'].showEdit()
}
},
handleDelete(row) {
if (row.id) {
this.$baseConfirm('你确定要删除当前项吗', null, async () => {
const { msg } = await doDelete({ ids: [row.id] })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
if (this.selectRows.length > 0) {
const ids = this.selectRows.map((item) => item.id).join()
this.$baseConfirm('你确定要删除选中项吗', null, async () => {
const { msg } = await doDelete({ ids: ids.split(',') })
this.$baseMessage(msg, 'success')
this.fetchData()
})
} else {
this.$baseMessage('未选中任何行', 'error')
return false
}
}
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
goToDevice(deviceId) {
this.$router.push({ path: '/spring/user/userChat', query: { deviceId } })
},
async fetchData() {
this.listLoading = true
const { data } = await getUserList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>
<style scoped>
.author-option {
display: flex;
align-items: center;
}
.author-avatar {
width: 24px;
height: 24px;
border-radius: 50%;
object-fit: cover;
margin-right: 8px;
}
.author-name {
font-size: 14px;
}
.image-grid {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.grid-image {
width: 80px;
height: 80px;
object-fit: cover;
border-radius: 8px;
}
</style>

View File

@@ -0,0 +1,106 @@
<template>
<div class="sfg-device-container">
<vab-query-form>
<vab-query-form-right-panel :span="12">
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
<el-form-item>
<el-input v-model.trim="queryForm.permission" clearable placeholder="请输入查询条件" />
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
</el-form-item>
</el-form>
</vab-query-form-right-panel>
</vab-query-form>
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
<el-table-column align="center" label="品牌" prop="brand" show-overflow-tooltip />
<el-table-column align="center" label="型号" prop="model" show-overflow-tooltip />
<el-table-column align="center" label="系统版本" prop="system" show-overflow-tooltip />
<el-table-column align="center" label="屏幕宽度px" prop="screenWidth" show-overflow-tooltip />
<el-table-column align="center" label="屏幕高度px" prop="screenHeight" show-overflow-tooltip />
<el-table-column align="center" label="像素比" prop="pixelRatio" show-overflow-tooltip />
<el-table-column align="center" label="语言" prop="language" show-overflow-tooltip />
<el-table-column align="center" label="版本号" prop="version" show-overflow-tooltip />
<el-table-column align="center" label="基础库版本" prop="SDKVersion" show-overflow-tooltip />
<el-table-column align="center" label="应用" show-overflow-tooltip>
<template slot-scope="{ row }">
{{ row.appName || row.addId }}
</template>
</el-table-column>
<el-table-column align="center" label="创建时间" show-overflow-tooltip>
<template #default="{ row }">
{{ formatTime(row.createdAt) }}
</template>
</el-table-column>
</el-table>
<el-pagination
background
:current-page="queryForm.pageNo"
:layout="layout"
:page-size="queryForm.pageSize"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</template>
<script>
import { getDeviceList } from '@/api/system'
import { formatTime } from '@/utils'
export default {
name: 'SFGDeviceManagement',
data() {
return {
list: null,
listLoading: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
selectRows: '',
elementLoadingText: '正在加载...',
queryForm: {
pageNo: 1,
pageSize: 10,
permission: '',
},
timeOutID: null,
}
},
created() {
this.fetchData()
},
beforeDestroy() {
clearTimeout(this.timeOutID)
},
methods: {
formatTime,
setSelectRows(val) {
this.selectRows = val
},
handleSizeChange(val) {
this.queryForm.pageSize = val
this.fetchData()
},
handleCurrentChange(val) {
this.queryForm.pageNo = val
this.fetchData()
},
queryData() {
this.queryForm.pageNo = 1
this.fetchData()
},
async fetchData() {
this.listLoading = true
const { data } = await getDeviceList(this.queryForm)
this.list = data.list
this.total = data.totalCount
this.timeOutID = setTimeout(() => {
this.listLoading = false
}, 300)
},
},
}
</script>

View File

@@ -21,7 +21,7 @@
@node-collapse="nodeCollapse"
@node-expand="nodeExpand"
>
<template #defalut="{ node, data }" class="vab-custom-tree-node">
<template #defalut="{ node, data }">
<span class="vab-tree-item">
<i v-if="node.data.rank == 4" class="el-icon-s-custom"></i>
{{ node.label }}
@@ -55,7 +55,7 @@
:props="defaultProps"
@node-click="nodeClick"
>
<template #defalut="{ node }" class="vab-custom-tree-node">
<template #defalut="{ node }">
<span class="vab-tree-item">
<i v-if="node.data.rank == 4" class="el-icon-s-custom"></i>
{{ node.label }}
@@ -87,7 +87,7 @@
:props="defaultProps"
@node-click="nodeClick"
>
<template #defalut="{ node }" class="vab-custom-tree-node">
<template #defalut="{ node }">
<span class="vab-tree-item">
<i v-if="node.data.rank == 4" class="el-icon-s-custom"></i>
{{ node.label }}
@@ -128,7 +128,7 @@
:props="selectTreeDefaultProps"
@node-click="selectTreeNodeClick"
>
<template #defalut="{ node }" class="vab-custom-tree-node">
<template #defalut="{ node }">
<span class="vab-tree-item">{{ node.label }}</span>
</template>
</el-tree>