|
@@ -0,0 +1,227 @@
|
|
|
+<template>
|
|
|
+ <section class="content">
|
|
|
+ <div class="box box-info">
|
|
|
+ <div class="box-body">
|
|
|
+ <el-form
|
|
|
+ ref="formSearch"
|
|
|
+ :model="formSearch"
|
|
|
+ :inline="true"
|
|
|
+ label-width="70px"
|
|
|
+ >
|
|
|
+ <el-form-item label="学习中心">
|
|
|
+ <el-select
|
|
|
+ v-model="formSearch.orgId"
|
|
|
+ class="input"
|
|
|
+ :remote-method="getOrgList4Search"
|
|
|
+ :loading="getOrgList4SearchLoading"
|
|
|
+ remote
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in orgList4Search"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name + ' - ' + item.code"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="resetPageAndSearchForm"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="d-block">
|
|
|
+ <el-button size="small" type="primary" @click="editItem(null)"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
+ <el-button size="small" type="primary">批量导入</el-button>
|
|
|
+ <el-button size="small" type="danger">批量删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="success"
|
|
|
+ @click="openSynchronousDialog"
|
|
|
+ >同步到考试</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ style="width: 100%; text-align: center; margin-top: 10px"
|
|
|
+ @selection-change="selectChange"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="50"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="page pull-right">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200, 300]"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ ></el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ title="同步到考试"
|
|
|
+ width="400px"
|
|
|
+ :visible.sync="showSynchronousDialog"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="synchronousRef"
|
|
|
+ :model="synchronousForm"
|
|
|
+ :rules="synchronousRules"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="选择考试" prop="examId">
|
|
|
+ <el-select
|
|
|
+ v-model="synchronousForm.examId"
|
|
|
+ placeholder="请选择考试"
|
|
|
+ />
|
|
|
+ <div style="font-size: 12px; color: #e6a23c">
|
|
|
+ 提示:只能选择开启了IP特殊设置的考试
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="showSynchronousDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="synchronousSubmit">同步</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :title="curRow ? '修改' : '新增'"
|
|
|
+ width="450px"
|
|
|
+ :visible.sync="showEditDialog"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ ref="editRef"
|
|
|
+ :model="editForm"
|
|
|
+ :rules="editRules"
|
|
|
+ label-width="80px"
|
|
|
+ >
|
|
|
+ <el-form-item label="学习中心" prop="orgId">
|
|
|
+ <el-select v-model="editForm.orgId" placeholder="请选择学习中心" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="IP/IP段" prop="ip">
|
|
|
+ <el-input v-model="editForm.ip" placeholder="请输入IP或者IP段" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input v-model="editForm.remark" type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer">
|
|
|
+ <el-button @click="showEditDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="editSubmit">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { CORE_API } from "@/constants/constants.js";
|
|
|
+import { mapState } from "vuex";
|
|
|
+export default {
|
|
|
+ name: "IpConfig",
|
|
|
+ computed: {
|
|
|
+ ...mapState({ user: (state) => state.user }),
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ curRow: null,
|
|
|
+ showSynchronousDialog: false,
|
|
|
+ formSearch: {
|
|
|
+ orgId: "",
|
|
|
+ },
|
|
|
+ getOrgList4SearchLoading: false,
|
|
|
+ orgList4Search: [],
|
|
|
+ tableData: [],
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: 10,
|
|
|
+ selectedIds: [],
|
|
|
+ editForm: {
|
|
|
+ orgId: "",
|
|
|
+ ip: "",
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ editRules: {},
|
|
|
+ synchronousForm: {
|
|
|
+ examId: "",
|
|
|
+ },
|
|
|
+ synchronousRules: {
|
|
|
+ examId: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择考试",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ showEditDialog: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getOrgList4Search("");
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ editSubmit() {},
|
|
|
+ openSynchronousDialog() {
|
|
|
+ this.synchronousForm.examId = "";
|
|
|
+ this.showSynchronousDialog = true;
|
|
|
+ },
|
|
|
+ synchronousSubmit() {
|
|
|
+ this.showSynchronousDialog = false;
|
|
|
+ },
|
|
|
+ getOrgList4Search(orgName) {
|
|
|
+ this.getOrgList4SearchLoading = true;
|
|
|
+ let url =
|
|
|
+ CORE_API +
|
|
|
+ "/org/query?rootOrgId=" +
|
|
|
+ this.user.rootOrgId +
|
|
|
+ "&name=" +
|
|
|
+ orgName;
|
|
|
+ this.$httpWithMsg
|
|
|
+ .get(url)
|
|
|
+ .then((response) => {
|
|
|
+ this.getOrgList4SearchLoading = false;
|
|
|
+ this.orgList4Search = response.data;
|
|
|
+ })
|
|
|
+ .catch((response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.getOrgList4SearchLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resetPageAndSearchForm() {
|
|
|
+ this.currentPage = 1;
|
|
|
+ this.searchForm();
|
|
|
+ },
|
|
|
+ searchForm() {},
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.currentPage = val;
|
|
|
+ this.searchForm();
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pageSize = val;
|
|
|
+ this.searchForm();
|
|
|
+ },
|
|
|
+ editItem(item) {
|
|
|
+ this.curRow = item;
|
|
|
+ this.showEditDialog = true;
|
|
|
+ },
|
|
|
+ selectChange(rows) {
|
|
|
+ this.selectedIds = rows.map((item) => item.id);
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|