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