洋浦学校八大中心 德育管理前端

init
gongdi 3 years ago
parent e1941cb9dc
commit 4cdeda1418

@ -2,17 +2,18 @@
<div class="img-text-list-content-style">
<template v-if="pageType === 0">
<div class="search-and-add-style">
<div>
<span style="margin:0 0.5rem">{{menuid === "imgAdmin"?'图片分类':'文档分类'}}</span>
<a-select :value="categoryId" @change="categoryChange">
<a-select-option v-for="item in categoryList" :key="item.category_id" :value="item.category_id">
{{ item.category_name }}
</a-select-option>
</a-select>
</div>
<!--<div>-->
<!--<span style="margin:0 0.5rem">{{menuid === "imgAdmin"?'图片分类':'文档分类'}}</span>-->
<!--<a-select :value="categoryId" @change="categoryChange">-->
<!--<a-select-option v-for="item in categoryList" :key="item.category_id" :value="item.category_id">-->
<!--{{ item.category_name }}-->
<!--</a-select-option>-->
<!--</a-select>-->
<!--</div>-->
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false" class="imgListTable">
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false"
class="imgListTable">
<div slot="photo" slot-scope="text, record" class="idPhotoContent">
<Upload :type="menuid === 'imgAdmin'?2:1" :multiple="false" :option="{}" :canDownload="false"
:fileData="record.fileList"
@ -39,7 +40,7 @@
<template v-if="pageType === 1">
<PictureInfo :categoryId="categoryId"
:pictureId="pictureId"
:menuId="menuid"
:menuType="menuType"
@cancel="cancel"
/>
</template>
@ -47,7 +48,7 @@
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input,Pagination} from 'ant-design-vue';
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input, Pagination} from 'ant-design-vue';
import PictureInfo from './pictureInfo';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
const pictureTableColumn = [
@ -130,6 +131,8 @@
scopedSlots: {customRender: 'action'},
}
]
const imgTableArr = ['moralEducationClassCulture', 'moralEducationPictureShow', 'moralEducationBeautifulShow','moralEducationPsychologicalInformationRoom','moralEducationPsychologicalClassRoom','moralEducationStudentActivity'];
const documentTableArr = ['moralEducationTwoCaseNineSystem', 'moralEducationPolicyFile'];
export default{
props: {
menuId: {
@ -138,19 +141,20 @@
},
data(){
return {
menuid:this.$props.menuId,
menuid: this.$props.menuId,
menuType: imgTableArr.indexOf(this.$props.menuId) > -1 ? "imgAdmin" : (documentTableArr.indexOf(this.$props.menuId) > -1 ? "documentAdmin" : ""),
pageType: 0,//0 1
categoryId: "",
categoryList: [],
tableColumn: this.$props.menuId === 'imgAdmin'?pictureTableColumn:documentTableColumn,
tableColumn: imgTableArr.indexOf(this.$props.menuId) > -1 ? pictureTableColumn : documentTableColumn,
dataList: [],
loading: false,
visible: false,
pageNumber: 1,
pageSize: this.$props.menuId === 'imgAdmin'?3:10,
pageSize: imgTableArr.indexOf(this.$props.menuId) > -1 ? 3 : 10,
totalPage: 0,
totalNum: 0,
pictureId:"",
pictureId: "",
}
},
created(){
@ -159,60 +163,97 @@
watch: {
menuId: function (val) {
this.menuid = val;
this.tableColumn = this.menuId === 'imgAdmin'?pictureTableColumn:documentTableColumn;
this.pageSize = this.menuId === 'imgAdmin'?3:10;
this.menuType = imgTableArr.indexOf(this.menuid) > -1 ? "imgAdmin" : (documentTableArr.indexOf(this.$props.menuId) > -1 ? "documentAdmin" : "");
this.tableColumn = this.menuType === "imgAdmin" ? pictureTableColumn : documentTableColumn;
this.pageSize = this.menuType === "imgAdmin" ? 3 : 10;
this.getPictureCategories();
this.pageType = 0;
}
},
methods: {
getPictureCategories: function () {
this.categoryList = [];
this.categoryId = "";
let url = "";
let method = "";
let isTestLogin = "";
if(this.menuid === "imgAdmin"){
url = InterConfig.getPictureCategories.url;
method = InterConfig.getPictureCategories.method;
isTestLogin = InterConfig.getPictureCategories.isTestLogin;
}else if(this.menuid === "documentAdmin"){
url = InterConfig.getDocumentCategories.url;
method = InterConfig.getDocumentCategories.method;
isTestLogin = InterConfig.getDocumentCategories.isTestLogin;
}
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
switch (this.menuid) {
case "moralEducationClassCulture":
//
this.categoryId = "2201";
break;
case "moralEducationPictureShow":
//
this.categoryId = "2211";
break;
case "moralEducationBeautifulShow":
//
this.categoryId = "2221";
break;
case "moralEducationTwoCaseNineSystem":
//
this.categoryId = "3201";
break;
case "moralEducationPolicyFile":
//
this.categoryId = "3202";
break;
case "moralEducationPsychologicalInformationRoom":
//
this.categoryId = "2231";
break;
case "moralEducationPsychologicalClassRoom":
//
this.categoryId = "2232";
break;
case "moralEducationStudentActivity":
//
this.categoryId = "2241";
break;
default:
break;
}
this.InterfaceConfig.callInterface([{
url: url,
params: param,
method: method,
isTestLogin: isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let categoryList = resData.data;
if(categoryList && categoryList.length > 0){
this.categoryList.push(...categoryList);
this.categoryId = categoryList[0].category_id;
this.getPictureList();
}
}
})
this.getPictureList();
// let url = "";
// let method = "";
// let isTestLogin = "";
// if(this.menuid === "imgAdmin"){
// url = InterConfig.getPictureCategories.url;
// method = InterConfig.getPictureCategories.method;
// isTestLogin = InterConfig.getPictureCategories.isTestLogin;
// }else if(this.menuid === "documentAdmin"){
// url = InterConfig.getDocumentCategories.url;
// method = InterConfig.getDocumentCategories.method;
// isTestLogin = InterConfig.getDocumentCategories.isTestLogin;
// }
// let param = {
// bureau_id: this.BaseConfig.person_info_my.bureau_id,
// }
// this.InterfaceConfig.callInterface([{
// url: url,
// params: param,
// method: method,
// isTestLogin: isTestLogin,
// }], (result) => {
// let resData = result[0].data;
// if (resData.code === 2000) {
// let categoryList = resData.data;
// if(categoryList && categoryList.length > 0){
// this.categoryList.push(...categoryList);
// this.categoryId = categoryList[0].category_id;
// this.getPictureList();
// }
// }
// })
},
search:function () {
search: function () {
this.getPictureList();
},
getPictureList: function () {
let url = "";
let method = "";
let isTestLogin = "";
if(this.menuid === "imgAdmin"){
if (this.menuType === "imgAdmin") {
url = InterConfig.getPictureList.url;
method = InterConfig.getPictureList.method;
isTestLogin = InterConfig.getPictureList.isTestLogin;
}else if(this.menuid === "documentAdmin"){
} else if (this.menuType === "documentAdmin") {
url = InterConfig.getDocumentList.url;
method = InterConfig.getDocumentList.method;
isTestLogin = InterConfig.getDocumentList.isTestLogin;
@ -263,18 +304,18 @@
},
toEdit: function (record) {
this.pageType = 1;
if(this.menuid === "imgAdmin"){
if (this.menuType === "imgAdmin") {
this.pictureId = record.picture_id + "";
}
if(this.menuid === "documentAdmin"){
if (this.menuType === "documentAdmin") {
this.pictureId = record.document_id + "";
}
},
toDelete: function (record) {
if(this.menuid === "imgAdmin"){
if (this.menuType === "imgAdmin") {
this.pictureId = record.picture_id + "";
}
if(this.menuid === "documentAdmin"){
if (this.menuType === "documentAdmin") {
this.pictureId = record.document_id + "";
}
this.visible = true;
@ -291,12 +332,12 @@
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
if(this.menuid === "imgAdmin"){
if (this.menuType === "imgAdmin") {
url = InterConfig.pictureDelete.url;
method = InterConfig.pictureDelete.method;
isTestLogin = InterConfig.pictureDelete.isTestLogin;
param.picture_ids = this.pictureId;
}else if(this.menuid === "documentAdmin"){
} else if (this.menuType === "documentAdmin") {
url = InterConfig.documentDelete.url;
method = InterConfig.documentDelete.method;
isTestLogin = InterConfig.documentDelete.isTestLogin;
@ -336,7 +377,7 @@
ACascader: Cascader,
AIcon: Icon,
AInput: Input,
APagination:Pagination,
APagination: Pagination,
PictureInfo,
Upload
}
@ -368,16 +409,16 @@
}
}
.imgListTable {
.ant-spin-nested-loading{
.ant-spin-container{
.ant-table{
.ant-table-content{
.ant-table-body{
.ant-table-tbody{
.ant-table-row{
td{
.idPhotoContent{
.upload-container-style{
.ant-spin-nested-loading {
.ant-spin-container {
.ant-table {
.ant-table-content {
.ant-table-body {
.ant-table-tbody {
.ant-table-row {
td {
.idPhotoContent {
.upload-container-style {
display: flex !important;
justify-content: center !important;
align-items: center !important;

@ -1,20 +1,20 @@
<template>
<div class="picture-info-content-style">
<a-spin :spinning="pageLoading">
<!--<div class="add-record-row-style">-->
<!--<div class="li-box li-left"><span class="must-option-style">*</span>{{this.$props.menuType === "imgAdmin"?'图片分类':'文档分类'}}</div>-->
<!--<div class="li-box li-right">-->
<!--<a-select :value="categoryid" @change="categoryChange">-->
<!--<a-select-option v-for="item in categoryList" :key="item.category_id" :value="item.category_id">-->
<!--{{ item.category_name }}-->
<!--</a-select-option>-->
<!--</a-select>-->
<!--</div>-->
<!--</div>-->
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>{{this.$props.menuId === "imgAdmin"?'图片分类':'文档分类'}}</div>
<div class="li-box li-left"><span class="must-option-style">*</span>{{this.$props.menuType === "imgAdmin"?'图片':'文档'}}</div>
<div class="li-box li-right">
<a-select :value="categoryid" @change="categoryChange">
<a-select-option v-for="item in categoryList" :key="item.category_id" :value="item.category_id">
{{ item.category_name }}
</a-select-option>
</a-select>
</div>
</div>
<div class="add-record-row-style">
<div class="li-box li-left"><span class="must-option-style">*</span>{{this.$props.menuId === "imgAdmin"?'图片':'文档'}}</div>
<div class="li-box li-right">
<Upload :type="this.$props.menuId === 'imgAdmin'?2:1" :multiple="multiple" title="点击上传" :option="{}" :canDownload="false"
<Upload :type="this.$props.menuType === 'imgAdmin'?2:1" :multiple="multiple" title="点击上传" :option="{}" :canDownload="false"
ref="fileUpload"
:fileData="attachmentListJson"
@uploadComplete="uploadComplete"
@ -44,7 +44,7 @@
type:String,
default:""
},
menuId:{
menuType:{
type:String,
default:""
}
@ -70,11 +70,11 @@
let url = "";
let method = "";
let isTestLogin = "";
if(this.$props.menuId === "imgAdmin"){
if(this.$props.menuType === "imgAdmin"){
url = InterConfig.getPictureCategories.url;
method = InterConfig.getPictureCategories.method;
isTestLogin = InterConfig.getPictureCategories.isTestLogin;
}else if(this.$props.menuId === "documentAdmin"){
}else if(this.$props.menuType === "documentAdmin"){
url = InterConfig.getDocumentCategories.url;
method = InterConfig.getDocumentCategories.method;
isTestLogin = InterConfig.getDocumentCategories.isTestLogin;
@ -95,7 +95,6 @@
this.categoryList.push(...categoryList);
}
}
console.log("this.categoryList:",this.categoryList)
})
},
categoryChange:function (value) {
@ -126,7 +125,7 @@
submit:function () {
if(this.categoryid === ""){
Modal.warning({
title: this.$props.menuId === "imgAdmin"?"请选择图片分类":"请选择文档分类",
title: this.$props.menuType === "imgAdmin"?"请选择图片分类":"请选择文档分类",
content: "",
centered: true
})
@ -134,7 +133,7 @@
}
if(this.attachmentListJson.length === 0){
Modal.warning({
title: this.$props.menuId === "imgAdmin"?"请选择图片":"请选择文档",
title: this.$props.menuType === "imgAdmin"?"请选择图片":"请选择文档",
content: "",
centered: true
})
@ -150,11 +149,11 @@
let url = "";
let method = "";
let isTestLogin = "";
if(this.$props.menuId === "imgAdmin"){
if(this.$props.menuType === "imgAdmin"){
url = InterConfig.pictureSave.url;
method = InterConfig.pictureSave.method;
isTestLogin = InterConfig.pictureSave.isTestLogin;
}else if(this.$props.menuId === "documentAdmin"){
}else if(this.$props.menuType === "documentAdmin"){
url = InterConfig.documentSave.url;
method = InterConfig.documentSave.method;
isTestLogin = InterConfig.documentSave.isTestLogin;

@ -142,6 +142,27 @@
case "heartNurtureSelected":
categoryId = 1271;
break;
case "moralEducationAffairsNews":
categoryId = 1211;
break;
case "moralEducationTeamBuilding":
categoryId = 1221;
break;
case "moralEducationTeacherTrain":
categoryId = 1222;
break;
case "moralEducationPolicyWelfare":
categoryId = 1281;
break;
case "moralEducationSpecialEducation":
categoryId = 1282;
break;
case "moralEducationHomeEducation":
categoryId = 1291;
break;
case "moralEducationActivityRecord":
categoryId = 1292;
break;
default:
break;
}

@ -4,12 +4,14 @@
<a-layout-header>{{title}}</a-layout-header>
<a-layout>
<a-layout-sider>
<vue-scroll :ops="listScroll" style="height:100%">
<a-menu
:default-selected-keys="defaultKeys"
mode="inline"
theme="dark"
:open-keys.sync="openKeys"
:open-keys="openKeys"
:inline-collapsed="collapsed"
@openChange="onOpenChange"
>
<template v-for="menu,index in menuAry">
<a-sub-menu v-if="menu.children" :key="'sub-'+index">
@ -24,6 +26,7 @@
</a-menu-item>
</template>
</a-menu>
</vue-scroll>
</a-layout-sider>
<a-layout-content>
<!--业务page-->
@ -56,6 +59,7 @@
title: this.$props.name,
systemCenterList:_.cloneDeep(systemCenterConfig),
openKeys:[],
listScroll: this.StaticParams.scrollOption,
}
},
watch:{
@ -71,6 +75,10 @@
this.buildMenuAry();
},
methods: {
onOpenChange:function (openKeys) {
const latestOpenKey = openKeys.find(key => this.openKeys.indexOf(key) === -1);
this.openKeys = latestOpenKey ? [latestOpenKey] : [];
},
//
menuClick: function (menu) {
this.$router.replace({name: menu.name, params: {id: this.systemId, name: this.title, menuId: menu.name}})

File diff suppressed because it is too large Load Diff

@ -83,6 +83,7 @@
justify-content: flex-start;
transform: translateX(300px);
transition: transform 100ms linear;
z-index: 999;
.in-box-menu-list-style{
width: 310px;
height: 100%;

Loading…
Cancel
Save