fix: bug修复
This commit is contained in:
parent
ddee1e906b
commit
4d2cd4a120
@ -86,6 +86,13 @@ export const constantRouterMap = [
|
|||||||
import("@/views/liveBroadcast/manage/components/detail"),
|
import("@/views/liveBroadcast/manage/components/detail"),
|
||||||
name: "直播单场分析",
|
name: "直播单场分析",
|
||||||
meta: { title: "直播单场分析" }
|
meta: { title: "直播单场分析" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "marketing",
|
||||||
|
component: () =>
|
||||||
|
import("@/views/liveBroadcast/manage/components/marketing"),
|
||||||
|
name: "营销单场分析",
|
||||||
|
meta: { title: "营销单场分析" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
227
src/views/behavior/index.vue
Normal file
227
src/views/behavior/index.vue
Normal 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>
|
||||||
228
src/views/behavior/marketing.vue
Normal file
228
src/views/behavior/marketing.vue
Normal 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>
|
||||||
@ -494,7 +494,12 @@ export default {
|
|||||||
this.queryList();
|
this.queryList();
|
||||||
},
|
},
|
||||||
openProduct(val) {
|
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`)
|
// this.$router.push(`/liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`)
|
||||||
},
|
},
|
||||||
toCreate(id, type) {
|
toCreate(id, type) {
|
||||||
|
|||||||
@ -504,7 +504,12 @@ export default {
|
|||||||
this.queryList();
|
this.queryList();
|
||||||
},
|
},
|
||||||
openProduct(val) {
|
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`)
|
// this.$router.push(`/liveBroadcast/liveBroadcastDetail?id=${val.id}&type=1`)
|
||||||
},
|
},
|
||||||
toCreate(id, type) {
|
toCreate(id, type) {
|
||||||
|
|||||||
@ -533,26 +533,26 @@
|
|||||||
label="购物车"
|
label="购物车"
|
||||||
name="3"
|
name="3"
|
||||||
/>
|
/>
|
||||||
<el-tab-pane
|
<!-- <el-tab-pane
|
||||||
v-if="[1, 2, 4].includes(type)"
|
v-if="[1, 2, 4].includes(type)"
|
||||||
label="发优惠券"
|
label="发优惠券"
|
||||||
name="4"
|
name="4"
|
||||||
/>
|
/> -->
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-if="[1, 2, 4].includes(type)"
|
v-if="[1, 2, 4].includes(type)"
|
||||||
label="问卷"
|
label="问卷"
|
||||||
name="5"
|
name="5"
|
||||||
/>
|
/>
|
||||||
<el-tab-pane
|
<!-- <el-tab-pane
|
||||||
v-if="[1, 2, 4].includes(type)"
|
v-if="[1, 2, 4].includes(type)"
|
||||||
label="营销二维码"
|
label="营销二维码"
|
||||||
name="6"
|
name="6"
|
||||||
/>
|
/> -->
|
||||||
<el-tab-pane
|
<!-- <el-tab-pane
|
||||||
v-if="[1, 2, 4].includes(type) && detail.playType === 1"
|
v-if="[1, 2, 4].includes(type) && detail.playType === 1"
|
||||||
label="转播设置"
|
label="转播设置"
|
||||||
name="7"
|
name="7"
|
||||||
/>
|
/> -->
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-if="[1, 2, 4].includes(type)"
|
v-if="[1, 2, 4].includes(type)"
|
||||||
label="嘉宾设置"
|
label="嘉宾设置"
|
||||||
|
|||||||
@ -3,8 +3,22 @@
|
|||||||
<!--工具栏-->
|
<!--工具栏-->
|
||||||
<div class="head-container">
|
<div class="head-container">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<el-input v-model="query.value" clearable placeholder="输入部门名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
<el-input
|
||||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
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;">
|
<div v-if="isShow" style="display: inline-block;margin: 0px 2px;">
|
||||||
<el-button
|
<el-button
|
||||||
@ -13,7 +27,8 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="add"
|
@click="add"
|
||||||
>新增</el-button>
|
>新增</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<el-button
|
<el-button
|
||||||
@ -22,7 +37,8 @@
|
|||||||
type="warning"
|
type="warning"
|
||||||
icon="el-icon-more"
|
icon="el-icon-more"
|
||||||
@click="changeExpand"
|
@click="changeExpand"
|
||||||
>{{ expand ? '折叠' : '展开' }}</el-button>
|
>{{ expand ? "折叠" : "展开" }}</el-button
|
||||||
|
>
|
||||||
<eForm ref="form" :is-add="true" />
|
<eForm ref="form" :is-add="true" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -30,27 +46,54 @@
|
|||||||
<eForm ref="form" :is-add="isAdd" />
|
<eForm ref="form" :is-add="isAdd" />
|
||||||
<addedForm ref="added" />
|
<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="创建日期">
|
<el-table-column prop="createTime" label="创建日期">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<!-- icon="el-icon-edit" -->
|
<!-- icon="el-icon-edit" -->
|
||||||
<el-button size="mini" type="primary" @click="edit(scope.row)">修改</el-button>
|
<el-button size="mini" type="primary" @click="edit(scope.row)"
|
||||||
<el-popover
|
>修改</el-button
|
||||||
:ref="scope.row.id"
|
|
||||||
placement="top"
|
|
||||||
width="180"
|
|
||||||
>
|
>
|
||||||
|
<el-popover :ref="scope.row.id" placement="top" width="180">
|
||||||
<p>确定删除本条数据吗?</p>
|
<p>确定删除本条数据吗?</p>
|
||||||
<div style="text-align: right; margin: 0">
|
<div style="text-align: right; margin: 0">
|
||||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
<el-button
|
||||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</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>
|
</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>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -59,103 +102,112 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import treeTable from '@/components/TreeTable'
|
import treeTable from "@/components/TreeTable";
|
||||||
import checkPermission from '@/utils/permission'
|
import checkPermission from "@/utils/permission";
|
||||||
import initData from '@/mixins/initData'
|
import initData from "@/mixins/initData";
|
||||||
import { del } from '@/api/dept'
|
import { del } from "@/api/dept";
|
||||||
import { parseTime } from '@/utils/index'
|
import { parseTime } from "@/utils/index";
|
||||||
import eForm from './form'
|
import eForm from "./form";
|
||||||
import addedForm from './addedForm.vue'
|
import addedForm from "./addedForm.vue";
|
||||||
export default {
|
export default {
|
||||||
name: '部门管理',
|
name: "部门管理",
|
||||||
components: { eForm, treeTable, addedForm },
|
components: { eForm, treeTable, addedForm },
|
||||||
mixins: [initData],
|
mixins: [initData],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
text: '名称',
|
text: "名称",
|
||||||
value: 'name'
|
value: "name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "编号",
|
||||||
|
value: "id"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
enabledTypeOptions: [
|
enabledTypeOptions: [
|
||||||
{ key: 'true', display_name: '正常' },
|
{ key: "true", display_name: "正常" },
|
||||||
{ key: 'false', display_name: '禁用' }
|
{ key: "false", display_name: "禁用" }
|
||||||
],
|
],
|
||||||
isShow: true,
|
isShow: true,
|
||||||
delLoading: false, expand: true
|
delLoading: false,
|
||||||
}
|
expand: true
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.init()
|
this.init();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseTime,
|
parseTime,
|
||||||
checkPermission,
|
checkPermission,
|
||||||
beforeInit() {
|
beforeInit() {
|
||||||
this.url = '/admin/rbac/dept/list'
|
this.url = "/admin/rbac/dept/list";
|
||||||
const query = this.query
|
const query = this.query;
|
||||||
const value = query.value
|
const value = query.value;
|
||||||
// const enabled = query.enabled
|
// 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 }
|
// if (enabled !== '' && enabled !== null) { this.params['enabled'] = enabled }
|
||||||
return true
|
return true;
|
||||||
},
|
},
|
||||||
subDelete(id) {
|
subDelete(id) {
|
||||||
this.delLoading = true
|
this.delLoading = true;
|
||||||
del({ id }).then(res => {
|
del({ id })
|
||||||
this.delLoading = false
|
.then(res => {
|
||||||
this.$refs[id].doClose()
|
this.delLoading = false;
|
||||||
if (!res.code) {
|
this.$refs[id].doClose();
|
||||||
this.init()
|
if (!res.code) {
|
||||||
this.$notify({
|
this.init();
|
||||||
title: '删除成功',
|
this.$notify({
|
||||||
type: 'success',
|
title: "删除成功",
|
||||||
duration: 2500
|
type: "success",
|
||||||
})
|
duration: 2500
|
||||||
} else {
|
});
|
||||||
this.$notify({
|
} else {
|
||||||
title: res.message,
|
this.$notify({
|
||||||
type: 'error',
|
title: res.message,
|
||||||
duration: 2500
|
type: "error",
|
||||||
})
|
duration: 2500
|
||||||
}
|
});
|
||||||
}).catch(err => {
|
}
|
||||||
this.delLoading = false
|
})
|
||||||
this.$refs[id].doClose()
|
.catch(err => {
|
||||||
console.log(err.response.data.message)
|
this.delLoading = false;
|
||||||
})
|
this.$refs[id].doClose();
|
||||||
|
console.log(err.response.data.message);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
add() {
|
add() {
|
||||||
this.isAdd = true
|
this.isAdd = true;
|
||||||
const _this = this.$refs.form
|
const _this = this.$refs.form;
|
||||||
_this.getDepts()
|
_this.getDepts();
|
||||||
// const _this = this.$refs.added
|
// const _this = this.$refs.added
|
||||||
_this.dialog = true
|
_this.dialog = true;
|
||||||
},
|
},
|
||||||
changeExpand() {
|
changeExpand() {
|
||||||
this.expand = !this.expand
|
this.expand = !this.expand;
|
||||||
this.init()
|
this.init();
|
||||||
},
|
},
|
||||||
edit(data) {
|
edit(data) {
|
||||||
this.isAdd = false
|
this.isAdd = false;
|
||||||
const _this = this.$refs.form
|
const _this = this.$refs.form;
|
||||||
_this.getDepts()
|
_this.getDepts();
|
||||||
_this.form = {
|
_this.form = {
|
||||||
id: data.id,
|
id: data.id,
|
||||||
name: data.name,
|
name: data.name,
|
||||||
pid: data.pid,
|
pid: data.pid,
|
||||||
createTime: data.createTime,
|
createTime: data.createTime,
|
||||||
status: data.status
|
status: data.status
|
||||||
}
|
};
|
||||||
_this.dialog = true
|
_this.dialog = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user