|
@@ -162,7 +162,9 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="editor-wrapper">
|
|
|
- <editor id="editor" class="ql-container" placeholder="开始输入..." show-img-size
|
|
|
+ <editor id="editor" class="ql-container"
|
|
|
+
|
|
|
+ placeholder="开始输入..." show-img-size
|
|
|
show-img-toolbar show-img-resize @statuschange="onStatusChange"
|
|
|
:read-only="readOnly" @ready="onEditorReady">
|
|
|
</editor>
|
|
@@ -176,7 +178,7 @@
|
|
|
</template>
|
|
|
|
|
|
</view>
|
|
|
- <view class="submitBtn">
|
|
|
+ <view class="submitBtn" v-if="isReady">
|
|
|
<u-button type="info" class="submitBtn30" @click="submit(0)">保存</u-button>
|
|
|
<u-button type="primary" class="submitBtn60" @click="submit(1)">提交</u-button>
|
|
|
</view>
|
|
@@ -213,6 +215,7 @@
|
|
|
//editor
|
|
|
readOnly: false,
|
|
|
formats: {},
|
|
|
+ editorCtx:"",
|
|
|
//editor
|
|
|
oatype: "",
|
|
|
|
|
@@ -242,8 +245,9 @@
|
|
|
|
|
|
},
|
|
|
id: "",
|
|
|
- placeholder: '开始输入...'
|
|
|
-
|
|
|
+ placeholder: '开始输入...',
|
|
|
+ isReady:true,
|
|
|
+ themeWordKey:"",
|
|
|
}
|
|
|
},
|
|
|
onLoad(op) {
|
|
@@ -286,7 +290,22 @@
|
|
|
}
|
|
|
return true
|
|
|
},
|
|
|
+
|
|
|
submit(draftStatus) {
|
|
|
+ if(this.editorCtx){
|
|
|
+ var _this=this
|
|
|
+ this.formData[this.themeWordKey]=this.editorCtx.getContents({
|
|
|
+ success(obj){
|
|
|
+ _this.formData[_this.themeWordKey]=obj.html
|
|
|
+ console.log(obj.html)
|
|
|
+ _this.submitApi(draftStatus);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.submitApi(draftStatus);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitApi(draftStatus) {
|
|
|
if(draftStatus){
|
|
|
var c=this.inspect()
|
|
|
if(!c){
|
|
@@ -301,6 +320,8 @@
|
|
|
this.formData.draftStatus = draftStatus
|
|
|
this.formData.formId = this.oatype
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
if(this.$refs.uUpload){
|
|
|
var list=this.$refs.uUpload[0].lists.filter(val => {
|
|
@@ -381,11 +402,24 @@
|
|
|
this.formData[obj.key] = applyContent[obj.key]
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ if(this.editorCtx){
|
|
|
+ var _this=this
|
|
|
+ //console.log(_this.formData.themeWord)
|
|
|
+ this.editorCtx.setContents({
|
|
|
+ html:_this.formData[_this.themeWordKey]
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- //(this.formData)
|
|
|
+ //console.log("formData",this.formData)
|
|
|
////(this.formData.maintenanceDescription,res.data.applyContent.maintenanceDescription)
|
|
|
}).catch(error => {
|
|
|
+ this.isReady=false;
|
|
|
+ if(!error){
|
|
|
+ error="未配置审批流程,请联系管理员"
|
|
|
+ }
|
|
|
uni.showToast({
|
|
|
title: error,
|
|
|
icon: "none"
|
|
@@ -417,6 +451,10 @@
|
|
|
for (var i in this.fieldList) {
|
|
|
var obj = this.fieldList[i];
|
|
|
this.formData[obj.key] = ""
|
|
|
+ if(obj.type.indexOf('texteditor')>-1){
|
|
|
+ this.themeWordKey=obj.key
|
|
|
+ console.log("this.themeWordKey",this.themeWordKey)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.action = process.car.BASE_URL + "uploadPicture"
|
|
@@ -463,6 +501,15 @@
|
|
|
// #ifdef APP-PLUS || MP-WEIXIN || H5
|
|
|
uni.createSelectorQuery().select('#editor').context((res) => {
|
|
|
this.editorCtx = res.context
|
|
|
+
|
|
|
+ if(this.editorCtx){
|
|
|
+ var _this=this
|
|
|
+ //console.log(_this.formData.themeWord)
|
|
|
+ this.editorCtx.setContents({
|
|
|
+ html:_this.formData[_this.themeWordKey]
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}).exec()
|
|
|
// #endif
|
|
|
},
|
|
@@ -622,7 +669,12 @@
|
|
|
width: 200%;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ // .oawork-itemline {
|
|
|
+ // .oawork-item1_a {
|
|
|
+
|
|
|
+ // width: 100%;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
.oawork-textlong {
|
|
|
.oawork-item1_a {
|
|
|
width: 100%;
|