feat(期刊): 初始化期刊

dev
zjb 8 months ago
parent 0217ffe135
commit b4d9f25ce9

@ -19,7 +19,8 @@ module.exports = {
proxyTable: {
'/': {
// target: 'http://39.103.180.196:9011', // 接口域名
target: 'http://localhost:9011', // 接口域名
// target: 'http://localhost:9011', // 接口域名
target: 'http://testapi.indie.cn:9012', // 接口域名
changeOrigin: true, //是否跨域
pathRewrite: {
'^/': '/' //需要rewrite重写的,

@ -19,7 +19,9 @@
"node-sass": "^8.0.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"sortablejs": "^1.15.2",
"vue": "2.5.10",
"vue-quill-editor": "^3.0.6",
"vue-router": "3.0.1",
"vuex": "3.0.1"
},

@ -0,0 +1,50 @@
/*
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-19 23:38:16
*/
import request from "@/utils/request";
export default {
getList(data, page, size) {
return request({
url: `/luoo-music/cms/journal/search/${page}/${size}`,
method: "post",
data: data
});
},
/**
* 删除
* @param {*} id
* @returns
*/
delete(id) {
return request({
url: `/luoo-music/cms/journal/${id}`,
method: "delete"
});
},
/**
* 发布
* @param {*} id
* @returns
*/
publish(id) {
return request({
url: `/luoo-music/cms/journal/publish/${id}`,
method: "put"
});
},
/**
* 更新状态
* @param {*} id
* @param {*} state
* @returns
*/
updateStatus(id, state) {
return request({
url: `/luoo-music/cms/journal/publish/${id}?state=${state}`,
method: "put"
});
}
};

@ -130,6 +130,18 @@ export const constantRouterMap = [
}
]
},
{
path: '/article',
component: Layout,
children: [
{
path: 'index',
name: 'Form',
component: () => import('@/views/article'),
meta: { title: '期刊管理v2', icon: 'table' }
}
]
},
{ path: '*', redirect: '/404', hidden: true }
]

