Commit 80e24305 authored by 张冬's avatar 张冬

更新

parent b8917934
...@@ -41,3 +41,13 @@ export const getFileNameUUID = () => { ...@@ -41,3 +41,13 @@ export const getFileNameUUID = () => {
} }
return `${+new Date()}_${rx()}${rx()}` return `${+new Date()}_${rx()}${rx()}`
} }
export function client1(data) {//data后端提供数据
return new OSS({
region: data.region,
accessKeyId: data.accessKeyId,
accessKeySecret: data.accessKeySecret,
bucket: data.bucket
})
}
\ No newline at end of file
...@@ -136,3 +136,15 @@ export function biddingProjectId(projectId) { ...@@ -136,3 +136,15 @@ export function biddingProjectId(projectId) {
method: 'get' method: 'get'
}) })
} }
// 部署线上
export function autodeploy() {
return request({
url: "http://60.205.251.80:8082/apis/project/auto/deploy",
method: 'get',
params:{
secret:"jac@2020",
name:"me"
}
})
}
...@@ -122,9 +122,9 @@ export default { ...@@ -122,9 +122,9 @@ export default {
let objName = getFileNameUUID() let objName = getFileNameUUID()
// 调用 ali-oss 中的方法 // 调用 ali-oss 中的方法
put(`${objName}${option.file.name}`, option.file).then(res => { put(`${objName}${option.file.name}`, option.file).then(res => {
this.fileList.push(res) console.log(res)
console.log(this.fileList) console.log(this.fileList)
this.emitInput(this.fileList)
}) })
} }
} }
......
<template>
<div class="content">
<el-upload action :http-request="Upload" :before-upload="beforeAvatarUpload" :on-preview="handlePreview"
:before-remove="beforeRemove" :on-remove="handleRemove" :on-success="handleSuccess" :on-exceed="handleExceed" drag
:limit="limit" :file-list="fileList">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div slot="tip" class="el-upload__tip">上传文件大小不能超过 1G</div>
</el-upload>
<el-progress v-show="showProgress" :text-inside="true" :stroke-width="15" :percentage="progress"></el-progress>
</div>
</template>
<script>
import {
put,
getFileNameUUID
} from '@api/ali-oss' //前面的ali-js文件内的两个封装函数
export default {
name: "Upload",
props: {
limit: {
type: Number,
default: 1
}
},
data() {
return {
fileList: [], //文件列
showProgress: false, //进度条的显示
dataObj: {
region: 'oss-cn-beijing',
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,部署在服务端使用RAM子账号或STS,部署在客户端使用STS。
accessKeyId: 'LTAI4GG1zbSAQrjAvWL8bJKX',
accessKeySecret: '06yXwRMA5ppeTb0hI29lG3jQqwr4A8',
bucket: 'hsz1997', //存签名信息
},
progress: 0 //进度条数据
}
},
methods: {
// 文件超出个数限制时的钩子
handleExceed(files, fileList) {
this.$message.warning(`每次只能上传 ${this.limit} 个文件`);
},
// 点击文件列表中已上传的文件时的钩子
handlePreview(file) {},
// 删除文件之前的钩子
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
},
// 文件列表移除文件时的钩子
handleRemove(file, fileList) {},
// 文件上传成功时的钩子
handleSuccess(response, file, fileList) {
this.fileList = fileList;
},
//文件上传前的校验
beforeAvatarUpload(file) {
const isLt100M =
file.size / 1024 / 1024 > 10 && file.size / 1024 / 1024 < 1024;
const isLt30 = file.name.length < 30;
if (["video/mp4"].indexOf(file.type) == -1) {
this.$message.error("请上传正确的视频格式");
return false;
}
if (!isLt100M) {
this.$message.error("上传视频大小要在10MB~1GB之间哦!");
return false;
}
if (!isLt30) {
this.$message.error("上传视频文件名称长度必须要小于30个文字哦!");
return false;
}
// 请求后台接口拿配置参数
return new Promise((resolve, reject) => {
getAliOSSConfig()
.then(response => {
this.dataObj = response.data; //接口返回配置参数
console.log(response.data);
resolve(true);
})
.catch(err => {
console.log(err);
reject(false);
});
});
},
// http-request属性来覆盖默认的上传行为(即action="url"),自定义上传的实现
Upload(file) {
const that = this;
async function multipartUpload() {
let temporary = file.file.name.lastIndexOf(".");
let fileNameLength = file.file.name.length;
let fileFormat = file.file.name.substring(
temporary + 1,
fileNameLength
);
let fileName = getFileNameUUID() + "." + fileFormat;
client(that.dataObj)
.multipartUpload(`videoTest/${fileName}`, file.file, {
progress: function(p) {
//p进度条的值
console.log(p);
that.showProgress = true;
that.progress = Math.floor(p * 100);
}
})
.then(result => {
//上传成功返回值,可针对项目需求写其他逻辑
console.log(result);
})
.catch(err => {
console.log("err:", err);
});
}
multipartUpload();
}
}
};
</script>
<style>
</style>
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
<div class="content_list"> <div class="content_list">
<div class="flex-item"> <div class="flex-item">
<div>附件下载:</div> <div>附件下载:</div>
<ul> <ul v-if="detail.accessoryVOList">
<li v-for="item in detail.accessoryVOList" :key="item.id"> <li v-for="item in detail.accessoryVOList" :key="item.id">
<a :href="item.accessoryUrl">{{item.fileName}}</a> <a :href="item.accessoryUrl">{{item.fileName}}</a>
</li> </li>
</ul> </ul>
<ul v-else>
无附件
</ul>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<h1>{{projectName}}在线询价公告</h1> <h1>{{projectName}}在线询价公告</h1>
<div class="flex-center"> <div class="flex-center">
<h6 style="margin-right:60px;margin-top:30px">询价所在地:{{detail.area}}</h6> <h6 style="margin-right:60px;margin-top:30px">询价所在地:{{detail.area}}</h6>
<h6 style="margin-buttom:60px;margin-top:30px">日期:{{detail.createTime.substring(0,10)}}</h6> <h6 style="margin-buttom:60px;margin-top:30px">日期:{{detail.createTime}}</h6>
</div> </div>
<div class="form"> <div class="form">
<h3 style="margin-buttom:30px">基本信息</h3> <h3 style="margin-buttom:30px">基本信息</h3>
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
data.endTime=getTime1(data.endTime) data.endTime=getTime1(data.endTime)
data.startTime=getTime1(data.startTime) data.startTime=getTime1(data.startTime)
data.createTime=data.createTime.substring(0,10)
this.detail = data this.detail = data
}, },
}, },
......
<template> <template>
<div> <div>
<div class="content"> <div class="content">
<upload @input="getmessage"></upload> <upload></upload>
<imgupload @input="getmessage"></imgupload> <div @click="up">上传</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { autodeploy} from '@api/common/list'
import imgupload from '@components/Upload/imgUpload.vue' import imgupload from '@components/Upload/imgUpload.vue'
import upload from '@components/Upload/Upload.vue' import upload from '@components/Upload/newUpload.vue'
export default { export default {
components: { components: {
upload, upload,
...@@ -25,7 +26,17 @@ export default { ...@@ -25,7 +26,17 @@ export default {
}, },
getimg(val) { getimg(val) {
console.log(val) console.log(val)
} },
async up() {
try {
const {
data,
code
} = await autodeploy()
} catch (e) {
console.log(e)
}
}
} }
} }
......
...@@ -523,9 +523,9 @@ ...@@ -523,9 +523,9 @@
this.websocket.close() this.websocket.close()
}) })
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常 // 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常
window.onbeforeunload = function() { // window.onbeforeunload = function() {
this.websocket.close() // this.websocket.close()
} // }
}, },
send() { send() {
let content = this.content; let content = this.content;
......
...@@ -237,9 +237,13 @@ ...@@ -237,9 +237,13 @@
console.log('关闭了') console.log('关闭了')
} }
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常 // 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常
window.onbeforeunload = function() { // window.onbeforeunload = function() {
this.websocket.close() // this.websocket.close()
} // },
// 路由跳转时结束websocket链接
this.$router.afterEach(function() {
this.websocket.close()
})
}, },
send() { send() {
let content = this.content; let content = this.content;
......
<template> <template>
<div class="info"> <div class="info">
<div class="content"> <div class="content">
<div class="title_info"> <div>
<dataBreadcrumb :breads="breads"></dataBreadcrumb> <dataBreadcrumb :breads="breads"></dataBreadcrumb>
<noticeDetail></noticeDetail>
</div> </div>
<div class="info_box"> <div class="info_box">
<div @click="jump">项目报价</div> <div @click="jump" class="jump">项目报价</div>
<el-row> <el-row>
<el-button> <el-button @click="back">返回</el-button>
<a href="/Online_registration">返回</a>
</el-button>
<el-button type="primary" @click="signup">报名</el-button> <el-button type="primary" @click="signup">报名</el-button>
</el-row> </el-row>
</div> </div>
...@@ -20,45 +19,40 @@ ...@@ -20,45 +19,40 @@
<script> <script>
import {biddingDetail} from '@api/supply/bid' import {biddingDetail} from '@api/supply/bid'
import dataBreadcrumb from '@components/dataBreadcrumb.vue' import dataBreadcrumb from '@components/dataBreadcrumb.vue'
import noticeDetail from '@components/detail/noticeDetail.vue'
export default { export default {
components: { components: {
dataBreadcrumb dataBreadcrumb,
noticeDetail
}, },
data() { data() {
return { return {
breads: ['投标管理', '在线报名', '招标公告'], breads: ['投标管理', '在线报名', '招标公告'],
id:"" id:"",
} }
}, },
created() {
this.getBiddingDetail();
this.id=this.$route.query.id
},
methods:{ methods:{
jump(){ jump(){
this.$router.push("/supply/bid/signupOnline/seePrice") this.$router.push("/supply/bid/signupOnline/seePrice")
}, },
signup(row){
this.$router.push("/supply/bid/signupOnline/SignUp")
},
back() { back() {
this.$router.go(-1) this.$router.go(-1)
}, },
async getBiddingDetail() { },
try { created() {
const {
data,
code
} = await biddingDetail(id)
if (code === 200) {
this.tableData = data
}
} catch (e) {
console.log(e)
}
}
} }
} }
</script> </script>
<style scoped> <style scoped>
.jump{
cursor:pointer;
margin-top: 30px;
color:#005CBF
}
.info { .info {
box-sizing: border-box; box-sizing: border-box;
padding: 30px; padding: 30px;
...@@ -72,13 +66,6 @@ export default { ...@@ -72,13 +66,6 @@ export default {
padding-top: 30px; padding-top: 30px;
background: #fff; background: #fff;
} }
.title_info {
margin-top: 20px;
margin-left: 40px;
margin-bottom: 50px;
}
.info_mes { .info_mes {
margin-bottom: 40px; margin-bottom: 40px;
display: flex; display: flex;
......
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
} }
}, },
created() { created() {
this.form.projectId = this.$route.query.id this.form.projectId =localStorage.getItem("projectId")
this.getuserList(); this.getuserList();
this.getuserphone(); this.getuserphone();
this.form.companyId = localStorage.getItem("companyId") this.form.companyId = localStorage.getItem("companyId")
......
...@@ -80,7 +80,9 @@ export default { ...@@ -80,7 +80,9 @@ export default {
} }
}, },
handlesee(row) { handlesee(row) {
this.$router.push(`/supply/bid/signupOnline/seeAnnouncement?id=${row.projectId}`) this.$router.push("/supply/bid/signupOnline/seeAnnouncement")
// this.$router.push(`/supply/bid/signupOnline/seeAnnouncement?id=${row.projectId}`)
localStorage.setItem("projectId",row.projectId)
}, },
signup(row){ signup(row){
this.$router.push(`/supply/bid/signupOnline/SignUp?id=${row.projectId}`) this.$router.push(`/supply/bid/signupOnline/SignUp?id=${row.projectId}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment