洋浦学校 我的工作台 八大中心 社团图片管理模块前端开发

init
feiliming 3 years ago
parent e267ff35af
commit e1b9658fec

@ -129,6 +129,7 @@
content: "",
centered: true
})
return
}
if(this.attachmentListJson.length === 0){
Modal.warning({
@ -136,6 +137,7 @@
content: "",
centered: true
})
return
}
let param = {
category_id: this.categoryid,

@ -815,5 +815,56 @@ const InterfaceConfig = {
method: 'post',
isTestLogin: true,
},
/*
* 社团图片列表-分页
"bureau_id":"必填 int 机构id"
"club_id":"必填 int 社团id"
"page_number":"非必填 number 【当前页码】"
"page_size":"非必填 number 【每页条数】"
* */
"getClubPictureList":{
url: 'intellioa/center/club/listPicture',
method: 'get',
isTestLogin: true,
},
/*
* 新增社团图片批量选择图片保存为多个条目
"club_id""社团信息idnumber必填"
"attachment_list_json":"必填 附件对象 对象列表属性需要JSON.stringify转成json字符串再传使用以下属性"
[{
"guid": "C6E451C1-AA32-0E3F-3E37-94BE1A544797",
"url_code": "room2.jpg",
"name": "room2.jpg",
"file_id": "C6E451C1-AA32-0E3F-3E37-94BE1A544797",
"resource_format": "jpg",
"resource_title": "room2.jpg",
"resource_type_name": "图片",
"resource_id_int": "210018190",
"id": "o_1fj58vlu1p2e3e91ns31t1k1n7am",
"resource_info_id": "210018578"
}]
"person_id":"必填 int 操作人ID"
"identity_id":"必填 int 操作人身份ID"
"bureau_id":"必填 int 机构ID"
* */
"saveClubPicture":{
url: 'intellioa/center/club/savePicture',
method: 'post',
isTestLogin: true,
},
/*
* 删除社团图片
"picture_ids""图片idsstring必填批量删除时以英文逗号分隔"
"club_id":"必填 int 社团id"
"bureau_id":"必填 int 机构ID"
* */
"deleteClubPicture":{
url: 'intellioa/center/club/deletePicture',
method: 'post',
isTestLogin: true,
},
};
export default InterfaceConfig;

