Commit 116f0064 authored by 黄奎's avatar 黄奎

页面修改

parent 1b634083
......@@ -19,7 +19,6 @@ let downloadExcelEasy = {
let data = [tableH];
// 组装表格内容
dataSource.forEach((x,index)=>{
console.log(index);
let obj = [];
obj.push(x.LineName+" ");
obj.push(x.TCNUM);
......@@ -42,21 +41,9 @@ let downloadExcelEasy = {
const ws = XLSX.utils.aoa_to_sheet(data);
ws['!cols'] = wscols;
ws['!rows'] = [];
// colName.forEach((x,index)=>{
// wscols.push({wpx: 100})
// });
// dataSource.forEach((x,index)=>{
// if(index===dataSource.length)
// ws['!rows'].push({ hpx:30 });
// else
// ws['!rows'].push({});
// });
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, xlsxName);
var dataInfo = wb.Sheets[wb.SheetNames[0]];
console.log(data[0].length);
console.log(colName.length);
// return
data[0].forEach((x,i)=>{
dataInfo[colName[i]+'1'].s={
fill: { fgColor: { rgb: "#ffff00"}},
......@@ -74,12 +61,9 @@ let downloadExcelEasy = {
}
}
});
console.log(dataInfo);
// return
XLSX.writeFile(wb, xlsxName + ".xlsx")
},
countColumn: function (data) {
console.log(data.length)
let list = [];
let col = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
data.forEach((item , index)=> {
......@@ -88,7 +72,6 @@ let downloadExcelEasy = {
}else if (index > 25 && index < 52) {
list.push('A'+col[index-col.length])
}else if (index > 51 && index < 78) {
console.log(index-(col.length*2));
list.push('B'+col[index-(col.length*2)])
}
});
......
......@@ -191,11 +191,10 @@ var lunarCalendar = {
return { isLeap, year, lunarmonth, lunarDay };
},
/**
* 传入阳历年月日获得详细的公历、农历object信息 <=>Array
* 传入阳历年月日获得详细的公历、农历object信息 lunarCalendar.initLunar(1987,11)<=>Array
* @param y solar year
* @param m solar month
* @return Array
* @eg:console.log(lunarCalendar.initLunar(1987,11));
*/
initLunar: function (yearStr, monthStr, dayNum) {
//年份限定、上限
......
......@@ -366,10 +366,8 @@ export default {
this.apipost("line_post_GetLineEmployeeList",this.msg, res => {
if (res.data.resultCode == 1) {
this.loading = false;
this.DataList = res.data.data.pageData;
this.total=res.data.data.count;
console.log("this.DataList",this.DataList)
}else{
this.Error(res.data.message)
}
......
......@@ -151,7 +151,6 @@
this.Loading = false;
if (res.data.resultCode == 1) {
this.DataList = res.data.data.HotelOrderListReport;
console.log("this.DataList",this.DataList)
} else {
this.Error(res.data.message);
}
......
<style>
@import "../../assets/css/advert/advertfont";
@import "../../assets/css/advert/advmanager";
</style>
<template>
<div class="adv-box">
<div v-if='bg!=""' v-loading='isLoading'>
<div class="board" ref="board" >
<div class="board" ref="board">
<img :src="bg" class="bg" @click="currentNode={},currentNodeList=[]" />
<a style="display:none" ref='down' ></a>
<VueDraggableResizable @click="moreSelect()" v-for="item in nodes" tabindex="0" :key="item.nodeId" :active="item.active" :parent="item.rotate==0||item.rotate==360?true:false" :style="{transform:'rotate('+item.rotate+'deg)'}" @activated="onActivated(item.nodeId)" :w="item.width" :h="item.height" :x="item.x" :y="item.y" :minh='item.fontSize' :minw='item.fontSize' :z="item.zindex" @resizestop="onResizstop" @dragstop="onDragstop">
<div v-if="item.type==0" class='text' :style="{'font-size':item.fontSize+'px','letter-spacing':item.letterSpacing+'px','background':item.bg,'font-family':item.fontname,'color':item.color,'line-height':item.lineHeight,'text-align':item.textAlign,'font-weight':(item.isBold==0?'400':'bold'),'font-style':(item.isXie==0?'normal':'italic'),'border-radius':item.radius+'px','text-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'text-stroke':item.strokeWidth+'px '+item.strokeColor}">{{item.content}}</div>
<img class="img" v-if="item.type==1" :src="item.src" :style="{'border-radius':item.radius+'px','box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100),'border':item.strokeWidth+'px solid '+item.strokeColor}" />
<div style='height:1px' v-if="item.type==2" :style="{'border-bottom':item.height+'px '+item.style+' '+item.bg,'border-radius':item.radius+'px','box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100)}"></div>
<img class="img" v-if="item.type==3" :src="item.src" :style="{'box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100)}" />
<a style="display:none" ref='down'></a>
<VueDraggableResizable @click="moreSelect()" v-for="item in nodes" tabindex="0" :key="item.nodeId"
:active="item.active" :parent="item.rotate==0||item.rotate==360?true:false"
:style="{transform:'rotate('+item.rotate+'deg)'}" @activated="onActivated(item.nodeId)" :w="item.width"
:h="item.height" :x="item.x" :y="item.y" :minh='item.fontSize' :minw='item.fontSize' :z="item.zindex"
@resizestop="onResizstop" @dragstop="onDragstop">
<div v-if="item.type==0" class='text'
:style="{'font-size':item.fontSize+'px','letter-spacing':item.letterSpacing+'px','background':item.bg,'font-family':item.fontname,'color':item.color,'line-height':item.lineHeight,'text-align':item.textAlign,'font-weight':(item.isBold==0?'400':'bold'),'font-style':(item.isXie==0?'normal':'italic'),'border-radius':item.radius+'px','text-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'text-stroke':item.strokeWidth+'px '+item.strokeColor}">
{{item.content}}</div>
<img class="img" v-if="item.type==1" :src="item.src"
:style="{'border-radius':item.radius+'px','box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100),'border':item.strokeWidth+'px solid '+item.strokeColor}" />
<div style='height:1px' v-if="item.type==2"
:style="{'border-bottom':item.height+'px '+item.style+' '+item.bg,'border-radius':item.radius+'px','box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100)}">
</div>
<img class="img" v-if="item.type==3" :src="item.src"
:style="{'box-shadow':item.hshadow+'px '+item.vshadow+'px '+item.blur+'px '+item.shadowcolor,'opacity':(item.alpha/100)}" />
</VueDraggableResizable>
</div>
<ul class="tools">
......@@ -45,7 +56,7 @@
<el-tooltip effect="dark" content="插入图片" placement="top-start">
<i class="iconfont icon-tupian1"></i>
</el-tooltip>
<input type="file" ref='addImage' style="display:none" @change="addPic"/>
<input type="file" ref='addImage' style="display:none" @change="addPic" />
</li>
<li @click="tiggerMax" class="source">
原图
......@@ -84,30 +95,43 @@
</el-option>
</el-select>
<label>加粗</label>
<el-switch v-model="currentNode.isBold" active-color="#13ce66" active-value="1" inactive-value="0" inactive-color="#ccc">
<el-switch v-model="currentNode.isBold" active-color="#13ce66" active-value="1" inactive-value="0"
inactive-color="#ccc">
</el-switch>
<label>斜体</label>
<el-switch v-model="currentNode.isXie" active-color="#13ce66" active-value="1" inactive-value="0" inactive-color="#ccc">
<el-switch v-model="currentNode.isXie" active-color="#13ce66" active-value="1" inactive-value="0"
inactive-color="#ccc">
</el-switch>
</el-form-item>
<el-form-item label="字体阴影:">
<el-col :span="6"><el-input size="mini" v-model="currentNode.hshadow">
<el-col :span="6">
<el-input size="mini" v-model="currentNode.hshadow">
<template slot="prepend">水平位置</template>
</el-input></el-col>
<el-col :span="6"><el-input size="mini" v-model="currentNode.vshadow">
</el-input>
</el-col>
<el-col :span="6">
<el-input size="mini" v-model="currentNode.vshadow">
<template slot="prepend">垂直位置</template>
</el-input></el-col>
<el-col :span="6"><el-input size="mini" v-model="currentNode.blur">
</el-input>
</el-col>
<el-col :span="6">
<el-input size="mini" v-model="currentNode.blur">
<template slot="prepend">距离</template>
</el-input></el-col>
<el-col :span="6"><el-color-picker v-model="currentNode.shadowcolor" show-alpha>
</el-input>
</el-col>
<el-col :span="6">
<el-color-picker v-model="currentNode.shadowcolor" show-alpha>
<template slot="prepend">颜色</template>
</el-color-picker></el-col>
</el-color-picker>
</el-col>
</el-form-item>
<el-form-item label="对齐方式:">
<el-button type="primary" @click='alignMethod(1)'><i class="iconfont icon-zuoduiqi" style="margin-right:5px"></i>左对齐</el-button>
<el-button type="primary" @click='alignMethod(2)'><i class="iconfont icon-juzhongduiqi" style="margin-right:5px"></i>居中</el-button>
<el-button type="primary" @click='alignMethod(3)'><i class="iconfont icon-youduiqi" style="margin-right:5px"></i>右对齐</el-button>
<el-button type="primary" @click='alignMethod(1)'><i class="iconfont icon-zuoduiqi"
style="margin-right:5px"></i>左对齐</el-button>
<el-button type="primary" @click='alignMethod(2)'><i class="iconfont icon-juzhongduiqi"
style="margin-right:5px"></i>居中</el-button>
<el-button type="primary" @click='alignMethod(3)'><i class="iconfont icon-youduiqi"
style="margin-right:5px"></i>右对齐</el-button>
</el-form-item>
<el-form-item label="文字颜色:">
......@@ -141,7 +165,7 @@
</el-form>
</div>
<div class="resorece max-resource" @click="tiggerMax" v-if="isMax">
<img :src="st"/>
<img :src="st" />
</div>
<div class="property-box" v-if='currentNode.type==1 && !isMax'>
<el-form ref="form" :model="currentNode" label-width="100px">
......@@ -160,18 +184,26 @@
<el-slider v-model="currentNode.rotate" :max="360" :step="1"></el-slider>
</el-form-item>
<el-form-item label="阴影:">
<el-col :span="6"><el-input v-model="currentNode.hshadow">
<el-col :span="6">
<el-input v-model="currentNode.hshadow">
<template slot="prepend">水平位置</template>
</el-input></el-col>
<el-col :span="6"><el-input v-model="currentNode.vshadow">
</el-input>
</el-col>
<el-col :span="6">
<el-input v-model="currentNode.vshadow">
<template slot="prepend">垂直位置</template>
</el-input></el-col>
<el-col :span="6"><el-input v-model="currentNode.blur">
</el-input>
</el-col>
<el-col :span="6">
<el-input v-model="currentNode.blur">
<template slot="prepend">距离</template>
</el-input></el-col>
<el-col :span="6"><el-color-picker v-model="currentNode.shadowcolor" show-alpha>
</el-input>
</el-col>
<el-col :span="6">
<el-color-picker v-model="currentNode.shadowcolor" show-alpha>
<template slot="prepend">颜色</template>
</el-color-picker></el-col>
</el-color-picker>
</el-col>
</el-form-item>
<el-form-item label="透明:">
<el-slider v-model="currentNode.alpha" :max="100" :step="1"></el-slider>
......@@ -204,18 +236,26 @@
<el-slider v-model="currentNode.rotate" :max="360" :step="1"></el-slider>
</el-form-item>
<el-form-item label="阴影:">
<el-col :span="6"><el-input v-model="currentNode.hshadow">
<el-col :span="6">
<el-input v-model="currentNode.hshadow">
<template slot="prepend">水平位置</template>
</el-input></el-col>
<el-col :span="6"><el-input v-model="currentNode.vshadow">
</el-input>
</el-col>
<el-col :span="6">
<el-input v-model="currentNode.vshadow">
<template slot="prepend">垂直位置</template>
</el-input></el-col>
<el-col :span="6"><el-input v-model="currentNode.blur">
</el-input>
</el-col>
<el-col :span="6">
<el-input v-model="currentNode.blur">
<template slot="prepend">距离</template>
</el-input></el-col>
<el-col :span="6"><el-color-picker v-model="currentNode.shadowcolor" show-alpha>
</el-input>
</el-col>
<el-col :span="6">
<el-color-picker v-model="currentNode.shadowcolor" show-alpha>
<template slot="prepend">颜色</template>
</el-color-picker></el-col>
</el-color-picker>
</el-col>
</el-form-item>
<el-form-item label="透明:">
<el-slider v-model="currentNode.alpha" :max="100" :step="1"></el-slider>
......@@ -257,22 +297,31 @@
<el-button type="danger" @click='canvasQrCode'>重新生成二维码</el-button>
</el-form-item>
<el-form-item label="旋转:">
<el-input-number @mousewheel.native="whellRotate()" v-model="currentNode.rotate" :min="0" :max="360"></el-input-number>
<el-input-number @mousewheel.native="whellRotate()" v-model="currentNode.rotate" :min="0" :max="360">
</el-input-number>
<el-slider v-model="currentNode.rotate" :max="360" :step="1"></el-slider>
</el-form-item>
<el-form-item label="阴影:">
<el-col :span="6"><el-input size="mini" v-model="currentNode.hshadow">
<el-col :span="6">
<el-input size="mini" v-model="currentNode.hshadow">
<template slot="prepend">水平位置</template>
</el-input></el-col>
<el-col :span="6"><el-input size="mini" v-model="currentNode.vshadow">
</el-input>
</el-col>
<el-col :span="6">
<el-input size="mini" v-model="currentNode.vshadow">
<template slot="prepend">垂直位置</template>
</el-input></el-col>
<el-col :span="6"><el-input size="mini" v-model="currentNode.blur">
</el-input>
</el-col>
<el-col :span="6">
<el-input size="mini" v-model="currentNode.blur">
<template slot="prepend">距离</template>
</el-input></el-col>
<el-col :span="6"><el-color-picker v-model="currentNode.shadowcolor" show-alpha>
</el-input>
</el-col>
<el-col :span="6">
<el-color-picker v-model="currentNode.shadowcolor" show-alpha>
<template slot="prepend">颜色</template>
</el-color-picker></el-col>
</el-color-picker>
</el-col>
</el-form-item>
<el-form-item label="透明:">
<el-slider v-model="currentNode.alpha" :max="100" :step="1"></el-slider>
......@@ -319,10 +368,7 @@
<span>{{$t('advmanager.v_country')}}:</span>
<el-select v-model="msg.countryId" clearable class="w150" filterable>
<el-option :label="$t('advmanager.v_all')" value='0'></el-option>
<el-option v-for='item in countrys'
:key="item.ID"
:label="item.Name"
:value="item.ID">
<el-option v-for='item in countrys' :key="item.ID" :label="item.Name" :value="item.ID">
</el-option>
</el-select>
</li>
......@@ -335,11 +381,12 @@
</el-select>
</li>
<li>
<button class="hollowFixedBtn" type="button" @click="getaddatas(0)" style="top:-66px;right:10px;">{{$t('pub.searchBtn')}}</button>
<button class="hollowFixedBtn" type="button" @click="getaddatas(0)"
style="top:-66px;right:10px;">{{$t('pub.searchBtn')}}</button>
</li>
</ul>
</div>
<div class="content" >
<div class="content">
<!-- <ul>
<li v-for="x in addatas" :key="x.ID">
<div class="img-box">
......@@ -355,7 +402,8 @@
</div>
</li>
</ul> -->
<vueWaterfallEasy :imgsArr="addatas" ref="waterfall" @scrollReachBottom="handleCurrentChange" :maxCols='7' :imgWidth='208' :enablePullDownEvent='true'>
<vueWaterfallEasy :imgsArr="addatas" ref="waterfall" @scrollReachBottom="handleCurrentChange" :maxCols='7'
:imgWidth='208' :enablePullDownEvent='true'>
<template slot-scope="props">
<span class="money" v-if="props.value.IsFee==1">{{props.value.ChargeAmount.toFixed(2)}}</span>
<span class="free" v-else>{{$t('advmanager.v_free')}}</span>
......@@ -376,8 +424,8 @@
</div>
<el-dialog custom-class='isAssociatTeam' title="是否关联团期" :visible.sync="outerVisible" center>
<el-switch v-model="AssociatedTeam" active-color="#13ce66" inactive-color="#ff4949"
active-text="关联团期" inactive-text="不关联团期"></el-switch>
<el-switch v-model="AssociatedTeam" active-color="#13ce66" inactive-color="#ff4949" active-text="关联团期"
inactive-text="不关联团期"></el-switch>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" type="primary" @click="getFileBase64(2)">{{$t('pub.sureBtn')}}</button>
......@@ -389,350 +437,410 @@
</template>
<script>
import VueDraggableResizable from 'vue-draggable-resizable'
import QRCode from 'qrcode'
import browserMD5File from 'browser-md5-file';
import vueWaterfallEasy from 'vue-waterfall-easy'
import h2c from 'html2canvas'
// import Canvas2Image from 'Canvas2Image'
export default {
components:{
import VueDraggableResizable from 'vue-draggable-resizable'
import QRCode from 'qrcode'
import browserMD5File from 'browser-md5-file';
import vueWaterfallEasy from 'vue-waterfall-easy'
import h2c from 'html2canvas'
// import Canvas2Image from 'Canvas2Image'
export default {
components: {
VueDraggableResizable,
vueWaterfallEasy
},
data(){
return{
isLoading:true,
isMax:false,
outerVisible:false,
AssociatedTeam:true,
imgUrl:'',
currentZIndex:100,
currentMaxId:0,
nodes:[],
currentnodeId:-1,
user:{},
currentNode:{
nodeId:0,
type:-1,
lineHeight:'1',
bg:null,
color:'#333',
zindex:100,
content:'',
textAlign:'center',
fontSize:16,
fontname:'微软雅黑',
active:false,
letterSpacing:1,
isBold:0,
isXie:0,
radius:0,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
alpha:100,
width:0,
height:0,
style:'solid',
strokeWidth:0,
strokeColor:null
data() {
return {
isLoading: true,
isMax: false,
outerVisible: false,
AssociatedTeam: true,
imgUrl: '',
currentZIndex: 100,
currentMaxId: 0,
nodes: [],
currentnodeId: -1,
user: {},
currentNode: {
nodeId: 0,
type: -1,
lineHeight: '1',
bg: null,
color: '#333',
zindex: 100,
content: '',
textAlign: 'center',
fontSize: 16,
fontname: '微软雅黑',
active: false,
letterSpacing: 1,
isBold: 0,
isXie: 0,
radius: 0,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
alpha: 100,
width: 0,
height: 0,
style: 'solid',
strokeWidth: 0,
strokeColor: null
},
fonts:[],
bg:'',
st:'',
templateId:0,
backBg:'',
backSt:'',
lines:[],
teams:[],
modelTeams:[],
countrys:[],
addatas:[],
pageIndex:1,
pageSize:50,
total:0,
msg:{
lineId:'0',
teamId:'0',
countryId:'0',
type:'0'
fonts: [],
bg: '',
st: '',
templateId: 0,
backBg: '',
backSt: '',
lines: [],
teams: [],
modelTeams: [],
countrys: [],
addatas: [],
pageIndex: 1,
pageSize: 50,
total: 0,
msg: {
lineId: '0',
teamId: '0',
countryId: '0',
type: '0'
},
dataId:0,
isCtrl:false,
currentNodeList:[],
TCID:0,
dataId: 0,
isCtrl: false,
currentNodeList: [],
TCID: 0,
}
},
mounted(){
this.dataId=this.$route.query.id?this.$route.query.id:0
this.msg.lineId = this.$route.query.LineID?parseInt(this.$route.query.LineID):'0';
mounted() {
this.dataId = this.$route.query.id ? this.$route.query.id : 0
this.msg.lineId = this.$route.query.LineID ? parseInt(this.$route.query.LineID) : '0';
var QTCID = this.$route.query.TCID;
if(QTCID!=undefined){
if (QTCID != undefined) {
this.TCID = QTCID;
}else{
} else {
this.TCID = '';
}
this.user=JSON.parse(window.localStorage.userInfo)
if(this.dataId!=0){
this.bg=' '
this.user = JSON.parse(window.localStorage.userInfo)
if (this.dataId != 0) {
this.bg = ' '
this.loadObj()
}else{
this.isLoading=false
} else {
this.isLoading = false
}
//this.loadingFont(this.nodes[0])
this.nodes.forEach(x=>{
this.currentZIndex=x.zindex>this.currentZIndex?x.zindex:this.currentZIndex
this.currentMaxId=x.nodeId>this.currentMaxId?x.nodeId:this.currentMaxId
this.nodes.forEach(x => {
this.currentZIndex = x.zindex > this.currentZIndex ? x.zindex : this.currentZIndex
this.currentMaxId = x.nodeId > this.currentMaxId ? x.nodeId : this.currentMaxId
})
this.fonts.push({
'label': '默认',
'value': '微软雅黑'
})
this.fonts.push({
'label': '苹果黑体',
'value': 'pingfang'
})
this.fonts.push({
'label': '时尚中黑体',
'value': 'sszhjt'
})
this.fonts.push({
'label': '方正剪纸体',
'value': 'fzjzjt'
})
this.fonts.push({
'label': '方正喵呜体',
'value': 'fzmwt'
})
this.fonts.push({
'label': '方正铁筋隶书体',
'value': 'fztjlst'
})
this.fonts.push({
'label': '方正硬笔行书体',
'value': 'FZYBXSJW'
})
this.fonts.push({
'label': '汉仪萝卜体',
'value': 'hxlbjt'
})
this.fonts.push({
'label': '汉仪火柴体',
'value': 'hybqt'
})
this.fonts.push({
'label': '汉仪哈哈体',
'value': 'hyhht'
})
this.fonts.push({
'label': '汉仪凌波体',
'value': 'hylbt'
})
this.fonts.push({
'label': '汉仪清韵体',
'value': 'hyqytj'
})
this.fonts.push({
'label': '汉仪娃娃篆体',
'value': 'hywwzj'
})
this.fonts.push({
'label': '汉仪燕翎体',
'value': 'hyyltj'
})
this.fonts.push({
'label': '迷你菱心体',
'value': 'jlx'
})
this.fonts.push({
'label': '叶根友圆趣卡通体',
'value': 'katongjian'
})
this.fonts.push({
'label': '叶根友毛笔行书体',
'value': 'YGYXSZITI'
})
this.fonts.push({'label':'默认','value':'微软雅黑'})
this.fonts.push({'label':'苹果黑体','value':'pingfang'})
this.fonts.push({'label':'时尚中黑体','value':'sszhjt'})
this.fonts.push({'label':'方正剪纸体','value':'fzjzjt'})
this.fonts.push({'label':'方正喵呜体','value':'fzmwt'})
this.fonts.push({'label':'方正铁筋隶书体','value':'fztjlst'})
this.fonts.push({'label':'方正硬笔行书体','value':'FZYBXSJW'})
this.fonts.push({'label':'汉仪萝卜体','value':'hxlbjt'})
this.fonts.push({'label':'汉仪火柴体','value':'hybqt'})
this.fonts.push({'label':'汉仪哈哈体','value':'hyhht'})
this.fonts.push({'label':'汉仪凌波体','value':'hylbt'})
this.fonts.push({'label':'汉仪清韵体','value':'hyqytj'})
this.fonts.push({'label':'汉仪娃娃篆体','value':'hywwzj'})
this.fonts.push({'label':'汉仪燕翎体','value':'hyyltj'})
this.fonts.push({'label':'迷你菱心体','value':'jlx'})
this.fonts.push({'label':'叶根友圆趣卡通体','value':'katongjian'})
this.fonts.push({'label':'叶根友毛笔行书体','value':'YGYXSZITI'})
this.getline()
this.getcountry()
this.getaddatas(0)
var sUserAgent = navigator.userAgent;
var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform ==
"Macintosh") || (navigator.platform == "MacIntel");
document.addEventListener('keydown', e => {
if((e.keyCode === 17 && isWin) || (e.keyCode === 91 && isMac)){
if ((e.keyCode === 17 && isWin) || (e.keyCode === 91 && isMac)) {
this.isCtrl = true
}
})
document.addEventListener('keyup', e => {
if((e.keyCode === 17 && isWin) || (e.keyCode === 91 && isMac)){
if ((e.keyCode === 17 && isWin) || (e.keyCode === 91 && isMac)) {
this.isCtrl = false
}
})
},
methods:{
loadObj(){
let msg={'ID':this.dataId}
methods: {
loadObj() {
let msg = {
'ID': this.dataId
}
this.apipost("Advertising_post_Get", msg, x => {
this.isLoading=false
if(x.data.resultCode==1){
let data=x.data.data
this.dataId=data.id,
this.bg=data.pictureUrl+'?x-oss-process=image/resize,w_470'
this.st=data.samplePicturesUrl+'?x-oss-process=image/resize,w_470'
this.templateId=data.baseAdvertisingID
this.nodes=JSON.parse(data.content)
this.nodes.forEach(y=>{
this.currentZIndex=y.zindex>this.currentZIndex?y.zindex:this.currentZIndex
this.currentMaxId=y.nodeId>this.currentMaxId?y.nodeId:this.currentMaxId
this.isLoading = false
if (x.data.resultCode == 1) {
let data = x.data.data
this.dataId = data.id,
this.bg = data.pictureUrl + '?x-oss-process=image/resize,w_470'
this.st = data.samplePicturesUrl + '?x-oss-process=image/resize,w_470'
this.templateId = data.baseAdvertisingID
this.nodes = JSON.parse(data.content)
this.nodes.forEach(y => {
this.currentZIndex = y.zindex > this.currentZIndex ? y.zindex : this.currentZIndex
this.currentMaxId = y.nodeId > this.currentMaxId ? y.nodeId : this.currentMaxId
})
let reg = /^http(s)?:\/\/(.*?)\//
let getBlob=this.getFileBlob(data.pictureUrl.replace(reg,''),'aa.jpg')
let that=this
let getBlob = this.getFileBlob(data.pictureUrl.replace(reg, ''), 'aa.jpg')
let that = this
getBlob.then(blob => {
that.blobToDataURL(blob,function(e){
that.bg=e
that.blobToDataURL(blob, function (e) {
that.bg = e
})
});
} else {
this.dataId=0
this.bg=''
this.dataId = 0
this.bg = ''
}
},err => {})
}, err => {})
},
save(imgUrl){
this.isLoading=true;
let msg={
ID:this.dataId,
BaseAdvertisingID:this.templateId,
content:JSON.stringify(this.nodes),
AdvertisingPicUrl:'',
SecretKey:'',
fileName:'',
fileSize:'',
TCID:0,
IsAssociated:0,
save(imgUrl) {
this.isLoading = true;
let msg = {
ID: this.dataId,
BaseAdvertisingID: this.templateId,
content: JSON.stringify(this.nodes),
AdvertisingPicUrl: '',
SecretKey: '',
fileName: '',
fileSize: '',
TCID: 0,
IsAssociated: 0,
}
if(this.AssociatedTeam){
if (this.AssociatedTeam) {
msg.TCID = this.TCID;
msg.IsAssociated=1;
}else{
msg.IsAssociated = 1;
} else {
msg.TCID = this.TCID;
msg.IsAssociated=0;
msg.IsAssociated = 0;
}
let that=this
let that = this
let blob = that.base64ToBlob(imgUrl)
let newArr = [];
newArr.push(blob);
var fileName = `${that.uuid(10,10)}.png`
var path = `/Adv/user/${that.user.EmployeeId}/${fileName}`;
msg.AdvertisingPicUrl=path
msg.AdvertisingPicUrl = path
that.uploadBlob(path, newArr, x => {
browserMD5File(blob, function (err, md5) {
msg.SecretKey = md5;
msg.fileName = fileName;
msg.fileSize = blob.size;
that.apipost("Advertising_post_Set", msg, x => {
that.isLoading=false;
that.outerVisible=false;
if(x.data.resultCode==1){
that.isLoading = false;
that.outerVisible = false;
if (x.data.resultCode == 1) {
that.$message.success('保存成功!')
if(msg.ID==0){
that.dataId=x.data.data.result
if (msg.ID == 0) {
that.dataId = x.data.data.result
}
} else
that.$message.success(x.data.message)
},err => {})
}, err => {})
})
})
},
uuid(len, radix) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
var uuid = [], i;
var uuid = [],
i;
radix = radix || chars.length;
if (len) {
// Compact form
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix];
for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
} else {
var r;
uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
uuid[14] = '4';
for (i = 0; i < 36; i++) {
if (!uuid[i]) {
r = 0 | Math.random()*16;
r = 0 | Math.random() * 16;
uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
}
}
}
return uuid.join('');
},
goon(){
this.bg=''
this.st=''
this.bg=this.backBg
this.st=this.backSt
goon() {
this.bg = ''
this.st = ''
this.bg = this.backBg
this.st = this.backSt
},
returnback(){
this.backBg=this.bg
this.backSt=this.st
this.bg=''
this.st=''
returnback() {
this.backBg = this.bg
this.backSt = this.st
this.bg = ''
this.st = ''
//this.$message.success('已自动保存数据')
},
chosenbg(x){
this.bg=x.PictureUrl+'?x-oss-process=image/resize,w_470'
this.st=x.SamplePicturesUrl+'?x-oss-process=image/resize,w_470'
this.templateId=x.ID
chosenbg(x) {
this.bg = x.PictureUrl + '?x-oss-process=image/resize,w_470'
this.st = x.SamplePicturesUrl + '?x-oss-process=image/resize,w_470'
this.templateId = x.ID
let reg = /^http(s)?:\/\/(.*?)\//
let getBlob=this.getFileBlob(x.PictureUrl.replace(reg,''),'aa.jpg')
let that=this
let getBlob = this.getFileBlob(x.PictureUrl.replace(reg, ''), 'aa.jpg')
let that = this
getBlob.then(blob => {
that.blobToDataURL(blob,function(e){
that.bg=e
that.blobToDataURL(blob, function (e) {
that.bg = e
})
});
},
blobToDataURL(blob, callback) {
var a = new FileReader()
a.onload = function (e) { callback(e.target.result); }
a.onload = function (e) {
callback(e.target.result);
}
a.readAsDataURL(blob)
},
handleCurrentChange() {
this.pageIndex++
this.getaddatas(1)
},
getaddatas(type){
if(type==0){
this.pageIndex=1
getaddatas(type) {
if (type == 0) {
this.pageIndex = 1
}
let msg={
pageIndex:this.pageIndex,
pageSize:this.pageSize,
lineId:0,
SeriesId:0,
CountryId:this.msg.countryId,
AdvName:'',
IsFee:this.msg.type
let msg = {
pageIndex: this.pageIndex,
pageSize: this.pageSize,
lineId: 0,
SeriesId: 0,
CountryId: this.msg.countryId,
AdvName: '',
IsFee: this.msg.type
}
this.apipost("Advertising_get_GetAdvertisingList", msg, x => {
x.data.data.pageData.forEach(x=>{
x.src= this.compressImg(x.SamplePicturesUrl, "filt", 200, "")
x.id=x.ID
x.data.data.pageData.forEach(x => {
x.src = this.compressImg(x.SamplePicturesUrl, "filt", 200, "")
x.id = x.ID
})
if(x.data.data.pageData.length==0){
if (x.data.data.pageData.length == 0) {
this.$refs.waterfall.waterfallOver()
}
if(type==0){
this.addatas=x.data.data.pageData
}else{
this.addatas=this.addatas.concat(x.data.data.pageData)
if (type == 0) {
this.addatas = x.data.data.pageData
} else {
this.addatas = this.addatas.concat(x.data.data.pageData)
}
this.total=x.data.data.pageCount
},err => {})
this.total = x.data.data.pageCount
}, err => {})
},
getcountry(){
getcountry() {
this.apipost("dict_post_Destination_GetCountry", {}, x => {
this.countrys=x.data.data
},err => {})
this.countrys = x.data.data
}, err => {})
},
getteam(){
let msg={
'RB_Branch_id':this.user.RB_Branch_id,
'isTOOP':1,
'lineID':this.msg.lineId
getteam() {
let msg = {
'RB_Branch_id': this.user.RB_Branch_id,
'isTOOP': 1,
'lineID': this.msg.lineId
}
this.apipost("team_post_GetList", msg, x => {
this.teams=x.data.data
if(x.data.data.length>0)
this.msg.teamId=x.data.data[0].LtID
},err => {})
this.teams = x.data.data
if (x.data.data.length > 0)
this.msg.teamId = x.data.data[0].LtID
}, err => {})
},
changeLine(){
this.teams.splice(0,this.teams.length-1)
if(this.msg.lineId!==0){
changeLine() {
this.teams.splice(0, this.teams.length - 1)
if (this.msg.lineId !== 0) {
this.getteam()
}
},
changeLineForm(){
this.modelTeams.splice(0,this.modelTeams.length-1)
if(this.model.LineID!==0&&this.model.LineID!=''){
let msg={
'RB_Branch_id':this.user.RB_Branch_id,
'isTOOP':1,
'lineID':this.model.LineID
changeLineForm() {
this.modelTeams.splice(0, this.modelTeams.length - 1)
if (this.model.LineID !== 0 && this.model.LineID != '') {
let msg = {
'RB_Branch_id': this.user.RB_Branch_id,
'isTOOP': 1,
'lineID': this.model.LineID
}
this.apipost("team_post_GetList", msg, x => {
this.modelTeams=x.data.data
if(x.data.data.length>0)
this.model.SeriesID=x.data.data[0].LtID
},err => {})
this.modelTeams = x.data.data
if (x.data.data.length > 0)
this.model.SeriesID = x.data.data[0].LtID
}, err => {})
}
},
getline(){
let msg={'pageIndex':0,'pageSize':100}
getline() {
let msg = {
'pageIndex': 0,
'pageSize': 100
}
this.apipost("line_post_GetPageList", msg, x => {
this.lines=x.data.data.pageData
},err => {})
this.lines = x.data.data.pageData
}, err => {})
},
tiggerMax(){
this.isMax=!this.isMax
tiggerMax() {
this.isMax = !this.isMax
},
downAdv(){
let that=this
downAdv() {
let that = this
var cntElem = this.$refs.board;
var shareContent = cntElem
......@@ -750,7 +858,7 @@ export default {
height: height,
useCORS: true // 【重要】开启跨域配置
};
h2c(shareContent,opts).then(function(canvas) {
h2c(shareContent, opts).then(function (canvas) {
var context = canvas.getContext('2d')
context.mozImageSmoothingEnabled = false
context.webkitImageSmoothingEnabled = false
......@@ -758,15 +866,12 @@ export default {
context.imageSmoothingEnabled = false
// 【重要】默认转化的格式为png,也可设置为其他格式
// var img = Canvas2Image.convertToJPEG(canvas, canvas.width, canvas.height);
// console.log(img)
let imgUrl = canvas.toDataURL("image/png")
that.downloadFile('我的广告图.png',imgUrl)
that.downloadFile('我的广告图.png', imgUrl)
})
},
getFileBase64(type){
console.log(type)
let that=this
getFileBase64(type) {
let that = this
var cntElem = this.$refs.board;
var shareContent = cntElem
......@@ -784,7 +889,7 @@ export default {
height: height,
useCORS: true // 【重要】开启跨域配置
};
h2c(shareContent,opts).then(function(canvas) {
h2c(shareContent, opts).then(function (canvas) {
var context = canvas.getContext('2d')
context.mozImageSmoothingEnabled = false
context.webkitImageSmoothingEnabled = false
......@@ -792,12 +897,10 @@ export default {
context.imageSmoothingEnabled = false
// 【重要】默认转化的格式为png,也可设置为其他格式
// var img = Canvas2Image.convertToJPEG(canvas, canvas.width, canvas.height);
// console.log(img)
let imgUrl = canvas.toDataURL("image/png")
if(type==1)
that.downloadFile('我的广告图.png',imgUrl)
else{
if (type == 1)
that.downloadFile('我的广告图.png', imgUrl)
else {
that.save(imgUrl)
}
})
......@@ -805,7 +908,7 @@ export default {
downloadFile(fileName, content) {
let aLink = this.$refs.down
let blob = this.base64ToBlob(content)
this.uploadImage(fileName,blob)
this.uploadImage(fileName, blob)
let evt = document.createEvent("HTMLEvents")
evt.initEvent("click", true, true)
aLink.download = fileName
......@@ -823,174 +926,169 @@ export default {
for (let i = 0; i < rawLength; ++i) {
uInt8Array[i] = raw.charCodeAt(i);
}
return new Blob([uInt8Array], {type: contentType});
return new Blob([uInt8Array], {
type: contentType
});
},
uploadImage(name,file) {
uploadImage(name, file) {
let newArr = [];
newArr.push(file);
var path = `/Adv/user/${this.user.EmployeeId}/${name}`;
this.uploadBlob(path, newArr, x => {
// console.log('upload finish!')
});
},
operation(type){
if (type==0) {
let index=this.nodes.indexOf(this.currentNode)
this.nodes.splice(index,1)
this.currentNode.type=-1
}else{
this.currentMaxId=this.currentMaxId+1
operation(type) {
if (type == 0) {
let index = this.nodes.indexOf(this.currentNode)
this.nodes.splice(index, 1)
this.currentNode.type = -1
} else {
this.currentMaxId = this.currentMaxId + 1
this.currentZIndex++
let t={}
if(this.currentNode.type==0){
t={
nodeId:this.currentMaxId,
type:0,//0文本,1图片
width:(this.currentNode.fontSize*4)+10,
height:this.currentNode.fontSize,
lineHeight:this.currentNode.lineHeight,
bg:this.currentNode.bg,
color:this.currentNode.color,
zindex:this.currentZIndex,
content:this.currentNode.content,
x:200,
y:300,
textAlign:this.currentNode.textAlign,
fontSize:this.currentNode.fontSize,
fontname:this.currentNode.fontname,
active:false,
letterSpacing:this.currentNode.letterSpacing,
isBold:this.currentNode.isBold,
isXie:this.currentNode.isXie,
radius:this.currentNode.radius,
rotate:this.currentNode.rotate,
hshadow:this.currentNode.hshadow,
vshadow:this.currentNode.vshadow,
blur:this.currentNode.blur,
shadowcolor:this.currentNode.shadowcolor,
alpha:this.currentNode.alpha,
strokeWidth:this.currentNode.strokeWidth,
strokeColor:this.currentNode.strokeColor
let t = {}
if (this.currentNode.type == 0) {
t = {
nodeId: this.currentMaxId,
type: 0, //0文本,1图片
width: (this.currentNode.fontSize * 4) + 10,
height: this.currentNode.fontSize,
lineHeight: this.currentNode.lineHeight,
bg: this.currentNode.bg,
color: this.currentNode.color,
zindex: this.currentZIndex,
content: this.currentNode.content,
x: 200,
y: 300,
textAlign: this.currentNode.textAlign,
fontSize: this.currentNode.fontSize,
fontname: this.currentNode.fontname,
active: false,
letterSpacing: this.currentNode.letterSpacing,
isBold: this.currentNode.isBold,
isXie: this.currentNode.isXie,
radius: this.currentNode.radius,
rotate: this.currentNode.rotate,
hshadow: this.currentNode.hshadow,
vshadow: this.currentNode.vshadow,
blur: this.currentNode.blur,
shadowcolor: this.currentNode.shadowcolor,
alpha: this.currentNode.alpha,
strokeWidth: this.currentNode.strokeWidth,
strokeColor: this.currentNode.strokeColor
}
} else if(this.currentNode.type==1){
t={
nodeId:this.currentMaxId,
type:1,//0文本,1图片
width:this.currentNode.width,
height:this.currentNode.height,
zindex:this.currentZIndex,
x:200,
y:300,
active:false,
src:this.currentNode.src,
radius:this.currentNode.radius,
rotate:this.currentNode.rotate,
hshadow:this.currentNode.hshadow,
vshadow:this.currentNode.vshadow,
blur:this.currentNode.blur,
shadowcolor:this.currentNode.shadowcolor,
alpha:this.currentNode.alpha,
strokeWidth:this.currentNode.strokeWidth,
strokeColor:this.currentNode.strokeColor
} else if (this.currentNode.type == 1) {
t = {
nodeId: this.currentMaxId,
type: 1, //0文本,1图片
width: this.currentNode.width,
height: this.currentNode.height,
zindex: this.currentZIndex,
x: 200,
y: 300,
active: false,
src: this.currentNode.src,
radius: this.currentNode.radius,
rotate: this.currentNode.rotate,
hshadow: this.currentNode.hshadow,
vshadow: this.currentNode.vshadow,
blur: this.currentNode.blur,
shadowcolor: this.currentNode.shadowcolor,
alpha: this.currentNode.alpha,
strokeWidth: this.currentNode.strokeWidth,
strokeColor: this.currentNode.strokeColor
}
}else if(this.currentNode.type==2){
t={
nodeId:this.currentMaxId,
type:2,//0文本,1图片
width:this.currentNode.width,
height:this.currentNode.height,
zindex:this.currentZIndex,
x:50,
y:300,
active:false,
radius:this.currentNode.radius,
rotate:this.currentNode.rotate,
hshadow:this.currentNode.hshadow,
vshadow:this.currentNode.vshadow,
blur:this.currentNode.blur,
shadowcolor:this.currentNode.shadowcolor,
alpha:this.currentNode.alpha,
bg:this.currentNode.bg,
style:this.currentNode.style,
fontSize:1
} else if (this.currentNode.type == 2) {
t = {
nodeId: this.currentMaxId,
type: 2, //0文本,1图片
width: this.currentNode.width,
height: this.currentNode.height,
zindex: this.currentZIndex,
x: 50,
y: 300,
active: false,
radius: this.currentNode.radius,
rotate: this.currentNode.rotate,
hshadow: this.currentNode.hshadow,
vshadow: this.currentNode.vshadow,
blur: this.currentNode.blur,
shadowcolor: this.currentNode.shadowcolor,
alpha: this.currentNode.alpha,
bg: this.currentNode.bg,
style: this.currentNode.style,
fontSize: 1
}
}else if(this.currentNode.type==3){
t={
nodeId:this.currentMaxId,
type:3,//0文本,1图片
width:this.currentNode.width,
height:this.currentNode.height,
zindex:this.currentZIndex,
x:200,
y:300,
active:false,
rotate:this.currentNode.rotate,
hshadow:this.currentNode.hshadow,
vshadow:this.currentNode.vshadow,
blur:this.currentNode.blur,
shadowcolor:this.currentNode.shadowcolor,
alpha:this.currentNode.alpha,
bg:this.currentNode.bg,
fontSize:50,
content:this.currentNode.content,
src:this.currentNode.src,
forecolor:this.currentNode.forecolor
} else if (this.currentNode.type == 3) {
t = {
nodeId: this.currentMaxId,
type: 3, //0文本,1图片
width: this.currentNode.width,
height: this.currentNode.height,
zindex: this.currentZIndex,
x: 200,
y: 300,
active: false,
rotate: this.currentNode.rotate,
hshadow: this.currentNode.hshadow,
vshadow: this.currentNode.vshadow,
blur: this.currentNode.blur,
shadowcolor: this.currentNode.shadowcolor,
alpha: this.currentNode.alpha,
bg: this.currentNode.bg,
fontSize: 50,
content: this.currentNode.content,
src: this.currentNode.src,
forecolor: this.currentNode.forecolor
}
}
this.nodes.push(t)
this.nodes.forEach((x,i)=>{
// if(i!=this.nodes.length-1){
x.active=false
// } else {
// this.currentNode=x
// this.currentnodeId=x.nodeId
// x.active=true
// }
})
this.nodes.forEach((x, i) => {
x.active = false
// console.log(this.nodes)
this.nodes[this.nodes.length-1].active=true
console.log(this.nodes[this.nodes.length-1])
this.currentNode=this.nodes[this.nodes.length-1]
this.currentnodeId=t.nodeId
})
this.nodes[this.nodes.length - 1].active = true
this.currentNode = this.nodes[this.nodes.length - 1]
this.currentnodeId = t.nodeId
}
},
moveLayer(type){
// console.log(this.nodes)
if (type==1) {
this.currentNode.zindex=this.currentNode.zindex+1
this.currentZIndex=this.currentZIndex>this.currentNode.zindex?this.currentZIndex:this.currentNode.zindex
} else if (type==2) {
this.currentNode.zindex=this.currentNode.zindex-1
} else if (type==3) {
moveLayer(type) {
if (type == 1) {
this.currentNode.zindex = this.currentNode.zindex + 1
this.currentZIndex = this.currentZIndex > this.currentNode.zindex ? this.currentZIndex : this.currentNode
.zindex
} else if (type == 2) {
this.currentNode.zindex = this.currentNode.zindex - 1
} else if (type == 3) {
this.currentZIndex++
this.currentNode.zindex=this.currentZIndex
// console.log(this.currentNode.zindex)
this.currentNode.zindex = this.currentZIndex
} else {
let min=1
this.nodes.forEach(x=>{
min=min>x.zindex?x.zindex:min
let min = 1
this.nodes.forEach(x => {
min = min > x.zindex ? x.zindex : min
})
min--
min=min<100?100:min
this.currentNode.zindex=min
min = min < 100 ? 100 : min
this.currentNode.zindex = min
}
},
alignMethod(type){
if(type==1)
this.currentNode.textAlign='left'
else if(type==2)
this.currentNode.textAlign='center'
alignMethod(type) {
if (type == 1)
this.currentNode.textAlign = 'left'
else if (type == 2)
this.currentNode.textAlign = 'center'
else
this.currentNode.textAlign='right'
// console.log(this.currentNode)
this.currentNode.textAlign = 'right'
},
addPic(){
let that=this;
if(this.$refs.addImage.files.length>0 && this.$refs.addImage.files[0].size>0){
addPic() {
let that = this;
if (this.$refs.addImage.files.length > 0 && this.$refs.addImage.files[0].size > 0) {
// 压缩图片需要的一些元素和对象
var reader = new FileReader(), img = new Image();
var reader = new FileReader(),
img = new Image();
// 选择的文件对象
var file = null;
// 是否含透明背景的标志量
......@@ -1020,22 +1118,24 @@ export default {
break;
}
}
that.chuliImg(isAlphaBackground,img.src);
that.chuliImg(isAlphaBackground, img.src);
// isAlphaBackground就是最后石头有透明或半透明背景色的结果
};
// 文件base64化,以便获知图片原始尺寸
reader.onload = function(e) {
reader.onload = function (e) {
img.src = e.target.result;
};
reader.readAsDataURL(this.$refs.addImage.files[0])
}
},
chuliImg(i,e){ // 判断是否有透明背景进行不同操作
let that=this;
if(i){
chuliImg(i, e) { // 判断是否有透明背景进行不同操作
let that = this;
if (i) {
that.creatImg(e);
}else{
this.lrz(e,{quality:0.7}).then(function (rst) {
} else {
this.lrz(e, {
quality: 0.7
}).then(function (rst) {
that.creatImg(rst.base64);
}).catch(function (err) {
// 处理失败会执行
......@@ -1044,239 +1144,235 @@ export default {
});
}
},
creatImg(e){ // 展示图片
let that=this;
that.currentMaxId=that.currentMaxId+1
creatImg(e) { // 展示图片
let that = this;
that.currentMaxId = that.currentMaxId + 1
that.currentZIndex++
//e.target.result
let t={
nodeId:that.currentMaxId,
type:1,//0文本,1图片
width:100,
height:100,
zindex:that.currentZIndex,
x:200,
y:300,
active:false,
src:e,
radius:1,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
alpha:100,
strokeWidth:0,
strokeColor:null
let t = {
nodeId: that.currentMaxId,
type: 1, //0文本,1图片
width: 100,
height: 100,
zindex: that.currentZIndex,
x: 200,
y: 300,
active: false,
src: e,
radius: 1,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
alpha: 100,
strokeWidth: 0,
strokeColor: null
}
that.nodes.push(t)
this.nodes.forEach((x,i)=>{
x.active=false
this.nodes.forEach((x, i) => {
x.active = false
})
this.nodes[this.nodes.length-1].active=true
that.currentNode=that.nodes[that.nodes.length-1]
that.currentnodeId=t.nodeId
this.nodes[this.nodes.length - 1].active = true
that.currentNode = that.nodes[that.nodes.length - 1]
that.currentnodeId = t.nodeId
},
addLine(){
this.currentMaxId=this.currentMaxId+1
addLine() {
this.currentMaxId = this.currentMaxId + 1
this.currentZIndex++
//e.target.result
let t={
nodeId:this.currentMaxId,
type:2,//0文本,1图片
width:300,
height:1,
zindex:this.currentZIndex,
x:50,
y:300,
active:false,
radius:1,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
alpha:100,
bg:'#000',
style:'solid',
fontSize:1
let t = {
nodeId: this.currentMaxId,
type: 2, //0文本,1图片
width: 300,
height: 1,
zindex: this.currentZIndex,
x: 50,
y: 300,
active: false,
radius: 1,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
alpha: 100,
bg: '#000',
style: 'solid',
fontSize: 1
}
this.nodes.push(t)
this.nodes.forEach((x,i)=>{
x.active=false
this.nodes.forEach((x, i) => {
x.active = false
})
this.nodes[this.nodes.length-1].active=true
this.currentNode=this.nodes[this.nodes.length-1]
this.currentnodeId=t.nodeId
this.nodes[this.nodes.length - 1].active = true
this.currentNode = this.nodes[this.nodes.length - 1]
this.currentnodeId = t.nodeId
},
addQr(){
this.currentMaxId=this.currentMaxId+1
addQr() {
this.currentMaxId = this.currentMaxId + 1
this.currentZIndex++
//e.target.result
let t={
nodeId:this.currentMaxId,
type:3,//0文本,1图片
width:100,
height:100,
zindex:this.currentZIndex,
x:200,
y:300,
active:false,
radius:0,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
alpha:100,
bg:null,
fontSize:50,
content:'新增二维码',
src:'',
forecolor:'#000'
let t = {
nodeId: this.currentMaxId,
type: 3, //0文本,1图片
width: 100,
height: 100,
zindex: this.currentZIndex,
x: 200,
y: 300,
active: false,
radius: 0,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
alpha: 100,
bg: null,
fontSize: 50,
content: '新增二维码',
src: '',
forecolor: '#000'
}
this.nodes.push(t)
this.nodes.forEach((x,i)=>{
x.active=false
this.nodes.forEach((x, i) => {
x.active = false
})
this.nodes[this.nodes.length-1].active=true
this.currentNode=this.nodes[this.nodes.length-1]
this.currentnodeId=t.nodeId
this.nodes[this.nodes.length - 1].active = true
this.currentNode = this.nodes[this.nodes.length - 1]
this.currentnodeId = t.nodeId
this.canvasQrCode()
},
canvasQrCode(){
let that=this
QRCode.toDataURL(this.currentNode.content,{
canvasQrCode() {
let that = this
QRCode.toDataURL(this.currentNode.content, {
color: {
dark: this.currentNode.forecolor, // Blue dots
light: this.currentNode.bg==null?'#0000':this.currentNode.bg // Transparent background
light: this.currentNode.bg == null ? '#0000' : this.currentNode.bg // Transparent background
}
}, function (err, url) {
that.currentNode.src=url
// console.log(err)
that.currentNode.src = url
})
},
openUploadPic(){
openUploadPic() {
this.$refs.addImage.click()
},
addTitle(){
this.currentMaxId=this.currentMaxId+1
addTitle() {
this.currentMaxId = this.currentMaxId + 1
this.currentZIndex++
let t={
nodeId:this.currentMaxId,
type:0,//0文本,1图片
width:(36*4)+10,
height:36,
lineHeight:'1',
bg:null,
color:'#000',
zindex:this.currentZIndex,
content:'新增标题',
x:200,
y:300,
textAlign:'center',
fontSize:36,
fontname:'sszhjt',
active:false,
letterSpacing:1,
isBold:0,
isXie:0,
radius:0,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
strokeWidth:0,
strokeColor:null
let t = {
nodeId: this.currentMaxId,
type: 0, //0文本,1图片
width: (36 * 4) + 10,
height: 36,
lineHeight: '1',
bg: null,
color: '#000',
zindex: this.currentZIndex,
content: '新增标题',
x: 200,
y: 300,
textAlign: 'center',
fontSize: 36,
fontname: 'sszhjt',
active: false,
letterSpacing: 1,
isBold: 0,
isXie: 0,
radius: 0,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
strokeWidth: 0,
strokeColor: null
}
this.nodes.push(t)
this.nodes.forEach((x,i)=>{
x.active=false
this.nodes.forEach((x, i) => {
x.active = false
})
this.nodes[this.nodes.length-1].active=true
this.currentNode=this.nodes[this.nodes.length-1]
this.currentnodeId=t.nodeId
this.nodes[this.nodes.length - 1].active = true
this.currentNode = this.nodes[this.nodes.length - 1]
this.currentnodeId = t.nodeId
},
addP(){
this.currentMaxId=this.currentMaxId+1
addP() {
this.currentMaxId = this.currentMaxId + 1
this.currentZIndex++
let t={
nodeId:this.currentMaxId,
type:0,//0文本,1图片
width:(16*4)+10,
height:16,
lineHeight:'1',
bg:null,
color:'#000',
zindex:this.currentZIndex,
content:'新增文字',
x:200,
y:300,
textAlign:'center',
fontSize:16,
fontname:'pingfang',
active:false,
letterSpacing:1,
isBold:0,
isXie:0,
radius:0,
rotate:0,
hshadow:0,
vshadow:0,
blur:0,
shadowcolor:null,
strokeWidth:0,
strokeColor:null
let t = {
nodeId: this.currentMaxId,
type: 0, //0文本,1图片
width: (16 * 4) + 10,
height: 16,
lineHeight: '1',
bg: null,
color: '#000',
zindex: this.currentZIndex,
content: '新增文字',
x: 200,
y: 300,
textAlign: 'center',
fontSize: 16,
fontname: 'pingfang',
active: false,
letterSpacing: 1,
isBold: 0,
isXie: 0,
radius: 0,
rotate: 0,
hshadow: 0,
vshadow: 0,
blur: 0,
shadowcolor: null,
strokeWidth: 0,
strokeColor: null
}
this.nodes.push(t)
this.nodes.forEach((x,i)=>{
x.active=false
this.nodes.forEach((x, i) => {
x.active = false
})
this.nodes[this.nodes.length-1].active=true
this.currentNode=this.nodes[this.nodes.length-1]
this.currentnodeId=t.nodeId
this.nodes[this.nodes.length - 1].active = true
this.currentNode = this.nodes[this.nodes.length - 1]
this.currentnodeId = t.nodeId
},
onResizstop(x,y,w,h){
if(this.currentnodeId==-1 || !x)
onResizstop(x, y, w, h) {
if (this.currentnodeId == -1 || !x)
return;
this.currentNode.x=x
this.currentNode.y=y
this.currentNode.width=w
this.currentNode.height=h
//this.nodes[this.currentnodeId].fontSize=Math.floor(w/this.nodes[this.currentnodeId].content.length)
// console.log(this.nodes)
this.currentNode.x = x
this.currentNode.y = y
this.currentNode.width = w
this.currentNode.height = h
},
onDragstop(x,y){
if(this.currentnodeId==-1)
onDragstop(x, y) {
if (this.currentnodeId == -1)
return;
this.currentNode.x=x
this.currentNode.y=y
// console.log(this.nodes)
this.currentNode.x = x
this.currentNode.y = y
},
onActivated(id){ //isCtrl ==true多选 ==false单选
if(!this.isCtrl){
this.currentnodeId=id
this.nodes.forEach(x=>{
if(x.nodeId==id) {
this.currentNode=x
onActivated(id) { //isCtrl ==true多选 ==false单选
if (!this.isCtrl) {
this.currentnodeId = id
this.nodes.forEach(x => {
if (x.nodeId == id) {
this.currentNode = x
}
})
}else{
this.nodes.forEach(x=>{
if(x.nodeId==id) {
if(this.currentNodeList.length>0){
} else {
this.nodes.forEach(x => {
if (x.nodeId == id) {
if (this.currentNodeList.length > 0) {
let isRepeat = false;
for(let i=0;i<this.currentNodeList.length;i++){
if(this.currentNodeList[i].nodeId==id){
for (let i = 0; i < this.currentNodeList.length; i++) {
if (this.currentNodeList[i].nodeId == id) {
isRepeat = true;
break;
}
}
if(!isRepeat){
if (!isRepeat) {
this.currentNodeList.push(x);
}
}else{
} else {
this.currentNodeList.push(x)
}
}
......@@ -1284,6 +1380,6 @@ export default {
}
}
}
}
</script>
}
</script>
......@@ -449,84 +449,12 @@
handleExceed(file, fileList) {
this.$message.warning('一次最多选择5个文件!')
return
//console.log(files[0])
// let Md5Arr=[]
// let fileArr=[]
// let that=this
// let path="/Upload/Temporary/"
// for(let i=0;i<files.length;i++){
//
// if(files[i].size>1024*1024*100){
// this.$message.warning('文件大小不能超过100M!')
// return
// }
//
// browserMD5File(files[i], function (err, md5) {
// Md5Arr.push(md5);
// if(Md5Arr.length==files.length){
// that.apipost('user_cloud_ValidataMD5Sign',{md5Sign:Md5Arr},res=>{
// if(res.data.resultCode == 1) {
// res.data.data.forEach((item,index)=>{
// files[index].md5Sign=item.md5Sign
// files[index].Status=item.Status
// })
// //console.log(files)
// for (let i=0;i<files.length;i++) {
// console.log(files[i])
// that.uploadFile(path,files[i],x=>{
// console.log(x.res)
// })
// }
//
// }else{}
// },err=>{})
// }
//
// });
// }
// this.apipost('user_cloud_ValidataMD5Sign',{md5Sign:Md5Arr},res=>{
// if(res.data.resultCode == 1) {
// console.log(res.data)
// }else{}
// },err=>{})
// },
// getFileMd5(files){
// let Md5Arr=[]
// let _string=''
// console.log(typeof Md5Arr)
// for(let i=0;i<files.length;i++){
// let lsOk = false
// browserMD5File(files[i], function (err, md5) {
// _string+='md5'+','
// lsOk =true;
// console.log(1)
// });
//
// }
// console.log(Md5Arr)
// return Md5Arr
// },
//
// validataMd5Sign(Md5Arr){
// let jsonMsg={md5Sign:[_arr]}
// this.apipost('user_cloud_ValidataMD5Sign',jsonMsg,res=>{
// if(res.data.resultCode == 1) {
// console.log(res.data)
// }else{}
// },err=>{})
},
uploadFileBtn(file) { //上传
//console.log(fileList)
if(file.file.size > 1024 * 1024 * 100) {
this.$message.warning('文件大小不能超过100M!')
return
}
// browserMD5File(file.file, function (err, md5) {
// console.log(md5);
// });
let that = this
let newArr = [];
newArr.push(file.file)
......@@ -542,7 +470,6 @@
FileSize: fileSize,
FolderId: this.msg.ParentId
})
//console.log(this.saveMsg);
that.apipost('user_cloud_SaveFile', this.saveMsg, res => {
if(res.data.resultCode == 1) {
this.$message.success(res.data.message);
......@@ -556,25 +483,17 @@
});
},
dowloadSingle() {
//console.log(this.notFileList)
let objKey = [];
this.list.forEach(item => {
if(item.DataType == 2) {
for(let i = 0; i < this.notFileList.length; i++) {
if(this.notFileList[i] == item.Id) {
//objKey.push(item.FilePath);
let reg = /^http(s)?:\/\/(.*?)\//
this.downloadFileRename(item.FilePath.replace(reg,''),item.FolderName);
}
}
}
})
// console.log(objKey)
// return
// objKey.forEach(item => {
// this.downloadFile(item)
// })
// return
},
downloadOne(obj){
if(obj.DataType==0){
......@@ -685,7 +604,6 @@
let fileList = []
let notFileList = []
let confirmMsg = ''
console.log(obj)
if(obj.DataType == 0) { //文件夹
fileList.push(obj.Id)
confirmMsg = '删除文件夹后,分享和子文件将被删除,是否删除?'
......@@ -750,7 +668,6 @@
}, err => {})
},
openShareOneDialog(obj) {
console.log(obj)
if(obj.DataType==0){
this.fileList=[]
this.notFileList=[]
......@@ -803,12 +720,10 @@
},
getDepartment() { //部门
this.apipost('app_get_GetCompanyDepartmentListTree', {}, res => {
console.log(res.data.data)
this.departmentList = res.data.data
}, err => {})
},
DepartmentListNodeChange(data,checked){
//console.log(data)
if(checked){
this.ckdDepartmentList.push({name:data.DepartmentName,id:data.DepartmentId})
this.ckdDepartmentListId.push(data.DepartmentId)
......@@ -831,7 +746,6 @@
getRole() { //岗位
this.apipost('WorkFlow_get_GetCompanyDepartMentPost', {}, res => {
this.roleList = res.data.data
//console.log(this.roleList)
}, err => {})
},
roleListNodeChange(data,checked){
......@@ -852,18 +766,15 @@
this.ckdRoleList.splice(this.ckdRoleList.findIndex(item => item.id === id), 1)
this.ckdRoleListId.splice(this.ckdRoleListId.findIndex(item => item === id), 1)
//删除相同id
console.log(this.ckdRoleListId)
this.$refs.treeRole.setCheckedKeys(this.ckdRoleListId);
},
getMenber() { //员工
this.apipost('WorkFlow_get_GetCompanyDepartMentEmployee', {}, res => {
this.menberList = res.data.data
console.log(this.menberList)
}, err => {})
},
MenberListNodeChange(data,checked){
console.log(data)
if(data.Type == 2 &&checked){
this.ckdMenberList.push({name:data.DepartmentName,id:data.DepartmentId})
this.ckdMenberListId.push(data.DepartmentId)
......@@ -936,7 +847,6 @@
this.msg.FolderName = this.srearchKey ;
this.apipost('user_cloud_GetFolderList', this.msg, res => {
if(res.data.resultCode == 1) {
console.log(res.data.data.data)
this.list = res.data.data.data
this.NavigationList = res.data.data.Navigation
this.isCkedAll = false
......@@ -952,10 +862,6 @@
}
if(item.DataType == 2) {
this.WjId.push(item.Id)
// let fileType=item.FolderName.substring(item.FolderName.lastIndexOf('.')+1,item.FolderName.length).toUpperCase()
// if('GIF|JPG|JPEG|PNG|BMP'.indexOf(fileType)!=-1){
// this.picObj.push(item.FilePath)
// }
let fileType=item.FolderName.substring(item.FolderName.lastIndexOf('.')+1,item.FolderName.length).toLowerCase()
item.icons=this.loadFileICON(fileType)
}
......@@ -973,7 +879,6 @@
this.apipost('user_cloud_GetFolderTreeList', {}, res => {
if(res.data.resultCode == 1) {
this.fileTreeList = res.data.data
console.log(res.data.data)
} else {}
}, err => {})
},
......
......@@ -196,9 +196,7 @@
if(res.data.resultCode==1){
this.list=res.data.data.pageData;
this.total=res.data.data.count;
//console.log(this.list)
this.loading=false
}else{}
},err=>{})
},
......
......@@ -149,13 +149,11 @@
getCompany() {
this.apipost('admin_get_BranchGetList', this.getCompanyMsg, res => {
if (res.data.resultCode == 1) {
//console.log(res.data.data)
if (this.outerVisible) {
this.layerCompanyList = res.data.data;
} else {
this.companyList = res.data.data;
}
//console.log(this.layerCompanyList)
} else {
}
}, err => {
......@@ -169,7 +167,6 @@
} else {
this.departMentList = res.data.data;
}
//console.log(this.departMentList)
} else {
}
}, err => {
......@@ -182,7 +179,6 @@
this.DataList = res.data.data.pageData
this.total = res.data.data.count
this.loading = false
// console.log(this.DataList)
} else {
}
}, err => {
......@@ -198,11 +194,8 @@
} else {
this.$message.error(res.data.message)
}
}, err => {
console.log(err)
})
},
updateData(index, id) {
this.addMsg.PostId = id
......
......@@ -340,7 +340,6 @@
}, res => {
if(res.data.resultCode == 1) {
this.loading=false;
console.log(res.data.data.askList)
this.askListType = res.data.data.TemplateType
this.TemplateTypeName = res.data.data.TemplateTypeName
this.askList = res.data.data.askList
......@@ -373,7 +372,6 @@
this.apipost('WorkFlow_get_GetDepartMentEmployee', {}, res => {
if(res.data.resultCode == 1) {
this.userList = res.data.data
//console.log(_this.$refs.treeUser.setCheckedKeys)
_this.$refs.treeUser.setCheckedKeys(_arr);
}
}, err => {})
......@@ -414,12 +412,9 @@
this.dialogTitle = '选择岗位';
this.apipost('WorkFlow_get_GetDepartMentPost', {}, res => {
this.roleList = res.data.data
//console.log(this.roleList)
}, err => {})
},
handleNodeChange1(data, checked) {
//myAuditUserList
//console.log(data)
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
......@@ -458,10 +453,8 @@
}
}
}
// console.log(this.myAuditUserList1)
},
handleNodeChange(data, checked) {
// console.log(data)
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
......@@ -499,10 +492,8 @@
}
}
}
//console.log(this.memberSetCheckedKeys)
},
mySetCheckedKeys(id) {
//console.log(this.memberSetCheckedKeys)
if(this.memberSetCheckedKeys.length == 0)
return
if(id == -1) {
......@@ -518,29 +509,22 @@
},
checkedRole(data, checked) {
data.IsCheck = checked;
//console.log(data.Disabled,checked)
//this.$refs.treeRole.setCheckedKeys([]);
if(data.Disabled == false && data.IsCheck) {
this.showRole = [];
//this.$refs.treeRole.setCheckedKeys([data.DepartmentId]);
this.showRole.push({
DepartmentName: data.DepartmentName,
Id: data.DepartmentId
})
console.log(this.showRole)
}
},
deleteItem(sort) {
//console.log(sort)
this.myAuditList.splice(this.myAuditList.findIndex(item => item.Sort === sort), 1)
//console.log(this.myAuditList)
},
getItemValue(obj, index) {
this.addBtn = false;
this.updateItemIndex = index;
this.updateItem = obj;
console.log(obj)
this.showLayer();
this.approvalType = obj.AuditType;
if(obj.AuditType == 1) {
......@@ -557,12 +541,9 @@
})
this.memberSetCheckedKeys.push(item.EmployeeId)
})
//this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys);
}
if(obj.AuditType == 3) {
this.zgObj.AuditWay = obj.AuditWay;
//console.log(this.showRole)
this.showRole = [];
this.showRole.push({
DepartmentName: obj.AuditDescription
......@@ -571,8 +552,6 @@
},
saveUpdateNode() {
// this.myAuditList.splice(this.updateItemIndex,1)
//console.log(this.updateItem)
let zg = {}
if(this.approvalType == 1) {
zg.AuditType = 1;
......@@ -590,7 +569,6 @@
zg.AuditDescription = '直接主管'
}
this.myAuditList[this.updateItemIndex] = zg;
//this.myAuditList.push(zg);
}
if(this.approvalType == 2) { //指定成员
let Au = this.showMember;
......@@ -621,7 +599,6 @@
return
}
this.myAuditList[this.updateItemIndex] = zg;
//console.log(zg.AuditUserList)
}
if(this.approvalType == 3) { //岗位
zg.AuditType = 3;
......@@ -637,14 +614,11 @@
}
this.myAuditList[this.updateItemIndex] = zg;
}
// console.log(this.myAuditList)
this.closeLayer()
},
deleteRole() {
this.showRole = [];
//this.showRole.length=0;
//this.showRole=null;
},
changeValue(value) {
this.tempChosenId = value
......@@ -700,7 +674,6 @@
}
this.myAuditList.push(zg);
console.log(zg.AuditUserList)
}
if(this.approvalType == 3) { //岗位
zg.AuditType = 3;
......@@ -752,7 +725,6 @@
this.addMsg.AuditUserList = this.myAuditUserList;
this.ConditionSortList = [],
this.addMsg.AskforleaveType = '[' + this.AskforleaveTypeArr.toString() + ']'
console.log(this.addMsg)
this.loading = true;
this.apipost('WorkFlow_post_SetOtherCondition', this.addMsg, res => {
if(res.data.resultCode == 1) {
......
......@@ -358,7 +358,6 @@
this.apipost('WorkFlow_get_GetDepartMentEmployee', {}, res => {
if(res.data.resultCode == 1) {
this.userList = res.data.data
//console.log(_this.$refs.treeUser.setCheckedKeys)
_this.$refs.treeUser.setCheckedKeys(_arr);
}
}, err => {})
......@@ -399,7 +398,6 @@
this.askList = res.data.data.aftList;
this.askListType = res.data.data.TemplateType
this.addMsg.Sort = res.data.data.Sort
// console.log(this.askListType)
let _arr = res.data.data.AskforleaveType.substring(1, res.data.data.AskforleaveType.length - 1).split(",")
let _arr1 = []
_arr.forEach(item => {
......@@ -421,13 +419,9 @@
this.myAuditList = res.data.data.AuditList
this.myAuditUserList = res.data.data.AuditUserList
this.myAuditUserList1 = JSON.parse(JSON.stringify(this.myAuditUserList))
//console.log(this.myAuditUserList1)
this.myAuditUserList1.forEach(item => {
this.sysUserKeys.push(item.EmployeeId)
})
// console.log(this.sysUserKeys)
// this.myAuditUserList1= res.data.data.AuditUserList
} else {}
}, error => {})
},
......@@ -443,12 +437,9 @@
this.dialogTitle = '选择岗位';
this.apipost('WorkFlow_get_GetDepartMentPost', {}, res => {
this.roleList = res.data.data
//console.log(this.roleList)
}, err => {})
},
handleNodeChange1(data, checked) {
//myAuditUserList
//console.log(data)
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
......@@ -487,10 +478,8 @@
}
}
}
// console.log(this.myAuditUserList1)
},
handleNodeChange(data, checked) {
// console.log(data)
data.IsCheck = checked;
if(data.Type == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
......@@ -528,10 +517,8 @@
}
}
}
//console.log(this.memberSetCheckedKeys)
},
mySetCheckedKeys(id) {
//console.log(this.memberSetCheckedKeys)
if(this.memberSetCheckedKeys.length == 0)
return
if(id == -1) {
......@@ -547,29 +534,21 @@
},
checkedRole(data, checked) {
data.IsCheck = checked;
//console.log(data.Disabled,checked)
//this.$refs.treeRole.setCheckedKeys([]);
if(data.Disabled == false && data.IsCheck) {
this.showRole = [];
//this.$refs.treeRole.setCheckedKeys([data.DepartmentId]);
this.showRole.push({
DepartmentName: data.DepartmentName,
Id: data.DepartmentId
})
//console.log(this.showRole)
}
},
deleteItem(sort) {
//console.log(sort)
this.myAuditList.splice(this.myAuditList.findIndex(item => item.Sort === sort), 1)
//console.log(this.myAuditList)
},
getItemValue(obj, index) {
this.addBtn = false;
this.updateItemIndex = index;
this.updateItem = obj;
console.log(obj)
this.showLayer();
this.approvalType = obj.AuditType;
if(obj.AuditType == 1) {
......@@ -586,12 +565,9 @@
})
this.memberSetCheckedKeys.push(item.EmployeeId)
})
//this.$refs.tree.setCheckedKeys(this.memberSetCheckedKeys);
}
if(obj.AuditType == 3) {
this.zgObj.AuditWay = obj.AuditWay;
//console.log(this.showRole)
this.showRole = [];
this.showRole.push({
DepartmentName: obj.AuditDescription
......@@ -600,8 +576,6 @@
},
saveUpdateNode() {
// this.myAuditList.splice(this.updateItemIndex,1)
//console.log(this.updateItem)
let zg = {}
if(this.approvalType == 1) {
zg.AuditType = 1;
......@@ -650,7 +624,6 @@
return
}
this.myAuditList[this.updateItemIndex] = zg;
//console.log(zg.AuditUserList)
}
if(this.approvalType == 3) { //岗位
zg.AuditType = 3;
......@@ -666,14 +639,12 @@
}
this.myAuditList[this.updateItemIndex] = zg;
}
// console.log(this.myAuditList)
this.closeLayer()
},
deleteRole() {
this.showRole = [];
//this.showRole.length=0;
//this.showRole=null;
},
changeValue(value) {
this.tempChosenId = value
......@@ -729,7 +700,6 @@
}
this.myAuditList.push(zg);
console.log(zg.AuditUserList)
}
if(this.approvalType == 3) { //岗位
zg.AuditType = 3;
......@@ -779,7 +749,6 @@
this.addMsg.AuditUserList = this.myAuditUserList;
this.ConditionSortList = [],
this.addMsg.AskforleaveType = '[' + this.AskforleaveTypeArr.toString() + ']'
console.log(this.addMsg)
this.loading = true;
this.apipost('WorkFlow_post_SetOtherCondition', this.addMsg, res => {
if(res.data.resultCode == 1) {
......
......@@ -64,7 +64,6 @@ export default {
},
methods: {
getList(obj) {
console.log("地图返回结果:", obj);
this.isdisable = true;
this.dataList.lat = obj.lat;
this.dataList.lng = obj.lng;
......
......@@ -243,9 +243,7 @@ export default{
google.maps.event.addListener(_this.map, 'click', function (event) { // 地图点击事件 获取经纬度
geocoder.geocode({ 'location': event.latLng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results[0].geometry.location.lat(), results[0].geometry.location.lng());
} else {
console.log("对不起没有找到相关的地理位置信息,请点击地图上的准确位置,进行定位!");
}
});
});
......
......@@ -1459,10 +1459,7 @@ export default {
let x = this.sysMsgList[i];
if (x.IMID === item.to) {
if (x.unread != item.unread) {
// console.log(x)
// console.log(item)
tempCount = 1;
// this.refreshSysNoteDate()
}
x.unread = item.unread;
x.lastMsgShow = item.lastMsg.text;
......@@ -1522,7 +1519,6 @@ export default {
item.updateTimeShow = util.formatDate(item.updateTime, true);
}
if (item.unread > 0) {
// console.log(item)
if (this.unReadMsgId.indexOf(item.lastMsg.idServer) == -1) {
if (!this.isFirst) {
this.msgGet(item);
......@@ -1534,18 +1530,10 @@ export default {
this.enterChat(item)
}
}
// else if(this.currentSession.id && item.lastMsg.sessionId==this.currentSession.id){
// if(item.lastMsg.tip && item.lastMsg.tip=='抖了一下'){
// this.dou()
// }
// }
// console.log(item.lastMsg)
return item;
});
this.hasNewMsg = tempCount;
this.isFirstLoad = false;
// this.allSsionList = JSON.parse(JSON.stringify(sessionlist));
return sessionlist;
},
sessionId() {
......@@ -1636,7 +1624,6 @@ export default {
}
};
document.addEventListener(visibilityChangeEvent, onVisibilityChange);
// console.log('initIM',this.firstMenuList.indexOf('IM'))
if(!localStorage.menu){
this.$store.dispatch("connect");
}else{
......@@ -1759,7 +1746,6 @@ export default {
msg,
res => {
if (res.data.resultCode == 1) {
// console.log('res.data.datares.data.datares.data.data',res)
this.NewSaleRnkInfo = res.data.data
let New = this.NewSaleRnkInfo.StartDateMonth + this.NewSaleRnkInfo.StartDateDay
let arr = localStorage.saleRnkInfo ? JSON.parse(localStorage.saleRnkInfo) : []
......@@ -1898,7 +1884,6 @@ export default {
let t=0;
let c=0;
this.douTimer = setInterval(()=>{
// console.log('come in ..........')
if(t==0)
this.$refs.resizeBox._data.top=y+2
if(t==2)
......@@ -1923,7 +1908,6 @@ export default {
}
},
LogSetReadStatus(s) {
console.log(s)
this.apipost(
"SystemLog_post_LogSetReadStatus",
{ LogId: s.ID },
......@@ -1971,7 +1955,6 @@ export default {
);
if (add) {
this.msgList.push(x);
// console.log(this.msgList)
}
});
if (!add) {
......@@ -3763,7 +3746,6 @@ export default {
}
});
n.onshow = function() {
//console.log("通知显示了!");
};
n.onclick = function(e) {
//可以直接通过实例的方式获取data内自定义的数据
......@@ -3775,10 +3757,8 @@ export default {
n.close();
};
n.onclose = function() {
//console.log("用户点击关闭");
};
n.onerror = function(err) {
//console.log("出错了,小伙子在检查一下吧");
throw err;
};
setTimeout(() => {
......
<style>
.per_title{font-size: 14px; color: #333; border-left: 3px solid #E95252; height: 14px; line-height: 14px; margin: 40px 0; padding-left: 15px;}
.mentTable{background: #BCBCBC; width: 100%; font-size: 14px; }
.mentTable td{background: #fff; height: 30px;}
.per_first_menu{overflow: hidden;}
.per_first_menu li{float: left; margin-right: 30px; position: relative; cursor: pointer; background: #fff; color: #999; width: 80px; font-size: 12px; height: 60px; padding: 10px 0; border-radius: 4px; text-align: center;}
.per_first_menu li.FirsrMenuCked{background: #E95252; color: #f1f1f1;}
.per_first_menu li i{font-size: 30px; line-height: 35px;}
.per_detail_menu{width: 100%; height: 300px; padding: 20px; margin: 40px 0; background: #fff; border-radius: 8px;}
.per_secondMenu{height: auto; overflow: hidden; margin-bottom: 20px;}
.per_secondMenu li{float: left; height: 24px; font-size:12px; cursor: pointer; padding: 0 30px; position: relative;}
.per_secondMenu li>div{width: 0; height: 3px; background: #F26262; margin: 5px auto 0;}
.per_secondMenu li:hover>div{width: 17px; transition: width .3s;}
.per_secondMenu li.per_secondLevelCked>div{width: 17px;}
.per_secondMenu li .liSplit{ height: 12px; width: 1px; background: #DCDFE6; position: absolute; right: 0; top: 2px;}
.per_thirdMenu li{float: left; margin: 0 50px 50px 0; width: 80px; cursor: pointer; height: 85px; padding:15px 10px 0; position: relative; font-size: 12px; color: #666; text-align: center; border-radius: 4px; background: #EBEBEB;}
.per_thirdMenu li i{position: absolute; bottom: 10px; right: 10px; font-size: 20px;}
.per_SaveBtn{float: right; margin-top: 50px; margin-left: 15px;}
.per_thirdMenu li.thirdLevelMenuCked{background: #E95252; color: #f1f1f1;}
.per_firstLevelCkbox{position: absolute!important;right:3px; top: 0;}
.per_thirdLevelAllCked{float: right;}
.per_title {
font-size: 14px;
color: #333;
border-left: 3px solid #E95252;
height: 14px;
line-height: 14px;
margin: 40px 0;
padding-left: 15px;
}
.mentTable {
background: #BCBCBC;
width: 100%;
font-size: 14px;
}
.mentTable td {
background: #fff;
height: 30px;
}
.per_first_menu {
overflow: hidden;
}
.per_first_menu li {
float: left;
margin-right: 30px;
position: relative;
cursor: pointer;
background: #fff;
color: #999;
width: 80px;
font-size: 12px;
height: 60px;
padding: 10px 0;
border-radius: 4px;
text-align: center;
}
.per_first_menu li.FirsrMenuCked {
background: #E95252;
color: #f1f1f1;
}
.per_first_menu li i {
font-size: 30px;
line-height: 35px;
}
.per_detail_menu {
width: 100%;
height: 300px;
padding: 20px;
margin: 40px 0;
background: #fff;
border-radius: 8px;
}
.per_secondMenu {
height: auto;
overflow: hidden;
margin-bottom: 20px;
}
.per_secondMenu li {
float: left;
height: 24px;
font-size: 12px;
cursor: pointer;
padding: 0 30px;
position: relative;
}
.per_secondMenu li>div {
width: 0;
height: 3px;
background: #F26262;
margin: 5px auto 0;
}
.per_secondMenu li:hover>div {
width: 17px;
transition: width .3s;
}
.per_secondMenu li.per_secondLevelCked>div {
width: 17px;
}
.per_secondMenu li .liSplit {
height: 12px;
width: 1px;
background: #DCDFE6;
position: absolute;
right: 0;
top: 2px;
}
.per_thirdMenu li {
float: left;
margin: 0 50px 50px 0;
width: 80px;
cursor: pointer;
height: 85px;
padding: 15px 10px 0;
position: relative;
font-size: 12px;
color: #666;
text-align: center;
border-radius: 4px;
background: #EBEBEB;
}
.per_thirdMenu li i {
position: absolute;
bottom: 10px;
right: 10px;
font-size: 20px;
}
.per_SaveBtn {
float: right;
margin-top: 50px;
margin-left: 15px;
}
.per_thirdMenu li.thirdLevelMenuCked {
background: #E95252;
color: #f1f1f1;
}
.per_firstLevelCkbox {
position: absolute !important;
right: 3px;
top: 0;
}
.per_thirdLevelAllCked {
float: right;
}
</style>
<template>
<div>
<div>
<div class="per_title">权限设置</div>
<div class="per_first_menu">
<ul>
<li v-model="item.IsShow" v-for="(item,index) in MenuList" @click="getSecondLevelMenu(index)" :class="{FirsrMenuCked:index==firstLevel}" >
<i :class="[fontPub,item.icon]"></i><br/>{{item.MenuName}}
<el-checkbox :indeterminate="item.choseParent" class="per_firstLevelCkbox" type="checkbox" :value="item.IsShow" v-model="item.IsShow"
@change="firstCheckAll" v-bind:checked="item.IsShow" ></el-checkbox>
<li v-model="item.IsShow" v-for="(item,index) in MenuList" @click="getSecondLevelMenu(index)"
:class="{FirsrMenuCked:index==firstLevel}">
<i :class="[fontPub,item.icon]"></i><br />{{item.MenuName}}
<el-checkbox :indeterminate="item.choseParent" class="per_firstLevelCkbox" type="checkbox"
:value="item.IsShow" v-model="item.IsShow" @change="firstCheckAll" v-bind:checked="item.IsShow">
</el-checkbox>
</li>
<input type="button" value="保存" class="normalBtn per_SaveBtn" @click="updateMenu()"/>
<input type="button" value="保存" class="normalBtn per_SaveBtn" @click="updateMenu()" />
<!-- <input type="button" value="返回" class="hollowFixedBtn per_SaveBtn" @click="goback"/>-->
</ul>
</div>
<div class="per_detail_menu">
<div class="per_secondMenu" v-if="MenuList.length>0 && MenuList[firstLevel].ChildMenu!=null">
<li v-model="item.IsShow" :class="{per_secondLevelCked:index==secondLevel}" v-for="(item,index) in MenuList[firstLevel].ChildMenu" @click="getThirdLevelMenu(index)">{{item.MenuName}}<div></div><span class="liSplit"></span></li>
<el-checkbox class='per_thirdLevelAllCked' @change='checkedAll($event)' v-model='secondChkAllState'>全选</el-checkbox>
<li v-model="item.IsShow" :class="{per_secondLevelCked:index==secondLevel}"
v-for="(item,index) in MenuList[firstLevel].ChildMenu" @click="getThirdLevelMenu(index)">{{item.MenuName}}
<div></div><span class="liSplit"></span></li>
<el-checkbox class='per_thirdLevelAllCked' @change='checkedAll($event)' v-model='secondChkAllState'>全选
</el-checkbox>
</div>
<div class="per_thirdMenu" v-if="MenuList.length>0 && MenuList[firstLevel].ChildMenu!=null">
<li v-model="item.IsShow" @click="thirdLevelMenuCked(item)" :class="{thirdLevelMenuCked:item.IsShow}" v-for="(item,index) in MenuList[firstLevel].ChildMenu[secondLevel].ChildMenu">{{item.MenuName}}<i :class="[fontPub,item.icon]"></i></li>
<li v-model="item.IsShow" @click="thirdLevelMenuCked(item)" :class="{thirdLevelMenuCked:item.IsShow}"
v-for="(item,index) in MenuList[firstLevel].ChildMenu[secondLevel].ChildMenu">{{item.MenuName}}<i
:class="[fontPub,item.icon]"></i></li>
</div>
</div>
<div class="per_title">功能管理</div>
<div class="per_first_menu">
<ul>
<li v-model="item.IsShow" v-for="(item,index) in actionList" @click="item.IsShow = !item.IsShow;" >
<i :class="[fontPub,item.icon]"></i><br/>{{item.ActionName}}
<li v-model="item.IsShow" v-for="(item,index) in actionList" @click="item.IsShow = !item.IsShow;">
<i :class="[fontPub,item.icon]"></i><br />{{item.ActionName}}
<el-checkbox class="per_firstLevelCkbox" type="checkbox" :value="item.IsShow" v-model="item.IsShow"
v-bind:checked="item.IsShow" ></el-checkbox>
v-bind:checked="item.IsShow"></el-checkbox>
</li>
<input type="button" value="保存" class="normalBtn per_SaveBtn" @click="saveAction()"/>
<input type="button" value="保存" class="normalBtn per_SaveBtn" @click="saveAction()" />
</ul>
</div>
......@@ -66,213 +195,194 @@
export default {
data() {
return {
fontPub:'iconfont',
MenuList:[],
thirdLevelMenu:[],
msg:{
VersionsId:0
fontPub: 'iconfont',
MenuList: [],
thirdLevelMenu: [],
msg: {
VersionsId: 0
},
updateMsg:{
VersionsId:0,
Permission:[],
updateMsg: {
VersionsId: 0,
Permission: [],
},
firstLevel:0,
secondLevel:0,
secondChkAllState:false,
firstLevel: 0,
secondLevel: 0,
secondChkAllState: false,
//功能菜单
actionList:[],
actionList: [],
}
},
mounted() {
this.updateMsg.VersionsId=this.msg.VersionsId = this.$route.query.id
let sysId=this.$route.query.sysId
this.updateMsg.VersionsId = this.msg.VersionsId = this.$route.query.id
let sysId = this.$route.query.sysId
this.getMenu();
this.getActionMenu();
},
methods: {
getActionMenu() {
this.apipost("admin_get_GetVersionsPermissionAction", this.updateMsg, res => {
if(res.data.resultCode == 1) {
//console.log(res.data.data)
let tempList=res.data.data;
if (res.data.resultCode == 1) {
let tempList = res.data.data;
this.actionList = tempList;
}else{}
} else {}
}, err => {})
},
getMenu() {
this.apipost("admin_get_GetVersionsPermission", this.updateMsg, res => {
if(res.data.resultCode == 1) {
//console.log(res.data.data)
let tempList=res.data.data
tempList.forEach(x=>{
if(x.ParentId==0){
let menuStyle=JSON.parse(x.MenuStyle)
x.icon=menuStyle.icon
x.color=menuStyle.color
x.choseParent=false
if (res.data.resultCode == 1) {
let tempList = res.data.data
tempList.forEach(x => {
if (x.ParentId == 0) {
let menuStyle = JSON.parse(x.MenuStyle)
x.icon = menuStyle.icon
x.color = menuStyle.color
x.choseParent = false
this.initParentChk(x)
this.MenuList.push(x)
//console.log(x)
}
})
//console.log(this.MenuList)
}else{}
} else {}
}, err => {})
},
updateMenu() {
this.MenuList.forEach(x=>{
//console.log(x.IsShow)
})
this.updateMsg.Permission=[]
this.MenuList.forEach(x => {})
this.updateMsg.Permission = []
this.getCkdId(this.MenuList);
// console.log(this.updateMsg.Permission)
// return;
this.apipost("admin_post_UpdateVersionsPermission", this.updateMsg, res => {
//console.log(res.data)
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success('保存成功!')
//console.log(this.updateMsg.Permission)
}else{
} else {
this.$message.error('保存失败!')
}
}, err => {})
},
//保存功能管理
saveAction() {
this.updateMsg.Permission=[]
this.updateMsg.Permission = []
this.getCkdActionId(this.actionList);
this.apipost("admin_post_UpdateVersionsPermissionAction", this.updateMsg, res => {
if(res.data.resultCode == 1) {
if (res.data.resultCode == 1) {
this.$message.success('保存成功!')
}else{
} else {
this.$message.error('保存失败!')
}
}, err => {})
},
getSecondLevelMenu(index){
// this.MenuList[this.firstLevel].ChildMenu.forEach(item=>{
// item.secondChoseParent=false;
// })
getSecondLevelMenu(index) {
this.firstLevel=index;
this.secondLevel=0;
this.firstLevel = index;
this.secondLevel = 0;
this.threeChange();
this.getThirdLevelMenu(0);
},
getThirdLevelMenu(index){ //三级菜单
this.secondLevel=index;
this.MenuList[this.firstLevel].ChildMenu[index].ChildMenu.forEach(x=>{
let menuStyle=JSON.parse(x.MenuStyle)
x.icon=menuStyle.icon
x.color=menuStyle.color
getThirdLevelMenu(index) { //三级菜单
this.secondLevel = index;
this.MenuList[this.firstLevel].ChildMenu[index].ChildMenu.forEach(x => {
let menuStyle = JSON.parse(x.MenuStyle)
x.icon = menuStyle.icon
x.color = menuStyle.color
this.thirdLevelMenu.push(x)
})
this.threeChange()
console.log(this.thirdLevelMenu)
},
thirdLevelMenuCked(item){
item.IsShow=!item.IsShow
thirdLevelMenuCked(item) {
item.IsShow = !item.IsShow
this.threeChange()
},
firstCheckAll(){
this.MenuList[this.firstLevel].ChildMenu.forEach(x=>{
x.IsShow=this.MenuList[this.firstLevel].IsShow
x.ChildMenu.forEach((item,index)=>{
item.IsShow=x.IsShow
firstCheckAll() {
this.MenuList[this.firstLevel].ChildMenu.forEach(x => {
x.IsShow = this.MenuList[this.firstLevel].IsShow
x.ChildMenu.forEach((item, index) => {
item.IsShow = x.IsShow
})
})
this.MenuList[this.firstLevel].choseParent=false
this.MenuList[this.firstLevel].choseParent = false
this.threeChange()
},
checkedAll(){
let thirdMenuLength=this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.length;
let chkNo=0;
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item)=>{
if(item.IsShow==true)
checkedAll() {
let thirdMenuLength = this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.length;
let chkNo = 0;
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item) => {
if (item.IsShow == true)
chkNo++
})
if(chkNo==thirdMenuLength){
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item)=>{
item.IsShow=false
if (chkNo == thirdMenuLength) {
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item) => {
item.IsShow = false
})
}else{
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item)=>{
item.IsShow=true
} else {
this.MenuList[this.firstLevel].ChildMenu[this.secondLevel].ChildMenu.forEach((item) => {
item.IsShow = true
})
}
this.threeChange()
},
threeChange(){
let chkCount=0
let count=0
this.MenuList[this.firstLevel].ChildMenu.forEach((x,i)=>{
let secondCheckCount=0
x.ChildMenu.forEach((item,index)=>{
threeChange() {
let chkCount = 0
let count = 0
this.MenuList[this.firstLevel].ChildMenu.forEach((x, i) => {
let secondCheckCount = 0
x.ChildMenu.forEach((item, index) => {
count++
if(item.IsShow){
if (item.IsShow) {
chkCount++
secondCheckCount++
}
})
if(this.secondLevel==i){
if(x.ChildMenu.length>0){
console.log(x.ChildMenu.length==secondCheckCount)
this.secondChkAllState=x.ChildMenu.length==secondCheckCount
if (this.secondLevel == i) {
if (x.ChildMenu.length > 0) {
this.secondChkAllState = x.ChildMenu.length == secondCheckCount
} else
this.secondChkAllState=false
this.secondChkAllState = false
}
x.IsShow=secondCheckCount>0
x.IsShow = secondCheckCount > 0
})
this.MenuList[this.firstLevel].IsShow=chkCount>0
this.MenuList[this.firstLevel].choseParent=chkCount>0&&chkCount<count
this.MenuList[this.firstLevel].IsShow = chkCount > 0
this.MenuList[this.firstLevel].choseParent = chkCount > 0 && chkCount < count
},
initParentChk(p){
console.log(p)
if(!p.ChildMenu || p.ChildMenu.length==0||p.ChildMenu)
initParentChk(p) {
if (!p.ChildMenu || p.ChildMenu.length == 0 || p.ChildMenu)
return
let chkCount=0
let count=0
p.ChildMenu.forEach(x=>{
x.ChildMenu.forEach((item,index)=>{
let chkCount = 0
let count = 0
p.ChildMenu.forEach(x => {
x.ChildMenu.forEach((item, index) => {
count++
if(item.IsShow){
if (item.IsShow) {
chkCount++
}
})
})
p.choseParent=chkCount>0&&chkCount<count
p.IsShow=chkCount>0
p.choseParent = chkCount > 0 && chkCount < count
p.IsShow = chkCount > 0
},
getCkdId(array){
array.forEach(x=>{
//console.log(x.IsShow)
if(x.IsShow==1||x.IsShow==true){
getCkdId(array) {
array.forEach(x => {
if (x.IsShow == 1 || x.IsShow == true) {
this.updateMsg.Permission.push(x.MenuId)
if(x.ChildMenu){
if (x.ChildMenu) {
this.getCkdId(x.ChildMenu)
}
}
})
},
//过滤获取功能管理id
getCkdActionId(array){
array.forEach(x=>{
if(x.IsShow==1||x.IsShow==true){
getCkdActionId(array) {
array.forEach(x => {
if (x.IsShow == 1 || x.IsShow == true) {
this.updateMsg.Permission.push(x.Id);
}
})
},
goback(){
goback() {
history.back(-1)
}
}
}
</script>
</script>
......@@ -98,17 +98,14 @@ export function sendChatroomFileMsg ({state, commit}, obj) {
type,
fileInput,
uploadprogress: function (data) {
// console.log(data.percentageText)
},
uploaderror: function () {
console && console.log('上传失败')
},
uploaddone: function (error, file) {
// console.log(error);
// console.log(file);
},
beforesend: function (msg) {
// console && console.log('正在发送消息, id=', msg);
},
done: function (error, msg) {
onSendMsgDone(error, msg)
......
......@@ -9,7 +9,6 @@ import store from '../'
import {onChatroomMsgs} from './chatroomMsgs'
// let sdkPath = '@/sdk/' + config.sdk
// console.log(sdkPath)
// const SDK = require(sdkPath)
// 切换聊天室之前需要断开连接,原因是移动端不断累积连接实例,消息并发较大时会有性能问题
......
......@@ -182,17 +182,16 @@ export function sendFileMsg ({state, commit}, obj) {
type,
fileInput,
uploadprogress: function (data) {
// console.log(data.percentageText)
},
uploaderror: function () {
console && console.log('上传失败')
},
uploaddone: function (error, file) {
// console.log(error);
// console.log(file);
},
beforesend: function (msg) {
// console && console.log('正在发送消息, id=', msg);
},
done: function (error, msg) {
onSendMsgDone(error, msg)
......@@ -218,17 +217,16 @@ export function sendDataUrlMsg ({state, commit}, obj) {
dataURL: dataURL,
custom: JSON.stringify(otherMsg),
uploadprogress: function (data) {
// console.log(data.percentageText)
},
uploaderror: function () {
console && console.log('上传失败')
},
uploaddone: function (error, file) {
// console.log(error);
// console.log(file);
},
beforesend: function (msg) {
// console && console.log('正在发送消息, id=', msg);
},
done: function (error, msg) {
onSendMsgDone(error, msg)
......@@ -282,10 +280,8 @@ export function sendRobotMsg ({state, commit}, obj) {
// 发送消息已读回执
export function sendMsgReceipt ({state, commit}) {
//console.log('in..................................')
// 如果有当前会话
let currSessionId = store.state.currSessionId
//console.log(currSessionId)
if (currSessionId) {
// 只有点对点消息才发已读回执
if (util.parseSession(currSessionId).scene === 'p2p') {
......
......@@ -25,14 +25,12 @@ function updateSessionAccount (sessions) {
// onSessions只在初始化完成后回调
export function onSessions (sessions) {
updateSessionAccount(sessions)
console.log("执行了...")
store.commit('updateSessions', sessions)
}
export function onUpdateSession (session) {
let sessions = [session]
updateSessionAccount(sessions)
//console.log(session)
store.commit('updateSessions', sessions)
}
......@@ -97,7 +95,6 @@ export function resetCurrSession ({state, commit}) {
if(!nim){
return;
}
console.log('重置了..................')
nim.resetCurrSession()
commit('updateCurrSessionMsgs', {
type: 'destroy'
......
......@@ -51,12 +51,10 @@ export function onDismissTeam(obj) {
}
export function onUpdateTeam(team) {
console.log('in.............')
onTeams(team)
}
export function onTeamNotificationMsg({state, commit}, msg) {
// console.log('aaaaaaaaaaa')
if (msg.attach.type === 'updateTeam' && msg.attach.team) {
store.commit('updateTeamInfo', msg.attach.team)
}
......
......@@ -213,7 +213,6 @@ export default {
let lastMsgIndex = tempMsgs.length - 1
for (let i = lastMsgIndex; i >= 0; i--) {
let currMsg = tempMsgs[i]
console.log(idClient, currMsg.idClient, currMsg.text)
if (idClient === currMsg.idClient) {
state.msgs[sessionId].splice(i, 1, msg)
break
......
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