|
@@ -40,25 +40,6 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="专业" prop="specialtyId">
|
|
|
|
- <el-select
|
|
|
|
- v-model="formSearch.specialtyId"
|
|
|
|
- remote
|
|
|
|
- :remote-method="getSpecialtyList4Search"
|
|
|
|
- :loading="specialtyLoading4Search"
|
|
|
|
- filterable
|
|
|
|
- clearable
|
|
|
|
- placeholder="请选择"
|
|
|
|
- @focus="(e) => getSpecialtyList4Search(e.target.value)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in specialtyList4SearchWrapper"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="danger" @click="handleSearchBtn">查询</el-button>
|
|
<el-button type="danger" @click="handleSearchBtn">查询</el-button>
|
|
@@ -351,133 +332,6 @@
|
|
<el-button @click="errDialog = false">确定</el-button>
|
|
<el-button @click="errDialog = false">确定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
-
|
|
|
|
- <!-- 关联专业弹出框 -->
|
|
|
|
- <el-dialog
|
|
|
|
- :title="specialtyDialogTitle"
|
|
|
|
- :visible.sync="specialtyDialog"
|
|
|
|
- width="800px"
|
|
|
|
- :modal="false"
|
|
|
|
- append-to-body
|
|
|
|
- custom-class="side-dialog"
|
|
|
|
- >
|
|
|
|
- <!-- 表单 -->
|
|
|
|
- <el-form :inline="true" :model="specialtySearchForm">
|
|
|
|
- <el-form-item label="专业名称">
|
|
|
|
- <el-input
|
|
|
|
- v-model="specialtySearchForm.name"
|
|
|
|
- placeholder="请输入专业名称"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="专业代码">
|
|
|
|
- <el-input
|
|
|
|
- v-model="specialtySearchForm.code"
|
|
|
|
- placeholder="请输入专业代码"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-search"
|
|
|
|
- @click="searchSpecialtyPage"
|
|
|
|
- >
|
|
|
|
- 查询
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- size="small"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-plus"
|
|
|
|
- @click="addRelation"
|
|
|
|
- >
|
|
|
|
- 新增
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- <!-- 专业列表 -->
|
|
|
|
- <el-table :data="specialtyTableData" border>
|
|
|
|
- <el-table-column prop="id" label="ID" width="100" />
|
|
|
|
- <el-table-column prop="name" label="专业名称" width="250" />
|
|
|
|
- <el-table-column prop="code" label="专业代码" />
|
|
|
|
- <el-table-column
|
|
|
|
- sortable
|
|
|
|
- prop="updateTime"
|
|
|
|
- label="更新时间"
|
|
|
|
- width="170"
|
|
|
|
- />
|
|
|
|
- <el-table-column label="操作">
|
|
|
|
- <div slot-scope="scope">
|
|
|
|
- <span>
|
|
|
|
- <el-button
|
|
|
|
- size="mini"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-edit"
|
|
|
|
- plain
|
|
|
|
- @click="deleteRelation(scope.row)"
|
|
|
|
- >
|
|
|
|
- 取消关联
|
|
|
|
- </el-button>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <div class="part-page">
|
|
|
|
- <el-pagination
|
|
|
|
- :current-page="currentSpecialtyPage"
|
|
|
|
- :page-size="10"
|
|
|
|
- :total="specialtyTotal"
|
|
|
|
- @current-change="handleSpecialtyCurrentChange"
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- <!-- 添加关联 -->
|
|
|
|
- <el-dialog
|
|
|
|
- title="添加关联专业"
|
|
|
|
- :visible.sync="addRelationDialog"
|
|
|
|
- width="520px"
|
|
|
|
- :modal="false"
|
|
|
|
- append-to-body
|
|
|
|
- custom-class="side-dialog"
|
|
|
|
- @close="() => $refs.addRelationForm.clearValidate()"
|
|
|
|
- >
|
|
|
|
- <el-form
|
|
|
|
- ref="addRelationForm"
|
|
|
|
- :inline="true"
|
|
|
|
- inline-message
|
|
|
|
- class="form-tight"
|
|
|
|
- :model="addRelationForm"
|
|
|
|
- :rules="addRelationRules"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="专业" prop="specialtyId">
|
|
|
|
- <el-select
|
|
|
|
- v-model="addRelationForm.specialtyId"
|
|
|
|
- class="dialog-input-width"
|
|
|
|
- remote
|
|
|
|
- :remote-method="getSpecialtyList4AddRelation"
|
|
|
|
- :loading="specialtyLoading4AddRelation"
|
|
|
|
- filterable
|
|
|
|
- clearable
|
|
|
|
- placeholder="请选择"
|
|
|
|
- @focus="(e) => getSpecialtyList4AddRelation(e.target.value)"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in specialtyList4AddRelationWrapper"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <div slot="footer">
|
|
|
|
- <el-button type="primary" @click="submitAddRelationForm">
|
|
|
|
- 保存
|
|
|
|
- </el-button>
|
|
|
|
- <el-button @click="addRelationDialog = false">取消</el-button>
|
|
|
|
- </div>
|
|
|
|
- </el-dialog>
|
|
|
|
</section>
|
|
</section>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -490,14 +344,11 @@ export default {
|
|
name: "Course",
|
|
name: "Course",
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- specialtyLoading4Search: false,
|
|
|
|
- specialtyList4Search: [],
|
|
|
|
formSearch: {
|
|
formSearch: {
|
|
name: "",
|
|
name: "",
|
|
code: "",
|
|
code: "",
|
|
enable: "",
|
|
enable: "",
|
|
level: "",
|
|
level: "",
|
|
- specialtyId: "",
|
|
|
|
},
|
|
},
|
|
courseForm: {
|
|
courseForm: {
|
|
id: null,
|
|
id: null,
|
|
@@ -513,11 +364,6 @@ export default {
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
total: 10,
|
|
total: 10,
|
|
- specialtyAllList: [],
|
|
|
|
- specialtyList: [],
|
|
|
|
- selectedSpecialtyList: [],
|
|
|
|
- specialtys: [],
|
|
|
|
- specialtyAll: [],
|
|
|
|
|
|
|
|
impDialog: false,
|
|
impDialog: false,
|
|
uploadAction: QUESTION_API + "/course/import",
|
|
uploadAction: QUESTION_API + "/course/import",
|
|
@@ -562,35 +408,6 @@ export default {
|
|
},
|
|
},
|
|
],
|
|
],
|
|
},
|
|
},
|
|
- specialtyDialog: false,
|
|
|
|
- specialtyDialogTitle: null,
|
|
|
|
- specialtySearchForm: {
|
|
|
|
- courseId: null,
|
|
|
|
- code: "",
|
|
|
|
- name: "",
|
|
|
|
- },
|
|
|
|
- specialtyTableData: [],
|
|
|
|
- currentSpecialtyPage: 1,
|
|
|
|
- specialtyPageSize: 10,
|
|
|
|
- specialtyTotal: 10,
|
|
|
|
-
|
|
|
|
- addRelationDialog: false,
|
|
|
|
- addRelationForm: {
|
|
|
|
- specialtyId: null,
|
|
|
|
- courseId: null,
|
|
|
|
- },
|
|
|
|
- specialtyLoading4AddRelation: false,
|
|
|
|
- specialtyList4AddRelation: [],
|
|
|
|
- addRelationRules: {
|
|
|
|
- specialtyId: [
|
|
|
|
- {
|
|
|
|
- required: true,
|
|
|
|
- type: "number",
|
|
|
|
- message: "请选择专业",
|
|
|
|
- trigger: "change",
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -611,43 +428,6 @@ export default {
|
|
}
|
|
}
|
|
return courseIds;
|
|
return courseIds;
|
|
},
|
|
},
|
|
- specialtyAllListSelect() {
|
|
|
|
- let specialtyList = [];
|
|
|
|
- for (let specialty of this.specialtyAllList) {
|
|
|
|
- let specialtyInfo = specialty.name + "(" + specialty.code + ")";
|
|
|
|
- specialtyList.push({ id: specialty.id, specialtyInfo: specialtyInfo });
|
|
|
|
- }
|
|
|
|
- return specialtyList;
|
|
|
|
- },
|
|
|
|
- getSpecialtyAllSelect4Search() {
|
|
|
|
- let specialtyList4Search = [];
|
|
|
|
- for (let specialty of this.specialtys) {
|
|
|
|
- let specialtyInfo = specialty.name + "(" + specialty.code + ")";
|
|
|
|
- specialtyList4Search.push({
|
|
|
|
- id: specialty.id,
|
|
|
|
- specialtyInfo: specialtyInfo,
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- return specialtyList4Search;
|
|
|
|
- },
|
|
|
|
- specialtyList4SearchWrapper() {
|
|
|
|
- var specialtyList = [];
|
|
|
|
- for (let course of this.specialtyList4Search) {
|
|
|
|
- var name = course.name + " - " + course.code;
|
|
|
|
- var id = course.id;
|
|
|
|
- specialtyList.push({ id: id, name: name });
|
|
|
|
- }
|
|
|
|
- return specialtyList;
|
|
|
|
- },
|
|
|
|
- specialtyList4AddRelationWrapper() {
|
|
|
|
- var specialtyList = [];
|
|
|
|
- for (let course of this.specialtyList4AddRelation) {
|
|
|
|
- var name = course.name + " - " + course.code;
|
|
|
|
- var id = course.id;
|
|
|
|
- specialtyList.push({ id: id, name: name });
|
|
|
|
- }
|
|
|
|
- return specialtyList;
|
|
|
|
- },
|
|
|
|
},
|
|
},
|
|
//初始化查询
|
|
//初始化查询
|
|
created() {
|
|
created() {
|
|
@@ -666,22 +446,6 @@ export default {
|
|
dialogBeforeClose() {
|
|
dialogBeforeClose() {
|
|
this.$refs.courseForm.clearValidate();
|
|
this.$refs.courseForm.clearValidate();
|
|
},
|
|
},
|
|
- deleteRelation(row) {
|
|
|
|
- var specialtyId = row.id;
|
|
|
|
- var courseId = this.specialtySearchForm.courseId;
|
|
|
|
- var param = new URLSearchParams({
|
|
|
|
- courseId: courseId,
|
|
|
|
- specialtyId: specialtyId,
|
|
|
|
- });
|
|
|
|
- var url = QUESTION_API + "/courseSpeciatlyRelation/delete?" + param;
|
|
|
|
- this.$httpWithMsg.delete(url).then(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "success",
|
|
|
|
- message: "取消关联成功!",
|
|
|
|
- });
|
|
|
|
- this.searchSpecialtyPage();
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
submitAddRelationForm() {
|
|
submitAddRelationForm() {
|
|
this.$refs.addRelationForm.validate((valid) => {
|
|
this.$refs.addRelationForm.validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
@@ -692,7 +456,6 @@ export default {
|
|
type: "success",
|
|
type: "success",
|
|
message: "添加成功!",
|
|
message: "添加成功!",
|
|
});
|
|
});
|
|
- this.searchSpecialtyPage();
|
|
|
|
this.addRelationDialog = false;
|
|
this.addRelationDialog = false;
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -701,50 +464,6 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- getSpecialtyList4AddRelation(query) {
|
|
|
|
- this.specialtyLoading4AddRelation = true;
|
|
|
|
- this.$httpWithMsg
|
|
|
|
- .get(QUESTION_API + "/specialty/query?name=" + query)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.specialtyList4AddRelation = response.data;
|
|
|
|
- this.specialtyLoading4AddRelation = false;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- addRelation() {
|
|
|
|
- this.addRelationForm.specialtyId = null;
|
|
|
|
- this.addRelationForm.courseId = this.specialtySearchForm.courseId;
|
|
|
|
- this.addRelationDialog = true;
|
|
|
|
- if (this.$refs.addRelationForm) {
|
|
|
|
- this.$refs.addRelationForm.resetFields();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleSpecialtyCurrentChange(val) {
|
|
|
|
- this.currentSpecialtyPage = val;
|
|
|
|
- this.searchSpecialtyPage();
|
|
|
|
- },
|
|
|
|
- searchSpecialtyPage() {
|
|
|
|
- var param = new URLSearchParams(this.specialtySearchForm);
|
|
|
|
- var url =
|
|
|
|
- QUESTION_API +
|
|
|
|
- "/specialty/specialtyPage/" +
|
|
|
|
- (this.currentSpecialtyPage - 1) +
|
|
|
|
- "/" +
|
|
|
|
- this.pageSize +
|
|
|
|
- "?" +
|
|
|
|
- param;
|
|
|
|
- this.$httpWithMsg
|
|
|
|
- .get(url)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.specialtyTableData = response.data.content;
|
|
|
|
- this.specialtyTotal = response.data.totalElements;
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- if (this.specialtyTableData.length === 0 && this.specialtyTotal > 0) {
|
|
|
|
- this.currentSpecialtyPage = this.currentSpecialtyPage - 1;
|
|
|
|
- this.searchSpecialtyPage();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
getTag(status) {
|
|
getTag(status) {
|
|
if (status == true) {
|
|
if (status == true) {
|
|
return "success";
|
|
return "success";
|
|
@@ -764,15 +483,6 @@ export default {
|
|
return "不限";
|
|
return "不限";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getSpecialtyList4Search(query) {
|
|
|
|
- this.specialtyLoading4Search = true;
|
|
|
|
- this.$httpWithMsg
|
|
|
|
- .get(QUESTION_API + "/specialty/query?name=" + query)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.specialtyList4Search = response.data;
|
|
|
|
- this.specialtyLoading4Search = false;
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
handleSearchBtn() {
|
|
handleSearchBtn() {
|
|
this.currentPage = 1;
|
|
this.currentPage = 1;
|
|
this.searchForm();
|
|
this.searchForm();
|
|
@@ -846,21 +556,6 @@ export default {
|
|
);
|
|
);
|
|
},
|
|
},
|
|
|
|
|
|
- //关联课程
|
|
|
|
- relation(row) {
|
|
|
|
- this.specialtyDialogTitle =
|
|
|
|
- "关联专业列表 【课程名称:" +
|
|
|
|
- row.name +
|
|
|
|
- "】【 课程代码:" +
|
|
|
|
- row.code +
|
|
|
|
- "】";
|
|
|
|
- this.specialtySearchForm.courseId = row.id;
|
|
|
|
- this.specialtySearchForm.name = "";
|
|
|
|
- this.specialtySearchForm.code = "";
|
|
|
|
-
|
|
|
|
- this.searchSpecialtyPage();
|
|
|
|
- this.specialtyDialog = true;
|
|
|
|
- },
|
|
|
|
closeCourse() {
|
|
closeCourse() {
|
|
this.courseDialog = false;
|
|
this.courseDialog = false;
|
|
},
|
|
},
|
|
@@ -915,7 +610,6 @@ export default {
|
|
code: "",
|
|
code: "",
|
|
enable: "",
|
|
enable: "",
|
|
level: "",
|
|
level: "",
|
|
- specialtyId: "",
|
|
|
|
};
|
|
};
|
|
this.$refs.primaryForm.resetFields();
|
|
this.$refs.primaryForm.resetFields();
|
|
},
|
|
},
|