@ -0,0 +1,259 @@
<template>
<div class="club-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>选择社团</div>
<div class="li-box li-right">
<a-select :value="clubid" @change="clubChange">
<a-select-option v-for="item in clubList" :key="item.club_id" :value="item.club_id">
{{ item.club_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>社团图片</div>
<div class="li-box li-right">
<Upload :type="2" :multiple="true" title="点击上传" :option="{}" :canDownload="false"
ref="fileUpload"
:fileData="attachmentListJson"
@uploadComplete="uploadComplete"
/>
</div>
</div>
<div class="add-record-row-style button-row-style">
<a-button type="primary" class="button-style" @click="submit">
提交
</a-button>
<a-button class="button-style" @click="cancel"></a-button>
</div>
</a-spin>
</div>
</template>
<script>
import InterConfig from '../interConfig';
import {Spin, Button, Cascader, Input, InputNumber, Modal, Select, DatePicker,Icon,TimePicker} from 'ant-design-vue';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
export default{
props:{
clubId:{
type:Number,
default:0
},
pictureId:{
type:String,
default:""
},
menuId:{
type:String,
default:""
}
},
created(){
this.getClubList();
},
data(){
return {
clubid:this.$props.clubId,
clubList: [],
pageLoading:false,
attachmentListJson:[],
}
},
methods:{
getClubList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
club_name: "",
page_number: 1,
page_size: 1000000,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getClublist.url,
params: param,
method: InterConfig.getClublist.method,
isTestLogin: InterConfig.getClublist.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let dataList = resData.data.list;
if(dataList && dataList.length > 0){
this.clubList = dataList;
}
}
})
},
clubChange:function (value) {
this.clubid = value;
},
uploadComplete:function(file){
this.attachmentListJson = file;
},
submit:function () {
if(this.clubid === ""){
Modal.warning({
title: "请选择社团",
content: "",
centered: true
})
return
}
if(this.attachmentListJson.length === 0){
Modal.warning({
title: "请选择图片",
content: "",
centered: true
})
return
}
let param = {
club_id: this.clubid,
attachment_list_json: JSON.stringify(this.attachmentListJson),
person_id: this.BaseConfig.userInfo.person_id,
identity_id: this.BaseConfig.userInfo.identity_id,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.saveClubPicture.url,
params: param,
method: InterConfig.saveClubPicture.method,
isTestLogin: InterConfig.saveClubPicture.isTestLogin,
}], (result) => {
this.pageLoading = false;
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.cancel();
}
})
},
cancel:function () {
this.$emit("cancel");
}
},
components:{
ASpin:Spin,
ASelect: Select,
ASelectOption: Select.Option,
Upload,
AButton:Button,
Modal
}
}
</script>
<style scoped lang="scss">
.club-picture-info-content-style {
width: 100%;
height: auto;
font-size: 1rem;
color: black;
.add-record-row-style {
width: 50%;
min-height: 3rem;
margin: 0.5rem auto;
display: flex;
.li-box {
min-height: 3rem;
line-height: 3rem;
.must-option-style {
color: red;
margin-right: 0.2rem;
}
}
.li-left {
width: 15%;
text-align: right;
}
.li-right {
width: 85%;
.person-list-content-style {
width: 700px;
height: 500px;
background-color: #ebebeb;
.list-content-style {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
.honor-person-info {
width: auto;
height: 180px;
border: 1px solid #31a8fa;
margin: 0.5rem 0 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
.person-name {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
/deep/ .img-style {
margin-right: 0 !important;
}
}
}
}
.ant-select {
width: 150px;
}
.no-border-input-style {
border-top: 0 !important;
border-left: 0 !important;
border-right: 0 !important;
}
.photo-container-style {
display: flex;
align-items: center;
align-content: center;
justify-content: center;
justify-items: center;
width: 120px !important;
border: 1px solid #e5e5e5;
height: 160px;
background-color: white;
position: relative;
.operate-class {
position: absolute;
bottom: 0.1rem;
color: #31a8fa;
font-size: 1rem;
cursor: pointer;
display: none;
}
.photo-size-style {
display: flex;
align-items: center;
align-content: center;
justify-items: center;
justify-content: center;
}
}
.edit-style {
&:hover {
.operate-class {
display: inline-block;
}
}
}
}
}
.button-row-style {
width: 50%;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
.button-style {
margin-left: 0.5rem;
}
}
}
</style>

@ -0,0 +1,269 @@
<template>
<div class="moral-club-img-list-content-style">
<template v-if="pageType === 0">
<div class="search-and-add-style">
<a-select :value="clubId" @change="clubChange">
<a-select-option v-for="item in clubList" :key="item.club_id" :value="item.club_id">
{{ item.club_name }}
</a-select-option>
</a-select>
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
</div>
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
<div slot="photo" 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="toDelete(record)"></a>
</span>
</a-table>
<a-pagination v-if="totalPage > 1" v-model="pageNumber" :pageSize="pageSize" :total="totalNum"
@change="onPageChange"/>
</template>
<a-modal title="提示"
:visible="visible"
centered
cancelText="取消"
okText="确定"
@ok="handleOk"
@cancel="handleCancel">
是否确定删除此条信息
</a-modal>
<template v-if="pageType === 1">
<ClubImgInfo :clubId="clubId" @cancel="cancel"/>
</template>
</div>
</template>
<script>
import InterConfig from '../interConfig';
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input,Pagination,DatePicker} from 'ant-design-vue';
import Upload from '../../../../../../components/common/uploader/Upload.vue';
import ClubImgInfo from './clubImgInfo';
const tableColumn = [
{
dataIndex: 'index',
key: 'index',
title: '序号',
width: "80px",
align: "center"
},
{
dataIndex: 'picture_name',
key: 'pictureName',
title: '图片名称',
align: "center"
},
{
dataIndex: 'picture_format',
key: 'pictureFormat',
title: '图片格式',
align: "center"
},
{
dataIndex: 'photo',
key: 'photo',
title: '图片',
align: "center",
scopedSlots: {customRender: 'photo'},
},
{
title: '操作',
key: 'action',
align: "center",
scopedSlots: {customRender: 'action'},
}
]
export default{
props: ["menuId"],
data(){
return {
pageType: 0,//0 1
clubName: "",//
tableColumn: tableColumn,
dataList: [],
loading: false,
pictureId:"",//ID
clubId: "",
clubList:[],
visible: false,
pageNumber: 1,
pageSize: 3,
totalPage: 0,
totalNum: 0,
}
},
created(){
this.getClubList();
},
mounted(){
},
methods: {
getClubList:function(){
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
club_name: "",
page_number: 1,
page_size: 1000000,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getClublist.url,
params: param,
method: InterConfig.getClublist.method,
isTestLogin: InterConfig.getClublist.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
let dataList = resData.data.list;
if(dataList && dataList.length > 0){
this.clubList = dataList;
this.clubId = dataList[0].club_id;
this.getClubImgList();
}
}
})
},
search:function () {
this.getClubImgList();
},
clubChange:function(value){
this.clubId = value;
this.getClubImgList();
},
getClubImgList: function () {
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
club_id: this.clubId,
page_number: this.pageNumber,
page_size: this.pageSize,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.getClubPictureList.url,
params: param,
method: InterConfig.getClubPictureList.method,
isTestLogin: InterConfig.getClubPictureList.isTestLogin,
}], (result) => {
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;
let fileList = [];
let fileJson = dataList[i]['attachment_json'];
if (fileJson && fileJson !== "") {
fileList.push(fileJson);
}
dataList[i]['fileList'] = fileList;
}
}
this.dataList = dataList;
this.totalNum = resData.data.total_row;
this.totalPage = resData.data.total_page;
}
})
},
onPageChange: function (page) {
this.pageNumber = page;
this.getClubImgList();
},
toAdd: function () {
this.pictureId = "";
this.pageType = 1;
},
toDelete: function (record) {
this.pictureId = record.picture_id + "";
this.visible = true;
},
cancel: function () {
this.pageType = 0;
this.getClubList();
},
//
handleOk: function () {
let param = {
picture_ids: this.pictureId,
club_id:this.clubId,
bureau_id: this.BaseConfig.person_info_my.bureau_id,
}
this.InterfaceConfig.callInterface([{
url: InterConfig.deleteClubPicture.url,
params: param,
method: InterConfig.deleteClubPicture.method,
isTestLogin: InterConfig.deleteClubPicture.isTestLogin,
}], (result) => {
let resData = result[0].data;
if (resData.code === 2000) {
Modal.success({
title: "操作成功",
content: "",
centered: true
});
this.handleCancel();
this.getClubImgList();
}
})
},
//
handleCancel: function () {
this.pictureId = "";
this.visible = false;
}
},
components: {
ATable: Table,
AButton: Button,
AModal: Modal,
ADivider: Divider,
AIcon: Icon,
AInput: Input,
APagination:Pagination,
AInputSearch: Input.Search,
ASelect: Select,
ASelectOption: Select.Option,
Upload,
ClubImgInfo
}
}
</script>
<style scoped lang="scss">
.moral-club-img-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-select {
width: 100px;
}
.ant-input {
width: 150px;
}
.add-button-style {
float: right;
}
}
.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>

@ -92,7 +92,6 @@
this.getClubList();
},
getClubList: function () {
console.log("getClubList")
let param = {
bureau_id: this.BaseConfig.person_info_my.bureau_id,
club_name: this.clubName,

@ -278,11 +278,19 @@ export const systemCenterConfig = [
{
id:"moralEducation-2-1",
title:"社团管理",
path:'/workBench/servicePlatform/moralEducationAssociation/:id/:name/:menuId',
name:'moralEducationAssociation',
path:'/workBench/servicePlatform/moralEducationClub/:id/:name/:menuId',
name:'moralEducationClub',
component:() => import("./servicePlatform/moralEducation/clubList.vue"),
props:true,
},
{
id:"moralEducation-2-2",
title:"社团图片管理",
path:'/workBench/servicePlatform/moralEducationClubImg/:id/:name/:menuId',
name:'moralEducationClubImg',
component:() => import("./servicePlatform/moralEducation/clubImgList.vue"),
props:true,
},
]
},
]

Loading…
Cancel
Save