|
|
|
@ -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;
|
|
|
|
|