提交 58d3afdf authored 作者: CRS's avatar CRS

new

......@@ -10646,6 +10646,11 @@
}
}
},
"simple-uploader.js": {
"version": "0.5.4",
"resolved": "https://registry.npm.taobao.org/simple-uploader.js/download/simple-uploader.js-0.5.4.tgz",
"integrity": "sha1-+FjtH+/t3FjUanJNWmx3BAsLKbs="
},
"slash": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
......@@ -12001,6 +12006,14 @@
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.7.tgz",
"integrity": "sha512-utJ+QR3YlIC/6x6xq17UMXeAfxEvXA0VKD3PiSio7hBOZNusA1jXcbxZxVEfJunLp48oonjTepY8ORoIlRx/EQ=="
},
"vue-simple-uploader": {
"version": "0.7.4",
"resolved": "https://registry.npm.taobao.org/vue-simple-uploader/download/vue-simple-uploader-0.7.4.tgz",
"integrity": "sha1-jPYDP9rgWzn4mBRsyWEhOjhgYlk=",
"requires": {
"simple-uploader.js": "^0.5.4"
}
},
"vue-style-loader": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-4.1.2.tgz",
......
......@@ -19,6 +19,7 @@
"node-sass": "^4.13.1",
"vue": "^2.6.11",
"vue-router": "^3.0.7",
"vue-simple-uploader": "^0.7.4",
"vuex": "^3.1.2"
},
"devDependencies": {
......
......@@ -6,141 +6,207 @@
<div class="company-content" style="text-align: center; margin-top: 14px;">
<p class="new">
<el-form :model="form">
<el-form-item label="上传类型" :label-width="formLabelWidth">
<el-select v-model="form.region" placeholder="请选择">
<el-option label="压缩包" value="zip"></el-option>
<el-option label="git地址" value="git"></el-option>
</el-select>
</el-form-item>
<div class="upload-text" v-show="form.region == 'zip'"><img src="../img/upload-text.png" alt="" style="margin-right:5px;margin-botton:5px; cursor: pointer;">上传文件<input type="file" name="file" id="fileUpload" class="up-input" ref="file" @change="after"> </div>
<div class="upload-text" v-show="form.region == 'zip'">
<uploader
:key="uploader_key"
:options="options"
class="uploader-example"
@file-success="onFileSuccess"
>
<uploader-unsupport></uploader-unsupport>
<uploader-drop>
<uploader-btn :single="true">选择文件</uploader-btn>
</uploader-drop>
<uploader-list></uploader-list>
</uploader>
</div>
<!-- <div class="upload-text" v-show="form.region == 'zip'"><img src="../img/upload-text.png" alt="" style="margin-right:5px;margin-botton:5px; cursor: pointer;">上传文件<input type="file" name="file" id="fileUpload" class="up-input" ref="file" @change="after"> </div> -->
<div class="box">{{ziptext}}</div>
<!-- <div class="box"></div> -->
<el-form-item label="请输入git账号" :label-width="formLabelWidth" v-show="form.region == 'git'">
<el-input v-model="form.username" ></el-input>
<el-form-item
label="请输入git账号"
:label-width="formLabelWidth"
v-show="form.region == 'git'"
>
<el-input v-model="form.username"></el-input>
</el-form-item>
<el-form-item label="请输入git密码" :label-width="formLabelWidth" v-show="form.region == 'git'">
<el-input type="password" v-model="form.password" ></el-input>
<el-form-item
label="请输入git密码"
:label-width="formLabelWidth"
v-show="form.region == 'git'"
>
<el-input type="password" v-model="form.password"></el-input>
</el-form-item>
<el-form-item label="请输入git地址" :label-width="formLabelWidth" v-show="form.region == 'git'">
<el-input type="textarea" v-model="form.desc" ></el-input>
<el-form-item
label="请输入git地址"
:label-width="formLabelWidth"
v-show="form.region == 'git'"
>
<el-input type="textarea" v-model="form.desc"></el-input>
</el-form-item>
</el-form>
</p>
</div>
<p class="line"></p>
<p class="buttonClick">
<!-- <span class="buttonCancl" @click="cancel">取消</span> -->
<span class="buttonSave" @click="goAdd" :class="{'buttonCancl my':ziptext==''?form.desc == ''?true:false:false}">确定</span>
<span
class="buttonSave"
@click="goAdd"
:class="{'buttonCancl my':ziptext==''?form.desc == ''?true:false:false}"
>确定</span>
</p>
</div>
</template>
<script>
export default {
name: 'addRole',
props: ['detailData', 'modalName'],
data () {
name: "addRole",
props: ["detailData", "modalName"],
data() {
return {
uploader_key: new Date().getTime(),//这个用来刷新组件--解决不刷新页面连续上传的缓存上传数据(注:每次上传时,强制这个值进行更改---根据自己的实际情况重新赋值)
options: {
target: 'http://120.55.57.35:8078/inspect/uploads',//SpringBoot后台接收文件夹数据的接口
testChunks: false//是否测试分片
},
tableDataAdd: [],
content: '',
target: '',
suffix: '',
technologyId: '',
content: "",
target: "",
suffix: "",
technologyId: "",
oldRule: {},
form: {
region:'zip',
desc:''
region: "zip",
desc: ""
},
ziptext:'',
formLabelWidth: '120px'
}
ziptext: "",
formLabelWidth: "120px",
myFiles:''
};
},
mounted() {
props: {
msg: String
},
mounted() {},
methods: {
testLoading(){
this.$parent.myLoading()
onFileSuccess(rootFile, file, response, chunk) {
this.uploader_key = new Date().getTime()
// if(this.myFiles != ''){
// console.log("???")
// console.log(this.$uploader)
// this.$uploader.removeFile(this.myFiles)
// }else{
// this.myFiles = file
// }
console.log('rootFile',rootFile)
console.log('files',file)
console.log('response',response)
console.log('chunk',chunk)
this.$message({
message: "上传代码成功",
type: "success"
});
this.ziptext = JSON.parse(response).path
},
add(){
this.form = { region:'zip', desc:''}
testLoading() {
this.$parent.myLoading();
},
add() {
this.form = { region: "zip", desc: "" };
// this.dialogFormVisible = true
},
close(){
close() {
// this.dialogFormVisible = false
this.form={}
this.form = {};
},
after(file){
after(file) {
// var test = document.getElementById('fileUpload').files[0].name
this.ziptext = this.$refs.file.files[0].name
this.ziptext = this.$refs.file.files[0].name;
},
goAdd(){
if(this.form.region == 'zip' && this.ziptext != ''){
goAdd() {
if (this.form.region == "zip" && this.ziptext != "") {
// this.$parent.reset()
this.$emit('reset')
var fd = new FormData()
fd.append('file',this.$refs.file.files[0])
this.$emit('myLoading')
this.$emit("reset");
// var fd = new FormData();
// fd.append("file", this.$refs.file.files[0]);
// this.$emit("myLoading");
// this.$parent.myLoading()
this.$server.upZip(fd).then(res =>{
console.log(res)
// this.$server.upZip(fd).then(res => {
// console.log(res);
this.$message({
message: '上传代码成功',
type: 'success'
});
this.$emit('addZip','zip',res.data.path)
// this.$message({
// message: "上传代码成功",
// type: "success"
// });
// this.$emit("addZip", "zip", res.data.path);
// // this.$parent.addZip('zip',res.data.path)
// this.form = { region: "zip", desc: "" };
// this.ziptext = "";
// });
// this.$message({
// message: "上传代码成功",
// type: "success"
// });
this.$emit("addZip", "zip", this.ziptext);
// this.$parent.addZip('zip',res.data.path)
this.form = { region:'zip', desc:''}
this.ziptext = ''
})
}else if (this.form.region == 'git' && this.form.desc != '' && this.form.username != '' && this.form.password != ''){
this.form = { region: "zip", desc: "" };
this.ziptext = "";
} else if (
this.form.region == "git" &&
this.form.desc != "" &&
this.form.username != "" &&
this.form.password != ""
) {
// this.$parent.reset()
// this.$parent.myLoading()
var obj = {
gitAddress:this.form.desc,
username:this.form.username,
password:this.form.password,
}
gitAddress: this.form.desc,
username: this.form.username,
password: this.form.password
};
var url = this.form.desc
console.log(obj)
this.$emit('reset')
this.$emit('myLoading')
this.$server.upGit(obj).then(res =>{
console.log(res)
var url = this.form.desc;
console.log(obj);
this.$emit("reset");
this.$emit("myLoading");
this.$server.upGit(obj).then(res => {
console.log(res);
this.$message({
message: '上传代码成功',
type: 'success'
message: "上传代码成功",
type: "success"
});
console.log("上传的git",url)
console.log("上传的git", url);
// this.$parent.addZip('git',res.data,url)
this.$emit('addZip','git',res.data,url)
this.form = { region:'zip', desc:''}
})
this.$emit("addZip", "git", res.data, url);
this.form = { region: "zip", desc: "" };
});
}
}
}}
}
};
</script>
<style scoped>
.buttonCancl.my{
cursor:default;
.buttonCancl.my {
cursor: default;
}
.upload-text{
.upload-text {
position: relative;
cursor: pointer;
}
.up-input{
.up-input {
cursor: pointer;
opacity: 0;
position: absolute;
......@@ -148,13 +214,13 @@ export default {
top: 0;
display: block;
}
.add-role .new{
.add-role .new {
display: inline-block;
}
.add-role .new{
}
.add-role .new {
right: 220px;
}
.add-role .addVal{
}
.add-role .addVal {
/*width: 390px;*/
width: 710px;
display: flex;
......@@ -162,33 +228,33 @@ export default {
color: #666;
text-align: center;
margin-top: 40px;
}
.add-role .addVal>span{
}
.add-role .addVal > span {
width: 160px;
display: inline-block;
line-height: 34px;
text-align: right;
}
.add-role .line{
}
.add-role .line {
margin: 40px 30px 0 30px;
height: 1px;
background: rgba(72,119,230,0.2);
}
.add-role .buttonClick{
background: rgba(72, 119, 230, 0.2);
}
.add-role .buttonClick {
display: flex;
justify-content: space-evenly;
margin-top: 30px;
}
.add-role .company-content{
}
.add-role .company-content {
height: 240px;
}
.add-role .company-content>>>.el-radio{
}
.add-role .company-content >>> .el-radio {
margin-right: 30px;
margin-bottom: 11px;
width: 49px;
}
.add-role .company-content>>>.el-input__inner, .add-role .company-content>>>.el-input{
}
.add-role .company-content >>> .el-input__inner,
.add-role .company-content >>> .el-input {
width: 220px;
}
}
</style>
\ No newline at end of file
......@@ -8,8 +8,9 @@
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<div
class="myloading2"
v-loading="loading2"
element-loading-text="评估报告生成中"
element-loading-text="正在评估中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
......@@ -2849,6 +2850,7 @@ export default {
data() {
//这里存放数据
return {
myloadingText:'',
compatibleBrowsersList:[],
middlewareEnumsList:[],
opGAscodeList: [],
......@@ -3659,6 +3661,7 @@ export default {
this.$server.goPg(obj).then(res => {
console.log(res);
this.$store.commit("changeRoutePg", 1);
this.$message({
message: "生成评估报告成功",
......@@ -5048,11 +5051,51 @@ export default {
},
//生命周期 - 创建完成(可以访问当前this实例)
created() {
this.getPrev();
console.log("系统不熟", this.middleware.microServices.length);
// console.log("系统不熟",this.$loading());
},
//生命周期 - 挂载完成(可以访问DOM元素)
mounted() {},
mounted() {
// localhost
var ws = new WebSocket("ws://120.55.57.35:8078/websocket/22");
var that = this
ws.onopen = function() {
ws.send("hello");
//心跳检测重置
// heartCheck.start();
};
ws.onmessage = function (e) {
//1成功 2失败
console.log('链接成功');
if(JSON.parse(e.data).msg != ""){
// this.myloadingText = JSON.parse(e.data)
// var str = document.querySelector(".myloading2 .el-loading-text")
// console.log('dsadsadsadsadsadsadsa',str)
// console.log(this.$loading(options))
var str = document.querySelector(".myloading2 .el-loading-text")
// console.log('dsadsadsadsadsadsadsa',str)
str.innerText = JSON.parse(e.data).msg
// console.log(JSON.parse(e.data));
}
// console.log(JSON.parse(e.data));
};
ws.onclose = function() {
console.log('链接关闭');
};
ws.onerror = function () {
console.log('发生异常了');
}
},
beforeCreate() {}, //生命周期 - 创建之前
beforeMount() {}, //生命周期 - 挂载之前
beforeUpdate() {}, //生命周期 - 更新之前
......
......@@ -8,9 +8,12 @@ import './tools/element';
import './assets/changeElementStyle.css'
import server from './services/server';
import echarts from 'echarts';
import uploader from 'vue-simple-uploader'
Vue.use(uploader)
Vue.prototype.$echarts = echarts;
Vue.prototype.$store = store;
Vue.prototype.$server = server;
Vue.prototype.$uploader = uploader;
Vue.config.productionTip = false;
import htmlToPdf from './tools/htmlToPdf' // 导出pdf npm install html2canvas jspdf --save
Vue.use(htmlToPdf)
......
......@@ -11,7 +11,7 @@ import axios from '@/services/axios';
*/
import qs from 'qs';
const assessma = 'http://120.55.57.35:8078'
// const assessma = 'http://192.168.1.85:8078'
// const assessma = 'http://192.168.1.104:8078'
const server = {
getloginOut(id) { // 用户退出
return axios('/user/loginOut/' + id, {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论