resolver-egretimp-plus 0.1.93 → 0.1.95

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": "resolver-egretimp-plus",
3
- "version": "0.1.93",
3
+ "version": "0.1.95",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -303,26 +303,28 @@ function normalTableRowValue(row) {
303
303
  }
304
304
  </script>
305
305
  <template>
306
- <cmi-table ref="tableRef" :key="tableKey" v-bind="tableProps" @rowclick="tableEvents.onRowclick" @togglelandscape="tableEvents.onTogglelandscape">
307
- <cmi-table-column
308
- v-for="column in pmPageMetaList" :key="column.metaCode"
309
- v-bind="{
310
- ...attrs,
311
- ...getTableColumnProps(column)
312
- }"
313
- >
314
- </cmi-table-column>
315
- </cmi-table>
316
- <div v-if="pageable && normalPageTotal > 3" :style="{'display': 'flex', 'justify-content': pageAlignEnmu[pageAlign || PAGE_CENTER]}" style="margin-bottom: 12px;">
317
- <cmi-pagination
318
- :key="normalPageTotal"
319
- style="border-radius: 8px;border: 1px solid rgba(219,219,219,1);"
320
- v-bind="{...paginationProps, ...pagenationEvents}"
321
- @sizeChange="pagenationEvents.onSizeChange"
322
- @currentChange="pagenationEvents.onCurrentChange"
323
- :total="normalPageTotal"
324
- :pagesize="page.pageSize"
325
- :current="page.pageNum"
326
- />
306
+ <div>
307
+ <cmi-table ref="tableRef" :key="tableKey" v-bind="tableProps" @rowclick="tableEvents.onRowclick" @togglelandscape="tableEvents.onTogglelandscape">
308
+ <cmi-table-column
309
+ v-for="column in pmPageMetaList" :key="column.metaCode"
310
+ v-bind="{
311
+ ...attrs,
312
+ ...getTableColumnProps(column)
313
+ }"
314
+ >
315
+ </cmi-table-column>
316
+ </cmi-table>
317
+ <div v-if="pageable && normalPageTotal > 3" :style="{'display': 'flex', 'justify-content': pageAlignEnmu[pageAlign || PAGE_CENTER]}" style="margin-bottom: 12px;">
318
+ <cmi-pagination
319
+ :key="normalPageTotal"
320
+ style="border-radius: 8px;border: 1px solid rgba(219,219,219,1);"
321
+ v-bind="{...paginationProps, ...pagenationEvents}"
322
+ @sizeChange="pagenationEvents.onSizeChange"
323
+ @currentChange="pagenationEvents.onCurrentChange"
324
+ :total="normalPageTotal"
325
+ :pagesize="page.pageSize"
326
+ :current="page.pageNum"
327
+ />
328
+ </div>
327
329
  </div>
328
330
  </template>
@@ -12,7 +12,7 @@
12
12
  <script setup>
13
13
  import { onMounted, inject, watch, defineProps, computed, defineEmits, nextTick, resolveComponent } from 'vue';
14
14
  import { useSelEmployeeJs } from '../helper/dock.js'
15
- import { commonPropsType, debounce } from '../../utils/index.js'
15
+ import { commonPropsType, debounce, isBoolean, isString } from '../../utils/index.js'
16
16
  import { useFormItem } from 'element-plus'
17
17
 
18
18
  // const SearchIcon = resolveComponent('Search')
