fix: bug修复

This commit is contained in:
kaizheng(郑凯) 2025-02-24 20:39:13 +08:00
parent ddee1e906b
commit 4d2cd4a120
7 changed files with 605 additions and 81 deletions

View File

@ -86,6 +86,13 @@ export const constantRouterMap = [
import("@/views/liveBroadcast/manage/components/detail"),
name: "直播单场分析",
meta: { title: "直播单场分析" }
},
{
path: "marketing",
component: () =>
import("@/views/liveBroadcast/manage/components/marketing"),
name: "营销单场分析",
meta: { title: "营销单场分析" }
}
]
},

View File

@ -0,0 +1,227 @@
<template>
<div class="app-container">
<el-input
class="w260 mb10"
clearable
v-model="queryParams.videoName"
placeholder="请输入直播名称"
/>
<el-button type="primary" @click="queryList(1)">查询</el-button>
<div class="mb10">
<el-button
v-for="(item, index) in buttonText"
:key="index"
:class="{ selected: selectedButton === index }"
plain
@click="selected(index)"
>{{ item }}</el-button
>
<el-date-picker
v-if="selectedButton === 5"
style="margin-left:20px"
v-model="valueTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
<el-button v-if="selectedButton === 5" type="primary" @click="queryList()"
>查询</el-button
>
</div>
<div class="mb10">
<el-button
v-for="(item, index) in buttonTextTwo"
:key="index"
:class="{ selected: selectedButtonTwo === index }"
plain
@click="selectedTwo(index)"
>{{ item }}</el-button
>
</div>
<div class="mb10">
<el-table :data="data" v-loading="loading" border style="width: 100%">
<el-table-column label="序号" type="index" fixed width="180">
</el-table-column>
<el-table-column prop="userName" label="昵称" width="180">
</el-table-column>
<el-table-column
prop="phone"
:label="settingToC ? '客户账号' : '客户手机号'"
width="180"
>
</el-table-column>
<el-table-column prop="notifyTime" label="提醒时间" width="180">
</el-table-column>
<el-table-column prop="description" label="事件描述"> </el-table-column>
</el-table>
</div>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="queryParams.current"
:page-size="queryParams.size"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { notifyList } from "@/api/videoLive";
import { mapGetters, mapState } from "vuex";
import dayjs from "dayjs";
export default {
data() {
return {
queryParams: {
current: 1,
size: 10,
videoName: ""
},
startTime: "",
endTime: "",
total: 1,
loading: false,
data: [],
selectedButton: 0,
selectedButtonTwo: 0,
buttonText: ["今日", "昨日", "近一周", "近一月", "近一年", "自定义"],
buttonTextTwo: [
"全部",
"领取优惠券",
"完成问卷任务",
"参与投票",
"点击产品",
"提交订单未付款",
"订阅产品",
"发生退款",
"预约未观看",
"预约"
],
valueTime: ""
};
},
computed: {
...mapGetters(["user"]),
...mapState({
settingToC: state => state.settings.settingToC
})
},
mounted() {
this.queryList();
},
watch: {
timeType(value) {
this.time = this.startTime = this.endTime = "";
}
},
methods: {
selected(index) {
this.queryParams.current = 1;
this.selectedButton = index;
if (index !== 5) {
this.queryList();
}
},
selectedTwo(index) {
this.queryParams.current = 1;
this.selectedButtonTwo = index;
this.queryList();
},
queryList(val) {
if (val) {
this.queryParams.current = 1;
}
this.loading = true;
if (this.selectedButton === 5) {
if (!this.valueTime) {
return this.$message.error("请选择自定义时间!");
} else {
this.startTime = dayjs(this.valueTime[0]).format(
"YYYY-MM-DD HH:mm:ss"
);
this.endTime = dayjs(this.valueTime[1])
.add(1, "day")
.format("YYYY-MM-DD HH:mm:ss");
}
} else if (this.selectedButton === 1) {
this.endTime = dayjs().format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 0) {
this.startTime = dayjs().format("YYYY-MM-DD");
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 2) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(7, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 3) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "month")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 4) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "year")
.format("YYYY-MM-DD");
}
if (this.selectedButtonTwo) {
this.queryParams.type = this.selectedButtonTwo;
} else {
this.queryParams.type = null;
}
this.queryParams.startTime = this.startTime;
this.queryParams.endTime = this.endTime;
notifyList(this.queryParams).then(data => {
this.data = data.data.list;
this.total = data.data.total;
this.loading = false;
});
},
searchList() {
this.queryParams.size = 10;
this.queryParams.current = 1;
this.queryList();
},
handleSizeChange(val) {
this.$set(this.queryParams, "size", val);
this.$set(this.queryParams, "current", 1);
this.queryList();
},
handleCurrentChange(val) {
this.$set(this.queryParams, "current", val || 1);
this.queryList();
},
toDetail(val) {}
}
};
</script>
<style scoped lang="scss">
.mb10 {
margin-bottom: 20px;
}
.w260 {
width: 260px;
}
.selected {
background-color: #409eff !important;
color: #ffffff !important;
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<div class="app-container">
<el-input
class="w260 mb10"
clearable
v-model="queryParams.videoName"
placeholder="请输入直播名称"
/>
<el-button type="primary" @click="queryList(1)">查询</el-button>
<div class="mb10">
<el-button
@click="selected(index)"
:class="{ selected: selectedButton === index }"
v-for="(item, index) in buttonText"
plain
>{{ item }}</el-button
>
<el-date-picker
style="margin-left:20px"
v-if="selectedButton === 5"
v-model="valueTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
<el-button v-if="selectedButton === 5" type="primary" @click="queryList()"
>查询</el-button
>
</div>
<div class="mb10">
<el-button
@click="selectedTwo(index)"
:class="{ selected: selectedButtonTwo === index }"
v-for="(item, index) in buttonTextTwo"
plain
>{{ item }}</el-button
>
</div>
<div class="mb10">
<el-table :data="data" v-loading="loading" border style="width: 100%">
<el-table-column label="序号" type="index" fixed width="180">
</el-table-column>
<el-table-column prop="userName" label="昵称" width="180">
</el-table-column>
<el-table-column
prop="phone"
:label="settingToC ? '客户账号' : '客户手机号'"
width="180"
>
</el-table-column>
<el-table-column prop="notifyTime" label="提醒时间" width="180">
</el-table-column>
<el-table-column prop="description" label="事件描述"> </el-table-column>
</el-table>
</div>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="queryParams.current"
:page-size="queryParams.size"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
import { notifyList } from "@/api/videoLive";
import { list } from "@/api/user";
import { mapGetters, mapState } from "vuex";
import dayjs from "dayjs";
export default {
data() {
return {
queryParams: {
current: 1,
size: 10,
videoName: ""
},
startTime: "",
endTime: "",
total: 1,
loading: false,
data: [],
selectedButton: 0,
selectedButtonTwo: 0,
buttonText: ["今日", "昨日", "近一周", "近一月", "近一年", "自定义"],
buttonTextTwo: [
"全部",
"领取优惠券",
"完成问卷任务",
"点击产品",
"提交订单未付款",
"订阅产品",
"发生退款",
"预约未观看",
"预约"
],
valueTime: ""
};
},
computed: {
...mapGetters(["user"]),
...mapState({
settingToC: state => state.settings.settingToC
})
},
mounted() {
this.queryList();
},
watch: {
timeType(value) {
this.time = this.startTime = this.endTime = "";
}
},
methods: {
selected(index) {
this.queryParams.current = 1;
this.selectedButton = index;
if (index !== 5) {
this.queryList();
}
},
selectedTwo(index) {
this.queryParams.current = 1;
this.selectedButtonTwo = index;
this.queryList();
},
queryList(val) {
if (val) {
this.queryParams.current = 1;
}
this.loading = true;
if (this.selectedButton === 5) {
if (!this.valueTime) {
return this.$message.error("请选择自定义时间!");
} else {
this.startTime = dayjs(this.valueTime[0]).format(
"YYYY-MM-DD HH:mm:ss"
);
this.endTime = dayjs(this.valueTime[1])
.add(1, "day")
.format("YYYY-MM-DD HH:mm:ss");
}
} else if (this.selectedButton === 1) {
this.endTime = dayjs().format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 0) {
this.startTime = dayjs().format("YYYY-MM-DD");
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 2) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(7, "day")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 3) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "month")
.format("YYYY-MM-DD");
} else if (this.selectedButton === 4) {
this.endTime = dayjs()
.add(1, "day")
.format("YYYY-MM-DD");
this.startTime = dayjs()
.subtract(1, "year")
.format("YYYY-MM-DD");
}
if (this.selectedButtonTwo) {
this.queryParams.type =
this.selectedButtonTwo <= 2
? this.selectedButtonTwo
: this.selectedButtonTwo + 1;
} else {
this.queryParams.type = null;
}
this.queryParams.startTime = this.startTime;
this.queryParams.endTime = this.endTime;
notifyList(this.queryParams).then(data => {
this.data = data.data.list;
this.total = data.data.total;
this.loading = false;
});
},
searchList() {
this.queryParams.size = 10;
this.queryParams.current = 1;
this.queryList();
},
handleSizeChange(val) {
this.$set(this.queryParams, "size", val);
this.$set(this.queryParams, "current", 1);
this.queryList();
},
handleCurrentChange(val) {
this.$set(this.queryParams, "current", val || 1);
this.queryList();
},
toDetail(val) {}
}
};
</script>
<style scoped lang="scss">
.mb10 {
margin-bottom: 20px;
}
.w260 {
width: 260px;
}
.selected {
background-color: #409eff !important;
color: #ffffff !important;
}
</style>

View File

@ -494,7 +494,12 @@ export default {
this.queryList();
},
openProduct(val) {
window.open(`./liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`);
window.open(
`${location.origin +
location.pathname}#/liveBroadcast/liveBroadcastDetail?id=${
val.id
}&type=1`
);
// this.$router.push(`/liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`)
},
toCreate(id, type) {

View File

@ -504,7 +504,12 @@ export default {
this.queryList();
},
openProduct(val) {
window.open(`./liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`);
window.open(
`${location.origin +
location.pathname}#/liveBroadcast/liveBroadcastDetail?id=${
val.id
}&type=1`
);
// this.$router.push(`/liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`)
},
toCreate(id, type) {

View File

@ -533,26 +533,26 @@
label="购物车"
name="3"
/>
<el-tab-pane
<!-- <el-tab-pane
v-if="[1, 2, 4].includes(type)"
label="发优惠券"
name="4"
/>
/> -->
<el-tab-pane
v-if="[1, 2, 4].includes(type)"
label="问卷"
name="5"
/>
<el-tab-pane
<!-- <el-tab-pane
v-if="[1, 2, 4].includes(type)"
label="营销二维码"
name="6"
/>
<el-tab-pane
/> -->
<!-- <el-tab-pane
v-if="[1, 2, 4].includes(type) && detail.playType === 1"
label="转播设置"
name="7"
/>
/> -->
<el-tab-pane
v-if="[1, 2, 4].includes(type)"
label="嘉宾设置"

View File

@ -3,8 +3,22 @@
<!--工具栏-->
<div class="head-container">
<!-- 搜索 -->
<el-input v-model="query.value" clearable placeholder="输入部门名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<el-input
v-model="query.value"
clearable
placeholder="输入部门名称搜索"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="toQuery"
/>
<el-button
class="filter-item"
size="mini"
type="success"
icon="el-icon-search"
@click="toQuery"
>搜索</el-button
>
<!-- 新增 -->
<div v-if="isShow" style="display: inline-block;margin: 0px 2px;">
<el-button
@ -13,7 +27,8 @@
type="primary"
icon="el-icon-plus"
@click="add"
>新增</el-button>
>新增</el-button
>
</div>
<div style="display: inline-block;">
<el-button
@ -22,7 +37,8 @@
type="warning"
icon="el-icon-more"
@click="changeExpand"
>{{ expand ? '折叠' : '展开' }}</el-button>
>{{ expand ? "折叠" : "展开" }}</el-button
>
<eForm ref="form" :is-add="true" />
</div>
</div>
@ -30,27 +46,54 @@
<eForm ref="form" :is-add="isAdd" />
<addedForm ref="added" />
<!--表格渲染-->
<tree-table v-loading="loading" :expand-all="expand" :data="data" :columns="columns" size="small">
<tree-table
v-loading="loading"
:expand-all="expand"
:data="data"
:columns="columns"
size="small"
>
<el-table-column prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column v-if="isShow" label="操作" fixed="right" width="130px" align="center">
<el-table-column
v-if="isShow"
label="操作"
fixed="right"
width="130px"
align="center"
>
<template slot-scope="scope">
<!-- icon="el-icon-edit" -->
<el-button size="mini" type="primary" @click="edit(scope.row)">修改</el-button>
<el-popover
:ref="scope.row.id"
placement="top"
width="180"
<el-button size="mini" type="primary" @click="edit(scope.row)"
>修改</el-button
>
<el-popover :ref="scope.row.id" placement="top" width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
<el-button
size="mini"
type="text"
@click="$refs[scope.row.id].doClose()"
>取消</el-button
>
<el-button
:loading="delLoading"
type="primary"
size="mini"
@click="subDelete(scope.row.id)"
>确定</el-button
>
</div>
<el-button slot="reference" :disabled="scope.row.id === 1" type="danger" icon="el-icon-delete" size="mini" />
<el-button
slot="reference"
:disabled="scope.row.id === 1"
type="danger"
icon="el-icon-delete"
size="mini"
/>
</el-popover>
</template>
</el-table-column>
@ -59,103 +102,112 @@
</template>
<script>
import treeTable from '@/components/TreeTable'
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del } from '@/api/dept'
import { parseTime } from '@/utils/index'
import eForm from './form'
import addedForm from './addedForm.vue'
import treeTable from "@/components/TreeTable";
import checkPermission from "@/utils/permission";
import initData from "@/mixins/initData";
import { del } from "@/api/dept";
import { parseTime } from "@/utils/index";
import eForm from "./form";
import addedForm from "./addedForm.vue";
export default {
name: '部门管理',
name: "部门管理",
components: { eForm, treeTable, addedForm },
mixins: [initData],
data() {
return {
columns: [
{
text: '名称',
value: 'name'
text: "名称",
value: "name"
},
{
text: "编号",
value: "id"
}
],
enabledTypeOptions: [
{ key: 'true', display_name: '正常' },
{ key: 'false', display_name: '禁用' }
{ key: "true", display_name: "正常" },
{ key: "false", display_name: "禁用" }
],
isShow: true,
delLoading: false, expand: true
}
delLoading: false,
expand: true
};
},
created() {
this.$nextTick(() => {
this.init()
})
this.init();
});
},
methods: {
parseTime,
checkPermission,
beforeInit() {
this.url = '/admin/rbac/dept/list'
const query = this.query
const value = query.value
this.url = "/admin/rbac/dept/list";
const query = this.query;
const value = query.value;
// const enabled = query.enabled
if (value) { this.params['keyword'] = value } else { this.params = {} }
if (value) {
this.params["keyword"] = value;
} else {
this.params = {};
}
// if (enabled !== '' && enabled !== null) { this.params['enabled'] = enabled }
return true
return true;
},
subDelete(id) {
this.delLoading = true
del({ id }).then(res => {
this.delLoading = false
this.$refs[id].doClose()
if (!res.code) {
this.init()
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
} else {
this.$notify({
title: res.message,
type: 'error',
duration: 2500
})
}
}).catch(err => {
this.delLoading = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
this.delLoading = true;
del({ id })
.then(res => {
this.delLoading = false;
this.$refs[id].doClose();
if (!res.code) {
this.init();
this.$notify({
title: "删除成功",
type: "success",
duration: 2500
});
} else {
this.$notify({
title: res.message,
type: "error",
duration: 2500
});
}
})
.catch(err => {
this.delLoading = false;
this.$refs[id].doClose();
console.log(err.response.data.message);
});
},
add() {
this.isAdd = true
const _this = this.$refs.form
_this.getDepts()
this.isAdd = true;
const _this = this.$refs.form;
_this.getDepts();
// const _this = this.$refs.added
_this.dialog = true
_this.dialog = true;
},
changeExpand() {
this.expand = !this.expand
this.init()
this.expand = !this.expand;
this.init();
},
edit(data) {
this.isAdd = false
const _this = this.$refs.form
_this.getDepts()
this.isAdd = false;
const _this = this.$refs.form;
_this.getDepts();
_this.form = {
id: data.id,
name: data.name,
pid: data.pid,
createTime: data.createTime,
status: data.status
}
_this.dialog = true
};
_this.dialog = true;
}
}
}
};
</script>
<style scoped>
</style>
<style scoped></style>