n20-common-lib 2.4.67 → 2.4.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "2.4.67",
3
+ "version": "2.4.68",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -157,6 +157,9 @@ th.vxe-header--column {
157
157
  .vxe-table--render-default.vxe-editable.size--mini .vxe-body--column {
158
158
  height: 32px !important;
159
159
  }
160
+ .vxe-table--tooltip-wrapper {
161
+ z-index: 9999 !important;
162
+ }
160
163
  .cell-default-set-- .vxe-table--body-wrapper .vxe-body--row .vxe-body--column .vxe-cell .vxe-cell--label:empty::before {
161
164
  content: '--';
162
165
  }
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <el-checkbox-group v-model="checkList" class="flex-column" @change="checkChange">
3
+ <el-checkbox v-for="(item, i) in filterList" :key="i" class="m-t-b" :label="item.label" />
4
+ <template v-if="filterLT.length > defaultShow">
5
+ <div :style="{ paddingLeft: labelWidth }">
6
+ <el-button class="p-t-0 m-b-s color-primary" type="text" @click="moreFn"
7
+ ><span>{{ '更多条件' | $lc }}</span
8
+ ><i :class="showMore ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i
9
+ ></el-button>
10
+ </div>
11
+ <el-collapse-transition>
12
+ <div v-if="showMore">
13
+ <el-form-item v-for="(item, i) in moreList" :key="i" class="m-b" :label="item.label">
14
+ <slot v-if="item.slotName" :name="item.slotName"></slot>
15
+ <form-item-input v-else :form="form" :item="item" />
16
+ </el-form-item>
17
+ </div>
18
+ </el-collapse-transition>
19
+ </template>
20
+ </el-checkbox-group>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: 'FilterItem',
26
+ props: {
27
+ filterList: {
28
+ type: Array,
29
+ default: () => []
30
+ }
31
+ },
32
+ data() {
33
+ return {
34
+ checkList: []
35
+ }
36
+ },
37
+ methods: {
38
+ checkChange(row) {
39
+ console.log(row)
40
+ }
41
+ }
42
+ }
43
+ </script>
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'FilterList'
8
+ }
9
+ </script>
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <div class="flex-box">
3
+ <filterList />
4
+ <el-popover
5
+ ref="popover"
6
+ v-model="showPop"
7
+ trigger="manual"
8
+ :width="widthAs"
9
+ :popper-class="popperClass"
10
+ placement="bottom-start"
11
+ @show="show"
12
+ >
13
+ <template slot="reference">
14
+ <el-button size="mini" onlyicon plain icon="el-icon-plus" @click="clickBtn" />
15
+ </template>
16
+ <el-form>
17
+ <InputSearch v-model="value" clearable class="input-w" :placeholder="$l('搜索筛选条件')" />
18
+ <filterItem :props="props" :filter-list="minList" />
19
+ </el-form>
20
+ </el-popover>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import filterList from './filterList.vue'
26
+ import InputSearch from '../InputSearch/index.vue'
27
+ import filterItem from './filterItem.vue'
28
+ import getWidth from '../../utils/asciiWidth'
29
+ export default {
30
+ name: 'AdvancedFilter',
31
+ components: {
32
+ filterList,
33
+ filterItem,
34
+ InputSearch
35
+ },
36
+ props: {
37
+ type: {
38
+ type: String,
39
+ default: ''
40
+ },
41
+ filterList: {
42
+ type: Array,
43
+ default: () => []
44
+ },
45
+ defaultShow: {
46
+ type: Number,
47
+ default: 5
48
+ },
49
+ labelWidth: {
50
+ type: [String, Number],
51
+ default: undefined
52
+ }
53
+ },
54
+ data() {
55
+ return {
56
+ value: '',
57
+ showPop: false,
58
+ showPopC: false,
59
+ remoteList: [],
60
+ popperClass: ('filters_popper_' + Date.now() + '_' + Math.random()).replace('.', '')
61
+ }
62
+ },
63
+ computed: {
64
+ widthAs() {
65
+ if (this.width !== undefined) return this.width
66
+
67
+ return this.labelWidthAs + 180
68
+ },
69
+ minList() {
70
+ return this.filterLT.slice(0, this.defaultShow)
71
+ },
72
+ moreList() {
73
+ return this.filterLT.slice(this.defaultShow)
74
+ },
75
+ filterLT() {
76
+ if (!this.isGroup) {
77
+ return this.filterList
78
+ } else {
79
+ let list = []
80
+ this.filterList.forEach((gp) => {
81
+ if (gp.children) {
82
+ gp.children.forEach((col) => {
83
+ list.push(Object.assign({}, col, { groupId: gp.groupId }))
84
+ })
85
+ }
86
+ })
87
+ return list
88
+ }
89
+ },
90
+ labelWidthAs() {
91
+ if (this.labelWidth !== undefined) {
92
+ return /em$/.test(this.labelWidth) ? parseInt(this.labelWidth) * 14 : parseInt(this.labelWidth)
93
+ }
94
+
95
+ if (this.type === 'remote') {
96
+ let maxW = Math.max(4 * 14, ...this.remoteList.map((r) => getWidth(r.label)))
97
+ return maxW + 14
98
+ } else {
99
+ let maxW = Math.max(4 * 14, ...this.minList.map((r) => getWidth(r.label)))
100
+ if (this.showMore) {
101
+ maxW = Math.max(maxW, ...this.moreList.map((r) => getWidth(r.label)))
102
+ }
103
+ return maxW + 14
104
+ }
105
+ }
106
+ },
107
+ methods: {
108
+ show() {
109
+ this.showPopC = true
110
+ },
111
+ clickBtn() {
112
+ if (!this.showPop) {
113
+ setTimeout(() => {
114
+ if (this.type === 'remote' && !this.remoteList.length) {
115
+ this.getRemote()
116
+ } else {
117
+ this.showPop = true
118
+ }
119
+ }, 60)
120
+ }
121
+ }
122
+ }
123
+ }
124
+ </script>
@@ -262,20 +262,20 @@
262
262
  </template>