@ -0,0 +1,209 @@
<!--
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-20 02:11:55
-->
<template>
<div>
<el-form
style="width: 800px;margin: 0 auto;"
label-position="left"
label-width="100px"
>
<el-form-item prop="volid" label="期刊编号">
<el-input size="small" placeholder="期刊编号"></el-input>
</el-form-item>
<el-form-item prop="title" label="期刊标题">
<el-input size="small" placeholder="请输入期刊标题"></el-input>
</el-form-item>
<el-form-item prop="tag" label="期刊标签">
<el-input size="small" placeholder="请选择"></el-input>
</el-form-item>
<el-form-item prop="author" label="期刊作者">
<el-input size="small" placeholder="不填写则默认为发布者"></el-input>
</el-form-item>
<el-form-item prop="image" label="上传封面">
<el-upload
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
multiple
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
>
<el-button size="small" type="primary" icon="el-icon-receiving"
>上传图片</el-button
>
<div
slot="tip"
style="font-family: '微软雅黑', sans-serif; font-weight: 400; font-style: normal; color: #999999;"
>
支持格式.jpg, .png 单个文件不能超过5MB 建议图片分辨率640*520
</div>
</el-upload>
</el-form-item>
<el-form-item label="期刊音乐">
<el-row>
<el-col :span="6"
><el-button plain size="middle" type="primary" icon="el-icon-plus"
>上传歌曲</el-button
></el-col
>
<el-col :span="6"
><el-button
plain
size="middle"
type="primary"
icon="el-icon-zoom-in"
>曲库添加</el-button
></el-col
>
</el-row>
</el-form-item>
</el-form>
<el-table
size="mini"
:data="data.songTableData"
style="width: calc(50% + 400px); margin: 0 0 auto auto;"
stripe
class="draggable-table"
row-key="na'me"
border
fit
element-loading-text="加载中"
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
>
<el-table-column label="排序" align="center" width="60">
<template slot-scope="scope">
<i class="el-icon-rank"></i>
</template>
</el-table-column>
<el-table-column label="专辑封面"></el-table-column>
<el-table-column prop="name" label="歌曲名称"></el-table-column>
<el-table-column label="歌手/乐队"></el-table-column>
<el-table-column label="所属专辑"></el-table-column>
<el-table-column label="时长"></el-table-column>
<el-table-column label="操作" fixed="right" width="300">
<template slot-scope="scope">
<el-button plain icon="el-icon-edit" type="primary" size="mini"
>编辑</el-button
>
<el-button plain icon="el-icon-success" type="success" size="mini"
>歌词</el-button
>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
icon="el-icon-info"
icon-color="red"
title="是否确认删除标签?"
style="margin-left: 10px;"
@confirm="console.log('delete')"
>
<el-button
slot="reference"
plain
icon="el-icon-delete"
type="danger"
size="mini"
>删除</el-button
>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<el-form
style="width: calc(50% + 400px); margin: 15px 0 auto auto;"
label-position="left"
label-width="100px"
>
<el-form-item prop="volid" label="期刊文案">
<quill-editor
ref="text"
v-model="data.content"
style="height: 500px;"
class="myQuillEditor"
:options="editorOption"
/>
</el-form-item>
</el-form>
</div>
</template>
<script>
import Sortable from "sortablejs";
import { quillEditor } from "vue-quill-editor";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
export default {
name: "ArticleDetailDialog",
props: {
data: {
type: Object,
default: {}
}
},
data() {
return {
// editorOption
// action: '/api/product/richtext_img_upload.do', //
// methods: 'post', //
// token: '', // tokentokensessionStorage
// name: 'upload_file', //
// size: 500, // Kb, 1M = 1024Kb
// accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' //
editorOption: {},
data: {
songTableData: [{ name: 1 }, { name: 2 }],
content: null
},
rules: {}
};
},
filters: {},
created() {},
components: {
quillEditor
},
mounted() {
// el-tabletbody
// el-tableclass: draggable-tabletabletable
// table.draggable-table
const tbody = document.querySelector(
".draggable-table .el-table__body-wrapper tbody"
);
new Sortable(tbody, {
animation: 150,
// odEndeltable使
onEnd: ({ newIndex, oldIndex }) => {
const targetRow = this.data.songTableData[oldIndex];
this.data.songTableData.splice(oldIndex, 1);
this.data.songTableData.splice(newIndex, 0, targetRow);
console.table(this.data.songTableData);
}
});
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,本次选择了 ${
files.length
} 个文件共选择了 ${files.length + fileList.length} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
}
}
};
</script>

