cnhis-design-vue 2.1.112 → 2.1.114

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 (109) hide show
  1. package/CHANGELOG.md +34 -18
  2. package/es/affix/index.js +8 -8
  3. package/es/age/index.js +10 -10
  4. package/es/alert/index.js +8 -8
  5. package/es/anchor/index.js +8 -8
  6. package/es/auto-complete/index.js +8 -8
  7. package/es/avatar/index.js +8 -8
  8. package/es/back-top/index.js +8 -8
  9. package/es/badge/index.js +8 -8
  10. package/es/base/index.js +8 -8
  11. package/es/big-table/index.js +154 -99
  12. package/es/big-table/style.css +1 -1
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/card-reader-sdk/index.js +1 -1
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/direct/index.js +16 -16
  30. package/es/divider/index.js +8 -8
  31. package/es/drag-layout/index.js +3 -3
  32. package/es/drawer/index.js +8 -8
  33. package/es/dropdown/index.js +8 -8
  34. package/es/editor/index.js +1 -1
  35. package/es/ellipsis/index.js +1 -1
  36. package/es/empty/index.js +8 -8
  37. package/es/fabric-chart/index.js +9 -9
  38. package/es/form/index.js +8 -8
  39. package/es/form-model/index.js +8 -8
  40. package/es/form-table/index.js +66 -66
  41. package/es/full-calendar/index.js +5272 -0
  42. package/es/full-calendar/style.css +1 -0
  43. package/es/index/index.js +2428 -446
  44. package/es/index/style.css +1 -1
  45. package/es/input/index.js +9 -9
  46. package/es/input-number/index.js +8 -8
  47. package/es/layout/index.js +8 -8
  48. package/es/list/index.js +8 -8
  49. package/es/locale-provider/index.js +8 -8
  50. package/es/map/index.js +9 -9
  51. package/es/mentions/index.js +8 -8
  52. package/es/menu/index.js +8 -8
  53. package/es/message/index.js +8 -8
  54. package/es/multi-chat/index.js +76 -76
  55. package/es/multi-chat-client/index.js +70 -70
  56. package/es/multi-chat-history/index.js +4 -4
  57. package/es/multi-chat-record/index.js +14 -14
  58. package/es/multi-chat-setting/index.js +22 -22
  59. package/es/multi-chat-sip/index.js +1 -1
  60. package/es/notification/index.js +8 -8
  61. package/es/page-header/index.js +8 -8
  62. package/es/pagination/index.js +8 -8
  63. package/es/popconfirm/index.js +8 -8
  64. package/es/popover/index.js +8 -8
  65. package/es/progress/index.js +8 -8
  66. package/es/radio/index.js +9 -9
  67. package/es/rate/index.js +8 -8
  68. package/es/result/index.js +8 -8
  69. package/es/row/index.js +8 -8
  70. package/es/scale-container/index.js +1 -1
  71. package/es/scale-view/index.js +27 -27
  72. package/es/select/index.js +12 -12
  73. package/es/select-label/index.js +11 -11
  74. package/es/select-person/index.js +2 -2
  75. package/es/select-tag/index.js +4 -4
  76. package/es/shortcut-setter/index.js +10 -10
  77. package/es/skeleton/index.js +8 -8
  78. package/es/slider/index.js +8 -8
  79. package/es/slider-tree/index.js +9 -9
  80. package/es/space/index.js +8 -8
  81. package/es/spin/index.js +8 -8
  82. package/es/statistic/index.js +8 -8
  83. package/es/steps/index.js +8 -8
  84. package/es/switch/index.js +8 -8
  85. package/es/table-filter/index.js +65 -65
  86. package/es/tabs/index.js +8 -8
  87. package/es/tag/index.js +9 -9
  88. package/es/time-picker/index.js +8 -8
  89. package/es/timeline/index.js +8 -8
  90. package/es/tooltip/index.js +8 -8
  91. package/es/transfer/index.js +8 -8
  92. package/es/tree/index.js +8 -8
  93. package/es/tree-select/index.js +8 -8
  94. package/es/upload/index.js +8 -8
  95. package/es/verification-code/index.js +2 -2
  96. package/lib/cui.common.js +49658 -49640
  97. package/lib/cui.umd.js +49658 -49640
  98. package/lib/cui.umd.min.js +154 -154
  99. package/package.json +9 -2
  100. package/packages/big-table/src/BigTable.vue +42 -7
  101. package/packages/big-table/src/assets/style/table-global.less +1 -1
  102. package/packages/full-calendar/index.js +10 -0
  103. package/packages/full-calendar/src/FullCalendar.vue +695 -0
  104. package/packages/full-calendar/src/api/index.js +71 -0
  105. package/packages/full-calendar/src/components/ListTag.vue +165 -0
  106. package/packages/full-calendar/src/components/Tag.vue +296 -0
  107. package/packages/full-calendar/src/components/TagDetail.vue +287 -0
  108. package/packages/full-calendar/src/utils/index.js +438 -0
  109. package/packages/index.js +5 -3
