From 7e2b9528646dba224ba2162d307eec0ad18cdf96 Mon Sep 17 00:00:00 2001 From: xinla <1570728529@qq.com> Date: Sun, 7 Feb 2021 17:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linkwe-ui/src/components/AddTag.vue | 76 ++--- linkwe-ui/src/components/SelectTag.vue | 19 +- linkwe-ui/src/directive/index.js | 17 + linkwe-ui/src/directive/permission/index.js | 15 - linkwe-ui/src/directive/preventReClick.js | 14 + linkwe-ui/src/main.js | 4 +- linkwe-ui/src/views/contacts/organization.vue | 12 +- .../src/views/customerManage/customer.vue | 294 +++++++++--------- .../dimission/allocatedStaffList.vue | 120 ++++--- .../views/customerManage/dimission/index.vue | 10 +- linkwe-ui/src/views/customerManage/group.vue | 36 +++ .../src/views/customerManage/lossRemind.vue | 1 + .../src/views/drainageCode/staff/detail.vue | 49 ++- .../src/views/drainageCode/welcome/add.vue | 4 +- 14 files changed, 388 insertions(+), 283 deletions(-) create mode 100644 linkwe-ui/src/directive/index.js delete mode 100644 linkwe-ui/src/directive/permission/index.js create mode 100644 linkwe-ui/src/directive/preventReClick.js diff --git a/linkwe-ui/src/components/AddTag.vue b/linkwe-ui/src/components/AddTag.vue index 00b6fefa..734e39cc 100644 --- a/linkwe-ui/src/components/AddTag.vue +++ b/linkwe-ui/src/components/AddTag.vue @@ -1,8 +1,8 @@ + 添加标签 + >+ 添加标签 diff --git a/linkwe-ui/src/components/SelectTag.vue b/linkwe-ui/src/components/SelectTag.vue index 73cc9501..71d33e4a 100644 --- a/linkwe-ui/src/components/SelectTag.vue +++ b/linkwe-ui/src/components/SelectTag.vue @@ -36,6 +36,9 @@ export default { type(val) { val === 'remove' && (this.removeTag = this.selected.slice()) }, + selected(val) { + this.Pselected = val + }, }, computed: { Pvisible: { @@ -94,12 +97,14 @@ export default { v-show="item.groupId === selectedGroup || !selectedGroup" :key="index" > - {{ unit.name }} + @@ -109,7 +114,7 @@ export default { v-if="item.groupId === selectedGroup || !selectedGroup" :label="item" :key="index" - >{{ item.name }}{{ item.name.trim() || '(空的无效标签,请移除)' }} diff --git a/linkwe-ui/src/directive/index.js b/linkwe-ui/src/directive/index.js new file mode 100644 index 00000000..7906f5bd --- /dev/null +++ b/linkwe-ui/src/directive/index.js @@ -0,0 +1,17 @@ +import hasRole from './permission/hasRole' +import hasPermi from './permission/hasPermi' +import preventReClick from './preventReClick' + +const install = function(Vue) { + Vue.directive('hasRole', hasRole) + Vue.directive('hasPermi', hasPermi) + Vue.directive('preventReClick', preventReClick) +} + +if (window.Vue) { + window['hasRole'] = hasRole + window['hasPermi'] = hasPermi + Vue.use(install) // eslint-disable-line +} + +export default install diff --git a/linkwe-ui/src/directive/permission/index.js b/linkwe-ui/src/directive/permission/index.js deleted file mode 100644 index e3d76d38..00000000 --- a/linkwe-ui/src/directive/permission/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import hasRole from './hasRole' -import hasPermi from './hasPermi' - -const install = function(Vue) { - Vue.directive('hasRole', hasRole) - Vue.directive('hasPermi', hasPermi) -} - -if (window.Vue) { - window['hasRole'] = hasRole - window['hasPermi'] = hasPermi - Vue.use(install); // eslint-disable-line -} - -export default install diff --git a/linkwe-ui/src/directive/preventReClick.js b/linkwe-ui/src/directive/preventReClick.js new file mode 100644 index 00000000..87c7b29f --- /dev/null +++ b/linkwe-ui/src/directive/preventReClick.js @@ -0,0 +1,14 @@ +/** + * vue 自定义阻止按钮连续点击指令 + * 使用
搜索
+ */ +export default { + inserted(el, binding) { + el.addEventListener('click', () => { + el.style.pointerEvents = 'none' + setTimeout(() => { + el.style.pointerEvents = 'auto' + }, binding.value || 2000) + }) + }, +} diff --git a/linkwe-ui/src/main.js b/linkwe-ui/src/main.js index da08de5d..2a74e231 100644 --- a/linkwe-ui/src/main.js +++ b/linkwe-ui/src/main.js @@ -20,7 +20,7 @@ import config from '@/config' import App from './App' import store from './store' import router from './router' -import permission from './directive/permission' +import directive from './directive' import './assets/icons' // icon import './permission' // permission control @@ -69,7 +69,7 @@ Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) Vue.component('Upload', Upload) -Vue.use(permission) +Vue.use(directive) /** * If you don't want to use mock-server diff --git a/linkwe-ui/src/views/contacts/organization.vue b/linkwe-ui/src/views/contacts/organization.vue index 117debb0..4db9c9a8 100644 --- a/linkwe-ui/src/views/contacts/organization.vue +++ b/linkwe-ui/src/views/contacts/organization.vue @@ -157,7 +157,7 @@ export default { .then(() => { this.msgSuccess('操作成功') this.dialogVisible = false - this.getList(!this.form.id && 1) + this.getList(form._new && 1) }) .catch(() => { this.dialogVisible = false @@ -260,7 +260,7 @@ export default { :inline="true" label-width="100px" > - + @@ -277,7 +277,7 @@ export default { - + @@ -446,7 +446,7 @@ export default { @@ -484,7 +484,7 @@ export default { @@ -572,7 +572,7 @@ export default { :title="(formDepart.id ? '修改' : '添加') + '部门'" :visible.sync="dialogVisibleDepart" > - + diff --git a/linkwe-ui/src/views/customerManage/customer.vue b/linkwe-ui/src/views/customerManage/customer.vue index 6007b838..4fe21cf1 100644 --- a/linkwe-ui/src/views/customerManage/customer.vue +++ b/linkwe-ui/src/views/customerManage/customer.vue @@ -1,13 +1,13 @@ @@ -398,13 +399,16 @@ export default { > @@ -429,7 +433,7 @@ export default { @click=" $router.push({ path: '/customerManage/customerDetail', - query: { id: scope.row.externalUserid } + query: { id: scope.row.externalUserid }, }) " type="text" diff --git a/linkwe-ui/src/views/customerManage/dimission/allocatedStaffList.vue b/linkwe-ui/src/views/customerManage/dimission/allocatedStaffList.vue index 539e5c37..e1987ce1 100644 --- a/linkwe-ui/src/views/customerManage/dimission/allocatedStaffList.vue +++ b/linkwe-ui/src/views/customerManage/dimission/allocatedStaffList.vue @@ -1,8 +1,8 @@ - + diff --git a/linkwe-ui/src/views/customerManage/dimission/index.vue b/linkwe-ui/src/views/customerManage/dimission/index.vue index 8b8a86b0..0fbb53e7 100644 --- a/linkwe-ui/src/views/customerManage/dimission/index.vue +++ b/linkwe-ui/src/views/customerManage/dimission/index.vue @@ -132,7 +132,7 @@ export default { label-width="100px" class="top-search" > - + @@ -147,14 +147,6 @@ export default { > - - - Date.now() + }, + shortcuts: [ + { + text: '最近一周', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) + picker.$emit('pick', [start, end]) + }, + }, + { + text: '最近一个月', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30) + picker.$emit('pick', [start, end]) + }, + }, + { + text: '最近三个月', + onClick(picker) { + const end = new Date() + const start = new Date() + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90) + picker.$emit('pick', [start, end]) + }, + }, + ], + }, // 遮罩层 loading: false, // 选中数组 @@ -123,6 +158,7 @@ export default { v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" + :picker-options="pickerOptions" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" diff --git a/linkwe-ui/src/views/customerManage/lossRemind.vue b/linkwe-ui/src/views/customerManage/lossRemind.vue index 0827fcc0..d99d57bf 100644 --- a/linkwe-ui/src/views/customerManage/lossRemind.vue +++ b/linkwe-ui/src/views/customerManage/lossRemind.vue @@ -292,6 +292,7 @@ export default { -import { getDetail, getUserAddCustomerStat, download } from '@/api/drainageCode/staff' +import { + getDetail, + getUserAddCustomerStat, + download, +} from '@/api/drainageCode/staff' import ClipboardJS from 'clipboard' import echarts from 'echarts' export default { @@ -26,6 +30,7 @@ export default { endTime: undefined, }, type: { 1: '单人', 2: '多人', 3: '批量单人' }, + timeRange: 7, } }, created() { @@ -89,9 +94,11 @@ export default { }) }, setTime(days) { + this.timeRange = days let date = new Date() date.setDate(date.getDate() - days) this.dateRange = [this.getTime(date), this.getTime()] + this.getList() }, getHandledValue(num) { return num < 10 ? '0' + num : num @@ -104,19 +111,21 @@ export default { return year + '-' + month + '-' + date }, download() { - let userName = this.form.weEmpleCodeUseScops.map((item) =>{ - return item.businessName - }).join(","); - let name = userName +"-"+this.form.activityScene+".png" - download(this.form.id).then((res) =>{ - if (res!=null) { - let blob = new Blob([res], {type: 'application/zip'}); - let url = window.URL.createObjectURL(blob); - const link = document.createElement('a'); // 创建a标签 - link.href = url; - link.download = name; // 重命名文件 - link.click(); - URL.revokeObjectURL(url); // 释放内存 + let userName = this.form.weEmpleCodeUseScops + .map((item) => { + return item.businessName + }) + .join(',') + let name = userName + '-' + this.form.activityScene + '.png' + download(this.form.id).then((res) => { + if (res != null) { + let blob = new Blob([res], { type: 'application/zip' }) + let url = window.URL.createObjectURL(blob) + const link = document.createElement('a') // 创建a标签 + link.href = url + link.download = name // 重命名文件 + link.click() + URL.revokeObjectURL(url) // 释放内存 } }) }, @@ -182,10 +191,18 @@ export default {
累计总人数:{{ total }}
- 近7日 - 近30日 diff --git a/linkwe-ui/src/views/drainageCode/welcome/add.vue b/linkwe-ui/src/views/drainageCode/welcome/add.vue index 3d49cde7..cf389524 100644 --- a/linkwe-ui/src/views/drainageCode/welcome/add.vue +++ b/linkwe-ui/src/views/drainageCode/welcome/add.vue @@ -25,7 +25,7 @@ export default { watch: {}, computed: {}, created() { - this.form = this.$route.query + this.form = Object.assign(this.form, this.$route.query) }, mounted() {}, methods: { @@ -66,7 +66,7 @@ export default {