bri-components 1.0.1 → 1.0.2

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": "bri-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "lib/bri-components.min.js",
@@ -5,40 +5,83 @@
5
5
  <slot></slot>
6
6
  </div>
7
7
  <!-- 时间渲染 -->
8
- <div class="briGantt-timer" :style="{width: clientWidth + 'px'}">
9
- <a class="briGantt-timer-icon briGantt-timer-icon-left" @click="preTime"><Icon type="ios-arrow-back" /></a>
8
+ <div
9
+ class="briGantt-timer"
10
+ :style="{width: clientWidth + 'px'}"
11
+ >
12
+ <a
13
+ class="briGantt-timer-icon briGantt-timer-icon-left"
14
+ @click="preTime"
15
+ >
16
+ <Icon type="ios-arrow-back" />
17
+ </a>
10
18
  <div class="briGantt-timer-bg"></div>
11
- <div class="bri-scrollbar0 briGantt-timer-main" ref="briGanttTimer" v-on:scroll="handleScroll($event, [{ ref: 'briGanttArea', direction: 'scrollLeft' }])">
12
- <table :style="{tableLayout:'fixed', width: tableWidth}" class="briGantt-tableBox">
19
+ <div
20
+ class="bri-scrollbar0 briGantt-timer-main"
21
+ ref="briGanttTimer"
22
+ v-on:scroll="handleScroll($event, [{ ref: 'briGanttArea', direction: 'scrollLeft' }])"
23
+ >
24
+ <table
25
+ :style="{tableLayout:'fixed', width: tableWidth}"
26
+ class="briGantt-tableBox"
27
+ >
13
28
  <thead class="briGantt-table-thead">
14
29
  <tr>
15
- <th class="briGantt-table-th"
30
+ <th
31
+ class="briGantt-table-th"
16
32
  v-for="timeItem in simpleData"
17
33
  :key="timeItem.key"
18
34
  :colspan="timeItem.colspan"
19
35
  :style="{...timeItem.style}"
36
+ >
37
+ <Tooltip
38
+ :content="timeItem.fullName"
39
+ placement="top"
40
+ :transfer="true"
41
+ :transfer-class-name="`briGantt-transfer-tooltip-${themeName}`"
20
42
  >
21
- <Tooltip :content="timeItem.fullName" placement="top" :transfer="true" :transfer-class-name="`briGantt-transfer-tooltip-${themeName}`">
22
43
  {{ timeItem.name }}
23
44
  </Tooltip>
24
- <div v-if="timeItem.now" class="briGantt-line-now"></div>
45
+ <div
46
+ v-if="timeItem.now"
47
+ class="briGantt-line-now"
48
+ ></div>
25
49
  </th>
26
50
  </tr>
27
51
  </thead>
28
52
  </table>
29
53
  </div>
30
- <a class="briGantt-timer-icon briGantt-timer-icon-right" @click="nextTime"><Icon type="ios-arrow-forward" /></a>
54
+ <a
55
+ class="briGantt-timer-icon briGantt-timer-icon-right"
56
+ @click="nextTime"
57
+ >
58
+ <Icon type="ios-arrow-forward" />
59
+ </a>
31
60
  </div>
32
61
  </div>
33
62
  <div class="briGantt-bottom">
34
- <div class="briGantt-bottom-title" v-if="title">{{ title }}</div>
63
+ <div
64
+ class="briGantt-bottom-title"
65
+ v-if="title"
66
+ >{{ title }}</div>
35
67
  <div class="briGantt-bottom-content">
36
68
  <!-- 数据映射 -->
37
- <div v-if="table" class="bri-scrollbar0 briGantt-tabledata" ref="briGanttColumn" v-on:scroll="handleScroll($event, [{ ref: 'briGanttArea', direction: 'scrollTop' }])">
69
+ <div
70
+ v-if="table"
71
+ class="bri-scrollbar0 briGantt-tabledata"
72
+ ref="briGanttColumn"
73
+ v-on:scroll="handleScroll($event, [{ ref: 'briGanttArea', direction: 'scrollTop' }])"
74
+ >
38
75
  <table class="briGantt-tableBox briGantt-table">
39
76
  <tbody>
