From 3fbd81920bdaf784ed424be76dbe5c928111d7a8 Mon Sep 17 00:00:00 2001 From: feiliming <275400898@qq.com> Date: Sat, 23 Apr 2022 12:30:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=8B=E6=B5=A6=E5=AD=A6=E6=A0=A1=20?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=B7=A5=E4=BD=9C=E5=8F=B0=20=E5=85=AB?= =?UTF-8?q?=E5=A4=A7=E4=B8=AD=E5=BF=83=20=E6=96=87=E6=A1=A3=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E5=89=8D=E7=AB=AF=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../servicePlatform/imgTextAdmin/imgAdmin.vue | 142 +++++++++++++++--- .../imgTextAdmin/pictureInfo.vue | 50 ++++-- .../servicePlatform/interConfig.js | 69 ++++++++- .../pages/adminCenter/systemConfig.js | 12 +- 4 files changed, 240 insertions(+), 33 deletions(-) diff --git a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/imgAdmin.vue b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/imgAdmin.vue index cf8deba..e212e9a 100644 --- a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/imgAdmin.vue +++ b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/imgAdmin.vue @@ -3,7 +3,7 @@ @@ -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) { diff --git a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/pictureInfo.vue b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/pictureInfo.vue index d5afa92..6646a5d 100644 --- a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/pictureInfo.vue +++ b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/imgTextAdmin/pictureInfo.vue @@ -2,7 +2,7 @@
-
*图片分类:
+
*{{this.$props.menuId === "imgAdmin"?'图片分类':'文档分类'}}:
@@ -12,9 +12,9 @@
-
*图片:
+
*{{this.$props.menuId === "imgAdmin"?'图片':'文档'}}:
- { let resData = result[0].data; if (resData.code === 2000) { @@ -109,14 +125,14 @@ submit:function () { if(this.categoryid === ""){ Modal.warning({ - title: "请选择图片分类", + title: this.$props.menuId === "imgAdmin"?"请选择图片分类":"请选择文档分类", content: "", centered: true }) } if(this.attachmentListJson.length === 0){ Modal.warning({ - title: "请选择图片", + title: this.$props.menuId === "imgAdmin"?"请选择图片":"请选择文档", content: "", centered: true }) @@ -128,11 +144,23 @@ identity_id: this.BaseConfig.userInfo.identity_id, bureau_id: this.BaseConfig.person_info_my.bureau_id, } + let url = ""; + let method = ""; + let isTestLogin = ""; + if(this.$props.menuId === "imgAdmin"){ + url = InterConfig.pictureSave.url; + method = InterConfig.pictureSave.method; + isTestLogin = InterConfig.pictureSave.isTestLogin; + }else if(this.$props.menuId === "documentAdmin"){ + url = InterConfig.documentSave.url; + method = InterConfig.documentSave.method; + isTestLogin = InterConfig.documentSave.isTestLogin; + } this.InterfaceConfig.callInterface([{ - url: InterConfig.pictureSave.url, + url: url, params: param, - method: InterConfig.pictureSave.method, - isTestLogin: InterConfig.pictureSave.isTestLogin, + method: method, + isTestLogin: isTestLogin, }], (result) => { this.pageLoading = false; let resData = result[0].data; diff --git a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/interConfig.js b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/interConfig.js index c7f393a..7cc640d 100644 --- a/src/views/screenAdaptation/pages/adminCenter/servicePlatform/interConfig.js +++ b/src/views/screenAdaptation/pages/adminCenter/servicePlatform/interConfig.js @@ -142,7 +142,7 @@ const InterfaceConfig = { isTestLogin: true, }, /* - 查看图片信息 + 删除图片信息 "picture_id": "必填 number【图片信息id】" * */ 'pictureDelete': { @@ -152,6 +152,73 @@ const InterfaceConfig = { }, + /* + 文档分类列表-不分页 + "bureau_id":"必填 int 机构id" + * */ + 'getDocumentCategories': { + url: 'intellioa/center/document/categories', + method: 'get', + isTestLogin: true, + }, + /* + 根据分类获取文档列表-分页 + "bureau_id":"必填 int 机构id" + "category_id":"必填 int 分类id + "page_number":"非必填 number 【当前页码】" + "page_size":"非必填 number 【每页条数】" + * */ + 'getDocumentList': { + url: 'intellioa/center/document/list', + method: 'get', + isTestLogin: true, + }, + /* + 查看文档信息 + "document_id": "必填 number【文档信息id】" + * */ + 'getDocumentInfo': { + url: 'intellioa/center/document/view', + method: 'get', + isTestLogin: true, + }, + /* + 新增文档信息(批量选择文档,保存为多个条目) + "category_id":"分类id,number,必填" + "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" + * */ + 'documentSave': { + url: 'intellioa/center/document/save', + method: 'post', + isTestLogin: true, + }, + /* + 删除文档信息 + "document_ids":"文档信息ids,string,必填,批量删除时以英文逗号分隔" + "bureau_id":"必填 int 机构ID" + * */ + 'documentDelete': { + url: 'intellioa/center/document/delete', + method: 'post', + isTestLogin: true, + }, + /* * 值班人员信息列表-分页 diff --git a/src/views/screenAdaptation/pages/adminCenter/systemConfig.js b/src/views/screenAdaptation/pages/adminCenter/systemConfig.js index 9f7506c..64d64c3 100644 --- a/src/views/screenAdaptation/pages/adminCenter/systemConfig.js +++ b/src/views/screenAdaptation/pages/adminCenter/systemConfig.js @@ -276,10 +276,18 @@ export const systemCenterConfig = [ title:'图文管理', menus:[ { - id:"1", + id:"imgText-1", title:"图片管理", path:'/workBench/servicePlatform/imgTextAdmin/:id/:name/:menuId', - name:'imgTextAdmin', + name:'imgAdmin', + component:() => import("./servicePlatform/imgTextAdmin/imgAdmin.vue"), + props:true, + }, + { + id:"imgText-2", + title:"文档管理", + path:'/workBench/servicePlatform/imgTextAdmin/:id/:name/:menuId', + name:'documentAdmin', component:() => import("./servicePlatform/imgTextAdmin/imgAdmin.vue"), props:true, },