|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
<template v-if="pageType === 0">
|
|
|
|
|
<div class="search-and-add-style">
|
|
|
|
|
<div>
|
|
|
|
|
<span style="margin:0 0.5rem">图片分类</span>
|
|
|
|
|
<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 }}
|
|
|
|
@ -14,7 +14,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false" class="imgListTable">
|
|
|
|
|
<div slot="photo" slot-scope="text, record" class="idPhotoContent">
|
|
|
|
|
<Upload :type="2" :multiple="false" :option="{}" :canDownload="false"
|
|
|
|
|
<Upload :type="menuid === 'imgAdmin'?2:1" :multiple="false" :option="{}" :canDownload="false"
|
|
|
|
|
:fileData="record.fileList"
|
|
|
|
|
:canUpload="false"
|
|
|
|
|
ref="fileUpload"
|
|
|
|
@ -37,7 +37,11 @@
|
|
|
|
|
是否确定删除此条信息?
|
|
|
|
|
</a-modal>
|
|
|
|
|
<template v-if="pageType === 1">
|
|
|
|
|
<PictureInfo :categoryId="categoryId" :pictureId="pictureId" @cancel="cancel"/>
|
|
|
|
|
<PictureInfo :categoryId="categoryId"
|
|
|
|
|
:pictureId="pictureId"
|
|
|
|
|
:menuId="menuid"
|
|
|
|
|
@cancel="cancel"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -46,7 +50,7 @@
|
|
|
|
|
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 tableColumn = [
|
|
|
|
|
const pictureTableColumn = [
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'index',
|
|
|
|
|
key: 'index',
|
|
|
|
@ -86,37 +90,102 @@
|
|
|
|
|
scopedSlots: {customRender: 'action'},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
const documentTableColumn = [
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'index',
|
|
|
|
|
key: 'index',
|
|
|
|
|
title: '序号',
|
|
|
|
|
width: "80px",
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'document_name',
|
|
|
|
|
key: 'documentName',
|
|
|
|
|
title: '文档名称',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'document_format',
|
|
|
|
|
key: 'documentFormat',
|
|
|
|
|
title: '文档格式',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'photo',
|
|
|
|
|
key: 'photo',
|
|
|
|
|
title: '文档',
|
|
|
|
|
align: "center",
|
|
|
|
|
scopedSlots: {customRender: 'photo'},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'create_time',
|
|
|
|
|
key: 'createTime',
|
|
|
|
|
title: '创建时间',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
key: 'action',
|
|
|
|
|
align: "center",
|
|
|
|
|
scopedSlots: {customRender: 'action'},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
export default{
|
|
|
|
|
props: ["menuId"],
|
|
|
|
|
props: {
|
|
|
|
|
menuId: {
|
|
|
|
|
type: String
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
menuid:this.$props.menuId,
|
|
|
|
|
pageType: 0,//0 列表页面 1 新增页面
|
|
|
|
|
categoryId: "",
|
|
|
|
|
categoryList: [],
|
|
|
|
|
tableColumn: tableColumn,
|
|
|
|
|
tableColumn: this.$props.menuId === 'imgAdmin'?pictureTableColumn:documentTableColumn,
|
|
|
|
|
dataList: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
visible: false,
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 3,
|
|
|
|
|
pageSize: this.$props.menuId === 'imgAdmin'?3:10,
|
|
|
|
|
totalPage: 0,
|
|
|
|
|
totalNum: 0,
|
|
|
|
|
pictureId:"",
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created(){
|
|
|
|
|
console.log("created:",this.$props.menuId)
|
|
|
|
|
this.getPictureCategories();
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
menuId: function (val) {
|
|
|
|
|
this.menuid = val;
|
|
|
|
|
this.getPictureCategories();
|
|
|
|
|
this.pageType = 0;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getPictureCategories: function () {
|
|
|
|
|
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: InterConfig.getPictureCategories.url,
|
|
|
|
|
url: url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getPictureCategories.method,
|
|
|
|
|
isTestLogin: InterConfig.getPictureCategories.isTestLogin,
|
|
|
|
|
method: method,
|
|
|
|
|
isTestLogin: isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
@ -133,6 +202,18 @@
|
|
|
|
|
this.getPictureList();
|
|
|
|
|
},
|
|
|
|
|
getPictureList: function () {
|
|
|
|
|
let url = "";
|
|
|
|
|
let method = "";
|
|
|
|
|
let isTestLogin = "";
|
|
|
|
|
if(this.menuid === "imgAdmin"){
|
|
|
|
|
url = InterConfig.getPictureList.url;
|
|
|
|
|
method = InterConfig.getPictureList.method;
|
|
|
|
|
isTestLogin = InterConfig.getPictureList.isTestLogin;
|
|
|
|
|
}else if(this.menuid === "documentAdmin"){
|
|
|
|
|
url = InterConfig.getDocumentList.url;
|
|
|
|
|
method = InterConfig.getDocumentList.method;
|
|
|
|
|
isTestLogin = InterConfig.getDocumentList.isTestLogin;
|
|
|
|
|
}
|
|
|
|
|
let param = {
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
category_id: this.categoryId,
|
|
|
|
@ -140,10 +221,10 @@
|
|
|
|
|
page_size: this.pageSize,
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.getPictureList.url,
|
|
|
|
|
url: url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getPictureList.method,
|
|
|
|
|
isTestLogin: InterConfig.getPictureList.isTestLogin,
|
|
|
|
|
method: method,
|
|
|
|
|
isTestLogin: isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
@ -179,10 +260,20 @@
|
|
|
|
|
},
|
|
|
|
|
toEdit: function (record) {
|
|
|
|
|
this.pageType = 1;
|
|
|
|
|
this.pictureId = record.picture_id + "";
|
|
|
|
|
if(this.menuid === "imgAdmin"){
|
|
|
|
|
this.pictureId = record.picture_id + "";
|
|
|
|
|
}
|
|
|
|
|
if(this.menuid === "documentAdmin"){
|
|
|
|
|
this.pictureId = record.document_id + "";
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
toDelete: function (record) {
|
|
|
|
|
this.pictureId = record.picture_id + "";
|
|
|
|
|
if(this.menuid === "imgAdmin"){
|
|
|
|
|
this.pictureId = record.picture_id + "";
|
|
|
|
|
}
|
|
|
|
|
if(this.menuid === "documentAdmin"){
|
|
|
|
|
this.pictureId = record.document_id + "";
|
|
|
|
|
}
|
|
|
|
|
this.visible = true;
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
@ -191,15 +282,28 @@
|
|
|
|
|
},
|
|
|
|
|
//确定删除
|
|
|
|
|
handleOk: function () {
|
|
|
|
|
let url = "";
|
|
|
|
|
let method = "";
|
|
|
|
|
let isTestLogin = "";
|
|
|
|
|
let param = {
|
|
|
|
|
picture_ids: this.pictureId,
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
}
|
|
|
|
|
if(this.menuid === "imgAdmin"){
|
|
|
|
|
url = InterConfig.pictureDelete.url;
|
|
|
|
|
method = InterConfig.pictureDelete.method;
|
|
|
|
|
isTestLogin = InterConfig.pictureDelete.isTestLogin;
|
|
|
|
|
param.picture_ids = this.pictureId;
|
|
|
|
|
}else if(this.menuid === "documentAdmin"){
|
|
|
|
|
url = InterConfig.documentDelete.url;
|
|
|
|
|
method = InterConfig.documentDelete.method;
|
|
|
|
|
isTestLogin = InterConfig.documentDelete.isTestLogin;
|
|
|
|
|
param.document_ids = this.pictureId;
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.pictureDelete.url,
|
|
|
|
|
url: url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.pictureDelete.method,
|
|
|
|
|
isTestLogin: InterConfig.pictureDelete.isTestLogin,
|
|
|
|
|
method: method,
|
|
|
|
|
isTestLogin: isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
|