diff --git a/src/js/form/style.scss b/src/js/form/style.scss index 6908667..c53dc7d 100644 --- a/src/js/form/style.scss +++ b/src/js/form/style.scss @@ -54,10 +54,10 @@ } -.do-radio {position:relative;display:inline-block;width:auto;height:30px;padding:0 10px;line-height:30px;text-align:center;cursor:default;font-size:14px; +.do-radio {position:relative;display:inline-block;width:auto;height:30px;padding-right:10px;line-height:30px;text-align:center;cursor:default;font-size:14px; - &__box {float:left;width:20px;height:20px;margin:5px;border:1px solid nth($cgr, 1);border-radius:50%;} + &__box {float:left;width:20px;height:20px;margin:5px;margin-left:0;border:1px solid nth($cgr, 1);border-radius:50%;} &.checked &__box::after {display:block;width:14px;height:14px;margin:2px;border-radius:50%;content:""} &.teal &__box {border-color:nth($ct, 1); @@ -115,7 +115,7 @@ -.do-switch {position:relative;display:inline-block;width:40px;height:30px;cursor:default; +.do-switch {position:relative;display:inline-block;width:50px;height:30px;padding-right:10px;cursor:default; &__label {position:relative;display:inline-block;width:100%;height:16px;margin:7px 0;background:nth($cp, 3);border-radius:12px;} @@ -164,10 +164,10 @@ } -.do-checkbox {position:relative;display:inline-block;width:auto;height:30px;padding:0 10px;line-height:30px;text-align:center;cursor:default;font-size:14px; +.do-checkbox {position:relative;display:inline-block;width:auto;height:30px;padding-right:10px;line-height:30px;text-align:center;cursor:default;font-size:14px; - &__box {float:left;width:20px;height:20px;margin:5px;line-height:18px;border:1px solid nth($cgr, 1);border-radius:3px;font-size:18px;text-align:center; + &__box {float:left;width:20px;height:20px;margin:5px;margin-right:0;line-height:18px;border:1px solid nth($cgr, 1);border-radius:3px;font-size:18px;text-align:center; } &.checked &__box {color:#fff;font-weight:bold;} diff --git a/src/js/meditor/addon/attach.js b/src/js/meditor/addon/attach.js index d9ffd80..b4935e8 100644 --- a/src/js/meditor/addon/attach.js +++ b/src/js/meditor/addon/attach.js @@ -194,11 +194,15 @@ function uploadFile(vm, tool) { this.uploadQueue[idx].progress = val + '%' }) .then(res => { - return res.data + if (vm.props.afterUpload) { + return vm.props.afterUpload(res) + } else { + return res.data.url + } }) }) - .then(data => { - this.uploadQueue[idx].url = data.url + .then(url => { + this.uploadQueue[idx].url = url }) .catch(err => { Anot.error(err) @@ -209,10 +213,14 @@ function uploadFile(vm, tool) { this.uploadQueue[idx].progress = val + '%' }) .then(res => { - return res.data + if (vm.props.afterUpload) { + return vm.props.afterUpload(res) + } else { + return res.data.url + } }) - .then(data => { - this.uploadQueue[idx].url = data.url + .then(url => { + this.uploadQueue[idx].url = url }) .catch(err => { Anot.error(err) @@ -234,19 +242,30 @@ function uploadScreenshot(vm, blob) { return Promise.reject('something wrong with beforeUpload') } return upload.then(res => { - return res.data + if (vm.props.afterUpload) { + return vm.props.afterUpload(res) + } else { + return res.data.url + } }) }) - .then(data => { - vm.insert(`![截图](${data.url})`) + .then(url => { + vm.insert(`![截图](${url})`) + }) + .catch(err => { + Anot.error(err) }) } else { upload .then(res => { - return res.data + if (vm.props.afterUpload) { + return vm.props.afterUpload(res) + } else { + return res.data.url + } }) - .then(data => { - vm.insert(`![截图](${data.url})`) + .then(url => { + vm.insert(`![截图](${url})`) }) } }