|
@@ -9,19 +9,117 @@
|
|
|
>
|
|
|
<div>
|
|
|
<el-form :inline="true" :model="searchForm">
|
|
|
- <el-form-item>
|
|
|
- <el-input
|
|
|
- v-model.trim="searchForm.search"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="search"
|
|
|
- placeholder="学员姓名/编号/手机号"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="search" type="primary">搜索</el-button>
|
|
|
- <el-button @click="onReSet" type="danger">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
+ <el-form :inline="true" :model="searchForm">
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.search"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="学员名/编号/手机号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="organIdList">
|
|
|
+ <select-all
|
|
|
+ class="multiple"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ collapse-tags
|
|
|
+ multiple
|
|
|
+ v-model.trim="searchForm.organIdList"
|
|
|
+ placeholder="请选择分部"
|
|
|
+ @change="onBranchChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in selects.branchs"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </select-all>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ v-model.trim="searchForm.cooperationOrganId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择合作单位"
|
|
|
+ :disabled="searchForm.organIdList.length <= 0"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in cooperationList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ :disabled="searchForm.organIdList.length <= 0"
|
|
|
+ v-model.trim="searchForm.musicGroupId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择乐团"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in teamList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item prop="subjectId">
|
|
|
+ <el-select
|
|
|
+ v-model="searchForm.subjectId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择声部"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in selects.subjects"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :key="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select
|
|
|
+ multiple
|
|
|
+ collapse-tags
|
|
|
+ v-model.trim="searchForm.groupList"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择群聊"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in groupList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="search" type="primary">搜索</el-button>
|
|
|
+ <el-button @click="onReSet" type="danger">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
</el-form>
|
|
|
+ <auth auths="imLiveRoomPurview/addByCondition">
|
|
|
+ <el-button
|
|
|
+ @click="addAllStudent"
|
|
|
+ type="primary"
|
|
|
+ style="margin-bottom: 10px"
|
|
|
+ >一键添加</el-button
|
|
|
+ >
|
|
|
+ </auth>
|
|
|
<div class="tableWrap">
|
|
|
<el-table
|
|
|
style="width: 100%"
|
|
@@ -34,7 +132,7 @@
|
|
|
<el-table-column type="selection" width="55"> </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="id"
|
|
|
+ prop="userId"
|
|
|
label="学员编号"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
@@ -44,6 +142,8 @@
|
|
|
></el-table-column>
|
|
|
<el-table-column align="center" prop="phone" label="手机号">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column align="center" prop="subjectName" label="声部">
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
sync
|
|
@@ -62,9 +162,15 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { addBlackList, getWaitBlackList } from "../api";
|
|
|
-import { getLiveGoodsMapperList } from "@/views/liveShopManger/api";
|
|
|
+import {
|
|
|
+ addLiveStudentList,
|
|
|
+ getWaitLiveStudentList,
|
|
|
+ addByCondition,
|
|
|
+} from "../api";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
+import { getGroupList } from "@/views/groupChatManager/api";
|
|
|
+import { queryByOrganId } from "@/api/systemManage";
|
|
|
+import { getTeamList } from "@/api/teamServer";
|
|
|
export default {
|
|
|
name: "eidtPostMsg",
|
|
|
components: { pagination },
|
|
@@ -72,9 +178,16 @@ export default {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
search: "",
|
|
|
+ organIdList: [],
|
|
|
+ cooperationOrganId: [],
|
|
|
+ musicGroupId: [],
|
|
|
+ groupList: [],
|
|
|
},
|
|
|
tableList: [],
|
|
|
organList: [],
|
|
|
+ cooperationList: [],
|
|
|
+ groupList: [],
|
|
|
+ teamList: [],
|
|
|
rules: {
|
|
|
// 分页规则
|
|
|
limit: 10, // 限制显示条数
|
|
@@ -91,12 +204,31 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ this.$store.dispatch("setSubjects");
|
|
|
+ this.$store.dispatch("setBranchs");
|
|
|
+ this.getGroupList();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async getGroupList() {
|
|
|
+ const res = await getGroupList({ page: 1, rows: 9999 });
|
|
|
+ this.groupList = res.data.rows;
|
|
|
+ },
|
|
|
async getList() {
|
|
|
try {
|
|
|
- const res = await getWaitBlackList({
|
|
|
- ...this.searchForm,
|
|
|
+ const {
|
|
|
+ organIdList,
|
|
|
+ cooperationOrganId,
|
|
|
+ musicGroupId,
|
|
|
+ groupList,
|
|
|
+ ...rest
|
|
|
+ } = this.searchForm;
|
|
|
+ const res = await getWaitLiveStudentList({
|
|
|
+ organIds: organIdList.join(","),
|
|
|
+ schoolIds: cooperationOrganId.join(","),
|
|
|
+ teamIds: musicGroupId.join(","),
|
|
|
+ groupIds: groupList.join(","),
|
|
|
+ ...rest,
|
|
|
page: this.rules.page,
|
|
|
rows: this.rules.limit,
|
|
|
roomUid: this.activeRow.roomUid,
|
|
@@ -104,12 +236,12 @@ export default {
|
|
|
this.tableList = res.data.rows;
|
|
|
this.rules.total = res.data.total;
|
|
|
let idList = this.chioseIdList.map((group) => {
|
|
|
- return group.id;
|
|
|
+ return group.userId;
|
|
|
});
|
|
|
this.isNewPage = true;
|
|
|
this.$nextTick(() => {
|
|
|
this.tableList.forEach((course) => {
|
|
|
- if (idList.indexOf(course.id) != -1) {
|
|
|
+ if (idList.indexOf(course.userId) != -1) {
|
|
|
this.$refs.multipleSelection.toggleRowSelection(course, true);
|
|
|
}
|
|
|
});
|
|
@@ -124,7 +256,15 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
onReSet() {
|
|
|
- this.searchForm.search = "";
|
|
|
+ (this.searchForm = {
|
|
|
+ search: "",
|
|
|
+ organIdList: [],
|
|
|
+ cooperationOrganId: [],
|
|
|
+ musicGroupId: [],
|
|
|
+ groupList: [],
|
|
|
+ }),
|
|
|
+ this.clearCom();
|
|
|
+ this.search();
|
|
|
this.clearCom();
|
|
|
this.search();
|
|
|
},
|
|
@@ -133,14 +273,15 @@ export default {
|
|
|
this.$message.error("请至少选择一名学生");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
try {
|
|
|
let idList = this.chioseIdList
|
|
|
.map((group) => {
|
|
|
- return group.id;
|
|
|
+ return group.userId;
|
|
|
})
|
|
|
.join(",");
|
|
|
- const res = await addBlackList({
|
|
|
- userIdList: idList,
|
|
|
+ const res = await addLiveStudentList({
|
|
|
+ ids: idList,
|
|
|
roomUid: this.activeRow.roomUid,
|
|
|
});
|
|
|
this.$message.success("添加成功");
|
|
@@ -162,25 +303,25 @@ export default {
|
|
|
this.chioseIdList = this.chioseIdList.concat(val);
|
|
|
this.chioseIdList = this.$helpers.lodash.uniqBy(
|
|
|
this.chioseIdList,
|
|
|
- "id"
|
|
|
+ "userId"
|
|
|
);
|
|
|
} else {
|
|
|
if (this.isNewPage) return;
|
|
|
let idList = this.chioseIdList.map((group) => {
|
|
|
- return group.id;
|
|
|
+ return group.userId;
|
|
|
});
|
|
|
this.$nextTick(() => {
|
|
|
let tableIdList = [];
|
|
|
this.tableList.forEach((group) => {
|
|
|
- tableIdList.push(group.id);
|
|
|
- if (idList.indexOf(group.id) != -1) {
|
|
|
+ tableIdList.push(group.userId);
|
|
|
+ if (idList.indexOf(group.userId) != -1) {
|
|
|
this.$refs.multipleSelection.toggleRowSelection(group, false);
|
|
|
}
|
|
|
});
|
|
|
this.chioseIdList = this.$helpers.lodash.remove(
|
|
|
this.chioseIdList,
|
|
|
function (item) {
|
|
|
- return tableIdList.indexOf(item.id) == -1;
|
|
|
+ return tableIdList.indexOf(item.userId) == -1;
|
|
|
}
|
|
|
);
|
|
|
if (this.chioseIdList.length <= 0) {
|
|
@@ -195,10 +336,10 @@ export default {
|
|
|
},
|
|
|
onTableSelect(rows, row) {
|
|
|
let idList = this.chioseIdList.map((group) => {
|
|
|
- return group.id;
|
|
|
+ return group.userId;
|
|
|
});
|
|
|
- if (idList.indexOf(row.id) != -1) {
|
|
|
- this.chioseIdList.splice(idList.indexOf(row.id), 1);
|
|
|
+ if (idList.indexOf(row.userId) != -1) {
|
|
|
+ this.chioseIdList.splice(idList.indexOf(row.userId), 1);
|
|
|
if (this.chioseIdList.length <= 0) {
|
|
|
this.clearCom();
|
|
|
}
|
|
@@ -206,7 +347,7 @@ export default {
|
|
|
},
|
|
|
onClose() {
|
|
|
this.clearCom();
|
|
|
- this.searchForm.search = ''
|
|
|
+ this.searchForm.search = "";
|
|
|
this.lookVisible = false;
|
|
|
},
|
|
|
openDioag(row) {
|
|
@@ -214,6 +355,68 @@ export default {
|
|
|
this.lookVisible = true;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ async onBranchChange(val) {
|
|
|
+ // this.searchForm.cooperationOrganId = [];
|
|
|
+ this.$set(this.searchForm, "cooperationOrganId", []);
|
|
|
+ if (val && val.length > 0) {
|
|
|
+ let organId = val.join(",");
|
|
|
+ try {
|
|
|
+ await queryByOrganId({ organId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.cooperationList = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.teamList = res.data.rows;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async addAllStudent() {
|
|
|
+ const {
|
|
|
+ organIdList,
|
|
|
+ cooperationOrganId,
|
|
|
+ musicGroupId,
|
|
|
+ groupList,
|
|
|
+ ...rest
|
|
|
+ } = this.searchForm;
|
|
|
+ if (
|
|
|
+ !organIdList.join(",") &&
|
|
|
+ !cooperationOrganId.join(",") &&
|
|
|
+ !musicGroupId.join(",") &&
|
|
|
+ !groupList.join(",") &&
|
|
|
+ !this.searchForm.search
|
|
|
+ ) {
|
|
|
+ this.$message.error("请至少选择一个搜索条件");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ await this.$confirm(
|
|
|
+ "确认后当前所选条件下所有学生都可观看直播",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ type: "warning",
|
|
|
+ }
|
|
|
+ );
|
|
|
+
|
|
|
+ const res = await addByCondition({
|
|
|
+ organIds: organIdList.join(","),
|
|
|
+ schoolIds: cooperationOrganId.join(","),
|
|
|
+ teamIds: musicGroupId.join(","),
|
|
|
+ groupIds: groupList.join(","),
|
|
|
+ ...rest,
|
|
|
+ roomUid: this.activeRow.roomUid,
|
|
|
+ });
|
|
|
+ this.$message.success("添加成功");
|
|
|
+ this.$emit("getList");
|
|
|
+ this.onClose();
|
|
|
+ } catch (e) {}
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|