Commit ac32da8d by 姜鹏凯

Merge branch 'develop'

2 parents 5ebff2a6 8ad0d1d1
......@@ -131,7 +131,6 @@
created() {
getCosConfig().then((res) => {
this.cosConfig = res
console.log(this.cosConfig)
if (this.cosConfig.fileObject == 'tencentOss') {
this.cosInstance = new Cos({
SecretId: res.secretId,
......@@ -192,7 +191,7 @@
this.aliOss()
}
},
aliOss() {
async aliOss() {
this.loading = true
let file = undefined
if (!this.multiple || this.limit == 1) {
......@@ -209,48 +208,43 @@
this.$message.error('存储空间正忙,请稍后再试')
return
}
let name = `/${dateFormat(date, 'yyyy-MM-dd')}/t${date.getTime()}-${uuid()}${format}`
this.ossObj
.multipartUpload(name, file, {
let name = `${dateFormat(date, 'yyyy-MM-dd')}/t${date.getTime()}-${uuid()}${format}`
try {
const data = await this.ossObj.multipartUpload(name, file, {
progress: (progressData) => {
console.log(progressData)
this.percentage = progressData.percent * 100
this.speed = (progressData.speed / 1024 / 1024).toFixed(2)
this.percentage = progressData * 100
// this.speed = (progressData.speed / 1024 / 1024).toFixed(2)
}
})
.then((err1, data) => {
if (data) {
this.percentage = this.speed = 0
if (err1) {
this.loading = false
this.$message.error('上传失败,请稍后再试')
} else {
let location = 'https://' + data.Location
this.$emit('upSuccess', location)
this.type == 2
? //获取视频第一帧画面
getVideoPic({ url: location }).then((res) => {
this.loading = false
this.$emit('getPicUrl', res.data.url)
})
: (this.loading = false)
let location = this.cosConfig.cosImgUrlPrefix + data.name
this.$emit('upSuccess', location)
this.type == 2
? //获取视频第一帧画面
getVideoPic({ url: location }).then((res) => {
this.loading = false
this.$emit('getPicUrl', res.data.url)
})
: (this.loading = false)
// 使用本地链接提供预览,避免上传后下载的问题
let url = window.URL.createObjectURL(file)
// 使用本地链接提供预览,避免上传后下载的问题
let url = window.URL.createObjectURL(file)
let name = file.name
if (!this.multiple) {
this.fileUrlWatch = url
this.$emit('update:fileUrl', location)
this.$emit('update:fileName', (this.fileNameWatch = name))
} else {
this.fileListWatch = this.fileListWatch.concat({ name, url })
this.$emit('update:fileList', this.fileList.concat({ name, url: location }))
}
let name = file.name
if (!this.multiple) {
this.fileUrlWatch = url
this.$emit('update:fileUrl', location)
this.$emit('update:fileName', (this.fileNameWatch = name))
} else {
this.fileListWatch = this.fileListWatch.concat({ name, url })
this.$emit('update:fileList', this.fileList.concat({ name, url: location }))
}
})
.catch((err) => {
console.log(err)
})
}
} catch (e) {
this.loading = false
this.$message.error('上传失败,请稍后再试')
}
},
tencentFn() {
this.loading = true
......@@ -290,7 +284,6 @@
},
(err1, data) => {
this.percentage = this.speed = 0
console.log(data)
if (err1) {
this.loading = false
this.$message.error('上传失败,请稍后再试')
......@@ -560,7 +553,7 @@
<circle cx="50" cy="50" r="20" fill="none" class="path"></circle>
</svg>
</div>
<div class="cc" style="margin-top: 35px;">
<div class="cc" style="margin-top: 35px;" v-if="speed">
{{ speed + 'M/s' }}
</div>
</div>
......
......@@ -7,7 +7,7 @@
<TextareaExtend
:disabled="isDetail"
v-model="talkForm.templateInfo"
:toolbar="['emoji', 'insertCustomerNickName']"
:toolbar="isDetail ? [] : ['emoji']"
maxlength="2000"
show-word-limit
placeholder="请输入"
......
......@@ -97,6 +97,7 @@
baseData: {
type: 0,
client: {
content: '',
type: 0,
sex: null,
trackState: null,
......@@ -108,7 +109,7 @@
taskSendTime: '',
taskEndTime: ''
},
attachmentsList: [],
attachments: [],
senderList: []
},
submitLoading: false,
......@@ -125,11 +126,11 @@
},
data: {
type: Object,
default: () => []
default: {}
},
posterObj: {
type: Object,
default: () => []
default: {}
}
},
watch: {
......@@ -149,9 +150,10 @@
methods: {
getPreviewInfoText(data) {
this.preview.templateInfo = data.templateInfo
this.$forceUpdate()
},
getPreviewInfo(data) {
this.preview = data
this.preview.previewData = JSON.parse(JSON.stringify(data.previewData))
if (this.baseData.style == 1) {
this.preview.previewData.unshift({
mediaType: '5',
......
......@@ -73,11 +73,11 @@
templateInfo: '',
attachments: []
},
previewData: [],
form: {
type: 0,
client: {
type: 0,
content: '',
sex: null,
trackState: null,
addBeginTime: '',
......@@ -98,23 +98,23 @@
if (this.form.attachments) {
let arr = []
this.form.attachments.forEach((dd) => {
if (dd.msgType == 'text') {
this.attachmentsData.templateInfo = dd.content
} else {
if (dd.msgType !== 'text') {
arr.push(dd)
}
})
this.attachmentsData.templateInfo = this.form.client.content
let data = setAttachments(arr)
this.attachmentsData.attachments = data
this.$emit('preview', {
templateInfo: this.attachmentsData.templateInfo,
previewData: JSON.parse(JSON.stringify(this.attachmentsData.attachments))
})
this.$emit('previewText', { templateInfo: JSON.parse(JSON.stringify(this.attachmentsData.templateInfo)) })
}
if (!this.form.client) {
this.form.client = {
type: 0,
sex: '',
content: '',
trackState: '',
addBeginTime: '',
addEndTime: '',
......@@ -132,12 +132,12 @@
},
changeInfo(data) {
this.form.client.content = data
this.$forceUpdate()
this.$emit('update', this.form)
this.$emit('previewText', { templateInfo: data, previewData: this.previewData })
this.$emit('previewText', { templateInfo: data })
},
getPhoneData(data) {
this.previewData = data
this.$emit('preview', { templateInfo: this.attachmentsData.templateInfo, previewData: data })
this.$emit('preview', { previewData: data })
},
getAttentment(data) {
this.form.attachments = data
......
......@@ -77,6 +77,7 @@
form: {
type: 0,
group: {
contnet: '',
type: 0,
userIds: '',
sendType: 0,
......@@ -93,22 +94,22 @@
if (this.form.attachments) {
let arr = []
this.form.attachments.forEach((dd) => {
if (dd.msgType == 'text') {
this.attachmentsData.templateInfo = dd.content
} else {
if (dd.msgType !== 'text') {
arr.push(dd)
}
})
this.attachmentsData.templateInfo = this.form.client.content
let data = setAttachments(arr)
this.attachmentsData.attachments = data
this.$emit('preview', {
templateInfo: this.attachmentsData.templateInfo,
previewData: JSON.parse(JSON.stringify(this.attachmentsData.attachments))
})
this.$emit('previewText', { templateInfo: JSON.parse(JSON.stringify(this.attachmentsData.templateInfo)) })
}
if (!this.form.group) {
this.form.group = {
type: 0,
content: '',
userIds: '',
sendType: 0,
taskSendTime: '',
......
......@@ -12,7 +12,7 @@
<TextareaExtend
:disabled="isDetail"
v-model="templateInfo"
:toolbar="isDetail ? '' : ['emoji']"
:toolbar="isDetail ? [] : ['emoji']"
maxlength="2000"
show-word-limit
placeholder="请输入"
......
......@@ -258,6 +258,12 @@
},
created() {
this.getList()
this.$store.dispatch(
'app/setBusininessDesc',
`
<div>通过群发、朋友圈、应用消息等多种推广形式快捷推广智能短链,触达客户</div>
`
)
}
}
</script>
......
......@@ -4,27 +4,29 @@
<div class="g-card">
<div class="my-title">自建应用</div>
<el-form-item label="消息应用ID:" prop="agentId">
<el-input style="width: 40%" v-model="form.agentId" placeholder="请输入消息应用ID"></el-input>
<el-input style="width: 40%;" v-model="form.agentId" placeholder="请输入消息应用ID"></el-input>
<div class="tips">用于接收应用消息,在企微后台->应用工具->自建应用中配置并获取</div>
</el-form-item>
<el-form-item label="消息应用Secret:" prop="agentSecret">
<div>
<el-input
style="width: 40%"
style="width: 40%;"
:disabled="!agentSecretEditState"
:type="agentSecretEditState ? 'text' : 'password'"
v-model="form.agentSecret"
placeholder="请输入消息应用Secret"></el-input>
<el-button style="margin-left: 20px" plain v-if="agentSecretEditState" @click="cancelEditAgentSecret">
placeholder="请输入消息应用Secret"
></el-input>
<el-button style="margin-left: 20px;" plain v-if="agentSecretEditState" @click="cancelEditAgentSecret">
取消
</el-button>
<el-button type="primary" plain v-if="agentSecretEditState" @click="submitEditAgentSecret">保存</el-button>
<el-button
type="primary"
style="margin-left: 20px"
style="margin-left: 20px;"
plain
v-if="!agentSecretEditState"
@click="editAgentSecret">
@click="editAgentSecret"
>
修改
</el-button>
</div>
......@@ -36,28 +38,30 @@
<el-form-item label="会话存档Secret:" prop="chatSecret">
<div>
<el-input
style="width: 40%"
style="width: 40%;"
:disabled="!chatSecretEditState"
:type="chatSecretEditState ? 'text' : 'password'"
v-model="form.chatSecret"
placeholder="请输入会话存档Secret"></el-input>
<el-button style="margin-left: 20px" plain v-if="chatSecretEditState" @click="cancelEditChatSecret">
placeholder="请输入会话存档Secret"
></el-input>
<el-button style="margin-left: 20px;" plain v-if="chatSecretEditState" @click="cancelEditChatSecret">
取消
</el-button>
<el-button type="primary" plain v-if="chatSecretEditState" @click="submitEditChatSecret">保存</el-button>
<el-button
type="primary"
style="margin-left: 20px"
style="margin-left: 20px;"
plain
v-if="!chatSecretEditState"
@click="editChatSecret">
@click="editChatSecret"
>
修改
</el-button>
</div>
<div class="tips">用于同步企微会话,在企微后台->管理工具->会话存档中获取</div>
</el-form-item>
<el-form-item label="消息加密公钥:" prop="financePrivateKey">
<el-input style="width: 40%" v-model="form.financePrivateKey" placeholder="请输入消息加密公钥"></el-input>
<el-form-item label="消息加密私钥:" prop="financePrivateKey">
<el-input style="width: 40%;" v-model="form.financePrivateKey" placeholder="请输入消息加密私钥"></el-input>
<div class="tips">用于同步企微会话,在企微后台->管理工具->会话存档中获取</div>
</el-form-item>
</div>
......@@ -68,88 +72,88 @@
</div>
</template>
<script>
export default {
name: 'enterprise-wechat-part2',
data() {
return {
agentSecretCopy: '',
agentSecretEditState: false,
chatSecretCopy: '',
chatSecretEditState: false,
form: {},
rules: {
agentId: [{ required: true, message: '必填项', trigger: 'blur' }],
agentSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
chatSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
financePrivateKey: [{ required: true, message: '必填项', trigger: 'blur' }],
// seasRedirectUrl: [{ required: true, message: '必填项', trigger: 'blur' }],
// sopTagRedirectUrl: [{ required: true, message: '必填项', trigger: 'blur' }]
},
}
},
watch: {
data: 'setData',
},
props: {
data: {
type: Object,
default: {},
},
},
methods: {
editAgentSecret() {
this.agentSecretEditState = true
this.agentSecretCopy = JSON.parse(JSON.stringify(this.form.agentSecret))
this.form.agentSecret = ''
},
cancelEditAgentSecret() {
this.agentSecretEditState = false
this.form.agentSecret = JSON.parse(JSON.stringify(this.agentSecretCopy))
},
submitEditAgentSecret() {
if (this.form.agentSecret) {
this.$emit('submit', this.form)
this.agentSecretEditState = false
export default {
name: 'enterprise-wechat-part2',
data() {
return {
agentSecretCopy: '',
agentSecretEditState: false,
chatSecretCopy: '',
chatSecretEditState: false,
form: {},
rules: {
agentId: [{ required: true, message: '必填项', trigger: 'blur' }],
agentSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
chatSecret: [{ required: true, message: '必填项', trigger: 'blur' }],
financePrivateKey: [{ required: true, message: '必填项', trigger: 'blur' }]
// seasRedirectUrl: [{ required: true, message: '必填项', trigger: 'blur' }],
// sopTagRedirectUrl: [{ required: true, message: '必填项', trigger: 'blur' }]
}
}
},
editChatSecret() {
this.chatSecretEditState = true
this.chatSecretCopy = JSON.parse(JSON.stringify(this.form.chatSecret))
this.form.chatSecret = ''
watch: {
data: 'setData'
},
cancelEditChatSecret() {
this.chatSecretEditState = false
this.form.chatSecret = JSON.parse(JSON.stringify(this.chatSecretCopy))
},
submitEditChatSecret() {
if (this.form.chatSecret) {
this.$emit('submit', this.form)
this.chatSecretEditState = false
props: {
data: {
type: Object,
default: {}
}
},
submit() {
this.$refs['form'].validate((validate) => {
if (validate) {
methods: {
editAgentSecret() {
this.agentSecretEditState = true
this.agentSecretCopy = JSON.parse(JSON.stringify(this.form.agentSecret))
this.form.agentSecret = ''
},
cancelEditAgentSecret() {
this.agentSecretEditState = false
this.form.agentSecret = JSON.parse(JSON.stringify(this.agentSecretCopy))
},
submitEditAgentSecret() {
if (this.form.agentSecret) {
this.$emit('submit', this.form)
this.agentSecretEditState = false
}
},
editChatSecret() {
this.chatSecretEditState = true
this.chatSecretCopy = JSON.parse(JSON.stringify(this.form.chatSecret))
this.form.chatSecret = ''
},
cancelEditChatSecret() {
this.chatSecretEditState = false
this.form.chatSecret = JSON.parse(JSON.stringify(this.chatSecretCopy))
},
submitEditChatSecret() {
if (this.form.chatSecret) {
this.$emit('submit', this.form)
this.chatSecretEditState = false
}
},
submit() {
this.$refs['form'].validate((validate) => {
if (validate) {
this.$emit('submit', this.form)
}
})
},
setData() {
if (Object.keys(this.data).length) {
this.form = this.data
}
})
},
setData() {
if (Object.keys(this.data).length) {
this.form = this.data
}
},
},
mounted() {},
created() {},
}
mounted() {},
created() {}
}
</script>
<style lang="scss" scoped>
.my-title {
}
.tips {
color: #aaa;
font-size: 12px;
}
.my-title {
}
.tips {
color: #aaa;
font-size: 12px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!