@@ -25,6 +25,20 @@ const props = defineProps({
25
25
  type: [String, Boolean],
26
26
  default: false
27
27
  },
28
+ // ====start==== 按部门查找人员,type为user时有效,结构为{deptIds:'xxx,yyy', cascade: true, excludeDeptIds:'xxx,yyy'}, deptIds为部门ID(如有多个用英文逗号分隔),cascade为是否包含下级部门人员, excludeDeptIds为除外部门ID(如有多个用英文逗号分隔)
29
+ cascade: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ deptIds: {
34
+ type: String,
35
+ default: ''
36
+ },
37
+ excludeDeptIds: {
38
+ type: String,
39
+ default: ''
40
+ },
41
+ // ====end==== 按部门查找人员,type为user时有效,结构为{deptIds:'xxx,yyy', cascade: true, excludeDeptIds:'xxx,yyy'}, deptIds为部门ID(如有多个用英文逗号分隔),cascade为是否包含下级部门人员, excludeDeptIds为除外部门ID(如有多个用英文逗号分隔)
28
42
  type: {
29
43
  type: String,
30
44
  default: 'user'
@@ -88,15 +102,18 @@ const initSelEmployee = async () => {
88
102
  await seelp(200)
89
103
  console.log('select-employees modelValue:', modelValue.value)
90
104
  const data = modelValue.value ? modelValue.value.split(separator.value) : []
105
+ let deptForUser = {}
106
+ if (props.deptIds || props.excludeDeptIds) {
107
+ deptForUser.deptIds = isString(deptForUser.deptIds) ? props.deptIds : ''
108
+ deptForUser.excludeDeptIds = isString(deptForUser.excludeDeptIds) ? props.excludeDeptIds : ''
109
+ deptForUser.cascade = isBoolean(deptForUser.cascade) ? deptForUser.cascade : !!(deptForUser.cascade)
110
+ }
91
111
  const initParams = {
92
112
  el: `#${metaCode.value}`,
93
113
  data,
94
114
  token: feiShuTokens,
95
115
  type: props.type,
96
- deptForUser: {
97
- // deptIds: '100178100000000001X8',
98
- // cascade: true
99
- },
116
+ deptForUser,
100
117
  lang: lang.value,
101
118
  multiple: typeof props.multiple === 'boolean' ? props.multiple : props.multiple == '1',
102
119
  placeholder: lang?.value?.indexOf('zh') > -1 ? props.placeholder : props.placeholderEn,
@@ -28,6 +28,8 @@ import {
28
28
  import { ARG_FLAGS, MULTI_PAGE_META_LIST_TYPES } from '../utils/const'
29
29
 
30
30
  import { findComponent, formatDate, hasOwn, isPlainObject, parseExtendAttr } from '../utils/index';
31
+ import dayjs from 'dayjs';
32
+
31
33
  const valArrTypes = [...MULTI_PAGE_META_LIST_TYPES]
32
34
  const valBooleanTypes = []
33
35
 
@@ -538,6 +540,9 @@ const allInitEvents = {
538
540
  if (matchVal.trimEnd().trimStart() === ARG_FLAGS.CURRENT_DATE) {
539
541
  return formatDate(new Date(), 'yyyy-MM-dd')
540
542
  }
543
+ if (matchVal.trimEnd().trimStart() === ARG_FLAGS.CURRENT_DATE_EXCLUDE) {
544
+ return dayjs(new Date()).add(1, 'day').format('YYYY-MM-DD')
545
+ }
541
546
  return originVal
542
547
  })
543
548
  } else {
@@ -7,6 +7,7 @@ export const MODE = {
7
7
  }
8
8
  export const ARG_FLAGS = {
9
9
  CURRENT_DATE: '_currentDate',
10
+ CURRENT_DATE_EXCLUDE: '_currentDateExclude',
10
11
  CURRENT_DATE_TIME: '_currentDateTime',
11
12
  REF_VAL: '_refVal'
12
13
  }
@@ -2,6 +2,7 @@ import { toRaw } from 'vue'
2
2
  import { formatDate, isPlainObject } from './common'
3
3
  import { ARG_FLAGS, isHidden, VALUE_TYPES } from './const'
4
4
  import { isArray, isNumber, isString } from './is'
5
+ import dayjs from 'dayjs'
5
6
 
6
7
  export default function defaultVal(config) {
7
8
  if (
@@ -27,9 +28,17 @@ export default function defaultVal(config) {
27
28
  } else if (/^{[\w\W]*}$/.test(trimValue) || /^\[[\w\W]*\]$/.test(trimValue)) {
28
29
  defaultVal = JSON.parse(trimValue)
29
30
  } else {
30
- if (trimValue === ARG_FLAGS.CURRENT_DATE || trimValue === 'currentDate' || trimValue === ARG_FLAGS.CURRENT_DATE_TIME) {
31
+ const dateFlagIncluds = [
32
+ ARG_FLAGS.CURRENT_DATE,
33
+ 'currentDate',
34
+ ARG_FLAGS.CURRENT_DATE_TIME,
35
+ ARG_FLAGS.CURRENT_DATE_EXCLUDE
36
+ ]
37
+ if (dateFlagIncluds.includes((trimValue || '').trim())) {
31
38
  if (trimValue === ARG_FLAGS.CURRENT_DATE_TIME) {
32
39
  defaultVal = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')
40
+ } else if (trimValue === ARG_FLAGS.CURRENT_DATE_EXCLUDE) {
41
+ defaultVal = dayjs(new Date()).add(1, 'day').format('YYYY-MM-DD')
33
42
  } else {
34
43
  defaultVal = formatDate(new Date(), 'yyyy-MM-dd')
35
44
  }
@@ -35,6 +35,7 @@ import { dispatchClickEvent, dispatchClickEvents, getTableConfig } from '../comp
35
35
  import CmiFormItem from '../components/cmiFormItem'
36
36
  import loadModule from './loadModule.js'
37
37
  import { h } from 'vue'
38
+ import dayjs from 'dayjs'
38
39
 
39
40
  // 解析配置中的defStyle属性
40
41
  export function parseDefStyle(defStyle) {
@@ -59,6 +60,8 @@ function deepParseFnStr(obj, refVal) {
59
60
  obj[key] = refVal || ''
60
61
  } else if (obj[key] === ARG_FLAGS.CURRENT_DATE) {
61
62
  obj[key] = formatDate(new Date(), 'yyyy-MM-dd')
63
+ } else if (obj[key] === ARG_FLAGS.CURRENT_DATE_EXCLUDE) {
64
+ obj[key] = dayjs(new Date()).add(1, 'day').format('YYYY-MM-DD')
62
65
  } else {
63
66
  const { checked, val } = preserveCheck(key, obj[key])
64
67
  if (checked) {