@@ -0,0 +1,71 @@
1
+ import axios from 'axios';
2
+ import { message } from 'ant-design-vue';
3
+
4
+ export const axiosInstance = axios.create({
5
+ withCredentials: true,
6
+ timeout: 5000
7
+ });
8
+
9
+ axiosInstance.interceptors.response.use(response => {
10
+ const { config, data } = response;
11
+ if (data.success) {
12
+ return data;
13
+ } else {
14
+ message.error(data?.subErrors?.msg || '请求错误');
15
+ console.log('请求错误');
16
+ }
17
+ });
18
+
19
+ // 获取日程相关配置
20
+ export function getScheduleSettingApi(params) {
21
+ return axiosInstance({
22
+ method: 'get',
23
+ url: '/getScheduleSetting',
24
+ params
25
+ });
26
+ }
27
+
28
+ // 日程列表
29
+ export function getScheduleListApi(params) {
30
+ return axiosInstance({
31
+ method: 'get',
32
+ url: '/getScheduleList',
33
+ params
34
+ });
35
+ }
36
+
37
+ // 创建日程
38
+ export function getScheduleDataApi(params) {
39
+ return axiosInstance({
40
+ method: 'post',
41
+ url: '/getScheduleData',
42
+ data: params
43
+ });
44
+ }
45
+
46
+ // 新增日程
47
+ export function saveOrUpdateScheduleApi(params) {
48
+ return axiosInstance({
49
+ method: 'post',
50
+ url: '/schedule/saveOrUpdate',
51
+ data: params
52
+ });
53
+ }
54
+
55
+ // 查询日程
56
+ export function queryScheduleListApi(params) {
57
+ return axiosInstance({
58
+ method: 'post',
59
+ url: '/schedule/list',
60
+ data: params
61
+ });
62
+ }
63
+
64
+ // 删除日程
65
+ export function delScheduleApi(params) {
66
+ return axiosInstance({
67
+ method: 'post',
68
+ url: '/schedule/deleteById',
69
+ params
70
+ });
71
+ }
@@ -0,0 +1,165 @@
1
+ <template>
2
+ <div class="list-tag">
3
+ <ul v-if="formatedListData.length > 0">
4
+ <li v-for="(data, i) in formatedListData" :key="i">
5
+ <div class="list-tag__left" :class="getClassName(data)">
6
+ <span class="list-day">{{ data.day }}</span>
7
+ <span class="list-month">{{ data.month }},</span>
8
+ <span class="list-week">{{ data.week }}</span>
9
+ </div>
10
+ <div class="list-tag__right">
11
+ <div v-for="(item, index) in data.list" :key="index">
12
+ <tag v-bind="$attrs" v-on="$listeners" :item="item" :title="item.title" :statusFlag="data.statusFlag" :avatar="item.avatar" :isAllDay="item.isAllDay"></tag>
13
+ </div>
14
+ </div>
15
+ </li>
16
+ </ul>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ import Tag from './Tag.vue';
21
+ import { moment } from '@/utils/vexutils';
22
+
23
+ export default {
24
+ name: 'list-tag',
25
+ components: {
26
+ Tag
27
+ },
28
+ props: {
29
+ listData: {
30
+ type: Array,
31
+ default: () => []
32
+ }
33
+ },
34
+ data() {
35
+ this.curMoment = moment();
36
+ return {};
37
+ },
38
+ filters: {},
39
+ computed: {
40
+ formatedListData() {
41
+ if (!this.listData?.length) return [];
42
+ const result = this.listData.reduce((obj, item) => {
43
+ const date = moment(item.startTime);
44
+ const day = date.format('D');
45
+ const startTime = date.startOf('day').valueOf();
46
+ const curValue = this.curMoment
47
+ .clone()
48
+ .startOf('day')
49
+ .valueOf();
50
+ if (obj[day]) {
51
+ obj[day].list.push({ ...item });
52
+ } else {
53
+ obj[day] = {
54
+ _d: date,
55
+ day,
56
+ week: date.format('ddd'),
57
+ month: date.format('MMM'),
58
+ list: [{ ...item }],
59
+ statusFlag: startTime < curValue ? 0 : 1
60
+ };
61
+ }
62
+ return obj;
63
+ }, {});
64
+
65
+ return Object.values(result);
66
+ },
67
+ getClassName() {
68
+ return function({ _d }) {
69
+ const { curMoment } = this;
70
+ const startTime = _d
71
+ .clone()
72
+ .startOf('day')
73
+ .valueOf();
74
+ const curValue = curMoment
75
+ .clone()
76
+ .startOf('day')
77
+ .valueOf();
78
+ const res = [];
79
+ if (startTime < curValue) {
80
+ res.push('beforeDay');
81
+ }
82
+ if (startTime === curValue) {
83
+ res.push('curday');
84
+ }
85
+ if (startTime > curValue) {
86
+ res.push('active');
87
+ }
88
+ return res.join(' ');
89
+ };
90
+ }
91
+ },
92
+ watch: {},
93
+ // 生命周期
94
+ created() {},
95
+ mounted() {},
96
+ beforeDestroy() {},
97
+
98
+ // 方法
99
+ methods: {}
100
+ };
101
+ </script>
102
+ <style lang="less" scoped>
103
+ .list-tag {
104
+ width: 100%;
105
+ height: 100%;
106
+ flex: 1;
107
+ overflow-y: auto;
108
+ ul {
109
+ li {
110
+ display: flex;
111
+ border-bottom: 1px solid #e6e6e6;
112
+ padding: 16px;
113
+ .list-tag__left {
114
+ width: 142px;
115
+ color: rgba(0, 0, 0, 0.6);
116
+ > span {
117
+ display: inline-block;
118
+ }
119
+ &.beforeDay {
120
+ .list-day {
121
+ color: #b1b1b1;
122
+ }
123
+ }
124
+ &.active {
125
+ .list-day {
126
+ color: @primary-color;
127
+ background: rgba(36, 116, 255, 0.1);
128
+ }
129
+ }
130
+ &.curday {
131
+ .list-day {
132
+ color: #fff;
133
+ background: @primary-color;
134
+ &:hover {
135
+ background: @primary-color;
136
+ }
137
+ }
138
+ color: @primary-color;
139
+ }
140
+ .list-day {
141
+ width: 36px;
142
+ height: 36px;
143
+ line-height: 36px;
144
+ margin-right: 18px;
145
+ text-align: center;
146
+ color: #000000;
147
+ font-size: 20px;
148
+ font-weight: 600;
149
+ border-radius: 50%;
150
+ &:hover {
151
+ background: #e8f1fe;
152
+ }
153
+ }
154
+ }
155
+ .list-tag__right {
156
+ flex: 1;
157
+ width: calc(100% - 142px);
158
+ & > div {
159
+ margin-top: 5px;
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ </style>
@@ -0,0 +1,296 @@
1
+ <template>
2
+ <div :class="['event-tag', 'event-tag-' + viewType, { 'event-tag--active': isActive }, { 'event-tag-allday': isAllDay }]" @click.stop="clickTag" ref="tagRef">
3
+ <div :class="['event-tag__main', statusClass[statusFlag]]">
4
+ <span class="event-tag__main__text-time" v-if="viewType === 'list'">{{ timeRange }}</span>
5
+ <span class="event-tag__main__text-title">{{ title }}</span>
6
+ <div :class="['right-operate', { 'right-operate-hasBtn': hasBtns }]">
7
+ <!-- <img :src="avatar" class="avatar-icon" alt="" /> -->
8
+ <span class="calendar-quick-btn-wrap" v-if="hasBtns">
9
+ <span v-for="btn in btns" :key="btn.type" @click.stop="() => clickListBtn(btn)" class="calendar-quick-btn">
10
+ <a-tooltip :title="btn.name" :mouseLeaveDelay="0">
11
+ <a-icon :type="btn.type" :style="{ fontSize: viewType === 'list' ? '16px' : '12px' }" />
12
+ </a-tooltip>
13
+ </span>
14
+ </span>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ import { Tooltip, Icon } from 'ant-design-vue';
21
+ import { moment } from '@/utils/vexutils';
22
+ import tippy from 'tippy.js';
23
+ import 'tippy.js/dist/tippy.css';
24
+
25
+ export default {
26
+ name: 'tag',
27
+ components: {
28
+ [Tooltip.name]: Tooltip,
29
+ [Icon.name]: Icon
30
+ },
31
+ props: {
32
+ item: { type: Object },
33
+ title: { type: String },
34
+ avatar: { type: String },
35
+ viewType: { type: String },
36
+ isAllDay: { type: Boolean, default: false },
37
+ statusFlag: { type: Number, default: 1 }
38
+ },
39
+ data() {
40
+ return {
41
+ statusClass: ['done', 'undone'],
42
+ isActive: false,
43
+ btns: [
44
+ {
45
+ name: '新增',
46
+ type: 'plus-square'
47
+ },
48
+ {
49
+ name: '编辑',
50
+ type: 'form'
51
+ },
52
+ {
53
+ name: '删除',
54
+ type: 'delete'
55
+ }
56
+ ]
57
+ };
58
+ },
59
+ computed: {
60
+ hasBtns() {
61
+ return this.btns?.length;
62
+ },
63
+ tagDetailRef() {
64
+ let i = 0;
65
+ let $parent = this.$parent;
66
+ while (i < 4) {
67
+ if ($parent?.$refs?.tagDetailRef) {
68
+ break;
69
+ } else {
70
+ $parent = $parent.$parent;
71
+ }
72
+ i++;
73
+ }
74
+ return $parent?.$refs?.tagDetailRef;
75
+ },
76
+ timeRange() {
77
+ const { startTime, endTime } = this.item;
78
+ return `${moment(startTime).format('HH:mm')}-${moment(endTime).format('HH:mm')}`;
79
+ }
80
+ },
81
+ watch: {},
82
+ // 生命周期
83
+ created() {},
84
+ mounted() {},
85
+ beforeDestroy() {},
86
+
87
+ // 方法
88
+ methods: {
89
+ clickListBtn(btn) {
90
+ const { startTime, endTime, scheduleId } = this.item;
91
+ switch (btn.type) {
92
+ case 'plus-square':
93
+ this.$emit('add', { startTime, endTime });
94
+ break;
95
+ case 'form':
96
+ this.$emit('edit', { startTime, endTime });
97
+ break;
98
+ case 'delete':
99
+ this.$confirm({
100
+ title: '提示',
101
+ content: '是否删除当前日程?',
102
+ okText: '确定',
103
+ cancelText: '取消',
104
+ onOk: () => {
105
+ this.$emit('delete', { id: scheduleId });
106
+ },
107
+ onCancel() {}
108
+ });
109
+ break;
110
+ }
111
+ },
112
+ clickTag() {
113
+ if (!this.tagDetailRef?.$el) return;
114
+
115
+ this.tagDetailRef.title = this.item.title;
116
+ this.tagDetailRef.content = this.item.content;
117
+ this.tagDetailRef.item = this.item;
118
+
119
+ this.tagDetailRef.$parent.tippyInstance = tippy(this.$refs.tagRef, {
120
+ trigger: 'click',
121
+ allowHTML: true,
122
+ maxWidth: 'none',
123
+ arrow: false,
124
+ hideOnClick: true,
125
+ interactive: true, // Determines if the tippy has interactive content inside of it, so that it can be hovered over and clicked inside without hiding.
126
+ theme: 'cnhis',
127
+ placement: 'auto',
128
+ zIndex: 100,
129
+ showOnCreate: true,
130
+ content: this.tagDetailRef?.$el,
131
+ duration: [100, 0],
132
+ appendTo: () => document.body,
133
+ onHidden: () => {
134
+ // this.tagDetailRef.$parent.tippyInstance = null;
135
+ }
136
+ });
137
+ }
138
+ }
139
+ };
140
+ </script>
141
+ <style lang="less" scoped>
142
+ .event-tag {
143
+ width: 100%;
144
+ height: 100%;
145
+ color: #212121;
146
+ background: #f2f2f2;
147
+ border-color: rgba(130, 130, 130, 0.1);
148
+ box-shadow: 0px 0px 3px 0px rgba(130, 130, 130, 0.3);
149
+ border-radius: 2px;
150
+ min-height: 20px;
151
+
152
+ .tag-detail-modal {
153
+ display: none;
154
+ }
155
+
156
+ &:not(.event-tag--active) {
157
+ &:hover {
158
+ background: #f2f2f4;
159
+ .right-operate-hasBtn {
160
+ img {
161
+ display: none;
162
+ }
163
+ .calendar-quick-btn-wrap {
164
+ display: inline-block;
165
+ }
166
+ }
167
+ }
168
+ &:active {
169
+ color: #fff;
170
+ background: #05c987;
171
+ }
172
+ }
173
+ &.event-tag--active {
174
+ background: #05c987;
175
+ color: #fff;
176
+ &.event-tag-month.event-tag-allday {
177
+ &:hover {
178
+ background: #05c987;
179
+ }
180
+ }
181
+ }
182
+ &.event-tag-month,
183
+ &.event-tag-list {
184
+ box-shadow: unset;
185
+ &.event-tag-allday {
186
+ background: #e6f3e7;
187
+ // 13
188
+ &:hover {
189
+ background: #f2f2f4;
190
+ }
191
+ &:active {
192
+ background: #05c987;
193
+ }
194
+ }
195
+ &.event-tag--active {
196
+ background: #05c987;
197
+ }
198
+ .event-tag__main {
199
+ &.done,
200
+ &.undone {
201
+ padding: 0 4px 0 20px;
202
+ &::before {
203
+ width: 6px;
204
+ height: 6px;
205
+ border-radius: 50%;
206
+ position: absolute;
207
+ left: 8px;
208
+ top: 6px;
209
+ }
210
+ }
211
+ }
212
+ }
213
+ &.event-tag-list {
214
+ padding: 6px 8px;
215
+ .avatar-icon {
216
+ width: 20px;
217
+ height: 20px;
218
+ }
219
+ .calendar-quick-btn {
220
+ margin-left: 15px;
221
+ }
222
+ }
223
+ &__main {
224
+ position: relative;
225
+ display: flex;
226
+ align-items: flex-start;
227
+ flex: 1;
228
+ width: 100%;
229
+ height: 100%;
230
+ padding: 0 4px;
231
+ font-size: 14px;
232
+ overflow: hidden;
233
+ box-sizing: border-box;
234
+ &.done,
235
+ &.undone {
236
+ padding: 0 4px 0 15px;
237
+ &::before {
238
+ content: '';
239
+ width: 4px;
240
+ height: 100%;
241
+ position: absolute;
242
+ left: 0px;
243
+ top: 0px;
244
+ border-radius: 2px;
245
+ }
246
+ }
247
+ &.done {
248
+ &::before {
249
+ background: rgba(0, 0, 0, 0.2);
250
+ }
251
+ }
252
+ &.undone {
253
+ &::before {
254
+ background-color: #22c179;
255
+ }
256
+ }
257
+ &__text-time,
258
+ &__text-title {
259
+ flex: 1;
260
+ height: 18px;
261
+ overflow: hidden;
262
+ white-space: nowrap;
263
+ text-overflow: ellipsis;
264
+ }
265
+ &__text-time {
266
+ flex: 0 0 150px;
267
+ }
268
+ .right-operate {
269
+ height: 18px;
270
+ }
271
+ .avatar-icon {
272
+ width: 14px;
273
+ height: 14px;
274
+ margin-left: 8px;
275
+ border-radius: 50%;
276
+ }
277
+
278
+ .calendar-quick-btn-wrap {
279
+ height: 100%;
280
+ display: none;
281
+ .calendar-quick-btn {
282
+ display: inline-flex;
283
+ justify-content: center;
284
+ align-items: center;
285
+ width: 18px;
286
+ height: 100%;
287
+ font-size: 12px;
288
+ border-radius: 4px;
289
+ &:hover {
290
+ background: #dddddd;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ }
296
+ </style>