40
- <tr class="briGantt-table-tr" v-for="(row, rowIndex) in table" :key="rowIndex">
41
- <td class="briGantt-table-td" v-for="(col, colIndex) in row"
77
+ <tr
78
+ class="briGantt-table-tr"
79
+ v-for="(row, rowIndex) in table"
80
+ :key="rowIndex"
81
+ >
82
+ <td
83
+ class="briGantt-table-td"
84
+ v-for="(col, colIndex) in row"
42
85
  :key="colIndex"
43
86
  :colspan="col.colspan"
44
87
  :rowspan="col.rowspan"
@@ -50,35 +93,93 @@
50
93
  </table>
51
94
  </div>
52
95
  <!-- 区域映射 -->
53
- <div class="briGantt-data bri-scrollbar" :class="`briGantt-data-${type}`" ref="briGanttArea" v-on:scroll="handleScroll($event, [{ ref: 'briGanttTimer', direction: 'scrollLeft' }, { ref:'briGanttColumn', direction:'scrollTop' }, { ref:'briGanttScrollbar', direction:'scrollLeft' }])">
54
- <table :style="{tableLayout:'fixed', width: tableWidth}" class="briGantt-tableBox briGantt-table" border="0" cellspacing="0" cellpadding="0" >
96
+ <div
97
+ class="briGantt-data bri-scrollbar"
98
+ :class="`briGantt-data-${type}`"
99
+ ref="briGanttArea"
100
+ v-on:scroll="handleScroll($event, [{ ref: 'briGanttTimer', direction: 'scrollLeft' }, { ref:'briGanttColumn', direction:'scrollTop' }, { ref:'briGanttScrollbar', direction:'scrollLeft' }])"
101
+ >
102
+ <table
103
+ :style="{tableLayout:'fixed', width: tableWidth}"
104
+ class="briGantt-tableBox briGantt-table"
105
+ border="0"
106
+ cellspacing="0"
107
+ cellpadding="0"
108
+ >
55
109
  <tr v-if="computedData.length === 0">
56
- <td :colspan="timeData.length" class="briGantt-table-td">暂无数据</td>
110
+ <td
111
+ :colspan="timeData.length"
112
+ class="briGantt-table-td"
113
+ >暂无数据</td>
57
114
  </tr>
58
115
  <tbody v-if="type==='table'">
59
116
  <tr v-if="computedData.length === 0">
60
- <td :colspan="timeData.length" class="briGantt-table-td">暂无数据</td>
117
+ <td
118
+ :colspan="timeData.length"
119
+ class="briGantt-table-td"
120
+ >暂无数据</td>
61
121
  </tr>
62
- <tr class="briGantt-table-tr" v-for="(taskItem, taskIndex) in computedData" :key="taskIndex" style="border-left: none">
63
- <td class="briGantt-table-td"
122
+ <tr
123
+ class="briGantt-table-tr"
124
+ v-for="(taskItem, taskIndex) in computedData"
125
+ :key="taskIndex"
126
+ style="border-left: none"
127
+ >
128
+ <td
129
+ class="briGantt-table-td"
64
130
  v-for="(timeItem, timeIndex) in taskItem"
65
131
  :key="timeIndex"
66
132
  :colspan="timeItem.colspan"
133
+ >
134
+ <slot
135
+ v-if="timeItem.isApply"
136
+ name="table"
137
+ v-bind:task="timeItem.task"
138
+ v-bind:time="timeItem"
67
139
  >
68
- <slot v-if="timeItem.isApply" name="table" v-bind:task="timeItem.task" v-bind:time="timeItem"><div class="briGantt-table-td-main" :style="timeItem.style"></div></slot>
69
- <slot v-else name="tabletd" v-bind:preTime="taskItem[timeIndex-1]" v-bind:nextTime="taskItem[timeIndex+1]" v-bind:task="timeItem.task" v-bind:time="timeItem" ></slot>
140
+ <div
141
+ class="briGantt-table-td-main"
142
+ :style="timeItem.style"
143
+ ></div>
144
+ </slot>
145
+ <slot
146
+ v-else
147
+ name="tabletd"
148
+ v-bind:preTime="taskItem[timeIndex-1]"
149
+ v-bind:nextTime="taskItem[timeIndex+1]"
150
+ v-bind:task="timeItem.task"
151
+ v-bind:time="timeItem"
152
+ ></slot>
70
153
  </td>
