Commit 12541cc5 authored by 黄奎's avatar 黄奎

页面修改

parent 906a8cc5
......@@ -5007,7 +5007,6 @@
res => {
this.loading = false;
if (res.data.resultCode == 1) {
console.log(res,'resssssssss');
this.OrderDataList = res.data.data;
this.IsUpdateOrderMoney = res.data.data.IsUpdateOrderMoney
}
......
......@@ -655,13 +655,11 @@ export default {
}else if(this.index1 + 1==3){
period=this.yearVal
}
console.log(this.yearVal,this.weekVal,this.monthVal)
let msg = {
timeRange: this.index1 + 1,
userRange: this.index2 + 1,
period
};
console.log(msg)
this.apipost("user_get_usedsixSatistics", msg, r => {
if(r.data.data && r.data.data.length>0){
this.tableData = this.orderBy(
......
<template>
<div :class="isHorizontal === true?'vToolBar vToolBar_horizontal':'vToolBar vToolBar_vertical'">
<div
:class="
isHorizontal === true
? 'vToolBar vToolBar_horizontal'
: 'vToolBar vToolBar_vertical'
"
>
<div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftZ:'iconfont ' + icon.topZ" @click="toPreZ"></i>
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftZ
: 'iconfont ' + icon.topZ
"
@click="toPreZ"
></i>
</div>
<div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftY:'iconfont ' + icon.topY" @click="toPreY"></i>
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftY
: 'iconfont ' + icon.topY
"
@click="toPreY"
></i>
</div>
<div v-if="isHuan === true">
<i :class="'iconfont ' + icon.huan" @click="toHuan"></i>
......@@ -12,26 +32,44 @@
<div v-if="isXuan === true">
<i :class="'iconfont ' + icon.xuan" @click="toXuan"></i>
</div>
<div v-if="isAdd === true" style="display:none;">
<div v-if="isAdd === true">
<i :class="'' + icon.add" @click="toAdd"></i>
</div>
<div v-if="isDelete === true">
<i :class="'iconfont ' + icon.delete" @click="toDelete"></i>
</div>
<div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightY:'iconfont ' + icon.bottomY" @click="toNextY"></i>
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightY
: 'iconfont ' + icon.bottomY
"
@click="toNextY"
></i>
</div>
<div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightZ:'iconfont ' + icon.bottomZ" @click="toNextZ"></i>
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightZ
: 'iconfont ' + icon.bottomZ
"
@click="toNextZ"
></i>
</div>
<div v-if="isReset === true">
<i title="重置图片位置" :class="'iconfont ' + icon.reset" @click="toReset"></i>
<i
title="重置图片位置"
:class="'iconfont ' + icon.reset"
@click="toReset"
></i>
</div>
</div>
</template>
<script>
export default {
export default {
props: {
// 是否横向
isHorizontal: {
......@@ -46,7 +84,7 @@
// 标识
name: {
type: String,
default: ''
default: ""
},
// 当前版块下标
index1: {
......@@ -94,120 +132,132 @@
default: false
}
},
data () {
data() {
return {
icon: {
topZ: 'icon-zhiding',
topY: 'icon-arrow-up',
leftZ: 'icon-left1',
leftY: 'icon-left',
huan: 'icon-img_bdsc',
xuan: 'icon-img_cz',
delete: 'icon-remove',
rightY: 'icon-right1',
rightZ: 'icon-right',
bottomY: 'icon-arrowdown',
bottomZ: 'icon-zhidi',
reset: 'icon-zhongzhi',
add: 'el-icon-plus'
}
topZ: "icon-zhiding",
topY: "icon-arrow-up",
leftZ: "icon-left1",
leftY: "icon-left",
huan: "icon-img_bdsc",
xuan: "icon-img_cz",
delete: "icon-remove",
rightY: "icon-right1",
rightZ: "icon-right",
bottomY: "icon-arrowdown",
bottomZ: "icon-zhidi",
reset: "icon-zhongzhi",
add: "el-icon-plus"
}
};
},
methods: {
preShow: function () {
preShow: function() {
if (this.type === 1) {
if (this.length1!==0&&this.index1>0&&this.index1<this.length1) {
return true
if (
this.length1 !== 0 &&
this.index1 > 0 &&
this.index1 < this.length1
) {
return true;
} else {
return false
return false;
}
} else {
if (this.length2!==0&&this.index2>0&&this.index2<this.length2) {
return true
if (
this.length2 !== 0 &&
this.index2 > 0 &&
this.index2 < this.length2
) {
return true;
} else {
return false
return false;
}
}
},
nextShow: function () {
nextShow: function() {
if (this.type === 1) {
if (this.length1!==0&&this.index1<this.length1-1) {
return true
if (this.length1 !== 0 && this.index1 < this.length1 - 1) {
return true;
} else {
return false
return false;
}
} else {
if (this.length2!==0&&this.index2<this.length2-1) {
return true
if (this.length2 !== 0 && this.index2 < this.length2 - 1) {
return true;
} else {
return false
return false;
}
}
},
toPreZ: function () {
this.$emit('toPreZ', this.name, this.index1, this.index2)
toPreZ: function() {
this.$emit("toPreZ", this.name, this.index1, this.index2);
},
toPreY: function () {
this.$emit('toPreY', this.name, this.index1, this.index2)
toPreY: function() {
this.$emit("toPreY", this.name, this.index1, this.index2);
},
toNextY: function () {
this.$emit('toNextY', this.name, this.index1, this.index2)
toNextY: function() {
this.$emit("toNextY", this.name, this.index1, this.index2);
},
toNextZ: function () {
this.$emit('toNextZ', this.name, this.index1, this.index2)
toNextZ: function() {
this.$emit("toNextZ", this.name, this.index1, this.index2);
},
toHuan: function () {
this.$emit('toHuan', this.name, this.index1, this.index2)
toHuan: function() {
this.$emit("toHuan", this.name, this.index1, this.index2);
},
toXuan: function () {
this.$emit('toXuan', this.name, this.index1, this.index2)
toXuan: function() {
this.$emit("toXuan", this.name, this.index1, this.index2);
},
toDelete: function () {
this.$emit('toDelete', this.name, this.index1, this.index2)
toDelete: function() {
this.$emit("toDelete", this.name, this.index1, this.index2);
},
toReset: function () {
this.$emit('toReset', this.name, this.index1, this.index2)
toReset: function() {
this.$emit("toReset", this.name, this.index1, this.index2);
},
//添加
toAdd:function()
{
this.$emit('toAdd', this.name, this.index1, this.index2)
}
toAdd: function() {
this.$emit("toAdd", this.name, this.index1, this.index2);
}
}
};
</script>
<style scoped>
.vToolBar{
.vToolBar {
display: inline-block;
font-size: 0px;
background-color: rgba(0, 0, 0, .7);
background-color: rgba(0, 0, 0, 0.7);
border-radius: 2px;
}
.vToolBar_horizontal{
}
.vToolBar_horizontal {
height: 30px;
white-space: nowrap;
}
.vToolBar_vertical{
}
.vToolBar_vertical {
width: 30px;
}
.vToolBar>div{
}
.vToolBar > div {
display: inline-block;
width: 30px;
height: 30px;
vertical-align: top;
cursor: pointer;
}
.vToolBar>div>i{
}
.vToolBar > div > i {
display: inline-block;
width: 30px;
height: 30px;
line-height: 30px;
text-align: center;
font-size: 20px;
color: #FFFFFF;
}
.vToolBar>div>i:hover{
color: #ffffff;
}
.vToolBar > div > i:hover {
background-color: #666666;
}
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -303,9 +303,6 @@
methods: {
//非直采切换
NoDirectScenicCheck(number) {
// this.dayObj.ScenicArray.forEach(x=>{
// x.ScenicJson = x.ScenicJsonStr ? JSON.parse(x.ScenicJsonStr) : { x:0, y:0 };
// })
if (this.dayObj.ScenicArray == null) {
this.dayObj.ScenicArray = [];
}
......
......@@ -2,7 +2,7 @@ import store from '../'
import config from '../../configs'
import util from '../../utils'
export function formatMsg (msg) {
export function formatMsg(msg) {
const nim = store.state.nim
if (msg.type === 'robot') {
if (msg.content && msg.content.flag === 'bot') {
......@@ -25,21 +25,21 @@ export function formatMsg (msg) {
return msg
}
export function onRoamingMsgs (obj) {
export function onRoamingMsgs(obj) {
let msgs = obj.msgs.map(msg => {
return formatMsg(msg)
})
store.commit('updateMsgs', msgs)
}
export function onOfflineMsgs (obj) {
export function onOfflineMsgs(obj) {
let msgs = obj.msgs.map(msg => {
return formatMsg(msg)
})
store.commit('updateMsgs', msgs)
}
export function onMsg (msg) {
export function onMsg(msg) {
msg = formatMsg(msg)
store.commit('putMsg', msg)
if (msg.sessionId === store.state.currSessionId) {
......@@ -52,7 +52,7 @@ export function onMsg (msg) {
}
}
function onSendMsgDone (error, msg) {
function onSendMsgDone(error, msg) {
store.dispatch('hideLoading')
if (error) {
// 被拉黑
......@@ -67,7 +67,7 @@ function onSendMsgDone (error, msg) {
}
// 消息撤回
export function onRevocateMsg (error, msg) {
export function onRevocateMsg(error, msg) {
const nim = store.state.nim
if (error) {
if (error.code === 508) {
......@@ -94,7 +94,7 @@ export function onRevocateMsg (error, msg) {
to: msg.to,
tip,
time: msg.time,
done: function sendTipMsgDone (error, tipMsg) {
done: function sendTipMsgDone(error, tipMsg) {
let idClient = msg.deletedIdClient || msg.idClient
store.commit('replaceMsg', {
sessionId: msg.sessionId,
......@@ -112,20 +112,28 @@ export function onRevocateMsg (error, msg) {
})
}
export function revocateMsg ({state, commit}, msg) {
export function revocateMsg({
state,
commit
}, msg) {
const nim = state.nim
let {idClient} = msg
let {
idClient
} = msg
msg = Object.assign(msg, state.msgsMap[idClient])
nim.deleteMsg({
msg,
done: function deleteMsgDone (error) {
done: function deleteMsgDone(error) {
onRevocateMsg(error, msg)
}
})
}
// 发送普通消息
export function sendMsg ({state, commit}, obj) {
export function sendMsg({
state,
commit
}, obj) {
const nim = state.nim
obj = obj || {}
let type = obj.type || ''
......@@ -152,13 +160,16 @@ export function sendMsg ({state, commit}, obj) {
}
}
export function sendTip ({state, commit}, obj) {
export function sendTip({
state,
commit
}, obj) {
const nim = store.state.nim
nim.sendTipMsg({
scene: obj.scene,
to: obj.to,
tip: obj.tip,
done: function sendTipMsgDone (error, msg) {
done: function sendTipMsgDone(error, msg) {
// 超哥 do something
onSendMsgDone(error, msg)
}
......@@ -166,9 +177,16 @@ export function sendTip ({state, commit}, obj) {
}
// 发送文件消息
export function sendFileMsg ({state, commit}, obj) {
export function sendFileMsg({
state,
commit
}, obj) {
const nim = state.nim
let {scene, to, fileInput} = obj
let {
scene,
to,
fileInput
} = obj
let type = 'file'
if (/\.(png|jpg|bmp|jpeg|gif)$/i.test(fileInput.value)) {
type = 'image'
......@@ -199,16 +217,26 @@ export function sendFileMsg ({state, commit}, obj) {
})
}
export function sendDataUrlMsg ({state, commit}, obj) {
export function sendDataUrlMsg({
state,
commit
}, obj) {
const nim = state.nim
let {scene, to, dataURL, name} = obj
let {
scene,
to,
dataURL,
name
} = obj
let type = 'file'
if (/(png|jpg|bmp|jpeg|gif)$/i.test(name)) {
type = 'image'
} else if (/(mov|mp4|ogg|webm)$/i.test(name)) {
type = 'video'
}
let otherMsg = {'fileName': name}
let otherMsg = {
'fileName': name
}
store.dispatch('showLoading')
nim.sendFile({
scene: scene,
......@@ -235,9 +263,21 @@ export function sendDataUrlMsg ({state, commit}, obj) {
}
// 发送机器人消息
export function sendRobotMsg ({state, commit}, obj) {
export function sendRobotMsg({
state,
commit
}, obj) {
const nim = state.nim
let {type, scene, to, robotAccid, content, params, target, body} = obj
let {
type,
scene,
to,
robotAccid,
content,
params,
target,
body
} = obj
scene = scene || 'p2p'
if (type === 'text') {
nim.sendRobotMsg({
......@@ -279,7 +319,10 @@ export function sendRobotMsg ({state, commit}, obj) {
}
// 发送消息已读回执
export function sendMsgReceipt ({state, commit}) {
export function sendMsgReceipt({
state,
commit
}) {
// 如果有当前会话
let currSessionId = store.state.currSessionId
if (currSessionId) {
......@@ -290,7 +333,7 @@ export function sendMsgReceipt ({state, commit}) {
if (state.sessionMap[currSessionId]) {
nim.sendMsgReceipt({
msg: state.sessionMap[currSessionId].lastMsg,
done: function sendMsgReceiptDone (error, obj) {
done: function sendMsgReceiptDone(error, obj) {
// do something
}
})
......@@ -299,21 +342,27 @@ export function sendMsgReceipt ({state, commit}) {
}
}
function sendMsgReceiptDone (error, obj) {
function sendMsgReceiptDone(error, obj) {
console.log('发送消息已读回执' + (!error ? '成功' : '失败'), error, obj)
}
export function getHistoryMsgs ({state, commit}, obj) {
export function getHistoryMsgs({
state,
commit
}, obj) {
const nim = state.nim
if (nim) {
let {scene, to} = obj
let {
scene,
to
} = obj
let options = {
scene,
to,
reverse: false,
asc: true,
limit: config.localMsglimit || 20,
done: function getHistoryMsgsDone (error, obj) {
done: function getHistoryMsgsDone(error, obj) {
if (obj.msgs) {
if (obj.msgs.length === 0) {
commit('setNoMoreHistoryMsgs')
......@@ -341,11 +390,15 @@ export function getHistoryMsgs ({state, commit}, obj) {
}
}
export function resetNoMoreHistoryMsgs ({commit}) {
export function resetNoMoreHistoryMsgs({
commit
}) {
commit('resetNoMoreHistoryMsgs')
}
// 继续与机器人会话交互
export function continueRobotMsg ({commit}, robotAccid) {
export function continueRobotMsg({
commit
}, robotAccid) {
commit('continueRobotMsg', robotAccid)
}
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