项目基本信息管理
项目总览 消息 17512009894 公司管理员
This commit is contained in:
parent
bd78ce9184
commit
e0b13afdaf
@ -18,7 +18,7 @@ var PROJECT = {
|
||||
}
|
||||
|
||||
|
||||
var PROJECT_TYPE = PROJECT.online_zjsj
|
||||
var PROJECT_TYPE = PROJECT.local_test
|
||||
|
||||
var headerShow = true; // 是否显示头部
|
||||
var tabsShow = true; // 是否显示tabs
|
||||
|
||||
@ -45,8 +45,8 @@ export default new Vuex.Store({
|
||||
// UPLOADURL:'http://10.0.1.43:6023/upload/image',//测试
|
||||
// FILEURL:'http://10.0.1.43:6023/image/',//测试
|
||||
BASEURL: baseUrl ? baseUrl : window.location.protocol + '//' + window.location.host + '/', //
|
||||
UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
|
||||
FILEURL: window.location.protocol + '//' + window.location.host + '/image/', //测试 // tag: 本地测试接口
|
||||
// UPLOADURL: window.location.protocol + '//' + window.location.host + '/upload/image', //
|
||||
// FILEURL: window.location.protocol + '//' + window.location.host + '/image/', //测试 // tag: 本地测试接口
|
||||
/* 2022-05-16 */
|
||||
// tag: 部署河南项目时,需要打开这两行代码
|
||||
// UPLOADURL: 'http://139.9.66.234:6324/upload/image',
|
||||
@ -56,8 +56,8 @@ export default new Vuex.Store({
|
||||
// UPLOADURL: 'http://182.90.224.237:7000/upload/image',
|
||||
// FILEURL: 'http://182.90.224.237:7000/image/',
|
||||
// 邱平毅的
|
||||
// UPLOADURL: 'http://192.168.34.116:6023/upload/image',
|
||||
// FILEURL: 'http://192.168.34.116:6023/image/',
|
||||
UPLOADURL: 'http://192.168.34.116:6023/upload/image',
|
||||
FILEURL: 'http://192.168.34.116:6023/image/',
|
||||
// UPLOADURL: 'http://124.71.67.160:8088/upload/image',
|
||||
// FILEURL: 'http://124.71.67.160:8088/image/',
|
||||
|
||||
|
||||
@ -89,22 +89,32 @@
|
||||
:label="$t('message.cooperationUnit.aptitudeFile')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<a
|
||||
:href="url"
|
||||
download
|
||||
v-for="url in getUrl(scope.row.fileUrl, 2)"
|
||||
:key="url"
|
||||
target="blank"
|
||||
class="qualificationHref"
|
||||
>
|
||||
<img
|
||||
v-if="scope.row.fileUrl && matchResult"
|
||||
:key="url"
|
||||
:src="url"
|
||||
v-for="(url,index) in getUrl(scope.row.fileUrl, 2)"
|
||||
:key="index"
|
||||
:src="url[index]"
|
||||
class="showImg"
|
||||
@click="
|
||||
bigImageDialog = true;
|
||||
bigImageUrl = url[index];
|
||||
"
|
||||
/>
|
||||
{{ matchResult ? "" : url.substr(fileUrl.length) }}
|
||||
</a>
|
||||
<!-- <a
|
||||
:href="url[index]"
|
||||
download
|
||||
v-for="(url,index) in getUrl(scope.row.fileUrl, 2)"
|
||||
:key="index"
|
||||
target="self"
|
||||
class="qualificationHref"
|
||||
> -->
|
||||
<!-- <img
|
||||
v-if="scope.row.fileUrl && matchResult"
|
||||
:key="index"
|
||||
:src="url[index]"
|
||||
class="showImg"
|
||||
/> -->
|
||||
<!-- {{ matchResult ? "" : url[index]}}
|
||||
</a> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -149,8 +159,10 @@
|
||||
:on-preview="showImgBtn"
|
||||
:on-remove="handleRemove"
|
||||
:on-success="handleSuccess"
|
||||
multiple
|
||||
accept="image/jpg,image/jpeg,image/png"
|
||||
:before-upload="handleBeforeUpload"
|
||||
name="files"
|
||||
multiple
|
||||
ref="upload"
|
||||
:file-list="fileList"
|
||||
>
|
||||
@ -491,7 +503,7 @@ export default {
|
||||
// 新增企业资质
|
||||
addQualification() {
|
||||
this.$refs.qualificationForm.validate((valid) => {
|
||||
console.log(this.qualificationForm);
|
||||
console.log('新增的参数',this.qualificationForm);
|
||||
if (valid) {
|
||||
let data = this.qualificationForm;
|
||||
(data.enterpriseId = this.$props.projectEnterpriseId),
|
||||
@ -546,7 +558,9 @@ export default {
|
||||
},
|
||||
// 资质文件上传成功
|
||||
handleSuccess(file) {
|
||||
console.log('上传成功放回的值',file)
|
||||
let data = { name: file.data[0].filename, url: file.data[0].imageUrl };
|
||||
// let data = { name: file.data[0].fileInfo.attr.originalFilename, url: file.data[0].imageUrl };
|
||||
this.fileList.push(data);
|
||||
this.qualificationForm.fileUrl =
|
||||
this.fileList.length > 0 ? JSON.stringify(this.fileList) : "";
|
||||
@ -564,6 +578,23 @@ export default {
|
||||
}
|
||||
console.log(this.fileList);
|
||||
},
|
||||
// 判断上传的是否为图片
|
||||
handleBeforeUpload(file) {
|
||||
var img = file.name.substring(file.name.lastIndexOf('.') + 1)
|
||||
const suffix = img === 'jpg'
|
||||
const suffix2 = img === 'png'
|
||||
const suffix3 = img === 'jpeg'
|
||||
const isLt1M = file.size / 1024 / 1024 < 1;
|
||||
if (!suffix && !suffix2 && !suffix3) {
|
||||
this.$message.error("只能上传图片!");
|
||||
return false
|
||||
}
|
||||
// 可以限制图片的大小
|
||||
if (!isLt1M) {
|
||||
this.$message.error('上传图片大小不能超过 1MB!');
|
||||
}
|
||||
return suffix || suffix2 || suffix3
|
||||
},
|
||||
|
||||
//截取图片地址
|
||||
getUrl(url, type) {
|
||||
@ -576,16 +607,32 @@ export default {
|
||||
showArr.push(this.fileUrl + showUrl);
|
||||
}
|
||||
return showArr;
|
||||
} else {
|
||||
let arr = JSON.parse(JSON.stringify(url));
|
||||
this.matchResult = arr.match("(.+?).(png|jpg|gif)");
|
||||
arr = arr.split(",");
|
||||
} else if(type == 2) {
|
||||
let arr = JSON.parse(url);
|
||||
// this.matchResult = arr.match("(.+?).(png|jpg|gif)");
|
||||
// console.log('this.matchResult',this.matchResult)
|
||||
// arr = arr.split(",");
|
||||
let showArr = [];
|
||||
for (let i = 0; i < JSON.parse(arr).length; i++) {
|
||||
let showUrl = JSON.parse(arr)[i].url;
|
||||
showArr.push(this.fileUrl + showUrl);
|
||||
}
|
||||
showArr = arr.map((item)=>{
|
||||
let showUrl = item.url
|
||||
let showArray = []
|
||||
showArray.push(this.fileUrl + showUrl);
|
||||
return showArray
|
||||
})
|
||||
return showArr;
|
||||
|
||||
// for (let i = 0; i < arr.length; i++) {
|
||||
// let showUrl = arr[i].url;
|
||||
// // showArr.push(this.fileUrl + showUrl);
|
||||
// let a = showUrl.split(".")[1]
|
||||
// if( a === 'png'|| a === 'jpg' || a ==='gif'){
|
||||
// showArr.push(this.fileUrl + showUrl);
|
||||
// }else{
|
||||
// this.matchResult = showUrl
|
||||
// }
|
||||
// }
|
||||
// console.log('showArr',showArr)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user