71
154
  </tr>
72
155
  </tbody>
73
156
  <tbody v-else-if="type==='chart'">
74
- <tr class="briGantt-chart-tr" v-for="(taskItem, taskIndex) in computedData" :key="taskIndex">
75
- <td class="briGantt-chart-td"
157
+ <tr
158
+ class="briGantt-chart-tr"
159
+ v-for="(taskItem, taskIndex) in computedData"
160
+ :key="taskIndex"
161
+ >
162
+ <td
163
+ class="briGantt-chart-td"
76
164
  v-for="(timeItem, timeIndex) in taskItem"
77
165
  :key="timeIndex"
78
- :colspan="timeItem.colspan">
79
- <div v-if="timeItem.isApply" class="briGantt-chart-td-main">
80
- <slot name="chart" v-bind:task="timeItem.task" v-bind:chartItem="timeItem">
81
- <Tooltip placement="right" transfer :transfer-class-name="`briGantt-transfer-tooltip-${themeName}`" style="width:100%">
166
+ :colspan="timeItem.colspan"
167
+ >
168
+ <div
169
+ v-if="timeItem.isApply"
170
+ class="briGantt-chart-td-main"
171
+ >
172
+ <slot
173
+ name="chart"
174
+ v-bind:task="timeItem.task"
175
+ v-bind:chartItem="timeItem"
176
+ >
177
+ <Tooltip
178
+ placement="right"
179
+ transfer
180
+ :transfer-class-name="`briGantt-transfer-tooltip-${themeName}`"
181
+ style="width:100%"
182
+ >
82
183
  <div
83
184
  class="briGantt-chart-td-main-center"
84
185
  :style="{
@@ -86,8 +187,12 @@
86
187
  minWidth: minTdWidth,
87
188
  border: `1px solid ${timeItem.style.background}`,
88
189
  padding: timeItem.task.progressField == 100 ? '' : '1px'}"
190
+ >
191
+ <slot
192
+ name="chartCenter"
193
+ v-bind:task="timeItem.task"
194
+ v-bind:chartItem="timeItem"
89
195
  >
90
- <slot name="chartCenter" v-bind:task="timeItem.task" v-bind:chartItem="timeItem">
91
196
  <div
92
197
  class="ms-ellipsis"
93
198
  :style="{
@@ -99,7 +204,10 @@
99
204
  </div>
100
205
  </slot>
101
206
  </div>
102
- <div slot="content" class="briGantt-chart-td-main-center-tooltip">
207
+ <div
208
+ slot="content"
209
+ class="briGantt-chart-td-main-center-tooltip"
210
+ >
103
211
  <span
104
212
  class="briGantt-chart-td-main-center-tooltip-select"
105
213
  :style="{...timeItem.style}"
@@ -112,11 +220,14 @@
112
220
  </Tooltip>
113
221
  </slot>
114
222
  </div>
115
- <slot v-else name="charttd"
223
+ <slot
224
+ v-else
225
+ name="charttd"
116
226
  v-bind:task="timeItem.task"
117
227
  v-bind:time="timeItem"
118
228
  v-bind:preTime="taskItem[timeIndex-1]"
119
- v-bind:nextTime="taskItem[timeIndex+1]">
229
+ v-bind:nextTime="taskItem[timeIndex+1]"
230
+ >
120
231
  <div class="briGantt-chart-td-greyLine"></div>
121
232
  </slot>
122
233
  </td>
@@ -251,6 +362,8 @@
251
362
  name: "briGantt",
252
363
  components: {},
253
364
  props: {
365
+ simpleDataColor: String,
366
+
254
367
  tasks: Array,
255
368
  options: {
256
369
  type: Object,
@@ -408,7 +521,7 @@
408
521
  name: "今天",
409
522
  colspan: 1,
410
523
  fullName: this.dateFormat(getDate(0), "yyyy-MM-dd"),
411
- style: { color: this.$store.getters.systemConfig.themeColor, fontWeight: 500 },
524
+ style: { color: this.simpleDataColor, fontWeight: 500 },
412
525
  now: true
413
526
  }
414
527
  ];