diff --git a/src/api/project/project.js b/src/api/project/project.js index 471a577..5aeac44 100644 --- a/src/api/project/project.js +++ b/src/api/project/project.js @@ -16,3 +16,15 @@ export const searchUserRoll = data => createAPI(`/project/searchUserRoll`,'Post' export const saveProjectInfo = data => createAPI(`/project/saveProjectInfo`,'Post',data) + +/*查询文件内容*/ +export const getFileContentList = data => createAPI('sys/file/getSysFileByOrderRef2','post',data) + + +export const downLoadProjectFile = data => createAPI(`sys/file/downLoadProjectFile?id=`+data.id,'post','download') +export const deleteProjectFile= data => createAPI(`sys/file/deleteProjectFile`,'post',data) +export const uploadProjectFile= data => createAPI(`sys/file/upload`,'post',data) +export const getCustomerContactData = data => createAPI(`/project/getCustomerContactData`,'post',data) +export const getContactChooseData= data => createAPI(`/project/getContactChooseData`,'post',data) +export const saveProjectContactList= data => createAPI(`/project/saveProjectContactList`,'post',data) +export const deleteProjectInfo= data => createAPI(`/project/deleteProjectInfo`,'post',data) diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index bde06a6..13973f2 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -111,6 +111,40 @@ instance.interceptors.response.use(response => { return Promise.reject(error) }) +// ============================= 下载功能的请求 ============================= +const instance2 = axios.create({ + baseURL: (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl), + timeout: 10000 * 30, + withCredentials: true, + responseType: 'blob', + headers: { + 'Content-Type': 'application/json; charset=utf-8' + } +}) + +/** + * 请求拦截 + */ +instance2.interceptors.request.use(config => { + config.headers['token'] = Vue.cookie.get('token') // 请求头带上token + return config +}, error => { + return Promise.reject(error) +}) + +/** + * 响应拦截 + */ +instance2.interceptors.response.use(response => { + if (response.data && response.data.code === 401) { // 401, token失效 + clearLoginInfo() + router.push({name: 'login'}) + } + return response +}, error => { + return Promise.reject(error) +}) + @@ -121,6 +155,13 @@ export const createAPI = (url, method, data) => { } else { config.data = data } + if (data === 'download'){ // 下载功能的请求 + return instance2({ + url, + method, + ...config + }) + } return instance({ url, method, diff --git a/src/views/modules/project/projectInfo/projectInfo.vue b/src/views/modules/project/projectInfo/projectInfo.vue index 8ba05d3..9892e94 100644 --- a/src/views/modules/project/projectInfo/projectInfo.vue +++ b/src/views/modules/project/projectInfo/projectInfo.vue @@ -21,6 +21,9 @@ :height="height" :data="dataList1" border + ref="mainTable" + @row-click="changeData" + highlight-current-row v-loading="dataListLoading" style="width: 100%;"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 编辑 + + + + + + + + + + + + + 上传文件 + + + + + + + + + + + + + + + +
+ 确定 + 取消 +
+
+
+ + + - diff --git a/src/views/modules/project/projectInfo/project_upload_file.vue b/src/views/modules/project/projectInfo/project_upload_file.vue new file mode 100644 index 0000000..0543d8b --- /dev/null +++ b/src/views/modules/project/projectInfo/project_upload_file.vue @@ -0,0 +1,161 @@ + + + +