Commit 67e294da by xinla

公用组件优化与新增等,从release的部分合并

1 parent bd33c200
......@@ -27,9 +27,15 @@
<div class="load-title">正在加载系统资源,请耐心等待</div>
</div>
<script type="module" src="/src/main.js"></script>
<script src="https://hm.baidu.com/hm.js?8f5214f3a0f80a33eb32a0f890167cc1"></script>
<script src="https://hm.baidu.com/hm.js?489a58fd4fcaf2347cee64a8827e7094"></script>
<script>
setTimeout(() => {
if (window.lwConfig && window.lwConfig._env !== 'development') {
var hm = document.createElement("script").src = "https://hm.baidu.com/hm.js?489a58fd4fcaf2347cee64a8827e7094";
var hm1 = document.createElement("script").src = "https://hm.baidu.com/hm.js?8f5214f3a0f80a33eb32a0f890167cc1";
document.body.append(hm, hm1)
}
}, 1000);
</script>
</body>
</html>
\ No newline at end of file
......@@ -179,9 +179,9 @@ export default {
</script>
<template>
<div v-if="series && series.length" ref="chart" class="chart-bar chart" key="1"></div>
<div v-if="series?.length" ref="chart" class="chart-bar chart" key="1"></div>
<div v-else class="chart-bar chart" key="2">
<div class="cc">暂无数据</div>
<div class="cc"><Empty /></div>
</div>
</template>
......
......@@ -221,8 +221,10 @@ export default {
</script>
<template>
<div v-if="series && series.length" ref="chart" class="chart-line chart" key="1"></div>
<div v-else class="chart-line chart" key="2"><div class="cc">暂无数据</div></div>
<div v-if="series?.length" ref="chart" class="chart-line chart" key="1"></div>
<div v-else class="chart-line chart" key="2">
<div class="cc"><Empty /></div>
</div>
</template>
<style lang="scss" scoped>
......
......@@ -122,13 +122,17 @@ export default {
</script>
<template>
<div ref="chart" class="chart-pie chart"></div>
<div v-if="series?.length" ref="chart" class="chart-pie chart" key="1"></div>
<div v-else class="chart-pie chart" key="2">
<div class="cc"><Empty /></div>
</div>
</template>
<style lang="scss" scoped>
.chart {
position: relative;
max-height: 100%;
min-width: 200px;
min-height: 200px;
min-width: 400px;
min-height: 400px;
}
</style>
<!-- 时间搜索(近一周,近一月,自定义)数据图表或表格 组件 -->
<script>
// import * as customerApi from '@/api/operateCenter/customerAnalysis'
// import * as groupApi from '@/api/operateCenter/groupAnalysis'
// import * as conversationApi from '@/api/operateCenter/conversationAnalysis'
import { getList as getGroupList } from '@/api/customer/group'
export default {
name: '',
components: {
ChartLine: defineAsyncComponent(() => import('@/components/ChartLine')),
ChartBar: defineAsyncComponent(() => import('@/components/ChartBar')),
},
props: {
// 数据展示图表类型
type: {
type: String, // lineChart, barChart, table
default: 'lineChart',
},
// 接口请求
request: {
type: Function,
},
// 是否显示时间查询
isTimeQuery: {
type: Boolean,
default: true,
},
// 是否显示选择部门员工搜索框
isStaffQuery: {
type: Boolean,
default: false,
},
// 选择员工搜索框的placeholder
staffQueryPlaceholder: {
type: String,
default: '请选择部门或员工',
},
// 是否只选择员工, 不能通过选择部门来选择员工
isOnlyStaff: {
type: Boolean,
default: false,
},
// 是否只选择部门
isOnlyDepart: {
type: Boolean,
default: false,
},
// 是否显示选择群聊搜索框
isGroupQuery: {
type: Boolean,
default: false,
},
// 自定义的查询参数处理方法,可用于添加和修改查询参数
dealQueryFun: {
type: Function,
default: null,
},
// 自定义的返回数据处理方法,可用于添加和修改查询参数
dealDataFun: {
type: Function,
default: null,
},
// 导出接口请求
requestExport: {
type: Function,
default: null,
},
// 导出文件名(需包含后缀名)
exportFileName: { type: String },
// 图表图例; 单个图例可传字符串,多个图例传数组
legend: {
type: [Array, String],
default: null,
},
// 自定义图表配置项,使用loadsh.merge(origin, option)和原有的配置进行覆盖合并
// loadsh.merge: https://www.html.cn/doc/lodash/#_mergeobject-sources
option: {
type: Object,
default: null,
},
},
data() {
return {
loading: false,
timeRange: 7,
total: 0,
// 表格数据
data: [],
xData: [],
// 日期范围
dateRange: [],
// 查询参数
query: {
pageNum: 1,
pageSize: undefined,
deptIds: [],
userIds: [],
chatIds: [],
ownerIds: [],
beginTime: undefined,
endTime: undefined,
},
// 群聊
groupChats: [],
tableProps: [],
userArray: [], // 选择人员
dialogVisible: false,
dialogType: '',
}
},
computed: {},
watch: {},
created() {
this.setTime(7)
this.isGroupQuery && this.getGroupList()
},
mounted() {},
methods: {
getList(page) {
if (this.type == 'table') {
this.query.pageSize || (this.query.pageSize = 10)
}
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
this.dealQueryFun && this.dealQueryFun(this.query)
if (Array.isArray(this.userArray)) {
this.query.deptIds = this.userArray
.filter((e) => e.isParty)
.map((e) => e.id)
.join(',')
this.query.userIds = this.userArray
.filter((e) => !e.isParty)
.map((e) => e.userId)
.join(',')
if (this.isGroupQuery) {
this.query.ownerIds = this.userArray
.filter((e) => !e.isParty)
.map((e) => e.userId)
.join(',')
}
} else {
this.query.deptIds = this.query.userIds = this.query.ownerIds = ''
}
this.loading = true
page && (this.query.pageNum = page)
this.request(this.query)
.then(({ rows, total, data }) => {
data = data || rows
// if (!data) {
// return
// }
if (this.type == 'table') {
// 表格
this.data = data
this.total = +total
} else {
// 自定义echarts图表数据处理
this.dealDataFun && this.dealDataFun(data, this.data, this.xData)
}
})
.catch((e) => {
console.error(e)
})
.finally(() => {
this.loading = false
})
},
getTime(datePar) {
const d = datePar ? new Date(datePar) : new Date()
d.setMinutes(d.getMinutes() - d.getTimezoneOffset())
return d.toJSON().substr(0, 10)
},
setTime(days) {
this.timeRange = days
if (days) {
let date = new Date()
date.setDate(date.getDate() - days)
this.dateRange = [this.getTime(date), this.getTime()]
this.getList()
} else {
this.dateRange = null
}
},
// showDialog(type) {
// this.dialogType = type
// this.dialogVisible = true
// },
getSelectUser(data) {
this.userArray = data
if (this.isGroupQuery) {
this.query.chatIds = ''
// 根据群主获取群列表
this.getGroupList({
userIds: data.map((e) => e.userId).join(','),
})
}
this.getList()
},
// 获取群列表
getGroupList(params) {
getGroupList(params)
.then(({ rows }) => {
this.groupChats = rows
})
.catch(() => {})
},
exprotTable() {
this.$confirm('是否确认导出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.loading = true
let query = Object.assign({}, this.query, { pageNum: undefined, pageSize: undefined })
return this.requestExport(query)
})
.then((resBlob) => {
this.downloadBlob(resBlob, this.exportFileName)
})
.catch((error) => {
console.error(error)
})
.finally(() => {
this.loading = false
})
},
},
}
</script>
<template>
<div>
<div class="operation">
<template v-if="isTimeQuery">
<el-button-group>
<el-button type="primary" :plain="timeRange != 7" @click="setTime(7)">近一周</el-button>
<el-button type="primary" :plain="timeRange != 30" @click="setTime(30)">近一月</el-button>
<el-button type="primary" :plain="!!timeRange" @click="setTime()">自定义</el-button>
</el-button-group>
<el-date-picker
v-if="!timeRange"
v-model="dateRange"
class="ml20"
style="width: 260px"
value-format="YYYY-MM-DD"
type="daterange"
:clearable="false"
v-bind="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="getList(1)"></el-date-picker>
</template>
<el-input
v-if="isStaffQuery"
style="width: 180px; margin-left: 20px"
:model-value="userArray.map((e) => e.name) + ''"
readonly
@click="dialogVisible = true"
:placeholder="staffQueryPlaceholder" />
<el-select
style="margin-left: 20px; vertical-align: middle"
v-if="isGroupQuery"
v-model="query.chatIds"
placeholder="请选择群聊"
clearable
@change="getList()">
<el-option
v-for="item in groupChats"
:key="item.chatId"
:label="item.groupName"
:value="item.chatId"></el-option>
</el-select>
<!-- <el-input
v-if="isStaffQuery"
style="width: 180px; margin-left: 20px"
:model-value="userArray.map((e) => e.name) + ''"
readonly
@click="showDialog('_users')"
:placeholder="staffQueryPlaceholder"/> -->
<slot name="query" :query="query"></slot>
<el-button v-if="requestExport" style="position: absolute; right: 0" type="primary" @click="exprotTable">
导出 Excel
</el-button>
</div>
<div v-loading="loading">
<!-- 折线图 -->
<ChartLine v-if="type == 'lineChart'" :xData="xData" :legend="legend" :series="data" :option="option"></ChartLine>
<!-- 柱状图 -->
<ChartBar v-else-if="'barChart'.includes(type)" :xData="xData" :series="data" :option="option"></ChartBar>
<!-- 表格 -->
<template v-else-if="type == 'table'">
<slot name="table" :data="data"></slot>
<pagination
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getList()" />
</template>
</div>
<SelectUser
v-model:visible="dialogVisible"
title="组织架构"
departReplaceUser
:defaultValues="userArray"
:isOnlyDepart="isOnlyDepart"
:isOnlyLeaf="isOnlyStaff"
@success="getSelectUser"></SelectUser>
</div>
</template>
<style lang="scss" scoped>
.operation {
position: relative;
// display: flex;
// align-items: center;
margin-bottom: var(--card-margin, 16px);
}
</style>
<template>
<!-- 空状态,没有数据的时候 -->
<el-empty v-bind="$attrs" />
<!-- <div class="empty">
<svg-icon class="right-icon" :icon="nodataObj[type].svgName"></svg-icon>
<div class="nodata-text">{{ description}}</div>
</div> -->
</template>
<script>
export default {
props: {
// 显示的提示文字
// description: {
// type: String,
// default: null,
// },
},
data() {
return {}
},
}
</script>
<style lang="scss" scoped>
// .empty {
// width: 100%;
// height: 100%;
// display: flex;
// flex-direction: column;
// text-align: center;
// align-items: center;
// justify-content: center;
// .right-icon {
// width: 80px;
// height: 64px;
// }
// .nodata-text {
// font-size: 14px;
// font-weight: 400;
// color: #4e5969;
// line-height: 22px;
// }
// }
</style>
<template>
<!--
导入表格模板弹窗 组件
由透传属性,可直接使用 el-dialog 的所有props,
用法示例:<ImportDialog v-model="dialogVisible" title="title"/>
-->
<el-dialog width="600px" :close-on-click-modal="false">
<el-form v-loading="loading" ref="ruleForm" label-width="100px">
<el-form-item label="选择表格:" style="margin-bottom: 0">
<div style="display: flex; align-items: center; justify-content: space-between; height: 100%">
<div>
<input ref="input" type="file" style="display: none" @change="changeFile" />
<span v-if="file?.name" style="margin-right: 15px" @click="$refs.input.click()">{{ file?.name }}</span>
<el-button text @click="$refs.input.click()">
{{ file?.name ? '重新上传' : '上传表格' }}
</el-button>
</div>
<el-button v-if="downloadTemplateRequest" text @click="downloadTemplate">模版下载</el-button>
</div>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="$emit('update:model-value', false)">取消</el-button>
<el-button :disabled="!file?.name" type="primary" @click="importFile">确定</el-button>
</template>
</el-dialog>
</template>
<script>
export default {
props: {
// 导入文件格式, eg:xlsx, xls
format: {
type: Array,
default: () => ['xlsx', 'xls'], // xlsx
},
// 文件体积限制大小
maxSize: {
type: Number,
default: 50, // 50M
},
// 下载模板api
downloadTemplateRequest: {
type: Function,
default: undefined,
},
// 导出文件名(需包含后缀名)
downloadFileName: {
type: String,
default: '',
},
},
data() {
return {
loading: false,
file: {},
}
},
mounted() {},
methods: {
// 下载模板
downloadTemplate() {
this.loading = true
this.downloadTemplateRequest()
.then((res) => {
res && this.downloadBlob(res, this.downloadFileName)
})
.finally(() => {
this.loading = false
})
},
changeFile(event) {
let file = event.target.files[0]
const isOk = this.checkFile(file)
if (!isOk) return
this.file = file
},
// 文件校验
checkFile(file) {
const { size, name } = file
const reg = new RegExp(`\\.(${this.format.join('|')})$`, 'ig') // /\.(xlsx|xls)$/ig
const isXlsx = reg.test(name)
const isLimit = size / 1024 / 1024 < this.maxSize
if (!isXlsx) {
this.msgError(`上传文件只能是 ${this.format.join(',')} 格式!`)
}
if (!isLimit) {
this.msgError(`上传文件大小不能超过 ${this.maxSize}MB!`)
}
return isXlsx && isLimit
},
// 确认导入事件
importFile() {
const isOk = this.checkFile(this.file)
if (!isOk) return
this.$emit('confirm', this.$data)
},
},
}
</script>
<style lang="scss" scoped></style>
......@@ -32,7 +32,7 @@ export default {
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
return [10, 20, 30, 50, 1000]
},
},
layout: {
......
<script>
import { getDeptUserAll } from '@/api/organization'
export default {
name: 'SelectPost',
components: {},
props: {
visible: {
type: Boolean,
default: false
},
title: {
type: String,
default: '选择岗位'
},
// 是否单选
isSigleSelect: {
type: Boolean,
default: false
},
// 默认选中
defaultValues: {
type: Array,
default: () => []
},
// 禁止选中
disabledValues: {
type: Array,
default: () => []
},
destroyOnClose: Boolean
import { getDeptUserAll } from '@/api/organization'
export default {
name: 'SelectPost',
components: {},
props: {
visible: {
type: Boolean,
default: false,
},
data() {
return {
postList: [],
selectList: []
}
title: {
type: String,
default: '选择岗位',
},
watch: {
defaultValues: {
handler(value) {
this.selectList = value
},
immediate: true,
deep: true
// 是否单选
isSigleSelect: {
type: Boolean,
default: false,
},
// 默认选中
defaultValues: {
type: Array,
default: () => [],
},
// 禁止选中
disabledValues: {
type: Array,
default: () => [],
},
destroyOnClose: Boolean,
},
data() {
return {
postList: [],
selectList: [],
}
},
watch: {
defaultValues: {
handler(value) {
this.selectList = value
},
Pvisible(val) {
this.selectList = this.defaultValues
}
immediate: true,
deep: true,
},
computed: {
Pvisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
Pvisible(val) {
this.selectList = this.defaultValues
},
created() {
},
computed: {
Pvisible: {
get() {
this.visible && !this.postList?.length && this.getList()
return this.visible
},
set(val) {
this.$emit('update:visible', val)
},
},
},
created() {},
mounted() {},
methods: {
getList() {
getDeptUserAll().then(({ data }) => {
let arr = data.map((item) => {
return item.position
......@@ -65,19 +69,17 @@
this.postList = Array.from(new Set(arr))
})
},
mounted() {},
methods: {
// 确 定
submit() {
this.Pvisible = false
this.$emit('success', [...this.selectList])
},
// 取消选择
cancle(index) {
this.selectList.splice(index, 1)
}
}
}
// 确 定
submit() {
this.Pvisible = false
this.$emit('success', [...this.selectList])
},
// 取消选择
cancle(index) {
this.selectList.splice(index, 1)
},
},
}
</script>
<template>
<el-dialog :title="title" v-model="Pvisible" :close-on-click-modal="false" :destroy-on-close="destroyOnClose">
......@@ -86,7 +88,7 @@
<div class="head-container">
<el-checkbox-group v-model="selectList">
<template v-for="(unit, index) in postList" :key="index">
<el-checkbox style="display: block;" :label="unit" v-if="unit" :disabled="disabledValues.includes(unit)">
<el-checkbox style="display: block" :label="unit" v-if="unit" :disabled="disabledValues.includes(unit)">
{{ unit }}
</el-checkbox>
</template>
......@@ -112,9 +114,9 @@
</template>
<style lang="scss" scoped>
.user-list {
.el-row {
line-height: 26px;
}
.user-list {
.el-row {
line-height: 26px;
}
}
</style>
<!-- 选择部门,岗位,人员组合组件 -->
<script>
import { getDeptTree, getDeptUserAll } from '@/api/organization'
import SelectPost from '@/components/SelectPost'
export default {
components: { SelectPost },
props: {
modelValue: {
type: Object,
default: () => ({
selectedUserList: {
select: false,
weUserIds: [],
},
selectedDeptList: {
select: false,
deptIds: [],
},
selectedPostList: {
select: false,
posts: [],
},
}),
},
// 是否必选,至少一项
required: {
type: Boolean,
default: true,
},
},
data() {
return {
dialogVisibleSelectUser: false,
dialogVisibleSelectDept: false,
dialogVisibleSelectPost: false,
selectedUserList: [],
selectedDeptList: [],
// selectedPostList: [],
}
},
computed: {},
watch: {
modelValue: {
handler(val) {
// 设置默认值
val.selectedUserList || (val.selectedUserList = {})
val.selectedDeptList || (val.selectedDeptList = {})
val.selectedPostList || (val.selectedPostList = {})
if (val.selectedUserList?.weUserIds?.length && !this.selectedUserList.length) {
this.setEditUser()
}
if (val.selectedDeptList?.deptIds?.length && !this.selectedDeptList.length) {
this.setEditDept()
}
this.$emit('update:modelValue', val)
},
deep: true,
immediate: true,
},
},
created() {},
mounted() {},
methods: {
// 提交校验
validate() {
if (
this.required &&
!this.modelValue.selectedUserList?.select &&
!this.modelValue.selectedDeptList?.select &&
!this.modelValue.selectedPostList?.select
) {
this.msgError('请选择成员!')
return false
}
if (this.modelValue.selectedUserList?.select) {
if (!this.modelValue.selectedUserList?.weUserIds?.length) {
this.msgError('请选择员工!')
return false
}
}
if (this.modelValue.selectedDeptList?.select) {
if (!this.modelValue.selectedDeptList.deptIds.length) {
this.msgError('请选择部门!')
return false
}
}
if (this.modelValue.selectedPostList?.select) {
if (!this.modelValue.selectedPostList.posts?.length) {
this.msgError('请选择岗位!')
return false
}
}
return true
},
// ------ 选中事件 ------
// 选中员工
selectedUser(data) {
this.selectedUserList = data
this.modelValue.selectedUserList.weUserIds = data.map((dd) => {
return dd.userId
})
// this.changeFn()
},
// 选中部门
selectedDept(data) {
this.selectedDeptList = data
this.modelValue.selectedDeptList.deptIds = data.map((dd) => {
return dd.deptId
})
// this.changeFn()
},
// 选中岗位
selectedPost(data) {
// this.selectedPostList = data
this.modelValue.selectedPostList.posts = data
// this.changeFn()
},
// ------ 清空选中 ------
clearUserData(data) {
if (!data) {
this.selectedUserList = []
this.modelValue.selectedUserList.weUserIds = []
// this.changeFn()
}
},
clearDeptData(data) {
if (!data) {
this.selectedDeptList = []
this.modelValue.selectedDeptList.deptIds = []
// this.selectedPostList = []
// this.modelValue.selectedDeptList.posts = []
// this.changeFn()
}
},
clearPostData(data) {
if (!data) {
// this.selectedPostList = []
this.modelValue.selectedPostList.posts = []
// this.changeFn()
}
},
// changeFn() {
// this.$emit('update', this.modelValue)
// },
// ------ 根据选中的 id 回显 数据 -------
setEditUser() {
if (this.modelValue.selectedUserList?.weUserIds) {
getDeptUserAll().then(({ data }) => {
this.selectedUserList = []
this.modelValue.selectedUserList.weUserIds.forEach((element) => {
let traget = data.find((item) => item.weUserId == element)
if (traget) {
traget.userId = element
traget.name = traget.userName
this.selectedUserList.push(traget)
}
})
})
}
},
setEditDept() {
if (this.modelValue.selectedDeptList?.deptIds?.length) {
getDeptTree().then(({ data }) => {
this.selectedDeptList = []
this.modelValue.selectedDeptList.deptIds.forEach((element) => {
let traget = data.find((item) => item.deptId == element)
if (traget) {
traget.userId = element
traget.name = traget.deptName
this.selectedDeptList.push(traget)
}
})
})
}
},
},
}
</script>
<template>
<div>
<!-- 选择成员 -->
<div>
<el-checkbox v-model="modelValue.selectedUserList.select" @change="clearUserData" label="选择成员"></el-checkbox>
<template v-if="modelValue.selectedUserList.select">
<el-button type="primary" @click="dialogVisibleSelectUser = true">选择成员</el-button>
<TagEllipsis :list="selectedUserList" limit="10" type="info" style="display: block" />
</template>
</div>
<!-- 选择部门 -->
<div class="mt10">
<el-checkbox v-model="modelValue.selectedDeptList.select" @change="clearDeptData" label="选择部门"></el-checkbox>
<template v-if="modelValue.selectedDeptList.select">
<el-button type="primary" @click="dialogVisibleSelectDept = true">选择部门</el-button>
<TagEllipsis :list="selectedDeptList" limit="10" type="info" style="display: block" />
</template>
</div>
<!-- 选择岗位 -->
<div class="mt10">
<el-checkbox v-model="modelValue.selectedPostList.select" @change="clearPostData" label="选择岗位"></el-checkbox>
<template v-if="modelValue.selectedPostList.select">
<el-button type="primary" @click="dialogVisibleSelectPost = true">选择岗位</el-button>
<TagEllipsis :list="modelValue.selectedPostList.posts" limit="10" type="info" style="display: block" />
</template>
</div>
<SelectUser
v-model:visible="dialogVisibleSelectUser"
append-to-body
width="600px"
title="选择员工"
:defaultValues="selectedUserList"
@success="selectedUser"></SelectUser>
<SelectUser
v-model:visible="dialogVisibleSelectDept"
append-to-body
width="600px"
title="选择部门"
:isOnlyDepart="true"
:departReplaceUser="true"
:isOnlyLeaf="false"
:defaultValues="selectedDeptList"
@success="selectedDept"></SelectUser>
<SelectPost
v-model:visible="dialogVisibleSelectPost"
append-to-body
width="600px"
title="选择岗位"
:defaultValues="modelValue.selectedPostList.posts"
@success="selectedPost"></SelectPost>
</div>
</template>
<style lang="scss" scoped>
.el-checkbox {
vertical-align: middle;
margin-right: 10px;
}
</style>
<script>
import { del } from '@/views/clue/clueTemplate/api'
export default {
name: 'TagEllipsis',
components: {},
......@@ -15,28 +17,37 @@ export default {
type: String,
default: 'name',
},
// 空数据时显示的文本内容
emptyText: {
type: String,
default: '',
},
},
data() {
return {}
},
computed: {
_list() {
return this.list.filter((e) => (typeof e === 'string' ? e : e[this.defaultProps]))
return this.list?.filter((e) => (typeof e === 'string' ? e : e[this.defaultProps]))
},
},
watch: {},
created() {},
created() {
// 可传入 el-tag 的props
this.elTagProps = Object.assign({}, this.$attrs)
delete this.elTagProps.style
},
mounted() {},
methods: {},
}
</script>
<template>
<div class="tag-ellipsis">
<div v-if="!_list.length">无</div>
<div class="tag-ellipsis" v-if="_list?.length || emptyText">
<div v-if="!_list?.length">{{ emptyText }}</div>
<template v-else-if="_list.length <= +limit">
<el-tag v-for="(item, unique) in _list" :key="unique">
<el-tag v-bind="elTagProps" v-for="(item, unique) in _list" :key="unique">
{{ item[defaultProps] || item }}
</el-tag>
</template>
......@@ -44,16 +55,16 @@ export default {
<el-popover v-else placement="bottom" trigger="hover">
<!-- 插入到body,这里用css scoped calss无效,需使用style-->
<div class="tag-all" style="display: flex; flex-wrap: wrap; gap: 10px">
<el-tag v-for="(item, unique) in _list" :key="unique" style="margin: 0">
<el-tag v-bind="elTagProps" v-for="(item, unique) in _list" :key="unique" style="margin: 0">
{{ item[defaultProps] || item }}
</el-tag>
</div>
<template #reference>
<div>
<el-tag v-for="(item, unique) in _list.slice(0, +limit)" :key="unique">
<el-tag v-bind="elTagProps" v-for="(item, unique) in _list.slice(0, +limit)" :key="unique">
{{ item[defaultProps] || item }}
</el-tag>
<el-tag key="a" v-if="_list.length > +limit">...</el-tag>
<el-tag v-bind="elTagProps" key="a" v-if="_list.length > +limit">...</el-tag>
</div>
</template>
</el-popover>
......
// 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
<!-- // 带 插入 表情/客户昵称 等扩展工具栏的文本内容框 -->
<script>
export default {
name: '',
......@@ -57,11 +57,7 @@ export default {
</el-button>
</template>
</SelectEmoji>
<el-button
v-if="toolbar.includes('insertCustomerNickName')"
@click="insertContent(nikeName)"
class="ml10"
>
<el-button v-if="toolbar.includes('insertCustomerNickName')" @click="insertContent(nikeName)" class="ml10">
插入客户昵称
</el-button>
</div>
......
......@@ -106,7 +106,6 @@ export default {
fileUrlWatch: this.fileUrl,
fileNameWatch: this.fileName,
fileListWatch: this.fileList,
imgSizeWatch: this.imgSize,
picUrl: '', // 视频第一帧
file: undefined,
......@@ -130,11 +129,6 @@ export default {
this.fileNameWatch = value
},
},
imgSize: {
handler(value) {
this.imgSizeWatch = value
},
},
fileList: {
handler(value) {
this.fileListWatch = value
......@@ -425,9 +419,9 @@ export default {
format = formatDefault[this.type].value
tip = formatDefault[this.type].tip
}
let match = file.name.match(/\.(\w+)$/g)
let fileFormat = match && match[0].replace('.', '').toLowerCase()
isFormat = format[0] === '*' || format.includes(fileFormat)
const reg = new RegExp(`\\.(${this.format.join('|')})$`, 'ig') // /\.xlsx|.$/
isFormat = format[0] === '*' || reg.test(file.name)
if (!isFormat) {
this.$message.error('文件格式错误,仅支持 ' + (tip || format.join(',')) + ' 格式!')
this.loading = false
......
......@@ -30,9 +30,10 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
// 全局异步组件挂载,
// 所有异步组件,在其父组件需要更改其样式时可能会导致同级权重css样式顺序覆盖问题,使用时需注意加权
let components = {
Empty: () => import('./components/Empty.vue'),
Upload: () => import('./components/Upload.vue'),
Pagination: () => import('./components/Pagination.vue'),
RightToolbar: () => import('./components/RightToolbar.vue'),
Upload: () => import('./components/Upload.vue'),
ButtonSync: () => import('./components/ButtonSync.vue'),
TagEllipsis: () => import('./components/TagEllipsis.vue'),
SelectUser: () => import('./components/SelectUser.vue'),
......@@ -41,6 +42,7 @@ let components = {
PhoneTemplate: () => import('./components/PhoneTemplate.vue'),
CardGroupIndex: () => import('./components/CardGroupIndex.vue'),
TextareaExtend: () => import('./components/TextareaExtend.vue'), // 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
DateSearchChartTable: () => import('./components/DateSearchChartTable.vue'),
}
for (const c in components) {
app.component(c, defineAsyncComponent(components[c]))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!