| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- import {
- postJ,
- post,
- get
- } from "@/utils/request";
- import Vue from "vue";
- /**
- * 查询文件夹分类数据
- * @data data
- */
- export async function getDocTreeListAPI(data) {
- const res = await postJ(Vue.prototype.apiUrl+'/fm/directory/selectTreeList', data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- /**
- * 查询文件数据
- * @data data
- */
- export async function filePageAPI(data) {
- const res = await postJ(Vue.prototype.apiUrl+'/fm/file/pageBusiness', data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- /**
- * 保存
- * @data data
- */
- export async function fileSaveAPI(data) {
- const res = await postJ(Vue.prototype.apiUrl+'/fm/file/save', data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- /**
- * 详情
- * @id id
- */
- export async function fileGetByIdAPI(id) {
- const res = await request.get(`/fm/file/getById/${id}`);
- if (res.data.code == 0) {
- return res.data.data;
- }
- return Promise.reject(new Error(res.data.message));
- }
- /**
- * ids查询文件列表
- * @data data
- */
- export async function queryIds(data) {
- const res = await postJ(Vue.prototype.apiUrl+'/fm/file/queryIds', data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 获取编码树
- export async function selectTreeList(data) {
- const res = await postJ(Vue.prototype.apiUrl+`/main/business_code_category/selectTreeList`, data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 获取右侧列表
- export async function listParentId(data) {
- const res = await postJ(Vue.prototype.apiUrl+`/main/business_code_category/listPageParentId`, data);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- /**
- * 上传文件
- * @param file 文件
- */
- export async function uploadFileNew (data) {
- const formData = new FormData();
- formData.append('multiPartFile', data.multiPartFile);
- formData.append('module', data.module);
- const res = await post(Vue.prototype.apiUrl+'/main/file/uploadFile', formData);
- if (res.code === '0') {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
- // 编码方案
- export async function listCode() {
- const res = await get(Vue.prototype.apiUrl+`/main/business_code_category/listCode/WD0001`);
- if (res.code == 0) {
- return res.data;
- }
- return Promise.reject(new Error(res.message));
- }
|