ylwl-cpscoms 1.0.0
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/README.md +15 -0
- package/es/SlAlert/index.vue.js +58 -0
- package/es/SlAlert/index.vue2.js +37 -0
- package/es/SlAlert/index.vue3.js +6 -0
- package/es/SlDescriptions/index.vue.js +55 -0
- package/es/SlDescriptions/index.vue2.js +57 -0
- package/es/SlDescriptions/index.vue3.js +6 -0
- package/es/SlDescriptions/renderOptions.vue.js +25 -0
- package/es/SlDescriptions/renderOptions.vue2.js +31 -0
- package/es/SlDialog/dialogPlus.js +159 -0
- package/es/SlDialog/index.js +202 -0
- package/es/SlDrawer/index.js +54 -0
- package/es/SlForm/index.vue.js +26 -0
- package/es/SlForm/index.vue2.js +433 -0
- package/es/SlForm/index.vue3.js +6 -0
- package/es/SlForm/mixinRender.js +239 -0
- package/es/SlForm/otherItem/titleItem.vue.js +39 -0
- package/es/SlForm/otherItem/titleItem.vue2.js +20 -0
- package/es/SlForm/otherItem/titleItem.vue3.js +6 -0
- package/es/SlGuide/index.vue.js +38 -0
- package/es/SlGuide/index.vue2.js +133 -0
- package/es/SlGuide/index.vue3.js +6 -0
- package/es/SlGuide/index.vue4.js +6 -0
- package/es/SlMessageBox/index.js +46 -0
- package/es/SlPage/index.vue.js +147 -0
- package/es/SlPage/index.vue2.js +312 -0
- package/es/SlPage/index.vue3.js +6 -0
- package/es/SlTable/components/colSetting.vue.js +94 -0
- package/es/SlTable/components/colSetting.vue2.js +66 -0
- package/es/SlTable/components/colSetting.vue3.js +6 -0
- package/es/SlTable/index.vue.js +171 -0
- package/es/SlTable/index.vue2.js +390 -0
- package/es/SlTable/index.vue3.js +6 -0
- package/es/SlTitle/index.vue.js +41 -0
- package/es/SlTitle/index.vue2.js +26 -0
- package/es/SlTitle/index.vue3.js +6 -0
- package/es/_virtual/_rollupPluginBabelHelpers.js +247 -0
- package/es/index.js +41 -0
- package/es/node_modules/shepherd.js/dist/css/shepherd.css.js +7 -0
- package/es/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/es/node_modules/vue-runtime-helpers/dist/normalize-component.js +76 -0
- package/es/utils/index.js +51 -0
- package/package.json +106 -0
- package/src/SlAlert/SlAlert.stories.js +108 -0
- package/src/SlAlert/index.vue +54 -0
- package/src/SlAlert/remark.md +16 -0
- package/src/SlDescriptions/SlDescriptions.stories.js +119 -0
- package/src/SlDescriptions/index.vue +60 -0
- package/src/SlDescriptions/renderOptions.vue +27 -0
- package/src/SlDialog/README-PLUS.md +74 -0
- package/src/SlDialog/README.md +114 -0
- package/src/SlDialog/dialogPlus.js +160 -0
- package/src/SlDialog/index.js +170 -0
- package/src/SlDrawer/SlDrawer.stories.js +154 -0
- package/src/SlDrawer/index.js +62 -0
- package/src/SlForm/SlForm.stories.js +120 -0
- package/src/SlForm/index.css +141 -0
- package/src/SlForm/index.vue +365 -0
- package/src/SlForm/mixinRender.js +228 -0
- package/src/SlForm/otherItem/titleItem.vue +31 -0
- package/src/SlForm/remark.md +607 -0
- package/src/SlGuide/SlGuide.stories.js +100 -0
- package/src/SlGuide/index.vue +166 -0
- package/src/SlGuide/remark.md +90 -0
- package/src/SlMessageBox/index.js +35 -0
- package/src/SlPage/README.md +515 -0
- package/src/SlPage/SlPage.stories.js +125 -0
- package/src/SlPage/index.css +38 -0
- package/src/SlPage/index.vue +266 -0
- package/src/SlPage/remark.md +283 -0
- package/src/SlTable/SlTable.stories.js +118 -0
- package/src/SlTable/components/colSetting.vue +86 -0
- package/src/SlTable/index.vue +541 -0
- package/src/SlTitle/SlTitle.stories.js +98 -0
- package/src/SlTitle/index.vue +49 -0
- package/src/global.css +5 -0
- package/src/index.js +47 -0
- package/src/store/index.js +20 -0
- package/src/utils/index.js +47 -0
- package/src/utils/tableConfig.js +33 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { typeof as _typeof, objectSpread2 as _objectSpread2, toConsumableArray as _toConsumableArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator, defineProperty as _defineProperty } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { typeOf, hasKey, isMobileDevice, getValueByPath } from '../utils/index.js';
|
|
3
|
+
|
|
4
|
+
var script = {
|
|
5
|
+
props: {
|
|
6
|
+
tableApi: {
|
|
7
|
+
type: Function,
|
|
8
|
+
default: function _default() {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
columns: {
|
|
13
|
+
type: Array,
|
|
14
|
+
default: function _default() {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
params: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: function _default() {}
|
|
21
|
+
},
|
|
22
|
+
filterForm: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: function _default() {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
otherConfig: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: function _default() {}
|
|
31
|
+
},
|
|
32
|
+
projectFrom: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: ''
|
|
35
|
+
},
|
|
36
|
+
autoRequest: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
defaultSeachParams: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: function _default() {}
|
|
43
|
+
},
|
|
44
|
+
// 是否需要分页
|
|
45
|
+
showPagination: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// itemWidth: { type: String, default: '' },
|
|
51
|
+
// data: { type: Array, default: () => [] },
|
|
52
|
+
// showlabel: { type: Boolean, default: true },
|
|
53
|
+
// drawer: { type: Boolean, default: false }, // 开启抽屉模式
|
|
54
|
+
// formProps: { type: Object, default: () => ({ inline: true }) },
|
|
55
|
+
// formItemProps: { type: Object, default: () => ({}) },
|
|
56
|
+
},
|
|
57
|
+
data: function data() {
|
|
58
|
+
return {
|
|
59
|
+
loading: false,
|
|
60
|
+
currentPage: 1,
|
|
61
|
+
pageSize: 10,
|
|
62
|
+
total: 0,
|
|
63
|
+
draggingIndex: null,
|
|
64
|
+
realColumns: this.columns,
|
|
65
|
+
// tableData: [],
|
|
66
|
+
tableData: [],
|
|
67
|
+
dragState: {
|
|
68
|
+
start: -3,
|
|
69
|
+
// 起始元素的 index 防止初始化cellStyle时序号、展开等默认样式改变,最好小于-3
|
|
70
|
+
end: -3,
|
|
71
|
+
// 移动鼠标时所覆盖的元素 index
|
|
72
|
+
dragging: false,
|
|
73
|
+
// 是否正在拖动
|
|
74
|
+
direction: undefined // 拖动方向
|
|
75
|
+
},
|
|
76
|
+
headKey: 'dragHead',
|
|
77
|
+
// 表头数组变换位置时,重绘table(不更新该值,表头数组变化时,页面不会改变)
|
|
78
|
+
scrollX: 0,
|
|
79
|
+
// 初始x轴scroll位置(用于定位X轴滚动条)
|
|
80
|
+
hrender: this.$createElement,
|
|
81
|
+
selectedListIds: [],
|
|
82
|
+
selectedList: [],
|
|
83
|
+
defaultParams: {}
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
created: function created() {
|
|
87
|
+
// console.log(this, "xzchizcjzxioj")
|
|
88
|
+
// console.log(this.$parent.$slots, "xzchizcjzxioj")
|
|
89
|
+
// console.log(this.$attrs, "asdasdasdasd")
|
|
90
|
+
this.defaultParams = this.defaultSeachParams;
|
|
91
|
+
this.autoRequest && this.getTableData();
|
|
92
|
+
},
|
|
93
|
+
watch: {
|
|
94
|
+
defaultSeachParams: {
|
|
95
|
+
handler: function handler(newVal) {
|
|
96
|
+
if (newVal && _typeof(newVal) === 'object') {
|
|
97
|
+
this.defaultParams = _objectSpread2(_objectSpread2({}, this.defaultParams), newVal);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
immediate: true,
|
|
101
|
+
deep: true
|
|
102
|
+
},
|
|
103
|
+
columns: {
|
|
104
|
+
deep: true,
|
|
105
|
+
immediate: true,
|
|
106
|
+
handler: function handler(val) {
|
|
107
|
+
var _this = this;
|
|
108
|
+
this.realColumns = Array.isArray(val) ? _toConsumableArray(val) : [];
|
|
109
|
+
this.$nextTick(function () {
|
|
110
|
+
_this.$refs.elTable.doLayout();
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
computed: {
|
|
116
|
+
processedParams: function processedParams() {
|
|
117
|
+
var processedParams = _objectSpread2(_objectSpread2({}, this.params), this.defaultParams);
|
|
118
|
+
// 如果有多选的筛选选项 就要配置这个projectFrom
|
|
119
|
+
if (this.projectFrom === 'ares') {
|
|
120
|
+
this.filterForm.forEach(function (item) {
|
|
121
|
+
if (item.type === 'select' && item.props && item.props.multiple) {
|
|
122
|
+
// console.log(processedParams[item.model] && processedParams[item.model].length === 0,"||||")
|
|
123
|
+
if (!processedParams[item.model] || processedParams[item.model].length === 0) {
|
|
124
|
+
processedParams[item.model] = [];
|
|
125
|
+
}
|
|
126
|
+
} else if (item.type === 'datePicker' && item.privateProps && item.privateProps.type === 'daterange') {
|
|
127
|
+
if (processedParams[item.model] && processedParams[item.model].length > 0 && item.callback) {
|
|
128
|
+
var setValueObj = item.callback(processedParams[item.model]);
|
|
129
|
+
Object.keys(setValueObj).forEach(function (key) {
|
|
130
|
+
processedParams[key] = setValueObj[key];
|
|
131
|
+
});
|
|
132
|
+
delete processedParams[item.model];
|
|
133
|
+
}
|
|
134
|
+
} else if (item.type === 'datePicker' || item.type === 'rangeInput') {
|
|
135
|
+
delete processedParams[item.model];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return processedParams;
|
|
139
|
+
} else {
|
|
140
|
+
this.filterForm.forEach(function (item) {
|
|
141
|
+
if (item.type === 'select' && item.props && item.props.multiple) {
|
|
142
|
+
if (processedParams[item.model]) {
|
|
143
|
+
processedParams[item.model] = processedParams[item.model].join(',');
|
|
144
|
+
} else {
|
|
145
|
+
processedParams[item.model] = '';
|
|
146
|
+
}
|
|
147
|
+
} else if (item.type === 'datePicker' && item.privateProps && item.privateProps.type === 'daterange') {
|
|
148
|
+
if (processedParams[item.model] && processedParams[item.model].length > 0 && item.callback) {
|
|
149
|
+
var setValueObj = item.callback(processedParams[item.model]);
|
|
150
|
+
Object.keys(setValueObj).forEach(function (key) {
|
|
151
|
+
processedParams[key] = setValueObj[key];
|
|
152
|
+
});
|
|
153
|
+
delete processedParams[item.model];
|
|
154
|
+
}
|
|
155
|
+
} else if (item.type === 'datePicker') {
|
|
156
|
+
delete processedParams[item.model];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
// console.log(processedParams, "processedParamsBycps")
|
|
160
|
+
return processedParams;
|
|
161
|
+
}
|
|
162
|
+
} // columns() {
|
|
163
|
+
// return this.columns
|
|
164
|
+
// }
|
|
165
|
+
},
|
|
166
|
+
methods: {
|
|
167
|
+
typeOf: typeOf,
|
|
168
|
+
hasKey: hasKey,
|
|
169
|
+
isMobileDevice: isMobileDevice,
|
|
170
|
+
isShowTableColumn: function isShowTableColumn(item) {
|
|
171
|
+
if (hasKey(item, 'isAlwaysShow') && typeof item.isAlwaysShow === 'function') {
|
|
172
|
+
return item.isAlwaysShow({
|
|
173
|
+
item: item
|
|
174
|
+
});
|
|
175
|
+
} else if (hasKey(item, 'isAlwaysShow') && typeof item.isAlwaysShow === 'string') {
|
|
176
|
+
return item.isAlwaysShow;
|
|
177
|
+
} else {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
getTableData: function getTableData() {
|
|
182
|
+
var _this2 = this;
|
|
183
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
184
|
+
var pageSize, currentPage, params, res, listPath, totalPath, statusCodePath, statusCode, _t;
|
|
185
|
+
return _regenerator().w(function (_context) {
|
|
186
|
+
while (1) switch (_context.p = _context.n) {
|
|
187
|
+
case 0:
|
|
188
|
+
_context.p = 0;
|
|
189
|
+
// console.log(this.otherConfig.requestBodyCof, "this.tableApi")
|
|
190
|
+
_this2.loading = true;
|
|
191
|
+
pageSize = _this2.otherConfig.requestBodyCof && _this2.otherConfig.requestBodyCof.pageSize ? _this2.otherConfig.requestBodyCof.pageSize : 'pageSize';
|
|
192
|
+
currentPage = _this2.otherConfig.requestBodyCof && _this2.otherConfig.requestBodyCof.currentPage ? _this2.otherConfig.requestBodyCof.currentPage : 'currentPage';
|
|
193
|
+
params = _objectSpread2(_defineProperty(_defineProperty({}, currentPage, _this2.currentPage), pageSize, _this2.pageSize), _this2.processedParams);
|
|
194
|
+
if (!_this2.showPagination) {
|
|
195
|
+
delete params[pageSize];
|
|
196
|
+
delete params[currentPage];
|
|
197
|
+
}
|
|
198
|
+
_context.n = 1;
|
|
199
|
+
return _this2.tableApi(params);
|
|
200
|
+
case 1:
|
|
201
|
+
res = _context.v;
|
|
202
|
+
// 默认路径
|
|
203
|
+
listPath = ['data', 'list'];
|
|
204
|
+
totalPath = ['data', 'total'];
|
|
205
|
+
statusCodePath = 'code'; // 检查 otherConfig 是否包含 responderCof
|
|
206
|
+
if (_this2.otherConfig.responderCof) {
|
|
207
|
+
statusCodePath = _this2.otherConfig.responderCof.statusCode || statusCodePath;
|
|
208
|
+
listPath = _this2.otherConfig.responderCof.list || listPath;
|
|
209
|
+
totalPath = _this2.otherConfig.responderCof.total || totalPath;
|
|
210
|
+
}
|
|
211
|
+
statusCode = getValueByPath(res, statusCodePath);
|
|
212
|
+
if (statusCode === 1) {
|
|
213
|
+
console.log(getValueByPath(res, listPath), "res", getValueByPath(res, totalPath));
|
|
214
|
+
if (getValueByPath(res, listPath) && getValueByPath(res, totalPath) > 0 || getValueByPath(res, listPath) && !_this2.showPagination) {
|
|
215
|
+
_this2.tableData = getValueByPath(res, listPath).map(function (res) {
|
|
216
|
+
var newData = _objectSpread2({}, res);
|
|
217
|
+
_this2.realColumns.forEach(function (column) {
|
|
218
|
+
if (column.isSwitchNumber && newData.hasOwnProperty(column.prop)) {
|
|
219
|
+
newData[column.prop] = Number(newData[column.prop]);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return newData;
|
|
223
|
+
});
|
|
224
|
+
} else {
|
|
225
|
+
_this2.tableData = [];
|
|
226
|
+
}
|
|
227
|
+
// this.tableData = getValueByPath(res, listPath) || []
|
|
228
|
+
_this2.total = (typeof getValueByPath(res, totalPath) === 'string' ? Number(getValueByPath(res, totalPath)) : getValueByPath(res, totalPath)) || 0;
|
|
229
|
+
_this2.$listeners.callback && _this2.$listeners.callback({
|
|
230
|
+
apiInfo: res,
|
|
231
|
+
allRequestParams: _objectSpread2(_defineProperty(_defineProperty({}, currentPage, _this2.currentPage), pageSize, _this2.pageSize), _this2.processedParams)
|
|
232
|
+
});
|
|
233
|
+
_this2.loading = false;
|
|
234
|
+
}
|
|
235
|
+
_context.n = 3;
|
|
236
|
+
break;
|
|
237
|
+
case 2:
|
|
238
|
+
_context.p = 2;
|
|
239
|
+
_t = _context.v;
|
|
240
|
+
console.log(_t, "error");
|
|
241
|
+
_this2.tableData = [];
|
|
242
|
+
_this2.loading = false;
|
|
243
|
+
case 3:
|
|
244
|
+
_context.p = 3;
|
|
245
|
+
_this2.loading = false;
|
|
246
|
+
return _context.f(3);
|
|
247
|
+
case 4:
|
|
248
|
+
return _context.a(2);
|
|
249
|
+
}
|
|
250
|
+
}, _callee, null, [[0, 2, 3, 4]]);
|
|
251
|
+
}))();
|
|
252
|
+
},
|
|
253
|
+
handleSizeChange: function handleSizeChange(val) {
|
|
254
|
+
console.log("\u6BCF\u9875 ".concat(val, " \u6761"), this.columns);
|
|
255
|
+
this.pageSize = val;
|
|
256
|
+
this.getTableData();
|
|
257
|
+
},
|
|
258
|
+
handleCurrentChange: function handleCurrentChange(val) {
|
|
259
|
+
console.log(this.params, "this.paramsthis.params");
|
|
260
|
+
console.log("\u5F53\u524D\u9875: ".concat(val));
|
|
261
|
+
this.currentPage = val;
|
|
262
|
+
this.getTableData();
|
|
263
|
+
},
|
|
264
|
+
// 不更换页数量
|
|
265
|
+
getCurrentPageList: function getCurrentPageList() {
|
|
266
|
+
this.getTableData();
|
|
267
|
+
},
|
|
268
|
+
/** 鼠标摁下触发 */handleMounseDown: function handleMounseDown(e, column, $index) {
|
|
269
|
+
this.dragState.dragging = true;
|
|
270
|
+
this.dragState.start = parseInt($index - 0);
|
|
271
|
+
// 添加鼠标抬起事件 消除鼠标摁下立刻松开问题
|
|
272
|
+
document.addEventListener('mouseup', this.handleMouseUp);
|
|
273
|
+
// 添加拖拽结束事件
|
|
274
|
+
document.addEventListener('dragend', this.handleMouseUp);
|
|
275
|
+
|
|
276
|
+
// 对选中的表头允许其拖拽
|
|
277
|
+
var dragclass = '.el-table__header-wrapper .' + column.id;
|
|
278
|
+
var dragDom = document.querySelectorAll(dragclass);
|
|
279
|
+
dragDom.forEach(function (dom) {
|
|
280
|
+
// 允许表头块可以被拖拽 draggable 属性 不允许拖拽dragover等相关拖拽事件无法触发
|
|
281
|
+
dom.setAttribute('draggable', true);
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
/** 鼠标在拖拽移动时触发 */handleDragover: function handleDragover(e, column, $index) {
|
|
285
|
+
if (this.dragState.dragging) {
|
|
286
|
+
// 获取当前滚动条的位置
|
|
287
|
+
var scrollDom = this.$refs.elTable.bodyWrapper;
|
|
288
|
+
this.scrollX = scrollDom.scrollLeft;
|
|
289
|
+
var index = parseInt($index - 0); // 记录起始列
|
|
290
|
+
/** 实时更改鼠标处于表头的位置 */
|
|
291
|
+
if (index - this.dragState.start !== 0) {
|
|
292
|
+
this.dragState.direction = index - this.dragState.start < 0 ? 'left' : 'right'; // 判断拖动方向
|
|
293
|
+
this.dragState.end = parseInt($index - 0);
|
|
294
|
+
} else {
|
|
295
|
+
this.dragState.end = this.dragState.start;
|
|
296
|
+
this.dragState.direction = null;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
/** 鼠标抬起或拖拽结束触发 */handleMouseUp: function handleMouseUp() {
|
|
301
|
+
var _this3 = this;
|
|
302
|
+
// 更新拖拽后的表头
|
|
303
|
+
this.headDraged(this.dragState);
|
|
304
|
+
var end = this.dragState.end;
|
|
305
|
+
// 初始化拖动状态
|
|
306
|
+
this.dragState = {
|
|
307
|
+
start: end,
|
|
308
|
+
end: -9,
|
|
309
|
+
dragging: false,
|
|
310
|
+
direction: undefined
|
|
311
|
+
};
|
|
312
|
+
document.removeEventListener('mouseup', this.handleMouseUp);
|
|
313
|
+
document.removeEventListener('dragend', this.handleMouseUp);
|
|
314
|
+
setTimeout(function () {
|
|
315
|
+
// 重置拖拽状态
|
|
316
|
+
_this3.dragState.start = -9;
|
|
317
|
+
}, 200);
|
|
318
|
+
},
|
|
319
|
+
// 更新拖拽后的表头
|
|
320
|
+
headDraged: function headDraged(_ref) {
|
|
321
|
+
var _this4 = this;
|
|
322
|
+
var start = _ref.start,
|
|
323
|
+
end = _ref.end,
|
|
324
|
+
direction = _ref.direction;
|
|
325
|
+
console.log(direction, 'direction');
|
|
326
|
+
if (direction) {
|
|
327
|
+
var originColumn = this.realColumns[start];
|
|
328
|
+
// 有位置交换时,原先位置的元素删除,再在目标处插入
|
|
329
|
+
this.realColumns.splice(start, 1);
|
|
330
|
+
this.realColumns.splice(end, 0, originColumn);
|
|
331
|
+
this.headKey = new Date().getTime() + ''; // 更新table key值
|
|
332
|
+
this.$nextTick(function () {
|
|
333
|
+
// 因为表头重绘后滚动条会移到最左端初始位置,因此如果是在中间部分拖拽,还需要把滚动条在定位到该位置
|
|
334
|
+
_this4.$refs.elTable.bodyWrapper.scrollLeft = _this4.scrollX;
|
|
335
|
+
});
|
|
336
|
+
console.log('handleDrop', this.realColumns);
|
|
337
|
+
this.$emit('setStorageCustomCol', this.realColumns);
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
// 拖动虚线样式设置
|
|
341
|
+
cellClassName: function cellClassName(_ref2) {
|
|
342
|
+
var columnIndex = _ref2.columnIndex;
|
|
343
|
+
var _this$dragState = this.dragState,
|
|
344
|
+
start = _this$dragState.start,
|
|
345
|
+
end = _this$dragState.end,
|
|
346
|
+
direction = _this$dragState.direction;
|
|
347
|
+
var target = columnIndex - 0;
|
|
348
|
+
if (target === start) {
|
|
349
|
+
return 'drag_start';
|
|
350
|
+
} else if (target === end) {
|
|
351
|
+
return "drag_end_".concat(direction);
|
|
352
|
+
}
|
|
353
|
+
return '';
|
|
354
|
+
},
|
|
355
|
+
// 重新设置表头
|
|
356
|
+
resetColumns: function resetColumns(columns) {
|
|
357
|
+
console.log(columns, "columns");
|
|
358
|
+
this.realColumns = columns;
|
|
359
|
+
this.headKey = new Date().getTime() + '';
|
|
360
|
+
},
|
|
361
|
+
handleSelectionChange: function handleSelectionChange(val) {
|
|
362
|
+
var _this5 = this;
|
|
363
|
+
// console.log(val, '123')
|
|
364
|
+
this.selectedListIds = val.map(function (item) {
|
|
365
|
+
return item[_this5.otherConfig.rowKey || 'id'];
|
|
366
|
+
});
|
|
367
|
+
this.selectedList = val;
|
|
368
|
+
},
|
|
369
|
+
showOverflowTooltip: function showOverflowTooltip(item) {
|
|
370
|
+
if (isMobileDevice()) return false;
|
|
371
|
+
if (item.prop === 'operate') return false;
|
|
372
|
+
if (item.overflowTooltip) return true;
|
|
373
|
+
if (this.otherConfig && !this.otherConfig.donShowOverflowTooltip) return true;
|
|
374
|
+
if (this.otherConfig && this.otherConfig.donShowOverflowTooltip) return false;
|
|
375
|
+
},
|
|
376
|
+
handleSortChange: function handleSortChange(_ref3) {
|
|
377
|
+
var column = _ref3.column,
|
|
378
|
+
prop = _ref3.prop,
|
|
379
|
+
order = _ref3.order;
|
|
380
|
+
// console.log(column, prop, order, 'column, prop, order');
|
|
381
|
+
this.$emit('sortChangeByApi', {
|
|
382
|
+
column: column,
|
|
383
|
+
prop: prop,
|
|
384
|
+
order: order
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
export { script as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styleInject from '../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = "@media (max-width:768px){.sl-table[data-v-29020ed9]{display:flex;flex-direction:column}}@media (min-width:769px){.sl-table[data-v-29020ed9]{display:flex;flex:1 1 0;flex-direction:column}}.el-table[data-v-29020ed9]{display:flex;flex-direction:column}[data-v-29020ed9] .el-table__header-wrapper{flex:1 0 1}@media (max-width:768px){[data-v-29020ed9] .el-table__body-wrapper{height:100%!important;overflow-y:auto}}@media (min-width:769px){[data-v-29020ed9] .el-table__body-wrapper{flex:1 1 0}}[data-v-29020ed9] .el-pagination{display:flex;justify-content:end;margin-top:20px}@media (max-width:768px){[data-v-29020ed9] .el-pagination{flex-wrap:wrap}}[data-v-29020ed9] .el-table .drag_start{color:#f3e8e8fd;opacity:.8;transition:all .3s cubic-bezier(.23,1,.32,1);-webkit-transition:all .3s cubic-bezier(.23,1,.32,1);-moz-transition:all .3s cubic-bezier(.23,1,.32,1);-ms-transition:all .3s cubic-bezier(.23,1,.32,1);-o-transition:all .3s cubic-bezier(.23,1,.32,1)}[data-v-29020ed9] .el-table .drag_end_left{border-left:2px dotted rgba(0,0,0,.938)}[data-v-29020ed9] .el-table .drag_end_right{border-right:2px dotted rgba(0,0,0,.938)}[data-v-29020ed9] .el-icon-info{vertical-align:middle}";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import script from './index.vue2.js';
|
|
2
|
+
import './index.vue3.js';
|
|
3
|
+
import normalizeComponent from '../node_modules/vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
+
|
|
5
|
+
/* script */
|
|
6
|
+
var __vue_script__ = script;
|
|
7
|
+
/* template */
|
|
8
|
+
var __vue_render__ = function __vue_render__() {
|
|
9
|
+
var _vm = this;
|
|
10
|
+
var _h = _vm.$createElement;
|
|
11
|
+
var _c = _vm._self._c || _h;
|
|
12
|
+
return _c("div", {
|
|
13
|
+
staticClass: "sl_title"
|
|
14
|
+
}, [_c("div", {
|
|
15
|
+
staticClass: "title_name"
|
|
16
|
+
}, [_vm._v("\n " + _vm._s(_vm.title) + "\n ")]), _vm._v(" "), _c("div", [_vm._t("default")], 2)]);
|
|
17
|
+
};
|
|
18
|
+
var __vue_staticRenderFns__ = [];
|
|
19
|
+
__vue_render__._withStripped = true;
|
|
20
|
+
|
|
21
|
+
/* style */
|
|
22
|
+
var __vue_inject_styles__ = undefined;
|
|
23
|
+
/* scoped */
|
|
24
|
+
var __vue_scope_id__ = "data-v-1dd333e6";
|
|
25
|
+
/* module identifier */
|
|
26
|
+
var __vue_module_identifier__ = undefined;
|
|
27
|
+
/* functional template */
|
|
28
|
+
var __vue_is_functional_template__ = false;
|
|
29
|
+
/* style inject */
|
|
30
|
+
|
|
31
|
+
/* style inject SSR */
|
|
32
|
+
|
|
33
|
+
/* style inject shadow dom */
|
|
34
|
+
|
|
35
|
+
var __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
36
|
+
render: __vue_render__,
|
|
37
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
38
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
39
|
+
var SlTitle = __vue_component__;
|
|
40
|
+
|
|
41
|
+
export { SlTitle as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
//
|
|
6
|
+
//
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
//
|
|
11
|
+
|
|
12
|
+
var script = {
|
|
13
|
+
name: 'SlTitle',
|
|
14
|
+
props: {
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
data: function data() {
|
|
21
|
+
return {};
|
|
22
|
+
},
|
|
23
|
+
methods: {}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { script as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import styleInject from '../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".sl_title[data-v-1dd333e6]{display:flex;justify-content:space-between;margin:10px 0}.title_name[data-v-1dd333e6]{color:#000;font-size:12px;font-weight:700}.title_name[data-v-1dd333e6]:before{border:2px solid #409eff;content:\" \";margin-left:2px;margin-right:10px}";
|
|
4
|
+
styleInject(css_248z);
|
|
5
|
+
|
|
6
|
+
export { css_248z as default };
|