洋浦学校 师生荣誉列表

init
gongdi 3 years ago
parent 88a434707a
commit 4528800e2f

@ -0,0 +1,178 @@
<template>
<div class="honor-list-content-style">
<template v-if="pageType === 0">
<div class="search-and-add-style">
<a-button type="primary" @click="toAdd"></a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
<span slot="action" slot-scope="text, record">
<a @click="toDelete(record)"></a>
</span>
</a-table>
<a-pagination v-if="totalPage > 1" v-model="pageNumber" :pageSize="pageSize" :total="totalNum"
@change="onPageChange"/>
</template>
</div>
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Pagination, Button} from 'ant-design-vue';
import _ from 'lodash';
const tableColumn = [
{
dataIndex: 'index',
key: 'index',
title: '序号',
width: "80px",
align: "center"
},
{
dataIndex: 'honor_person_name',
key: 'honorPersonName',
title: '人员姓名',
align: "center"
},
{
dataIndex: 'category_name',
key: 'categoryName',
title: '荣誉称号',
align: "center"
}
]
export default{
props: ["menuId"],
data(){
return {
pageType: 0,//0 1
categoryType: 0,// 5 6
pageNumber: 1,
pageSize: 10,
totalPage: 0,
totalNum: 0,
tableColumn: [],
dataList: [],
loading: false,
}
},
created(){
this.categoryType = this.$props.menuId === "studentHonor" ? 6 : 5;
this.buildTableColumn();
this.getHonorList();
},
mounted(){
},
watch: {
menuId: function (newId) {
this.categoryType = newId === "studentHonor" ? 6 : 5;
this.buildTableColumn();
this.getHonorList();
}
},
methods: {
buildTableColumn: function () {
this.tableColumn = _.cloneDeep(tableColumn);
if (this.categoryType === 5) {
//
this.tableColumn.push({
dataIndex: 'subject_name',
key: 'subjectName',
title: '学科',
align: "center"
})
} else if (this.categoryType === 6) {
//
this.tableColumn.push({
dataIndex: 'class_name',
key: 'className',
title: '班级',
align: "center"
})
}
this.tableColumn.push(
...[{
dataIndex: 'create_time',
key: 'createTime',
title: '创建时间',
align: "center"
},
{
title: '操作',
key: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}]
)
},
getHonorList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
category_type: this.categoryType,
category_id: "",
page_number: this.pageNumber,
page_size: this.pageSize
}
this.loading = true;
this.InterfaceConfig.callInterface([{
url: InterConfig.getHonorList.url,
params: param,
method: InterConfig.getHonorList.method,
isTestLogin: InterConfig.getHonorList.isTestLogin,
}], (result) => {
this.loading = false;
let resData = result[0].data;
if (resData.code === 2000) {
let dataList = resData.data.list;
if (dataList && dataList.length > 0) {
for (let i = 0, len = dataList.length; i < len; i++) {
dataList[i]['index'] = i + 1 + ((this.pageNumber - 1) * 10);
}
}
this.dataList = dataList;
this.totalNum = resData.data.total_row;
this.totalPage = resData.data.total_page;
}
})
},
toAdd: function () {
},
toDelete: function () {
}
},
components: {
ATable: Table,
APagination: Pagination,
AButton: Button
}
}
</script>
<style scoped lang="scss">
.honor-list-content-style {
width: 100%;
height: auto;
padding: 0.5rem;
.search-and-add-style {
width: 100%;
height: 3.5rem;
background-color: white;
margin-bottom: 0.5rem;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0.5rem;
}
.ant-table-wrapper {
/deep/ .upload-container-style {
display: flex;
justify-content: center;
align-items: center;
}
}
.ant-pagination {
margin-top: 0.5rem;
text-align: right;
}
}
</style>

@ -87,8 +87,8 @@ const InterfaceConfig = {
/*
* 值班人员信息列表-分页
* "bureau_id":"必填 int 机构id"
"staff_name":"非必填 string 值班职工姓名(搜索条件)"
"page_number":"非必填 number 【当前页码】"
"staff_name":"非必填 string 值班职工姓名(搜索条件)"
"page_number":"非必填 number 【当前页码】"
* */
'getListStaff': {
url: 'intellioa/center/duty/listStaff',
@ -97,8 +97,8 @@ const InterfaceConfig = {
},
/*
* 新增修改值班人员信息
* "staff_id""职工idnumber非必填填写时为修改"
* 新增修改值班人员信息
* "staff_id""职工idnumber非必填填写时为修改"
"staff_name""职工姓名string必填"
"position""职工职务string必填"
"telephone""联系电话string必填"
@ -112,9 +112,9 @@ const InterfaceConfig = {
},
/*
* 查看值班人员信息
* "staff_id": "必填 number【职工id】"
* */
* 查看值班人员信息
* "staff_id": "必填 number【职工id】"
* */
'viewStaff': {
url: 'intellioa/center/duty/viewStaff',
method: 'get',
@ -122,9 +122,9 @@ const InterfaceConfig = {
},
/*
* 删除值班人员信息存在关联关系如何处理
* "staff_ids""职工idsstring必填批量删除时以英文逗号分隔"
* "bureau_id":"必填 int 机构ID"
* 删除值班人员信息存在关联关系如何处理
* "staff_ids""职工idsstring必填批量删除时以英文逗号分隔"
* "bureau_id":"必填 int 机构ID"
* */
'deleteStaff': {
url: 'intellioa/center/duty/deleteStaff',
@ -133,9 +133,9 @@ const InterfaceConfig = {
},
/*
* 值班轮值列表-分页
* "bureau_id":"必填 int 机构id"
* */
* 值班轮值列表-分页
* "bureau_id":"必填 int 机构id"
* */
'getListRota': {
url: 'intellioa/center/duty/listRota',
method: 'get',
@ -154,8 +154,8 @@ const InterfaceConfig = {
},
/*
* 新增修改值班轮值信息
* "rota_id""轮值idnumber非必填填写即修改"
* 新增修改值班轮值信息
* "rota_id""轮值idnumber非必填填写即修改"
"rota_name""轮值名称string必填"
"staff_id_1""星期一值班职员idnumber非必填"
"staff_id_2""星期二值班职员idnumber非必填"
@ -175,8 +175,8 @@ const InterfaceConfig = {
},
/*
* "rota_ids""轮值idsstring必填批量删除时以英文逗号分隔"
* "bureau_id":"必填 int 机构ID"
* "rota_ids""轮值idsstring必填批量删除时以英文逗号分隔"
* "bureau_id":"必填 int 机构ID"
* */
'deleteRota': {
url: 'intellioa/center/duty/deleteRota',
@ -185,5 +185,19 @@ const InterfaceConfig = {
},
/*
* 师生荣誉列表-分页
* "bureau_id":"必填 int 机构id"
* "category_type":"必填 int 分类类型5-教师荣誉6-学生荣誉)"
* "category_id":"非必填 int 分类id"
* "page_number":"非必填 number 【当前页码】"
* "page_size":"非必填 number 【每页条数】"
* */
'getHonorList': {
url: 'intellioa/center/honor/list',
method: 'get',
isTestLogin: true,
},
};
export default InterfaceConfig;

Loading…
Cancel
Save