cnhis-design-vue 0.1.93-beta → 0.1.97-beta

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.
Files changed (99) hide show
  1. package/es/affix/index.js +8 -8
  2. package/es/age/index.js +10 -10
  3. package/es/alert/index.js +8 -8
  4. package/es/anchor/index.js +8 -8
  5. package/es/auto-complete/index.js +8 -8
  6. package/es/avatar/index.js +8 -8
  7. package/es/back-top/index.js +8 -8
  8. package/es/badge/index.js +8 -8
  9. package/es/base/index.js +8 -8
  10. package/es/big-table/index.js +65 -65
  11. package/es/breadcrumb/index.js +8 -8
  12. package/es/button/index.js +88 -71
  13. package/es/button/style.css +1 -1
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/empty/index.js +8 -8
  33. package/es/fabric-chart/index.js +9 -9
  34. package/es/form/index.js +8 -8
  35. package/es/form-model/index.js +8 -8
  36. package/es/index/index.js +998 -490
  37. package/es/index/style.css +1 -1
  38. package/es/input/index.js +9 -9
  39. package/es/input-number/index.js +8 -8
  40. package/es/layout/index.js +8 -8
  41. package/es/list/index.js +8 -8
  42. package/es/locale-provider/index.js +8 -8
  43. package/es/map/index.js +9 -9
  44. package/es/mentions/index.js +8 -8
  45. package/es/menu/index.js +8 -8
  46. package/es/message/index.js +8 -8
  47. package/es/multi-chat/index.js +72 -72
  48. package/es/multi-chat-client/index.js +66 -66
  49. package/es/multi-chat-history/index.js +4 -4
  50. package/es/multi-chat-record/index.js +14 -14
  51. package/es/multi-chat-setting/index.js +22 -22
  52. package/es/multi-chat-sip/index.js +1 -1
  53. package/es/notification/index.js +8 -8
  54. package/es/page-header/index.js +8 -8
  55. package/es/pagination/index.js +8 -8
  56. package/es/popconfirm/index.js +8 -8
  57. package/es/popover/index.js +8 -8
  58. package/es/progress/index.js +8 -8
  59. package/es/radio/index.js +9 -9
  60. package/es/rate/index.js +8 -8
  61. package/es/result/index.js +8 -8
  62. package/es/row/index.js +8 -8
  63. package/es/scale-view/index.js +22 -22
  64. package/es/select/index.js +11 -11
  65. package/es/select-label/index.js +10 -10
  66. package/es/select-person/index.js +2 -2
  67. package/es/skeleton/index.js +8 -8
  68. package/es/slider/index.js +8 -8
  69. package/es/space/index.js +8 -8
  70. package/es/spin/index.js +8 -8
  71. package/es/statistic/index.js +8 -8
  72. package/es/steps/index.js +8 -8
  73. package/es/switch/index.js +8 -8
  74. package/es/table-filter/index.js +750 -221
  75. package/es/table-filter/style.css +1 -1
  76. package/es/tabs/index.js +8 -8
  77. package/es/tag/index.js +9 -9
  78. package/es/time-picker/index.js +8 -8
  79. package/es/timeline/index.js +8 -8
  80. package/es/tooltip/index.js +8 -8
  81. package/es/transfer/index.js +8 -8
  82. package/es/tree/index.js +8 -8
  83. package/es/tree-select/index.js +8 -8
  84. package/es/upload/index.js +8 -8
  85. package/es/utils/time-domain.js +195 -0
  86. package/es/verification-code/index.js +2 -2
  87. package/lib/cui.common.js +2183 -955
  88. package/lib/cui.umd.js +2183 -955
  89. package/lib/cui.umd.min.js +66 -66
  90. package/package.json +2 -2
  91. package/packages/button/src/ButtonPrint/components/IdentityVerification.vue +17 -5
  92. package/packages/button/src/ButtonPrint/index.vue +1 -0
  93. package/packages/table-filter/src/base-search-com/BaseSearch.vue +59 -29
  94. package/packages/table-filter/src/components/c-tree-select/tree-select.vue +198 -0
  95. package/packages/table-filter/src/components/multi-select/multi-select.vue +13 -5
  96. package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +42 -6
  97. package/packages/table-filter/src/mixins/mixins.js +57 -21
  98. package/packages/table-filter/src/quick-search/QuickSearch.vue +38 -14
  99. package/src/utils/time-domain.js +193 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.1.93-beta",
