Commit 6000b230 authored by 黄媛媛's avatar 黄媛媛

update

parent 7bc36378
......@@ -131,8 +131,10 @@
<span @click="addEquityList" style="color: rgb(53, 53, 53);font-size: 14px;">新增权益</span>
</div>
</el-form-item>
<el-form-item label="会员规则" prop="MemberSpecification">
<el-form-item class="hygz" label="会员规则" prop="MemberSpecification">
<div style="width:455px">
<UE :defaultMsg=defaultMsg :config=config ref="ue" ></UE>
</div>
</el-form-item>
</el-form>
......@@ -147,16 +149,20 @@
</div>
</template>
<script>
import UE from '@/components/global/UE.vue'
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
components: {
ChooseImg
ChooseImg,UE
},
data() {
return {
icon1:'',
icon2:'',
icon3:'',
loading:false,
defaultMsg: '',
config: {
initialFrameWidth: null,
initialFrameHeight: 350,
},
currentPage4:3,
changeState:false,
val:'',
......@@ -210,9 +216,15 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
};
},
created() {
},
mounted(){
console.log("this.$refs.ue",this.$refs.ue)
if(this.$route.query.GradeId){
this.GradeId=this.$route.query.GradeId;
this.getData()
}else{
this.$refs.ue.InitData();
}
},
methods: {
......@@ -251,9 +263,10 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
this.addMsg.EquityList.splice(index, 1);
},
Save(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
let content = this.$refs.ue.getUEContent();
this.addMsg.MemberSpecification=content;
let cmd="/api/user/SetMemberGradeInfo";
this.apipost(cmd,this.addMsg,
res => {
......@@ -286,21 +299,22 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
this.loading=false;
if(res.data.resultCode==1){
this.addMsg=res.data.data;
this.addMsg.MallBaseId=this.getLocalStorage().MallBaseId
this.addMsg.MallBaseId=this.getLocalStorage().MallBaseId;
this.defaultMsg=res.data.data.MemberSpecification;
this.$refs.ue.InitData();
}
})
},
},
mounted() {
}
};
</script>
<style>
.setMember .hygz .el-form-item__content{
line-height:inherit!important;
}
.setMember .setTable .el-table__body .cell{
display: flex;
align-items: center;
......
......@@ -29,22 +29,22 @@
},
},
mounted() {
const _this = this;
},
methods: {
InitData(){
const _this = this;
this.editor = UE.getEditor('editor', this.config); // 初始化UE
this.editor.addListener("ready", function () {
_this.editor.setContent(_this.defaultMsg); // 确保UE加载完成后,放入内容。
});
this.loadUe();
},
methods: {
SelectId(e) {
console.log("eee",e);
if (e) {
let html = '';
this.ue = UE.getEditor('editor');
html= '< img src="' + this.domainManager().ImageUrl+e.url + '" style="max-width: 100%;">';
console.log("this.ue ",this.ue)
html= '<img src="' + this.domainManager().ImageUrl+e.url + '" style="max-width: 100%;">';
this.ue.execCommand('inserthtml', html);
}
this.changeState=false;
......@@ -55,19 +55,19 @@
loadUe() {
const vm = this;
this.ue = UE.getEditor('editor');
this.ue.addListener('ready', editor => {
if (this.tempContent) {
this.ue.setContent(this.tempContent);
}
});
this.ue.addListener('keyup', editor => {
this.isInputChange = true;
this.$emit('input', this.ue.getContent());
});
this.ue.addListener('contentChange', editor => {
this.isInputChange = true;
this.$emit('input', this.ue.getContent());
});
// this.ue.addListener('ready', editor => {
// if (this.tempContent) {
// this.ue.setContent(this.tempContent);
// }
// });
// this.ue.addListener('keyup', editor => {
// this.isInputChange = true;
// this.$emit('input', this.ue.getContent());
// });
// this.ue.addListener('contentChange', editor => {
// this.isInputChange = true;
// this.$emit('input', this.ue.getContent());
// });
let self = this;
UE.registerUI('appinsertimage', (editor, uiName) => {
return new UE.ui.Button({
......@@ -83,9 +83,6 @@
});
}
},
beforeInit(){
console.log("sagg")
},
destroyed() {
this.editor.destroy();
},
......
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