| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- import axios from '../utils/request'
- import qs from 'qs'
- import CONFIG from '../utils/config'
- interface LoginParams {
- userName: string
- password: string
- clientId: string
- }
- interface DmsTypesParams {
- cName?: string
- aType?: string
- }
- interface UpdatePasswordParams {
- oldPassword: string
- newPassword: string
- userId?: string
- }
- interface UpdateContentParams {
- id: string
- content: string
- [key: string]: unknown
- }
- interface AddContentParams {
- content: string,
- columnId: number
- modelId: number
- }
- interface DmsDataListParams {
- pageNum?: number
- pageSize?: number
- [key: string]: unknown
- }
- interface ModelByIdParams {
- modelId: number
- }
- interface UpdateAuditParams {
- id: string
- columnId: number
- state: number
- }
- interface UploadFileParams {
- columnId: string
- contentId?: string
- paraName: string
- type: number
- file: File
- }
- const login = (params: LoginParams) => {
- return axios.post(CONFIG.OAUTH_URL + '/user/pwd/login', qs.stringify(params), {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- })
- }
- const updatePassword = (params: UpdatePasswordParams) => {
- return axios.post(CONFIG.OAUTH_URL + '/user/updatePassword', qs.stringify(params), {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- })
- }
- const getDmsTypes = (params: DmsTypesParams) => {
- return axios.post(CONFIG.DMS_URL + '/category/selectByCNameAType', qs.stringify(params))
- }
- const updateContent = (params: UpdateContentParams) => {
- return axios.post(CONFIG.DMS_URL + '/content/updateContent', qs.stringify(params))
- }
- const addContent = (params: AddContentParams) => {
- return axios.post(CONFIG.DMS_URL + '/content/addContent', qs.stringify(params))
- }
- const getDmsDataList = (params: DmsDataListParams) => {
- return axios.post(CONFIG.DMS_URL + '/content/selectContentList', qs.stringify(params))
- }
- const getMultipleFormsOfJointInvestigation = (params: DmsDataListParams) => {
- return axios.post(CONFIG.DMS_URL + '/content/multipleFormsOfJointInvestigation', qs.stringify(params))
- }
- const getModelById = (params: ModelByIdParams) => {
- return axios.post(CONFIG.DMS_URL + '/model/getModelById', qs.stringify(params))
- }
- const updateAudit = (params: UpdateAuditParams) => {
- return axios.post(CONFIG.DMS_URL + '/content/updateAudit', qs.stringify(params))
- }
- const uploadFile = (params: UploadFileParams) => {
- const formData = new FormData()
- formData.append('columnId', params.columnId)
- formData.append('contentId', params.contentId || '')
- formData.append('paraName', params.paraName)
- formData.append('type', String(params.type))
- formData.append('file', params.file)
- return axios.post(CONFIG.DMS_URL + '/file/uploadFile', formData, {
- headers: { 'Content-Type': 'multipart/form-data' }
- })
- }
- const getBasicCount = () => {
- return axios.get(CONFIG.SQ_URL + '/count/basic')
- }
- const getHistoryPartner = () => {
- return axios.get(CONFIG.SQ_URL + '/count/history_partner')
- }
- const getGenerateTender = (params: any) => {
- return axios.post(CONFIG.SQ_URL + '/tender/generate', qs.stringify(params))
- }
- /** 查询标书生成步骤进度;path 参数为投续标内容 ID */
- const getTenderProgress = (txbId: string | number) => {
- return axios.get(`${CONFIG.SQ_URL}/tender/api/v1/jobs/${txbId}/progress`, {
- headers: { Accept: 'application/json' },
- })
- }
- export default {
- login,
- updatePassword,
- getDmsTypes,
- updateContent,
- addContent,
- getDmsDataList,
- getMultipleFormsOfJointInvestigation,
- getModelById,
- updateAudit,
- uploadFile,
- getBasicCount,
- getHistoryPartner,
- getGenerateTender,
- getTenderProgress
- }
|