|
|
|
@ -10,7 +10,16 @@
|
|
|
|
|
<a-button type="primary" @click="toAdd">新增</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
|
|
|
|
|
<div slot="honorPhoto" slot-scope="text, record" class="idPhotoContent">
|
|
|
|
|
<Upload :type="2" :multiple="false" :option="{}" :canDownload="false"
|
|
|
|
|
:fileData="record.fileList"
|
|
|
|
|
:canUpload="false"
|
|
|
|
|
ref="fileUpload"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
|
<a @click="toView(record)">查看</a>
|
|
|
|
|
<a-divider type="vertical"/>
|
|
|
|
|
<a @click="toDelete(record)">删除</a>
|
|
|
|
|
</span>
|
|
|
|
|
</a-table>
|
|
|
|
@ -26,6 +35,7 @@
|
|
|
|
|
@cancel="handleCancel">
|
|
|
|
|
是否确定删除此条信息?
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<template v-if="pageType === 1">
|
|
|
|
|
<HonorInfo @cancel="cancel" @submit="submit" :categoryType="categoryType"/>
|
|
|
|
|
</template>
|
|
|
|
@ -33,8 +43,9 @@
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import InterConfig from '../interConfig';
|
|
|
|
|
import {Table, Pagination, Button, Select, Modal} from 'ant-design-vue';
|
|
|
|
|
import {Table, Pagination, Button, Select, Modal, Divider} from 'ant-design-vue';
|
|
|
|
|
import _ from 'lodash';
|
|
|
|
|
import Upload from '../../../../../../components/common/uploader/Upload.vue';
|
|
|
|
|
import HonorInfo from './honorInfo.vue';
|
|
|
|
|
const tableColumn = [
|
|
|
|
|
{
|
|
|
|
@ -63,29 +74,30 @@
|
|
|
|
|
return {
|
|
|
|
|
pageType: 0,//0 列表页面 1 新增页面
|
|
|
|
|
categoryType: 0,// 5 教师 6 学生
|
|
|
|
|
categoryId: 0,
|
|
|
|
|
categoryId: "",
|
|
|
|
|
categoryList: [
|
|
|
|
|
{category_id: 0, category_name: "全部"},
|
|
|
|
|
{category_id: 1, category_name: "模范教师"},
|
|
|
|
|
{category_id: 2, category_name: "优秀教师"},
|
|
|
|
|
{category_id: 3, category_name: "骨干教师"},
|
|
|
|
|
{category_id: 4, category_name: "特级名师"},
|
|
|
|
|
{category_id: 5, category_name: "教学名师"}
|
|
|
|
|
{category_id: "", category_name: "全部"},
|
|
|
|
|
// {category_id: 1, category_name: "模范教师"},
|
|
|
|
|
// {category_id: 2, category_name: "优秀教师"},
|
|
|
|
|
// {category_id: 3, category_name: "骨干教师"},
|
|
|
|
|
// {category_id: 4, category_name: "特级名师"},
|
|
|
|
|
// {category_id: 5, category_name: "教学名师"}
|
|
|
|
|
],
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageSize: 3,
|
|
|
|
|
totalPage: 0,
|
|
|
|
|
totalNum: 0,
|
|
|
|
|
tableColumn: [],
|
|
|
|
|
dataList: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
honorId:"",
|
|
|
|
|
honorId: "",
|
|
|
|
|
visible: false,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created(){
|
|
|
|
|
this.categoryType = this.$props.menuId === "studentHonor" ? 6 : 5;
|
|
|
|
|
this.buildTableColumn();
|
|
|
|
|
this.getCategoryList();
|
|
|
|
|
this.getHonorList();
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
@ -95,11 +107,32 @@
|
|
|
|
|
menuId: function (newId) {
|
|
|
|
|
this.pageType = 0;
|
|
|
|
|
this.categoryType = newId === "studentHonor" ? 6 : 5;
|
|
|
|
|
this.categoryList = [
|
|
|
|
|
{category_id: "", category_name: "全部"}];
|
|
|
|
|
this.categoryId = "";
|
|
|
|
|
this.buildTableColumn();
|
|
|
|
|
this.getCategoryList();
|
|
|
|
|
this.getHonorList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getCategoryList: function () {
|
|
|
|
|
let param = {
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
category_type: this.categoryType,
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.getCategories.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getCategories.method,
|
|
|
|
|
isTestLogin: InterConfig.getCategories.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
|
this.categoryList.push(...resData.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
buildTableColumn: function () {
|
|
|
|
|
this.tableColumn = _.cloneDeep(tableColumn);
|
|
|
|
|
if (this.categoryType === 5) {
|
|
|
|
@ -121,11 +154,18 @@
|
|
|
|
|
}
|
|
|
|
|
this.tableColumn.push(
|
|
|
|
|
...[{
|
|
|
|
|
dataIndex: 'create_time',
|
|
|
|
|
key: 'createTime',
|
|
|
|
|
title: '创建时间',
|
|
|
|
|
align: "center"
|
|
|
|
|
dataIndex: 'honor_photo',
|
|
|
|
|
key: 'honorPhoto',
|
|
|
|
|
title: '获奖照片',
|
|
|
|
|
align: "center",
|
|
|
|
|
scopedSlots: {customRender: 'honorPhoto'},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'create_time',
|
|
|
|
|
key: 'createTime',
|
|
|
|
|
title: '创建时间',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
key: 'action',
|
|
|
|
@ -138,7 +178,7 @@
|
|
|
|
|
let param = {
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
category_type: this.categoryType,
|
|
|
|
|
category_id: "",
|
|
|
|
|
category_id: this.categoryId,
|
|
|
|
|
page_number: this.pageNumber,
|
|
|
|
|
page_size: this.pageSize
|
|
|
|
|
}
|
|
|
|
@ -156,6 +196,12 @@
|
|
|
|
|
if (dataList && dataList.length > 0) {
|
|
|
|
|
for (let i = 0, len = dataList.length; i < len; i++) {
|
|
|
|
|
dataList[i]['index'] = i + 1 + ((this.pageNumber - 1) * 10);
|
|
|
|
|
let fileList = [];
|
|
|
|
|
let fileJson = dataList[i]['attachment_json'];
|
|
|
|
|
if (fileJson && fileJson !== "") {
|
|
|
|
|
fileList.push(...JSON.parse(fileJson));
|
|
|
|
|
}
|
|
|
|
|
dataList[i]['fileList'] = fileList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.dataList = dataList;
|
|
|
|
@ -172,6 +218,7 @@
|
|
|
|
|
categoryChange: function (value) {
|
|
|
|
|
if (this.categoryId !== value) {
|
|
|
|
|
this.categoryId = value;
|
|
|
|
|
this.getHonorList();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
toAdd: function () {
|
|
|
|
@ -181,6 +228,9 @@
|
|
|
|
|
this.honorId = record.honor_id;
|
|
|
|
|
this.visible = true;
|
|
|
|
|
},
|
|
|
|
|
toView: function (record) {
|
|
|
|
|
this.honorId = record.honor_id;
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
this.pageType = 0;
|
|
|
|
|
this.getHonorList();
|
|
|
|
@ -235,7 +285,7 @@
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//取消
|
|
|
|
|
handleCancel:function () {
|
|
|
|
|
handleCancel: function () {
|
|
|
|
|
this.honorId = "";
|
|
|
|
|
this.visible = false;
|
|
|
|
|
}
|
|
|
|
@ -247,7 +297,9 @@
|
|
|
|
|
ASelect: Select,
|
|
|
|
|
ASelectOption: Select.Option,
|
|
|
|
|
AModal: Modal,
|
|
|
|
|
HonorInfo
|
|
|
|
|
ADivider: Divider,
|
|
|
|
|
HonorInfo,
|
|
|
|
|
Upload
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|