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

update

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