|
@@ -1,6 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ :model="queryParams"
|
|
|
|
+ ref="queryForm"
|
|
|
|
+ size="small"
|
|
|
|
+ :inline="true"
|
|
|
|
+ v-show="showSearch"
|
|
|
|
+ label-width="68px"
|
|
|
|
+ >
|
|
<el-form-item label="学科名称" prop="dirName">
|
|
<el-form-item label="学科名称" prop="dirName">
|
|
<el-input
|
|
<el-input
|
|
v-model="queryParams.dirName"
|
|
v-model="queryParams.dirName"
|
|
@@ -10,8 +17,16 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleQuery"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
+ >重置</el-button
|
|
|
|
+ >
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
@@ -24,7 +39,8 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
v-hasPermi="['eas:direction:add']"
|
|
v-hasPermi="['eas:direction:add']"
|
|
- >新增</el-button>
|
|
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -35,7 +51,8 @@
|
|
:disabled="single"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['eas:direction:edit']"
|
|
v-hasPermi="['eas:direction:edit']"
|
|
- >修改</el-button>
|
|
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -46,7 +63,8 @@
|
|
:disabled="multiple"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
@click="handleDelete"
|
|
v-hasPermi="['eas:direction:remove']"
|
|
v-hasPermi="['eas:direction:remove']"
|
|
- >删除</el-button>
|
|
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -56,22 +74,33 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleExport"
|
|
@click="handleExport"
|
|
v-hasPermi="['eas:direction:export']"
|
|
v-hasPermi="['eas:direction:export']"
|
|
- >导出</el-button>
|
|
|
|
|
|
+ >导出</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
+ <right-toolbar
|
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
|
+ @queryTable="getList"
|
|
|
|
+ ></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="directionList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="directionList"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
- <el-table-column label="${comment}" align="center" prop="id" />
|
|
|
|
<el-table-column label="学科名称" align="center" prop="dirName" />
|
|
<el-table-column label="学科名称" align="center" prop="dirName" />
|
|
<el-table-column label="学科介绍" align="center" prop="dirDesc" />
|
|
<el-table-column label="学科介绍" align="center" prop="dirDesc" />
|
|
<el-table-column label="封面" align="center" prop="dirImg" width="100">
|
|
<el-table-column label="封面" align="center" prop="dirImg" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <image-preview :src="scope.row.dirImg" :width="50" :height="50"/>
|
|
|
|
|
|
+ <image-preview :src="scope.row.dirImg" :width="50" :height="50" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="操作"
|
|
|
|
+ align="center"
|
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
|
+ >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@@ -79,20 +108,22 @@
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['eas:direction:edit']"
|
|
v-hasPermi="['eas:direction:edit']"
|
|
- >修改</el-button>
|
|
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['eas:direction:remove']"
|
|
v-hasPermi="['eas:direction:remove']"
|
|
- >删除</el-button>
|
|
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
-
|
|
|
|
|
|
+
|
|
<pagination
|
|
<pagination
|
|
- v-show="total>0"
|
|
|
|
|
|
+ v-show="total > 0"
|
|
:total="total"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
@@ -106,10 +137,10 @@
|
|
<el-input v-model="form.dirName" placeholder="请输入学科名称" />
|
|
<el-input v-model="form.dirName" placeholder="请输入学科名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="学科介绍">
|
|
<el-form-item label="学科介绍">
|
|
- <editor v-model="form.dirDesc" :min-height="192"/>
|
|
|
|
|
|
+ <editor v-model="form.dirDesc" :min-height="192" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="封面" prop="dirImg">
|
|
<el-form-item label="封面" prop="dirImg">
|
|
- <image-upload v-model="form.dirImg"/>
|
|
|
|
|
|
+ <image-upload v-model="form.dirImg" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -121,7 +152,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listDirection, getDirection, delDirection, addDirection, updateDirection } from "@/api/eas/direction";
|
|
|
|
|
|
+import {
|
|
|
|
+ listDirection,
|
|
|
|
+ getDirection,
|
|
|
|
+ delDirection,
|
|
|
|
+ addDirection,
|
|
|
|
+ updateDirection,
|
|
|
|
+} from "@/api/eas/direction";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Direction",
|
|
name: "Direction",
|
|
@@ -151,13 +188,12 @@ export default {
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
dirName: null,
|
|
dirName: null,
|
|
dirDesc: null,
|
|
dirDesc: null,
|
|
- dirImg: null
|
|
|
|
|
|
+ dirImg: null,
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
- rules: {
|
|
|
|
- }
|
|
|
|
|
|
+ rules: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -167,7 +203,7 @@ export default {
|
|
/** 查询学科列表 */
|
|
/** 查询学科列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- listDirection(this.queryParams).then(response => {
|
|
|
|
|
|
+ listDirection(this.queryParams).then((response) => {
|
|
this.directionList = response.rows;
|
|
this.directionList = response.rows;
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -184,7 +220,7 @@ export default {
|
|
id: null,
|
|
id: null,
|
|
dirName: null,
|
|
dirName: null,
|
|
dirDesc: null,
|
|
dirDesc: null,
|
|
- dirImg: null
|
|
|
|
|
|
+ dirImg: null,
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -200,9 +236,9 @@ export default {
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
- this.ids = selection.map(item => item.id)
|
|
|
|
- this.single = selection.length!==1
|
|
|
|
- this.multiple = !selection.length
|
|
|
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
+ this.single = selection.length !== 1;
|
|
|
|
+ this.multiple = !selection.length;
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
@@ -213,8 +249,8 @@ export default {
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
this.reset();
|
|
- const id = row.id || this.ids
|
|
|
|
- getDirection(id).then(response => {
|
|
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getDirection(id).then((response) => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改学科";
|
|
this.title = "修改学科";
|
|
@@ -222,16 +258,16 @@ export default {
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
- updateDirection(this.form).then(response => {
|
|
|
|
|
|
+ updateDirection(this.form).then((response) => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- addDirection(this.form).then(response => {
|
|
|
|
|
|
+ addDirection(this.form).then((response) => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
@@ -243,19 +279,27 @@ export default {
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
- this.$modal.confirm('是否确认删除学科编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
- return delDirection(ids);
|
|
|
|
- }).then(() => {
|
|
|
|
- this.getList();
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ this.$modal
|
|
|
|
+ .confirm('是否确认删除学科编号为"' + ids + '"的数据项?')
|
|
|
|
+ .then(function () {
|
|
|
|
+ return delDirection(ids);
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
- this.download('eas/direction/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- }, `direction_${new Date().getTime()}.xlsx`)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ this.download(
|
|
|
|
+ "eas/direction/export",
|
|
|
|
+ {
|
|
|
|
+ ...this.queryParams,
|
|
|
|
+ },
|
|
|
|
+ `direction_${new Date().getTime()}.xlsx`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|