|
@@ -101,19 +101,15 @@
|
|
|
</van-dialog>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
|
- <div class="rowTextArea">
|
|
|
- <van-field
|
|
|
- v-model="inputForm.into"
|
|
|
- center
|
|
|
- label="内容:"
|
|
|
- label-align="top"
|
|
|
- />
|
|
|
- <div name="editor" id="editor" ref="editor"></div>
|
|
|
- </div>
|
|
|
+ <van-field label="内容:" label-align="top">
|
|
|
+ <template #input>
|
|
|
+ <wang-editor ref="contentEditor" v-model="inputForm.content" />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
</van-cell-group>
|
|
|
</div>
|
|
|
<div class="subbtn">
|
|
|
- <van-button type="primary">提交</van-button>
|
|
|
+ <van-button type="primary" @click="submit">提交</van-button>
|
|
|
<van-button type="default" hairline>取消</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -127,9 +123,9 @@ import PrivatePartyPointService from "@/api/privateparty/PrivatePartyPointServic
|
|
|
import UserManage from "@/api/user/UserManage";
|
|
|
import { useRoute } from "vue-router";
|
|
|
// 富文本编辑器
|
|
|
-import EWangEditor from "wangeditor";
|
|
|
+import WangEditor from "@/components/editor/WangEditor";
|
|
|
export default {
|
|
|
- components: { personList },
|
|
|
+ components: { personList, WangEditor },
|
|
|
setup() {
|
|
|
// 加载
|
|
|
let isLoading = ref(true);
|
|
@@ -157,7 +153,7 @@ export default {
|
|
|
state: "0",
|
|
|
assessment: "0",
|
|
|
});
|
|
|
-
|
|
|
+ const contentEditor = ref(null);
|
|
|
let route = useRoute();
|
|
|
onMounted(() => {
|
|
|
// 根据路由初始化
|
|
@@ -173,37 +169,13 @@ export default {
|
|
|
inputForm.value.relatedPersons.name += data.name + ",";
|
|
|
});
|
|
|
});
|
|
|
+ contentEditor.value.init(inputForm.value.content);
|
|
|
isLoading.value = false;
|
|
|
});
|
|
|
} else {
|
|
|
+ contentEditor.value.init(inputForm.value.content);
|
|
|
isLoading.value = false;
|
|
|
}
|
|
|
- // 富文本编辑器
|
|
|
- let editor = new EWangEditor("#editor");
|
|
|
- editor.config.uploadImgShowBase64 = true;
|
|
|
- editor.config.onchangeTimeout = 400;
|
|
|
-
|
|
|
- editor.config.customAlert = (err) => {
|
|
|
- console.log(err);
|
|
|
- };
|
|
|
-
|
|
|
- editor.customConfig = editor.customConfig
|
|
|
- ? editor.customConfig
|
|
|
- : editor.config;
|
|
|
-
|
|
|
- editor.customConfig.onchange = (html) => {
|
|
|
- data.editorContent = html;
|
|
|
- console.log(html);
|
|
|
- };
|
|
|
- //以下为新增
|
|
|
- const menuItem = [
|
|
|
- //工具栏里有哪些工具
|
|
|
- "image",
|
|
|
- ];
|
|
|
- editor.config.menus = [...menuItem]; /* 应用设置好的工具栏 */
|
|
|
- editor.config.height = 100; //你可能发现这个编辑器是没法用样式调高度的?
|
|
|
- //新增至此
|
|
|
- editor.create();
|
|
|
});
|
|
|
// 获取活动时间
|
|
|
let showAct = ref(false);
|
|
@@ -258,6 +230,13 @@ export default {
|
|
|
.map((option) => option.name)
|
|
|
.join("/");
|
|
|
};
|
|
|
+ // // 富文本传值
|
|
|
+ // const change = (val)=>{
|
|
|
+ // console.log("富文本数据",val);
|
|
|
+ // };
|
|
|
+ const submit = () => {
|
|
|
+ console.log("富文本数据", inputForm.value.content);
|
|
|
+ };
|
|
|
return {
|
|
|
isLoading,
|
|
|
inputForm,
|
|
@@ -279,6 +258,9 @@ export default {
|
|
|
options,
|
|
|
onFinish,
|
|
|
cascaderValue,
|
|
|
+ contentEditor,
|
|
|
+ // change,
|
|
|
+ submit,
|
|
|
};
|
|
|
},
|
|
|
};
|
|
@@ -321,19 +303,12 @@ export default {
|
|
|
.van-cell__value .van-field__right-icon .van-icon-location {
|
|
|
color: #36a7f3 !important;
|
|
|
}
|
|
|
-.rowTextArea {
|
|
|
- width: 98%;
|
|
|
-}
|
|
|
-.rowTextArea::v-deep .van-cell {
|
|
|
- display: flow-root;
|
|
|
-}
|
|
|
#editor {
|
|
|
position: relative;
|
|
|
- top: -40px;
|
|
|
- height: 100px;
|
|
|
+ height: 200px;
|
|
|
}
|
|
|
.w-e-text-container {
|
|
|
- height: 100px !important;
|
|
|
+ height: 150px !important;
|
|
|
}
|
|
|
.subbtn {
|
|
|
margin: 20px;
|