Commit ab092009 authored by 徐一鸣's avatar 徐一鸣

应用构建接口调试

parent d90cb6d6
...@@ -499,6 +499,7 @@ width: 620px!important; ...@@ -499,6 +499,7 @@ width: 620px!important;
/* 应用超市详情页公共样式 */ /* 应用超市详情页公共样式 */
.sevice_detail { .sevice_detail {
max-width: 1200px; max-width: 1200px;
padding-top: 1px;
margin: 0 auto; margin: 0 auto;
} }
...@@ -535,6 +536,11 @@ width: 620px!important; ...@@ -535,6 +536,11 @@ width: 620px!important;
background-color: #e1e4fb; background-color: #e1e4fb;
border-color: #e1e4fb; border-color: #e1e4fb;
} }
.apass_button .el-button.is-disabled,
.apass_button .el-button.is-disabled:focus,
.apass_button .el-button.is-disabled:hover {
cursor: not-allowed;
}
.apass_table .el-table th > .cell { .apass_table .el-table th > .cell {
color: #1a2236; color: #1a2236;
} }
......
<template> <template>
<div class="apass_table"> <div class="apass_table">
<el-table :data="data"> <el-table :data="data">
<el-table-column :width="paddingLeft - 10"></el-table-column> <el-table-column :width="Math.max(paddingLeft - 10, 0)"></el-table-column>
<el-table-column <el-table-column
v-for="(item, index) in header" v-for="(item, index) in header"
:label="item.label" :label="item.label"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
id="uploads" id="uploads"
class="up_input" class="up_input"
accept="image/png, image/jpeg, image/gif, image/jpg" accept="image/png, image/jpeg, image/gif, image/jpg"
@change="uploadImg($event,1)" @change="uploadImg($event, 1)"
/> />
</div> </div>
<!-- 弹出层-裁剪 --> <!-- 弹出层-裁剪 -->
...@@ -41,8 +41,12 @@ ...@@ -41,8 +41,12 @@
</div> </div>
</div> </div>
<el-row class="footerBtn" align="center"> <el-row class="footerBtn" align="center">
<el-button type="primary" size="small" round @click="cut('blob')">确认</el-button> <el-button type="primary" size="small" round @click="cut('blob')"
<el-button type="primary" size="small" round @click="handleClose">取消</el-button> >确认</el-button
>
<el-button type="primary" size="small" round @click="handleClose"
>取消</el-button
>
</el-row> </el-row>
</div> </div>
</el-dialog> </el-dialog>
...@@ -53,7 +57,7 @@ ...@@ -53,7 +57,7 @@
import { VueCropper } from "vue-cropper"; import { VueCropper } from "vue-cropper";
export default { export default {
components: { components: {
VueCropper VueCropper,
}, },
data() { data() {
return { return {
...@@ -64,7 +68,7 @@ export default { ...@@ -64,7 +68,7 @@ export default {
canMoveBox: true, //截图框不能拖动 canMoveBox: true, //截图框不能拖动
autoCropWidth: 200, //截图框宽度 autoCropWidth: 200, //截图框宽度
autoCropHeight: 200, //截图框高度 autoCropHeight: 200, //截图框高度
centerBox: false //截图框被限制在图片里面 centerBox: false, //截图框被限制在图片里面
}, },
previews: {}, //实时预览图数据 previews: {}, //实时预览图数据
attach: { attach: {
...@@ -72,10 +76,10 @@ export default { ...@@ -72,10 +76,10 @@ export default {
userId: "", userId: "",
customaryUrl: "", //原图片路径 customaryUrl: "", //原图片路径
laterUrl: "", //裁剪后图片路径 laterUrl: "", //裁剪后图片路径
attachType: "photo" //附件类型 attachType: "photo", //附件类型
}, },
fileName: "", //本机文件地址 fileName: "", //本机文件地址
uploadImgRelaPath: "" //上传后图片地址 uploadImgRelaPath: "", //上传后图片地址
}; };
}, },
methods: { methods: {
...@@ -90,7 +94,7 @@ export default { ...@@ -90,7 +94,7 @@ export default {
//加载图片信息 //加载图片信息
find() { find() {
this.userId = sessionStorage.getItem("userId"); this.userId = sessionStorage.getItem("userId");
this.$http.post("ssapi", this.attach).then(res => { this.$http.post("ssapi", this.attach).then((res) => {
console.log(res); console.log(res);
}); });
}, },
...@@ -105,7 +109,7 @@ export default { ...@@ -105,7 +109,7 @@ export default {
//fileReader 接口,用于异步读取文件数据 //fileReader 接口,用于异步读取文件数据
var reader = new FileReader(); var reader = new FileReader();
reader.readAsDataURL(file); //重要 以dataURL形式读取文件 reader.readAsDataURL(file); //重要 以dataURL形式读取文件
reader.onload = e => { reader.onload = (e) => {
// data = window.URL.createObjectURL(new Blob([e.target.result])) 转化为blob格式 // data = window.URL.createObjectURL(new Blob([e.target.result])) 转化为blob格式
let data = e.target.result; let data = e.target.result;
...@@ -120,25 +124,23 @@ export default { ...@@ -120,25 +124,23 @@ export default {
//确认截图,上传 //确认截图,上传
cut(type) { cut(type) {
var formData = new FormData(); var formData = new FormData();
this.$refs.cropper.getCropBlob(res => { this.$refs.cropper.getCropBlob((res) => {
//res是裁剪后图片的bolb对象 //res是裁剪后图片的bolb对象
formData.append("file", res, this.userId); formData.append("file", res, this.userId);
formData.append("directory", "image"); formData.append("directory", "image");
let url = "/awecloud/static/image/upload"; let url = "/awecloud/static/image/upload";
this.$http this.$http
.post(url, formData, { .post(url, formData, {
contentType: false, headers: { "Content-Type": "multipart/form-data" },
processData: false,
headers: { "Content-Type": "multipart/form-data" }
}) })
.then(res => { .then((res) => {
// 上传图片后服务器返回访问路径 // 上传图片后服务器返回访问路径
this.$emit("getNewUrl", res.data.data); this.$emit("getNewUrl", res.data.data);
this.handleClose(); this.handleClose();
}); });
}); });
} },
} },
}; };
</script> </script>
......
...@@ -42,27 +42,19 @@ export default { ...@@ -42,27 +42,19 @@ export default {
}, },
}, },
methods: { methods: {
getDataFromApi(_url) { init() {
return new Promise((resolve, reject) => {
this.$http this.$http
.get(_url) .get("/apaas/serviceapp/v3/servicemarket/detail", {
params: {
serviceId: 666,
},
})
.then((response) => { .then((response) => {
resolve(response.body); console.log(response.data);
}) })
.catch(function(error) { .catch(function(error) {
reject(error);
});
});
},
init() {
this.getDataFromApi(`/static/serviceBaseInfo.json`).then(
({ sjfw }) => {
this.baseInfo = sjfw;
},
(error) => {
console.log(error); console.log(error);
} });
);
}, },
}, },
mounted() { mounted() {
......
This diff is collapsed.
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