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

new

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