|
|
@@ -115,13 +115,12 @@
|
|
|
<!-- 发布人设置 -->
|
|
|
<el-dialog title="发布人设置" custom-class="configuration-window" :visible.sync="setPublisherVisible" :close-on-click-modal="false"
|
|
|
:close-on-press-escape="false" @close="setPublisherVisible = false">
|
|
|
- <el-row style="display: none;">
|
|
|
- <el-col :span="24" style="display: flex; justify-content: space-between; padding: 0;">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" style="display: flex; justify-content: center; padding: 0;">
|
|
|
<div>
|
|
|
- <el-input v-model="publisherSearch.key" style="width: 180px; margin-right: 10px;" clearable placeholder="请输入用户名"></el-input>
|
|
|
- <el-button type="primary" class="configure-btn" @click="btn_search">查询</el-button>
|
|
|
+ <el-input v-model="publisherSearch.key" style="width: 180px; margin-right: 10px;" @input="publisherSearchChange" clearable
|
|
|
+ placeholder="请输入用户名"></el-input>
|
|
|
</div>
|
|
|
- <el-button class="configure-btn" @click="show_add_publisher_dialog = true">确定设置</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
@@ -649,6 +648,7 @@
|
|
|
},
|
|
|
tableData: [], // 攻略分页列表
|
|
|
tableData_publisher: [], // 发布人列表
|
|
|
+ tableData_publisher_0: [], // 发布人列表
|
|
|
cond_data: {},
|
|
|
// 分页参数
|
|
|
pagination: {
|
|
|
@@ -748,6 +748,26 @@
|
|
|
document.removeEventListener('fullscreenchange', this.handleFullScreenChange);
|
|
|
},
|
|
|
methods: {
|
|
|
+ publisherSearchChange() {
|
|
|
+ // 进行查询
|
|
|
+ if (this.publisherSearch.key === "") {
|
|
|
+ // 如果查询字符串为空,则复制所有数据
|
|
|
+ this.tableData_publisher = this.tableData_publisher_0.slice();
|
|
|
+ } else {
|
|
|
+ // 如果查询字符串不为空,则进行模糊匹配
|
|
|
+ this.tableData_publisher = this.tableData_publisher_0.filter(item => item.name.includes(this.publisherSearch.key));
|
|
|
+ }
|
|
|
+ // 按照mark字段倒序排序,再按照id字段升序排序
|
|
|
+ this.tableData_publisher.sort((a, b) => {
|
|
|
+ // 首先按照mark字段倒序排序
|
|
|
+ if (b.mark - a.mark !== 0) {
|
|
|
+ return b.mark - a.mark;
|
|
|
+ } else {
|
|
|
+ // 如果mark相同,则按照id字段升序排序
|
|
|
+ return a.id - b.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
// 绑定 或 解绑发布人
|
|
|
bindingPuhlisherIds(id, param) {
|
|
|
if (param == 'add') {
|
|
|
@@ -797,9 +817,10 @@
|
|
|
let that = this;
|
|
|
publisherList(that.currentUserId).then((res) => {
|
|
|
// console.log(res.data.pageList);
|
|
|
+ that.tableData_publisher_0 = [];
|
|
|
+ that.tableData_publisher = [];
|
|
|
if (res.code === 200) {
|
|
|
let tempData = res.data.pageList;
|
|
|
- that.tableData_publisher = [];
|
|
|
if (typeof tempData !== 'undefined' && tempData !== '') {
|
|
|
let ids = '';
|
|
|
for (let i = 0; i < tempData.length; i++) {
|
|
|
@@ -809,24 +830,24 @@
|
|
|
name: tempData[i].user_name,
|
|
|
mark: tempData[i].mark
|
|
|
};
|
|
|
- that.tableData_publisher.push(tdata);
|
|
|
+ that.tableData_publisher_0.push(tdata);
|
|
|
+ this.publisherSearchChange();
|
|
|
if (tempData[i].mark == 1) {
|
|
|
ids = ids + tempData[i].id + ',';
|
|
|
}
|
|
|
}
|
|
|
that.bindedPublisherIds = ids.substring(0, ids.length - 1);
|
|
|
} else {
|
|
|
- that.tableData_publisher = [];
|
|
|
that.$message.warning('没有符合条件的数据!')
|
|
|
}
|
|
|
} else {
|
|
|
- that.tableData_publisher = [];
|
|
|
that.$message.warning('没有符合条件的数据!')
|
|
|
}
|
|
|
}).catch((err) => {
|
|
|
// console.log(err);
|
|
|
that.$message.error(err.message)
|
|
|
});
|
|
|
+
|
|
|
// 显示对话框窗口
|
|
|
that.setPublisherVisible = true;
|
|
|
},
|