263
263
 
264
264
  <script>
265
- import { $lc } from '@/utils/i18n/index.js'
265
+ import { $lc } from '../../../utils/i18n/index.js'
266
266
  import Cookies from 'js-cookie'
267
- import { themeList } from '@/utils/theme.config'
267
+ import { themeList } from '../../../utils/theme.config'
268
268
  import operatingStatus from '../../operatingStatus/index.vue'
269
269
  import dialogWrap from '../../Dialog/index.vue'
270
270
  import changePwd from './changePwd.vue'
271
271
  import noticePop from './noticePop.vue'
272
272
  import switchUser from './switchUser.vue'
273
273
 
274
- import axios from '@/utils/axios.js'
274
+ import axios from '../../../utils/axios.js'
275
275
  import getJsonc from '../../../assets/getJsonc'
276
276
  import realUrl from '../../../assets/realUrl'
277
- import auth from '@/utils/auth.js'
278
- import { linkPush } from '@/utils/urlToGo.js'
277
+ import auth from '../../../utils/auth.js'
278
+ import { linkPush } from '../../../utils/urlToGo.js'
279
279
  import dayjs from 'dayjs'
280
280
  import duration from 'dayjs/plugin/duration'
281
281
  dayjs.extend(duration)
@@ -69,7 +69,7 @@
69
69
 
70
70
  <script>
71
71
  import mixins from './mixins/index.js'
