Commit 91606d68 authored by 黄奎's avatar 黄奎

页面修改

parent 4fe69012
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -50,7 +50,7 @@
</div>
<el-tooltip v-for="(item,index) in PageList" :key="index" class="item" effect="dark"
:content="'双击选中【'+item.Name+'】'" placement="top-start">
<div @click="PageSelect(item,1)" @dblclick="PageSelect(item,2)" :class="selectId==item.Id ? 'selected' :''"
<div @click="PageSelect(item,1)" @dblclick="PageSelect(item,2)" :class="getChecked(item) ? 'selected' :''"
class="el-tooltip item app-attachment-item">
<img :src="getIconLink(item.Path)" class="app-attachment-img" style="width: 100px; height: 100px;">
<div class="app-attachment-name">{{item.Name}}</div>
......@@ -155,7 +155,7 @@
WithHeight: 0,
},
selectId: -1,
emitmsg: {},
emitmsg: [],
}
},
created() {
......@@ -178,14 +178,38 @@
this.GetPageList();
},
methods: {
getChecked(item) {
var isChecked = false;
if (this.emitmsg && this.emitmsg.length > 0) {
this.emitmsg.forEach(eItem => {
if (eItem.selectId == item.Id && !isChecked) {
isChecked = true;
}
});
}
return isChecked;
},
InitData(Type) {
this.czType = Type;
this.selectId = -1;
},
SelectImgId() {
this.$emit('SelectId', this.emitmsg)
//多选
if (this.IsMultiple) {
this.$emit('SelectId', this.emitmsg)
}
//单选
else {
if (this.emitmsg && this.emitmsg.length > 0) {
var result = {
selectId: this.emitmsg[0].selectId,
url: this.emitmsg[0].url
};
this.$emit('SelectId', result)
}
}
this.selectId = -1;
this.emitmsg = [];
},
UploadImage(file) {
this.UploadFileToTencent(this.FileType().GoodsImg, file.file, res => {
......@@ -204,18 +228,32 @@
}
})
},
// clickType 1单击 2双击
//选择图片 clickType 1单击 2双击
PageSelect(item, clickType) {
this.emitmsg = {
selectId: item.Id,
url: item.Path
//多选
if (this.IsMultiple) {
var findIndex = this.emitmsg.findIndex(eItem => eItem.selectId == item.Id);
if (findIndex > -1) {
//第二次点击相同图片就删除
this.emitmsg.splice(findIndex, 1)
} else {
this.emitmsg.push({
selectId: item.Id,
url: item.Path
});
}
} else {
this.emitmsg = [];
this.emitmsg.push({
selectId: item.Id,
url: item.Path
});
}
this.selectId = item.Id;
if (clickType == 2) {
this.SelectImgId();
}
},
addGroup() {
this.addGroupMsgDig = true;
this.addGroupMsg = {
......@@ -224,8 +262,8 @@
Type: 1,
Sort: '',
}
},
//删除分组
HsGroup(item) {
let that = this;
that.$confirm('是否删除?', '提示', {
......@@ -240,7 +278,6 @@
if (res.data.resultCode === 1) {
this.GetMemberGradeList();
this.Success(res.data.message)
} else {
this.Error(res.data.message);
}
......@@ -269,7 +306,6 @@
this.GetMemberGradeList();
this.Success(res.data.message)
this.addGroupMsgDig = false;
} else {
this.Error(res.data.message);
}
......@@ -306,7 +342,6 @@
this.PageList = data;
})
},
},
}
......
......@@ -2,8 +2,9 @@
<div>
<textarea type="text/plain" :id="id"></textarea>
<!-- 选择图片 -->
<el-dialog title="选择文件" :visible.sync="changeState" width="1240px">
<ChooseImg @SelectId="SelectId"></ChooseImg>
<ChooseImg @SelectId="SelectId" :IsMultiple="IsMultiple"></ChooseImg>
</el-dialog>
</div>
</template>
......@@ -30,6 +31,10 @@
config: {
type: Object
},
//是否多选
IsMultiple: {
type: Boolean
}
},
mounted() {
this.loadUe();
......@@ -37,9 +42,7 @@
watch: {
defaultMsg(newVal, oldVal) {
if (!this.isInputChange && newVal) {
if (this.editor && this.editor.isReady === 1) {
// this.editor.setContent(newVal);
} else {
if (this.editor && this.editor.isReady === 1) {} else {
this.tempContent = newVal;
}
}
......@@ -49,17 +52,25 @@
},
},
methods: {
SetVal(val){
SetVal(val) {
this.editor.setContent(val);
},
InitData() {
},
SelectId(e) {
if (e) {
SelectId(resultMsg) {
if (resultMsg) {
let html = '';
this.ue = UE.getEditor(this.id);
html = '<img src="' + this.domainManager().ImageUrl + e.url + '" style="max-width: 100%;">';
if (this.IsMultiple) {
if (resultMsg.length > 0) {
resultMsg.forEach(item => {
html += '<img src="' + this.getIconLink(item.url) + '" style="max-width: 100%;" />';
})
}
} else {
html = '<img src="' + this.getIconLink(resultMsg.url) + '" style="max-width: 100%;" />';
}
this.ue.execCommand('inserthtml', html);
}
this.changeState = false;
......
......@@ -265,9 +265,9 @@ export default {
MallBaseId: MallBaseId,
TenantId: TenantId,
EmpId: EmpId,
// MiniAppId:"wxacd9f8cc3480d29e",
// OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
// UserId:19992,
MiniAppId:"wxacd9f8cc3480d29e",
OpenId:"ow_7I5ZQKhAB66yvOTGI35Xk-Kmg",
UserId:19992,
}
return postData
},
......
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