feat:广播同步

This commit is contained in:
dzc committed 2025-04-28 11:45:39 +08:00
1 parent 57f7bb7bb1
commit d005600978
2 files changed
+120 -26

No files matched your search

+5 -5
View File
@@ -1,24 +1,24 @@
# port 端口号
VITE_PORT = 8888
# 浏览器自动打开
#浏览器自动打开
VITE_OPEN = true
# 本地环境
ENV = 'development'
# ADMIN 服务地址
VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上
# VITE_ADMIN_PROXY_PATH = http://47.96.250.9:8089/api/ # 测试线上
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
# VITE_ADMIN_PROXY_PATH = http://192.168.101.107:9999/ # 邓-本地
VITE_ADMIN_PROXY_PATH = http://192.168.101.123:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
# 图片访问基础地址
VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 测试线上
# VITE_IMAGE_BASE_PATH = http://47.96.250.9:8089/api # 测试线上
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999
# VITE_IMAGE_BASE_PATH = http://192.168.101.107:9999 # 邓-本地
VITE_IMAGE_BASE_PATH = http://192.168.101.123:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
# 代码生成服务地址
+115 -21
View File
@@ -1,6 +1,29 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row>
<el-form-item style="width: 300px" label="用户" prop="userId">
<select-user v-model="state.queryForm.userId" />
</el-form-item>
<el-form-item style="width: 300px" label="是否广播语音" prop="isBroadcast">
<dict-select v-model="state.queryForm.isBroadcast" dict-code="yes_no_type" />
</el-form-item>
<el-form-item style="width: 300px" label="是否完成" prop="isDone">
<dict-select v-model="state.queryForm.isDone" dict-code="yes_no_type" />
</el-form-item>
<el-form-item style="width: 350px" label="创建时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item>
<el-form-item style="width: 350px" label="完成时间" prop="isDoneTimeList">
<el-date-picker v-model="state.queryForm.isDoneTimeList" value-format="YYYY-MM-DD" type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'hard_hardBroadcast_add'">
@@ -36,31 +59,73 @@
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="userId" label="预定用户" show-overflow-tooltip />
<el-table-column prop="hardId" label="硬件id" show-overflow-tooltip />
<el-table-column prop="topic" label="mq主题" show-overflow-tooltip />
<el-table-column prop="bizId" label="关联业务编号" show-overflow-tooltip />
<el-table-column prop="title" label="预定标题" show-overflow-tooltip />
<el-table-column prop="content" label="广播内容" show-overflow-tooltip />
<el-table-column prop="broadcastCount" label="当前广播次数" show-overflow-tooltip />
<el-table-column prop="broadcastMaxCount" label="最大广播次数" show-overflow-tooltip />
<el-table-column prop="isBroadcast" label="是否广播语音" show-overflow-tooltip />
<el-table-column prop="isDone" label="是否完成" show-overflow-tooltip />
<el-table-column prop="isDoneTime" label="完成时间" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="username" width="120" label="预定用户" />
<el-table-column prop="hardName" width="180" label="硬件" />
<el-table-column prop="title" width="180" label="预定类型" />
<el-table-column width="160" label="商品">
<template #default="{ row }">
{{ row.productDesc }}
</template>
</el-table-column>
<el-table-column width="160" label="总价">
<template #default="{ row }">
<div class="status">
<span>实际支付</span>
<span class="color-primary">
{{ displayPrice(row.payPrice, "元", 2) }}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="broadcastCount" width="250" label="广播次数">
<template #default="{ row }">
<div>
<span>当前广播次数{{ row.broadcastCount }}次</span>
<span>最大广播次数{{ row.broadcastMaxCount }}次</span>
</div>
</template>
</el-table-column>
<el-table-column prop="isBroadcast" width="120" label="是否广播语音">
<template #default="{ row }">
<dict-tag :options="yes_no_type" :value="row.isBroadcast" />
</template>
</el-table-column>
<el-table-column prop="isDone" width="120" label="是否完成">
<template #default="{ row }">
<dict-tag :options="yes_no_type" :value="row.isDone" />
</template>
</el-table-column>
<el-table-column prop="isDoneTime" width="220" label="时间">
<template #default="{ row }">
<div class="flex flex-col">
<div class="flex">
<span>创建时间:</span>
<span>{{ row.createTime }}</span>
</div>
<div class="flex">
<span>完成时间:</span>
<span>{{ row.isDoneTime }}</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template #default="{ row }">
<el-button icon="ShoppingCartFull" text type="primary" @click="shopCarDialogRef.openDialog(row.bizId)"> 购物车 </el-button>
<el-button
v-if="false"
icon="edit-pen"
text
type="primary"
v-auth="'hard_hardBroadcast_edit'"
@click="formDialogRef.openDialog(scope.row.id)"
>编辑</el-button
>
<el-button icon="delete" text type="primary" v-auth="'hard_hardBroadcast_del'" @click="handleDelete([scope.row.id])"
>删除</el-button
@click="formDialogRef.openDialog(row.id)"
>
编辑
</el-button>
<el-button v-if="false" icon="delete" text type="primary" v-auth="'hard_hardBroadcast_del'" @click="handleDelete([row.id])">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -69,6 +134,7 @@
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<shop-car ref="shopCarDialogRef" />
</div>
</template>
@@ -76,14 +142,17 @@
import { BasicTableProps, useTable } from "/@/hooks/table"
import * as hardBroadcastApi from "/@/api/hard/hard-broadcast"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { displayPrice } from "/@/utils/formatMoney"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
const ShopCar = defineAsyncComponent(() => import("../components/shop-car.vue"))
// 定义查询字典
const { yes_no_type } = useDict("yes_no_type")
// 定义变量内容
const formDialogRef = ref()
const shopCarDialogRef = ref()
// 搜索变量
const queryRef = ref()
const showSearch = ref(true)
@@ -126,7 +195,6 @@ const handleDelete = async (ids: string[]) => {
} catch {
return
}
try {
await hardBroadcastApi.delObjs(ids)
getDataList()
@@ -136,3 +204,29 @@ const handleDelete = async (ids: string[]) => {
}
}
</script>
<style scoped lang="scss">
.status {
display: flex;
align-items: center;
margin-bottom: 2px;
span {
display: inline-block;
}
span:nth-child(1) {
min-width: 60px;
max-width: 100px;
text-align: left;
}
span:nth-child(2) {
flex: 1;
min-width: 50px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
</style>