72
- import { $lc } from '@/utils/i18n/index.js'
72
+ import { $lc } from '../../utils/i18n/index.js'
73
73
  export default {
74
74
  name: 'Pagination',
75
75
  mixins: [mixins],
@@ -1,4 +1,4 @@
1
- import axios from '@/utils/axios.js'
1
+ import axios from '../../../utils/axios.js'
2
2
  export default {
3
3
  data() {
4
4
  return {
@@ -1,72 +1,72 @@
1
- /**
2
- * author: zhengwei
3
- * tiem: 2021-8-31
4
- * amend: 只注册到bind上,有问题;onXX会导致事件覆盖
5
- */
6
- // 封装全局弹窗拖拽指令 v-drag
7
- function dialogMoveFn(_this) {
8
- var dialogDom = _this.parentNode
9
- dialogDom.style.top = parseFloat(dialogDom.style.top || '0') + _this.pageYc + 'px'
10
- dialogDom.style.left = parseFloat(dialogDom.style.left || '0') + _this.pageXc + 'px'
11
- }
12
-
13
- const dialogMove = {
14
- install: function (Vue) {
15
- Vue.directive('drag', {
16
- update(el, binding) {
17
- if (el.style.display === 'none') {
18
- var dialogDom = el.querySelector('.el-dialog')
19
- if (dialogDom) {
20
- dialogDom.style.left = ''
21
- dialogDom.style.top = ''
22
- }
23
- }
24
- Vue.nextTick(function () {
25
- var dialogHeader = el.querySelector('.el-dialog__header')
26
- if (dialogHeader && !dialogHeader._hasMoveDir) {
27
- var _this, pvrPageX, pvrPageY
28
- dialogHeader._hasMoveDir = true
29
- dialogHeader.style.cursor = 'move'
30
-
31
- dialogHeader.addEventListener('mousedown', function (evt) {
32
- var ev = evt || event
33
- this.pageXc = this.pageYc = 0
34
- _this = this
35
- pvrPageX = ev.pageX
36
- pvrPageY = ev.pageY
37
- document.addEventListener('mousemove', mousemoveThisMove)
38
- document.addEventListener('mouseup', mouseupThisMove)
39
- })
40
-
41
- var mousemoveThisMove = function (evt) {
42
- var ev = evt || event
43
- ev.stopPropagation()
44
- ev.preventDefault()
45
- if (
46
- ev.clientX >= 0 &&
47
- ev.clientY >= 0 &&
48
- ev.clientX <= document.documentElement.clientWidth &&
49
- ev.clientY <= document.documentElement.clientHeight
50
- ) {
51
- _this.pageXc = ev.pageX - pvrPageX
52
- _this.pageYc = ev.pageY - pvrPageY
53
- if (_this.pageXc !== 0 || _this.pageYc !== 0) {
54
- binding.value ? binding.value(_this, binding.arg) : dialogMoveFn(_this)
55
- }
56
- pvrPageX = ev.pageX
57
- pvrPageY = ev.pageY
58
- }
59
- }
60
-
61
- var mouseupThisMove = function () {
62
- document.removeEventListener('mousemove', mousemoveThisMove)
63
- document.removeEventListener('mouseup', mouseupThisMove)
64
- }
65
- }
66
- })
67
- }
68
- })
69
- }
70
- }
71
-
72
- export default dialogMove
1
+ /**
2
+ * author: zhengwei
3
+ * tiem: 2021-8-31
4
+ * amend: 只注册到bind上,有问题;onXX会导致事件覆盖
5
+ */
6
+ // 封装全局弹窗拖拽指令 v-drag
7
+ function dialogMoveFn(_this) {
8
+ var dialogDom = _this.parentNode
9
+ dialogDom.style.top = parseFloat(dialogDom.style.top || '0') + _this.pageYc + 'px'
10
+ dialogDom.style.left = parseFloat(dialogDom.style.left || '0') + _this.pageXc + 'px'
11
+ }
12
+
13
+ const dialogMove = {
14
+ install: function (Vue) {
15
+ Vue.directive('drag', {
16
+ update(el, binding) {
17
+ if (el.style.display === 'none') {
18
+ var dialogDom = el.querySelector('.el-dialog')
19
+ if (dialogDom) {
20
+ dialogDom.style.left = ''
21
+ dialogDom.style.top = ''
22
+ }
23
+ }
24
+ Vue.nextTick(function () {
25
+ var dialogHeader = el.querySelector('.el-dialog__header')
26
+ if (dialogHeader && !dialogHeader._hasMoveDir) {
27
+ var _this, pvrPageX, pvrPageY
28
+ dialogHeader._hasMoveDir = true
29
+ dialogHeader.style.cursor = 'move'
30
+
31
+ dialogHeader.addEventListener('mousedown', function (evt) {
32
+ var ev = evt || event
33
+ this.pageXc = this.pageYc = 0
34
+ _this = this
35
+ pvrPageX = ev.pageX
36
+ pvrPageY = ev.pageY
37
+ document.addEventListener('mousemove', mousemoveThisMove)
38
+ document.addEventListener('mouseup', mouseupThisMove)
39
+ })
40
+
41
+ var mousemoveThisMove = function (evt) {
42
+ var ev = evt || event
43
+ ev.stopPropagation()
44
+ ev.preventDefault()
45
+ if (
46
+ ev.clientX >= 0 &&
47
+ ev.clientY >= 0 &&
48
+ ev.clientX <= document.documentElement.clientWidth &&
49
+ ev.clientY <= document.documentElement.clientHeight
50
+ ) {
51
+ _this.pageXc = ev.pageX - pvrPageX
52
+ _this.pageYc = ev.pageY - pvrPageY
53
+ if (_this.pageXc !== 0 || _this.pageYc !== 0) {
54
+ binding.value ? binding.value(_this, binding.arg) : dialogMoveFn(_this)
55
+ }
56
+ pvrPageX = ev.pageX
57
+ pvrPageY = ev.pageY
58
+ }
59
+ }
60
+
61
+ var mouseupThisMove = function () {
62
+ document.removeEventListener('mousemove', mousemoveThisMove)
63
+ document.removeEventListener('mouseup', mouseupThisMove)
64
+ }
65
+ }
66
+ })
67
+ }
68
+ })
69
+ }
70
+ }
71
+
72
+ export default dialogMove
package/src/i18n.json CHANGED
@@ -23,6 +23,9 @@
23
23
  "截止": {
24
24
  "en": "The deadline"
25
25
  },
26
+ "搜索筛选条件": {
27
+ "en": "Search filter conditions"
28
+ },
26
29
  "审批进度查看": {
27
30
  "en": "Review of approval progress"
28
31
  },
package/src/index.js CHANGED
@@ -64,6 +64,7 @@ import WornPagination from './components/WornPagination/index.vue'
64
64
 
65
65
  import Tree from './components/Tree/index.vue'
66
66
  import SelectTreePro from './components/SelectTree/pro.vue'
67
+ import AdvancedFilter from './components/AdvancedFilter/index.vue'
67
68
 
68
69
  // 新版日期选择框
69
70
  import BusiDatePicker from './components/DateSelect/busiDate.vue'
@@ -197,6 +198,7 @@ const components = [
197
198
  UploadMsg,
198
199
  Tree,
199
200
  SelectTreePro,
201
+ AdvancedFilter,
200
202
  /* old */
201
203
  TableO,
202
204
  FiltersO,
@@ -349,5 +351,6 @@ export {
349
351
  refreshTab,
350
352
  Tree,
351
353
  SelectTreePro,
354
+ AdvancedFilter,
352
355
  version
353
356
  }