3
+ "version": "0.1.97-beta",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -93,4 +93,4 @@
93
93
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
94
94
  }
95
95
  }
96
- }
96
+ }
@@ -57,7 +57,11 @@ export default {
57
57
  },
58
58
  identityVerificationTitle: {
59
59
  type: String
60
- }
60
+ },
61
+ printConfig: {
62
+ type: Object,
63
+ default: () => ({})
64
+ },
61
65
  },
62
66
  components: {
63
67
  AModal: Modal
@@ -81,10 +85,18 @@ export default {
81
85
  .use(Input);
82
86
  },
83
87
  mounted() {
84
- httpFn = axios.create({
85
- withCredentials: false,
86
- timeout: 5000
87
- });
88
+ let config = {
89
+ withCredentials: false,
90
+ timeout: 5000
91
+ };
92
+ let printUrlPrefix = this?.printConfig?.printUrlPrefix;
93
+ if (axios !== this.axios && printUrlPrefix) {
94
+ config.baseURL = printUrlPrefix;
95
+ }
96
+ httpFn = axios.create({
97
+ ...config
98
+ });
99
+
88
100
  },
89
101
  watch: {
90
102
  visible(val) {
@@ -28,6 +28,7 @@
28
28
  </a-dropdown>
29
29
 
30
30
  <IdentityVerification
31
+ :printConfig="printConfig"
31
32
  :baseUrl="baseUrl"
32
33
  :verifyUserUrl="verifyUserUrl"
33
34
  :visible.sync="identityVerification.visible"
@@ -8,28 +8,17 @@
8
8
  设置
9
9
  <!-- {{ $t("1.1.5.3") }} -->
10
10
  </a-button>
11
- <template v-if="showViewList">
12
- <a-popover v-model="viewListVisible" placement="bottom" overlayClassName="product-line-popover viewList-popover" >
13
- <a-button class="viewList-button">
14
- <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
15
- </a-button>
16
- <template slot="content">
17
- <ul class="product-line-list">
18
- <li
19
- v-for="(item, index) in viewList"
20
- :value="item.id"
21
- :key="index"
22
- @click="handlerSelectTemp(item.id)"
23
- class="product-line-list-item"
24
- :class="{ 'active': currentTempId === item.id }"
25
- >
26
- <span>{{ item.name }}</span>
27
- <a-icon v-if="currentTempId === item.id" type="check" class="check-icon product-line-check-icon" />
28
- </li>
29
- </ul>
30
- </template>
31
- </a-popover>
32
- </template>
11
+ <a-dropdown overlayClassName="viewList-dropdown" v-if="showViewList">
12
+ <a-button class="viewList-button">
13
+ <svg-icon :icon-class="'anniuqiehuanmoshi'" style="font-size: 22px"></svg-icon>
14
+ </a-button>
15
+ <a-menu slot="overlay">
16
+ <a-menu-item v-for="(item, index) in viewList" :value="item.id" :key="index" @click="handlerSelectTemp(item.id)" :class="{ 'menu-active': currentTempId === item.id }">
17
+ <span>{{ item.name }}</span>
18
+ <!-- <a-icon v-if="currentTempId === item.id" type="check" /> -->
19
+ </a-menu-item>
20
+ </a-menu>
21
+ </a-dropdown>
33
22
  </div>
34
23
  <slot name="classification"></slot>
35
24
  <li v-if="isShowSetting('hideQuickSearch') && isRelatedSearchFold" ref="quickSearchLi">
@@ -88,7 +77,7 @@
88
77
  <li v-if="showResetFilterBtn">
89
78
  <a-button @click="handleReset" style="margin: 0 8px 8px 0">
90
79
  <svg-icon icon-class="xitongtubiaoliebiaocaozuoanniushanchu" style="margin-right: 6px"></svg-icon>
91
- 清空
80
+ 重置
92
81
  </a-button>
93
82
  </li>
94
83
 
@@ -771,8 +760,7 @@ export default create({
771
760
  groupBtnObj: {},
772
761
  btnObj: BTNOBJ,
773
762
  printBtnStrategys: [], // 打印按钮组策略list
774
- outRelationQuickSearch: [], // 关联表 筛选外显
775
- viewListVisible: false
763
+ outRelationQuickSearch: [] // 关联表 筛选外显
776
764
  };
777
765
  },
778
766
  created() {
@@ -1195,7 +1183,6 @@ export default create({
1195
1183
  },
1196
1184
  handlerSelectTemp(e) {
1197
1185
  if (this.currentTempId === e) return;
1198
- this.viewListVisible = false;
1199
1186
  this.currentTempId = e;
1200
1187
  const tab = e == 0 ? 'bigTable' : null;
1201
1188
  this.$emit('handlerChangeView', e, tab);
@@ -1521,7 +1508,7 @@ export default create({
1521
1508
  this.$emit('pubResetCheckStatus');
1522
1509
  },
1523
1510
  handleReset() {
1524
- this.$emit('handleReset');
1511
+ this.$emit('handleReset',{targetType: "outQuickSearchReset" });
1525
1512
  },
1526
1513
  handleUploadChange(info) {
1527
1514
  const { file, fileList } = info;
@@ -1606,7 +1593,7 @@ export default create({
1606
1593
  let params = { type: v, pageSize: 10000 };
1607
1594
  return this.axios.get('/label/list', { params: params });
1608
1595
  },
1609
- initOutSearchFieldList() {
1596
+ initOutSearchFieldList(config = {}) {
1610
1597
  this.outSearchFieldList = [];
1611
1598
  this.outRelationQuickSearch = [];
1612
1599
  let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => i.isShowSearch == 1 && i.filterExplicit == 1);
@@ -1639,6 +1626,14 @@ export default create({
1639
1626
  if (this.lastOutRelationQuickSearch.length) {
1640
1627
  this.outRelationQuickSearch = this.$utils.clone(this.lastOutRelationQuickSearch, true);
1641
1628
  }
1629
+
1630
+ // 如有配置默认值
1631
+ if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1632
+ this.$emit('outSearchInit');
1633
+ if('reset' != config?.type){
1634
+ this.outFilterChange();
1635
+ }
1636
+ }
1642
1637
  },
1643
1638
  dealOutFilterHideBtn() {
1644
1639
  if (!this.isShowSetting('buttonAdaption') && this.outSearchFieldList.length > 0) {
@@ -1875,6 +1870,21 @@ export default create({
1875
1870
  }
1876
1871
  this.setSaveRowStatus(true);
1877
1872
  },
1873
+
1874
+ /**
1875
+ * 获取外显检索的默认值设置
1876
+ */
1877
+ handleGetOutSearchInitValue(){
1878
+
1879
+ if(this.outSearchFieldList.some(v => !!v.explicitDefaultVal)){
1880
+ let conObj = this.getConObjParams() || [];
1881
+ return conObj
1882
+ }
1883
+
1884
+ return []
1885
+ },
1886
+
1887
+
1878
1888
  inlineEditCancel() {
1879
1889
  // 批量编辑
1880
1890
  if (this.isBatchEditing) {
@@ -2294,7 +2304,27 @@ export default create({
2294
2304
  }
2295
2305
  }
2296
2306
  }
2297
- .viewList-popover {
2307
+ .viewList-dropdown {
2298
2308
  min-width: 120px;
2309
+ .ant-dropdown-menu-item {
2310
+ display: flex;
2311
+ justify-content: space-between;
2312
+ align-items: center;
2313
+ color: #2e2e2e;
2314
+ margin: 1px 0;
2315
+ &:hover {
2316
+ background: #f2f2f2;
2317
+ }
2318
+ > span {
2319
+ display: inline;
2320
+ width: 85%;
2321
+ text-overflow: ellipsis;
2322
+ white-space: nowrap;
2323
+ overflow: hidden;
2324
+ }
2325
+ }
2326
+ .ant-dropdown-menu-item.menu-active {
2327
+ color: #2d7aff;
2328
+ }
2299
2329
  }
2300
2330
  </style>
@@ -0,0 +1,198 @@
1
+ <template>
2
+ <a-tree-select
3
+ v-model="item.value"
4
+ dropdownClassName="c-a-tree-select-container"
5
+ @select="treeSelect"
6
+ showSearch
7
+ style="width: 160px"
8
+ :dropdown-style="{ maxHeight: '200px', overflow: 'auto' }"
9
+ :tree-data="treeData"
10
+ allowClear
11
+ treeNodeFilterProp="title"
12
+ :placeholder="`请选择${item.alias || item.title}`"
13
+ >
14
+ <span class="init-key-loading" v-if="key === '_init_key_'" slot="title" slot-scope="{ key, value }" style="color: #08c">
15
+ <span v-show="false">{{ value }}</span>
16
+ <a-spin :tip="`加载中...`" />
17
+ </span>
18
+ </a-tree-select>
19
+ </template>
20
+
21
+ <script>
22
+ import { TreeSelect, Spin, Icon } from 'ant-design-vue';
23
+ import vexutils from '@/utils/vexutils';
24
+ export default {
25
+ name: 'cTreeSelect',
26
+ data() {
27
+ return {
28
+ treeData: [
29
+ {
30
+ // title: "_init_key_",
31
+ value: '_init_key_',
32
+ key: '_init_key_',
33
+ selectable: false,
34
+ scopedSlots: {
35
+ title: 'title'
36
+ }
37
+ }
38
+ ]
39
+ };
40
+ },
41
+ props: {
42
+ item: {
43
+ type: Object,
44
+ default: () => ({ value: '' })
45
+ },
46
+ handleGetConfigApi: {
47
+ type: Function,
48
+ default: () => {}
49
+ }
50
+ },
51
+ computed: {},
52
+ watch: {},
53
+ beforeCreate() {},
54
+ created() {},
55
+ beforeMount() {},
56
+ mounted() {
57
+ this.init();
58
+ },
59
+ beforeUpdate() {},
60
+ updated() {},
61
+ beforeDestroy() {},
62
+ destroyed() {},
63
+ activated() {},
64
+ methods: {
65
+ async init() {
66
+ try {
67
+ let res = await this.handleRequestedOptions(this.item);
68
+ let { result, map } = res.data;
69
+ if (result !== 'SUCCESS') {
70
+ this.treeData = [];
71
+ return;
72
+ }
73
+ let rows = map.rows || [];
74
+ if (rows) {
75
+ this.handleInitTreeData(rows, this.item);
76
+ this.treeData = rows;
77
+ }
78
+ } catch (error) {
79
+ console.log(error);
80
+ this.treeData = [];
81
+ } finally {
82
+ this.hanldeSetTreeDef();
83
+ }
84
+ },
85
+
86
+ async handleRequestedOptions(item = {}) {
87
+ let params = this.getSearchDefParams(item);
88
+ let res = await this.handleGetConfigApi(params, 'requestGetWordbookData', { fields: item });
89
+ return res;
90
+ },
91
+
92
+ getSearchDefParams(item = {}) {
93
+ let obj = {};
94
+ let { params = [], autograph, filterKeys, id, wordbookType } = item?.settingObj?.wordbook || {};
95
+ if (params) {
96
+ params.forEach(item => {
97
+ obj[item.p_name] = item.p_value;
98
+ });
99
+ }
100
+ if (autograph) {
101
+ obj.autograph = autograph;
102
+ }
103
+ let resFieldKeys = Array.isArray(filterKeys) ? JSON.stringify(filterKeys) : filterKeys;
104
+ let res = {
105
+ wordbookId: id,
106
+ fieldKeys: resFieldKeys,
107
+ wordbookType: wordbookType || 'WORDBOOK',
108
+ isLevelLazyLoad: false,
109
+ ...obj
110
+ };
111
+
112
+ return res;
113
+ },
114
+
115
+ /* 解析下拉选择接口返回字段 */
116
+ formatField(value, key) {
117
+ let res = value;
118
+ try {
119
+ if (res && typeof res == 'string' && res.startsWith('###')) {
120
+ res = res.slice(3);
121
+ res = JSON.parse(res);
122
+ res = res.change_text;
123
+ }
124
+
125
+ return res || '';
126
+ } catch (error) {
127
+ return '';
128
+ }
129
+ },
130
+
131
+ hanldeGetCascadelabel(v = [], k = {}) {
132
+ if (Array.isArray(v) && v.length) {
133
+ const l = [];
134
+ v.forEach(i => {
135
+ let res = this.formatField(k[i]);
136
+ l.push(res);
137
+ });
138
+ if (l.length == 0) {
139
+ return '';
140
+ }
141
+ return l.join(' ');
142
+ }
143
+ return '';
144
+ },
145
+
146
+ handleInitTreeData(list = [], config = {}) {
147
+ let { showKeys = [], field_key } = config?.setting?.wordbook || {};
148
+ list.forEach((item,i) => {
149
+ let val = vexutils.stringToValue(item[field_key], 'value');
150
+ item.myLabel = this.hanldeGetCascadelabel(showKeys, item) || val;
151
+ item.key = item.theUniqueKey;
152
+ item.title = item.myLabel;
153
+ // 避免接口配置的value 不知唯一值,导致前端页面卡死
154
+ item.value = `${val}<&=&>${i}<&=&>${item.key}`;
155
+ // item.scopedSlots = {
156
+ // title: "title"
157
+ // };
158
+
159
+ if (item.children && item.children.length) {
160
+ this.handleInitTreeData(item.children, config);
161
+ }
162
+ });
163
+ },
164
+
165
+ hanldeSetTreeDef() {},
166
+
167
+ treeSelect(key, vnode) {}
168
+ },
169
+ components: {
170
+ [TreeSelect.name]: TreeSelect,
171
+ [Spin.name]: Spin,
172
+ [Icon.name]: Icon
173
+ }
174
+ };
175
+ </script>
176
+
177
+ <style lang="less">
178
+ .c-a-tree-select-container {
179
+ .ant-select-tree-title {
180
+ display: inline-block;
181
+ width: 100%;
182
+ }
183
+
184
+ .init-key-loading {
185
+ display: flex;
186
+ justify-content: center;
187
+ width: 100%;
188
+ }
189
+
190
+ .ant-select-tree {
191
+ li.filter-node {
192
+ > span {
193
+ font-weight: 600;
194
+ }
195
+ }
196
+ }
197
+ }
198
+ </style>
@@ -13,12 +13,13 @@
13
13
  @search="handleWordBookSearch($event, item)"
14
14
  @dropdownVisibleChange="dropdownVisibleChange($event, item)"
15
15
  class="quick-input-select"
16
- allowClear
16
+ :allowClear="item.explicitRequired != 1"
17
17
  ref="quickInputSelect"
18
18
  :class="{ 'quick-input-select-mul': handleMaxTagCount > 0 }"
19
19
  :notFoundContent="fetchingWordbook ? undefined : '暂无数据'"
20
20
  >
21
- <a-spin v-if="fetchingWordbook" slot="notFoundContent" size="small" />
21
+ <!-- <a-spin v-if="fetchingWordbook" slot="notFoundContent" size="small" /> -->
22
+ <span v-if="fetchingWordbook" slot="notFoundContent" size="small" />
22
23
  <template v-if="item.comType == 'SelectMuiWordBook'">
23
24
  <a-select-option
24
25
  v-for="(sea, k) in item.dataSource"
@@ -47,8 +48,8 @@
47
48
  </a-select-option>
48
49
  </template>
49
50
 
50
- <div slot="dropdownRender" class="drop-down-container" slot-scope="menu">
51
- <a-spin :spinning="fetchingWordbook">
51
+ <div slot="dropdownRender" class="c-m-sdrop-down-container" slot-scope="menu">
52
+ <a-spin :spinning="fetchingWordbook" :tip="`加载中...`" >
52
53
  <v-nodes :vnodes="menu" />
53
54
  <select-pages v-if="!isnoPages" :searchPageConfig="item.searchPageConfig" :handleSearchChangePage="handleSearchChangePage" />
54
55
  </a-spin>
@@ -56,7 +57,7 @@
56
57
  </a-select>
57
58
  </template>
58
59
  <script>
59
- import { Select, Spin, Icon } from 'ant-design-vue';
60
+ import { Select, Spin, Icon,Button } from 'ant-design-vue';
60
61
  import utils from '@/utils/utils-map';
61
62
  import selectPages from './select-pages';
62
63
  export default {
@@ -65,6 +66,7 @@ export default {
65
66
  [Select.name]: Select,
66
67
  [Select.Option.name]: Select.Option,
67
68
  [Spin.name]: Spin,
69
+ [Button.name]:Button,
68
70
  [Icon.name]: Icon,
69
71
  selectPages,
70
72
  VNodes: {
@@ -187,4 +189,10 @@ export default {
187
189
  .c-s-content-item {
188
190
  padding: 0 5px;
189
191
  }
192
+
193
+ .c-m-sdrop-down-container {
194
+ .ant-select-dropdown-menu-item-disabled {
195
+ min-height: 42px;
196
+ }
197
+ }
190
198
  </style>
@@ -15,9 +15,15 @@
15
15
  >
16
16
  </a-input>
17
17
  </slot>
18
-
18
+ <template v-if="item.com == 'SelectMui'">
19
+ <c-tree-select
20
+ v-if="item.comType === 'treeSelect'"
21
+ :item="item"
22
+ :handleGetConfigApi="handleGetConfigApi"
23
+ style="margin: 0 8px 8px 0"
24
+ />
19
25
  <multiSelect
20
- v-if="item.com == 'SelectMui'"
26
+ v-else
21
27
  :item="item"
22
28
  :maxTagPlaceholder="maxTagPlaceholder"
23
29
  :outFilterChange="outFilterChange"
@@ -26,7 +32,10 @@
26
32
  :fetchingWordbook="fetchingWordbook"
27
33
  style="margin: 0 8px 8px 0"
28
34
  ></multiSelect>
35
+ </template>
36
+
29
37
  <a-range-picker
38
+ :allowClear="item.explicitRequired != 1"
30
39
  :format="item.showFormat"
31
40
  @change="value => rangePickerChange(value, item)"
32
41
  @ok="outFilterChange"
@@ -90,9 +99,11 @@
90
99
  <script>
91
100
 
92
101
  import multiSelect from '../multi-select/multi-select';
102
+ import cTreeSelect from '../c-tree-select/tree-select';
93
103
  import { filterApiFn } from '../../mixins/mixins';
94
104
  import wordBookutils from '../../mixins/wordBookutils';
95
-
105
+ import moment from 'moment';
106
+ import { DatePicker} from 'ant-design-vue';
96
107
  const EVALUATEList = [
97
108
  {
98
109
  label: "一星",
@@ -123,13 +134,15 @@ const EVALUATEList = [
123
134
  export default {
124
135
  name: "OutQuickSearch",
125
136
  mixins: [filterApiFn],
126
- components: { multiSelect },
137
+ components: { multiSelect,cTreeSelect, [DatePicker.RangePicker.name]: DatePicker.RangePicker },
127
138
  props: {
128
139
  item: Object
129
140
  },
130
141
  data() {
131
142
  return {
132
- fetchingWordbook: false
143
+ fetchingWordbook: false,
144
+ initSearch: false,
145
+ curDefaultValue: null,
133
146
  };
134
147
  },
135
148
 
@@ -138,7 +151,7 @@ export default {
138
151
  return function(item) {
139
152
  if (!item.showTime) return false;
140
153
  return {
141
- defaultValue: [this.$moment("00:00:00", "HH:mm:ss"), this.$moment("23:59:59", "HH:mm:ss")]
154
+ defaultValue: [moment("00:00:00", "HH:mm:ss"), moment("23:59:59", "HH:mm:ss")]
142
155
  };
143
156
  };
144
157
  }
@@ -181,6 +194,10 @@ export default {
181
194
  if (item.settingObj.wordbook) {
182
195
  obj.autograph = item.settingObj.wordbook.autograph;
183
196
  }
197
+ let df = item.explicitDefaultVal;
198
+ if(df != 'firstOption'){
199
+ obj.keyword = df;
200
+ }
184
201
  this.getWordbookData(item.setting.wordbook, obj).then(({ data }) => {
185
202
  this.handleWordbookData(item, data, obj);
186
203
  });
@@ -192,6 +209,25 @@ export default {
192
209
  this.$set(item, "hasFieldList", hasFieldList);
193
210
  this.$set(item, "dataSource", rows);
194
211
  item.searchPageConfig = Object.assign(item.searchPageConfig, searchPageConfig);
212
+ // 初始化获取值
213
+ if(!this.initSearch){
214
+ let df = item.explicitDefaultVal;
215
+ if(df){
216
+ let defval = [];
217
+ if(df === 'firstOption'){
218
+ let [v] = rows;
219
+ v && (defval = [v.myName])
220
+ } else {
221
+ let f = rows.find(v => v.myName.includes(df));
222
+ if(f){
223
+ defval = [f.myName]
224
+ }
225
+ }
226
+ item.value = [...defval]
227
+ item.search_DefaultValue= [...defval]
228
+ }
229
+ this.initSearch = true;
230
+ }
195
231
  },
196
232
  getWordbookData(o, obj) {
197
233
  let { id, filterKeys, wordbookType } = o;
@@ -33,7 +33,7 @@ const EVALUATEList = [
33
33
  ];
34
34
 
35
35
  import moment from 'moment';
36
-
36
+ import timeDomain from '@/utils/time-domain';
37
37
  export const durationMixin = {
38
38
  filters: {
39
39
  // 格式化时长单位
@@ -383,24 +383,38 @@ export const outQuickSearchFn = {
383
383
  arr.forEach(el => {
384
384
  el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
385
385
  const attr = el?.settingObj?.attr || "";
386
+ const showSetting = el?.setting?.showSetting || []
386
387
  // 映射优先级最高
387
- if (el.setting?.showSetting?.length) {
388
+ if (showSetting?.length) {
389
+ let tvalue = []
390
+ // 设置了默认值
391
+ let df = el.explicitDefaultVal;
392
+ if(df){
393
+ let i = df == 'firstOption' ? 0 : showSetting.findIndex(v => v.change_text == df);
394
+ if(i > -1){
395
+ tvalue.push(i)
396
+ }
397
+ }
388
398
  // 存在映射 使用下拉多选框
389
399
  this.$set(el, "con", "CONVERT");
390
400
  this.$set(el, "com", "SelectMui");
391
401
  this.$set(el, "comType", "SelectMui");
392
- this.$set(el, "value", []);
402
+ this.$set(el, "value", tvalue);
393
403
  const labelList = el.setting.showSetting.map(i => {
394
404
  i.labelName = i.change_text;
395
405
  return i;
396
406
  });
397
407
  this.$set(el, "labelList", labelList);
398
408
  } else if (!this.$utils.isEmpty(el.setting.wordbook)) {
409
+ // TODO:
399
410
  // 存在映射 wordbook
411
+ let isTree = "tree" === el?.setting?.wordbook?.showType;
412
+ let comType = isTree ? 'treeSelect' : 'SelectMuiWordBook';
413
+ let defVal = isTree ? undefined : [];
400
414
  this.$set(el, "con", "QUOTE");
401
415
  this.$set(el, "com", "SelectMui");
402
- this.$set(el, "comType", "SelectMuiWordBook");
403
- this.$set(el, "value", []);
416
+ this.$set(el, "comType", comType);
417
+ this.$set(el, "value", defVal);
404
418
  this.$set(el, "dataSource", []);
405
419
  this.$set(el, "searchPageConfig", {
406
420
  keyword: undefined,
@@ -427,7 +441,18 @@ export const outQuickSearchFn = {
427
441
  ["DATETIME", "DATE"].includes(el.fieldType)
428
442
  ) {
429
443
  // 查找默认值
430
- const value = this.getSearchDefValueByLimit(el, this.searchFieldLimit) || [];
444
+ let value = this.getSearchDefValueByLimit(el, this.searchFieldLimit) || [];
445
+ // explicitDefaultVal: "YESTERDAY"
446
+ // explicitRequired: 1
447
+
448
+ // 配置了默认值
449
+ if(el.explicitDefaultVal){
450
+ // let showFormat = attr === "BIRTHDAY" ? 'MM-DD':'YYYY-MM-DD HH:mm:ss';
451
+ let t = timeDomain.getTimeDomain(el.explicitDefaultVal)
452
+ if(t.length > 0){
453
+ value = t;
454
+ }
455
+ }
431
456
  this.$set(el, "con", "IN");
432
457
  this.$set(el, "com", "DatePicker");
433
458
  this.$set(el, "value", value);
@@ -500,24 +525,35 @@ export const outQuickSearchFn = {
500
525
  temp.value = item.value;
501
526
  conObj.push(temp);
502
527
  }
503
- if (item.com === "SelectMui" && item.value.length) {
504
- if (item.comType == "SelectMuiWordBook") {
528
+ if (item.com === "SelectMui" && item.value) {
529
+ let hasArr = Array.isArray(item.value) && item.value.length > 0
530
+ if (item.comType == "SelectMuiWordBook" && hasArr) {
505
531
  temp.value = item.value.join("|#|");
532
+ } else if(item.comType == "treeSelect"){
533
+ // 樹狀
534
+ let value = item.value;
535
+ if(typeof value === 'string'){
536
+ [value] = value.split('<&=&>')
537
+ }
538
+ temp.value = value;
506
539
  } else {
507
- if (item.con == "CONVERT") {
508
- // 存在映射
509
- let value = [];
510
- value = item.value.map(i => {
511
- return item.labelList[i].filter;
512
- });
513
- temp.value = value;
514
- } else {
515
- let value = [];
516
- value = item.value.map(i => {
517
- return item.labelList[i].labelName;
518
- });
519
- temp.value = value.join("|#|");
540
+ if(hasArr){
541
+ if (item.con == "CONVERT") {
542
+ // 存在映射
543
+ let value = [];
544
+ value = item.value.map(i => {
545
+ return item.labelList[i].filter;
546
+ });
547
+ temp.value = value;
548
+ } else {
549
+ let value = [];
550
+ value = item.value.map(i => {
551
+ return item.labelList[i].labelName;
552
+ });
553
+ temp.value = value.join("|#|");
554
+ }
520
555
  }
556
+
521
557
  }
522
558
  conObj.push(temp);
523
559
  }