@ -0,0 +1,741 @@
<!--
* @Description: 期刊
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-19 23:29:58
-->
<template>
<div class="app-container">
<!-- card -->
<el-card class="box-card">
<div slot="header" class="card-header clearfix">
<span class="card-header-text">期刊列表</span>
<el-button-group style="margin-top: -3px; margin-left: 10px;">
<el-button
:type="activateTab == 0 ? 'primary' : 'default'"
size="small"
@click="handleChangeActivateTab(0)"
>新建</el-button
>
<el-button
:type="activateTab == 1 ? 'primary' : 'default'"
size="small"
@click="handleChangeActivateTab(1)"
>已发布</el-button
>
<el-button
:type="activateTab == 2 ? 'primary' : 'default'"
size="small"
@click="handleChangeActivateTab(2)"
>回收站</el-button
>
</el-button-group>
<el-button
style="float: right; margin-top: -4px;"
type="primary"
icon="el-icon-plus"
size="small"
@click="handleAddClick"
>新建期刊</el-button
>
</div>
<!-- 查询条件 -->
<el-form :inline="true" class="in-card-form">
<el-form-item>
<el-input
placeholder="期刊号/期刊标题"
size="medium"
v-model="queryForm.data.name"
></el-input>
</el-form-item>
<el-form-item>
<el-select
placeholder="选择发布人"
size="medium"
v-model="queryForm.data.creatorId"
>
<el-option
v-for="item in queryForm.remoteData.publisher"
:label="item.name"
:value="item.id"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
placeholder="选择时间范围"
v-model="queryForm.data.timeRange"
type="daterange"
:range-separator="
queryForm.data.timeRange.length === 0 ? null : '~'
"
:editable="false"
:clearable="false"
value-format="yyyy-MM-dd"
start-placeholder="选择时间范围"
size="medium"
style="width: 280px;"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-search"
type="primary"
size="medium"
@click="handleQueryClick"
>查询</el-button
>
</el-form-item>
<el-form-item>
<el-button
icon="el-icon-refresh-left"
size="medium"
@click="handleResetClick"
>重置</el-button
>
</el-form-item>
<el-form-item>
<el-button
type="text"
icon="el-icon-s-operation"
@click="superFilterClick"
>高级筛选</el-button
>
</el-form-item>
</el-form>
<!-- 表格 -->
<el-table
stripe
:data="table.data"
height="calc(100vh - 345px)"
v-loading="table.loading"
v-if="table.show"
element-loading-text="加载中"
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
border
fit
>
<el-table-column align="center" label="序号" width="95">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="期刊编号">
<template slot-scope="scope">
<span>VOL</span>
<span>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column label="期刊标题" prop="name"></el-table-column>
<el-table-column label="风格标签" prop="tag"></el-table-column>
<el-table-column label="歌曲数" prop="songCount"></el-table-column>
<el-table-column
label="播放次数"
prop="playCount"
v-if="activateTab === 1"
></el-table-column>
<el-table-column
label="评论数"
prop="commentCount"
v-if="activateTab === 1"
></el-table-column>
<el-table-column label="期刊作者" prop="userId"></el-table-column>
<el-table-column label="创建时间" prop="createTime"></el-table-column>
<el-table-column
label="待发布时间"
prop="pubTime"
v-if="activateTab === 0"
></el-table-column>
<el-table-column
fixed="right"
label="操作"
:width="[300, 200, 300][activateTab]"
>
<template slot-scope="scope">
<el-button
plain
icon="el-icon-edit"
@click="handleModifyClick(scope.row)"
type="primary"
size="mini"
>编辑</el-button
>
<el-button
plain
icon="el-icon-success"
v-if="activateTab === 0 || activateTab === 2"
@click="handlePublishClick(scope.row)"
type="success"
size="mini"
>发布</el-button
>
<el-button
plain
icon="el-icon-info"
v-if="activateTab === 1"
@click="handleDetailClick(scope.row)"
type="primary"
size="mini"
>详情</el-button
>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
icon="el-icon-info"
icon-color="red"
title="是否确认删除标签?"
style="margin-left: 10px;"
v-if="activateTab === 0 || activateTab === 2"
@confirm="handleDeleteClick(scope.row)"
>
<el-button
slot="reference"
plain
icon="el-icon-delete"
type="danger"
size="mini"
>删除</el-button
>
</el-popconfirm>
</template>
</el-table-column>
<el-table-column fixed="right" label="启停用" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.state"
active-color="#13ce66"
@change="handleTableRowStatusChange($event, scope.row)"
:active-value="1"
:inactive-value="0"
></el-switch>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
class="pagination-right"
background
v-if="table.show"
layout="total, prev, pager, next, sizes"
:current-page.sync="table.page.current"
:page-size="table.page.size"
:total="table.page.total"
@size-change="handlePageSizeChange"
@current-change="handlePageCurrentChange"
>
</el-pagination>
</el-card>
<el-dialog
:title="['新建期刊', '编辑期刊', '详情'][modifyDialog.type]"
class="popup-dialog"
:visible="modifyDialog.visible"
v-if="modifyDialog.visible"
width="80%"
top="60px"
:before-close="handleModifyDialogBeforeClose"
>
<div style="height: 70vh;overflow: auto;">
<ArticleDetailDialog></ArticleDetailDialog>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="handleDialogSubmit"
>确定</el-button
>
<el-button size="small" type="primary" @click="handleDialogSubmit"
>重置</el-button
>
<el-button size="small" @click="handleDialogCancel"></el-button>
</span>
</el-dialog>
<el-drawer
title="高级筛选"
v-if="queryForm.superFilterDialog.visible"
:visible="true"
:before-close="handleTagsDialogBeforeClose"
direction="rtl"
>
<SuperFilterTagDrawer
:remoteTagData="queryForm.remoteData.superFilterTags"
@query="handleSuperFilterTagQuery"
></SuperFilterTagDrawer>
</el-drawer>
</div>
</template>
<script>
import articleApi from "@/api/article";
import SuperFilterTagDrawer from "./superFilterTagDrawer.vue";
import ArticleDetailDialog from "./articleDetail.vue";
export default {
name: "Article",
data() {
return {
// 01 2
activateTab: 0,
//
queryForm: {
remoteData: {
publisher: [],
superFilterTags: []
},
lastQuery: {},
superFilterDialog: {
visible: false
},
data: {
name: null,
creatorId: null,
timeRange: []
}
},
//
table: {
show: true,
loading: true,
data: [],
page: {
current: 1,
size: 10,
total: 0
}
},
//
modifyDialog: {
visible: false,
type: 0, // 0for 1for 2for
form: {
rules: {},
data: {}
}
}
};
},
components: {
ArticleDetailDialog,
SuperFilterTagDrawer
},
filters: {},
created() {
this.fetchCreaterList();
this.fetchSuperFilterTags();
this.fetchData(this.queryForm.data);
},
methods: {
log(e) {
this.$message.success(e);
},
// ************************* *************************
/**
* 查询表格数据
*/
fetchData(param) {
//
this.queryForm.lastQuery = param;
let queryParam = {
end: "",
keyword: param.name,
start: "",
tab: this.activateTab,
tags: [],
userId: param.creatorId
};
if (this.queryForm.data.timeRange) {
if (this.queryForm.data.timeRange[0]) {
queryParam.start = this.queryForm.data.timeRange[0];
}
if (this.queryForm.data.timeRange[1]) {
queryParam.end = this.queryForm.data.timeRange[1];
}
}
this.table.loading = true;
this.table.data = [];
// articleApi
// .getList(queryParam, this.table.page.current, this.table.page.size)
// .then(res => {
// if(res.code === 200){
// this.table.data = res.data.rows;
// this.table.page.total = res.data.total;
// }else{
// this.$message.error(res.message)
// }
// this.table.loading = false;
// });
let res = {
code: 200,
data: {
rows: [
{
commentCount: 0,
coverPhoto: "coverPhoto",
createTime: "2023-01-01",
id: "1",
name: "name",
number: "1001",
playCount: 1,
pubTime: "2023-01-01",
songCount: 1,
songs: [
{
album: "album",
artist: "artist",
duration: "duration",
id: "0",
journal: [],
lyric: "xx",
name: "name",
picture: "picture",
size: "size",
state: "state",
tags: [1, 2],
updateTime: "2023-01-01",
url: "/url",
userId: "userId"
}
],
state: "1",
status: "1",
summary: "2",
tag: [],
userId: "1"
}
],
total: 0
},
message: ""
};
this.table.data = res.data.rows;
this.table.page.total = res.data.total;
this.table.loading = false;
},
/**
* 创建人下拉框
*/
fetchCreaterList() {
// tagApi.createrList().then(res => {
// if (res.code === 200) {
// this.queryForm.remoteData.publisher = res.data;
// }
// });
this.queryForm.remoteData.publisher = [];
},
/**
* 高级筛选tag
*/
fetchSuperFilterTags() {
this.queryForm.remoteData.superFilterTags = [
{
name: "语言类型",
tags: [
{ id: 1, name: "abc" },
{ id: 2, name: "bcasdd" },
{ id: 21, name: "becd" }
]
},
{
name: "期刊标签",
tags: [
{ id: 4, name: "abc11" },
{ id: 5, name: "bcd22" }
]
}
];
},
// ************************* *************************
/**
* 查询按扭点击事件
*/
handleQueryClick() {
this.table.page.current = 1;
this.table.page.total = 0;
this.fetchData(this.queryForm.data);
},
/**
* 重置点击事件
*/
handleResetClick() {
this.queryForm.data = {
type: this.activateTab,
parentId: null,
name: null,
creatorId: null,
timeRange: []
};
},
/**
* 高级筛选按钮
*/
superFilterClick() {
this.queryForm.superFilterDialog.visible = true;
},
/**
* 高级筛选中的查询按钮
*/
handleSuperFilterTagQuery(val) {
this.console.log(val);
},
/**
* 新建标签点击事件
*/
handleAddClick() {
// TODO:
let newData = {
"id": null,
"name": null,
"tag": [],
"number": null,
"userId": null,
"coverPhoto": null,
}
this.modifyDialog.type = 0;
this.modifyDialog.visible = true;
},
/**
* 编辑标签点击事件
*/
handleModifyClick(row) {
// TODO:
this.modifyDialog.type = 1;
this.modifyDialog.visible = true;
},
/**
* 发布点击事件
*/
handlePublishClick(row) {
articleApi.publish(row.id).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
this.fetchData(this.queryForm.lastQuery);
return;
} else {
this.$message.error(res.message);
}
});
},
/**
* 详情点击事件
*/
handleDetailClick(row) {
this.$message.success("详情" + row.id);
},
/**
* 删除按钮点击事件
*/
handleDeleteClick(row) {
articleApi.delete(row.id).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
this.fetchData(this.queryForm.lastQuery);
return;
} else {
this.$message.error(res.message);
}
});
},
/**
* 表格内状态滑块切换事件
*/
handleTableRowStatusChange($event, row) {
articleApi.updateStatus(row.id, $event).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
} else {
this.$message.error(res.message);
}
this.fetchData(this.queryForm.lastQuery);
});
},
/**
* 弹窗取消按扭点击事件
*/
handleDialogCancel() {
this.modifyDialog.visible = false;
},
/**
* 弹窗确定按扭点击事件
*/
handleDialogSubmit() {
this.$refs.modifyDialogForm.validate(valid => {
if (valid) {
//
if (this.modifyDialog.type === 0) {
// tagApi.create(this.modifyDialog.form.data).then(res => {
// if (res.code === 200) {
// this.$message.success(res.message);
// this.modifyDialog.visible = false;
// this.table.page.current = 1;
// //
// this.handleResetClick();
// this.fetchData(this.queryForm.data);
// } else {
// this.$message.error(res.message);
// }
// });
this.$message.success("新增");
return;
}
//
if (this.modifyDialog.type === 1) {
// tagApi.update(this.modifyDialog.form.data).then(res => {
// if (res.code === 200) {
// this.$message.success(res.message);
// this.modifyDialog.visible = false;
// this.fetchData(this.queryForm.lastQuery);
// } else {
// this.$message.error(res.message);
// }
// });
this.$message.success("编辑");
return;
}
//
if (this.modifyDialog.type === 2) {
// tagApi.create(this.modifyDialog.form.data).then(res => {
// if (res.code === 200) {
// this.$message.success(res.message);
// this.modifyDialog.visible = false;
// this.fetchData(this.queryForm.lastQuery);
// } else {
// this.$message.error(res.message);
// }
// });
this.$message.success("详情");
return;
}
} else {
this.$message.error("请完善表单相关信息!");
return false;
}
});
},
/**
* 弹窗重置
*/
handleDialogReset() {
this.$message.success("重置");
},
/**
* 弹窗关闭按扭点击事件
*/
handleModifyDialogBeforeClose(done) {
this.modifyDialog.visible = false;
done();
},
/**
* 弹窗关闭按扭点击事件
*/
handleTagsDialogBeforeClose(done) {
this.queryForm.superFilterDialog.visible = false;
done();
},
/**
* 分页组件页数变化事件
*/
handlePageCurrentChange(val) {
this.table.page.current = val;
this.fetchData(this.queryForm.lastQuery);
},
/**
* 分页组件大小变化事件
*/
handlePageSizeChange(val) {
this.table.page.size = val;
this.fetchData(this.queryForm.lastQuery);
},
/**
* 切换标签事件
*/
handleChangeActivateTab(tab) {
this.activateTab = tab;
//
this.handleResetClick();
//
this.table.data = [];
this.table.page.current = 1;
this.table.page.size = 10;
this.table.show = false;
this.$nextTick(() => {
this.table.show = true;
});
this.fetchData(this.queryForm.data);
}
}
};
</script>
<style scoped>
.pagination-right {
text-align: right;
margin-top: 10px;
}
.box-card {
min-height: 300px;
height: calc(100vh - 140px);
border-radius: 10px;
.el-card__header {
background-color: rgba(249, 249, 249, 1);
}
}
/deep/ .el-dialog {
border-radius: 5px;
}
.popup-dialog {
.el-dialog__header {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
height: 50px;
background-color: #f5f5f5f5;
}
.el-dialog__title {
font-size: 15px;
font-weight: bolder;
}
.el-dialog__footer {
border-top: solid;
border-top-width: thin;
border-top-color: rgb(233, 233, 233);
padding: 10px 20px 10px;
}
}
.in-card-form {
height: 60px;
display: flex;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both;
}
.card-header {
height: 23px;
}
.app-container {
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular",
"Microsoft YaHei", sans-serif;
}
.card-header-text {
font-family: "Microsoft YaHei Bold", "Microsoft YaHei Regular",
"Microsoft YaHei", sans-serif;
font-weight: 700;
font-style: normal;
font-size: 16px;
text-align: left;
line-height: 20px;
letter-spacing: normal;
color: #333333;
}
</style>

@ -0,0 +1,136 @@
<!--
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-20 02:11:55
-->
<template>
<div>
<el-collapse v-model="activeTagGroupNames">
<el-collapse-item
style="padding-left: 20px;padding-right: 20px;"
v-for="group in remoteTagData"
:title="group.name"
:name="group.name"
>
<el-button
type="primary"
size="mini"
style="margin-left: 10px;margin-top:2px"
@click="tagAllClick(group)"
>全部</el-button
>
<el-button
type="primary"
plain
style="margin-left: 10px;margin-top: 2px;"
size="mini"
v-for="tag in group.tags"
@click="tagClick(tag)"
>{{ tag.name }}</el-button
>
</el-collapse-item>
</el-collapse>
<div style="padding:20px;font-size: 13px;font-weight: 500;">
<span style="margin-right: 5px;">已选条件</span>
<el-tag
:key="tag.id"
size="small"
v-for="tag in selectTagList"
closable
:disable-transitions="false"
style="margin-right:5px"
@close="tagClick(tag)"
>
{{ tag.name }}
</el-tag>
<el-button type="text" @click="clearAllClick"></el-button>
</div>
<div style="padding:20px">
<el-button
icon="el-icon-search"
type="primary"
size="small"
@click="queryClick"
>查询</el-button
>
<el-button icon="el-icon-refresh-left" size="small">重置</el-button>
</div>
</div>
</template>
<script>
export default {
name: "SuperFilterTagDrawer",
props: {
remoteTagData: {
type: Array,
default: []
}
},
data() {
return {
selectTagList: [],
activeTagGroupNames: []
};
},
filters: {},
created() {},
components: {},
mounted() {
this.activeTagGroupNames = [];
for (let index in this.remoteTagData) {
let item = this.remoteTagData[index];
this.activeTagGroupNames.push(item.name);
}
},
methods: {
/**
* 高级筛选弹窗中tag按钮
*/
tagAllClick(newTagGroup) {
let newTagList = [...this.selectTagList];
for (let subTagIndex in newTagGroup.tags) {
let newTag = newTagGroup.tags[subTagIndex];
let inList = false;
for (let index in this.selectTagList) {
let item = this.selectTagList[index];
if (item.id === newTag.id) {
inList = true;
continue;
}
}
if (!inList) {
newTagList.push(newTag);
}
}
this.selectTagList = newTagList;
},
/**
* 高级筛选弹窗中删除按钮
*/
tagClick(newTag) {
let newTagList = [];
let deleted = false;
for (let index in this.selectTagList) {
let item = this.selectTagList[index];
if (item.id === newTag.id) {
deleted = true;
continue;
}
newTagList.push(item);
}
if (!deleted) {
newTagList.push(newTag);
}
this.selectTagList = newTagList;
},
clearAllClick() {
this.selectTagList = [];
},
queryClick() {
this.$emit("query", this.selectTagList);
}
}
};
</script>

@ -1,3 +1,9 @@
<!--
* @Description:
* @version: v1
* @Author: zhangjiabao
* @Date: 2024-01-02 21:12:35
-->
<template>
<div class="menu-wrapper">
<template v-for="item in routes" v-if="!item.hidden&&item.children">

@ -400,8 +400,6 @@ export default {
*/
handleResetClick() {
this.queryForm.data = {
level: this.tagType,
parentId: null,
name: null,
creatorId: null,
timeRange: []

Loading…
Cancel
Save