ct-component-plus 0.0.40 → 0.0.42
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 +2 -2
- package/packages/components/button/src/button.vue +1 -1
- package/packages/components/search-box/src/search-box.vue +1 -1
- package/packages/components/table/src/index.js +5 -0
- package/packages/components/table/src/table.vue +17 -8
- package/packages/echarts/base.js +4 -0
- package/packages/style/element.less +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ct-component-plus",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.42",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "packages/components/index.js",
|
|
7
7
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"docs:build": "vuepress build docs"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"cingta-icon": "^2.
|
|
18
|
+
"cingta-icon": "^2.1.6",
|
|
19
19
|
"element-plus": "~2.3.4",
|
|
20
20
|
"vue": "^3.2.47"
|
|
21
21
|
},
|
|
@@ -210,7 +210,7 @@ onMounted(() => {});
|
|
|
210
210
|
box-shadow: 0 0 0 1px var(--ct-search-box-border-color);
|
|
211
211
|
border-radius: var(--ct-border-radius);
|
|
212
212
|
&:hover {
|
|
213
|
-
--ct-search-box-border-color: var(--ct-color-grey-
|
|
213
|
+
--ct-search-box-border-color: var(--ct-color-grey-sub);
|
|
214
214
|
}
|
|
215
215
|
&:focus-within {
|
|
216
216
|
--ct-search-box-border-color: var(--ct-color-primary);
|
|
@@ -40,6 +40,10 @@ export const tableProps = {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
selectableFn: {
|
|
44
|
+
//判断每行是否可选
|
|
45
|
+
type: Function
|
|
46
|
+
},
|
|
43
47
|
teleportDom: {
|
|
44
48
|
type: [String, Object],
|
|
45
49
|
},
|
|
@@ -59,4 +63,5 @@ export const tableProps = {
|
|
|
59
63
|
mergeList: Array,
|
|
60
64
|
alignLeftKeys: Array,
|
|
61
65
|
alignRightKeys: Array,
|
|
66
|
+
rowKey: String,
|
|
62
67
|
}
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
:data="showData"
|
|
8
8
|
:span-method="spanMethod"
|
|
9
9
|
@selection-change="handleSelectChange"
|
|
10
|
-
row-key="rowKey"
|
|
10
|
+
:row-key="rowKey || 'rowKey'"
|
|
11
11
|
v-bind="$attrs">
|
|
12
12
|
<el-table-column
|
|
13
13
|
v-if="isMultiSelect"
|
|
14
14
|
type="selection"
|
|
15
15
|
width="88"
|
|
16
16
|
v-bind="multiSelectAttr"
|
|
17
|
-
:reserve-selection="true"
|
|
17
|
+
:reserve-selection="true"
|
|
18
|
+
:selectable="judgeSelectable">
|
|
18
19
|
</el-table-column>
|
|
19
20
|
<el-table-column
|
|
20
21
|
v-for="(column, index) in columnData"
|
|
@@ -119,12 +120,13 @@ const handleCurrentChange = (val) => {
|
|
|
119
120
|
pageNo.value = val;
|
|
120
121
|
};
|
|
121
122
|
const showData = computed(() => {
|
|
122
|
-
const table = props.tableProps.tableData.map((item, index) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
123
|
+
// const table = props.tableProps.tableData.map((item, index) => {
|
|
124
|
+
// return {
|
|
125
|
+
// ...item,
|
|
126
|
+
// rowKey: `ct-row-${index}`,
|
|
127
|
+
// };
|
|
128
|
+
// });
|
|
129
|
+
const table = props.tableProps.tableData;
|
|
128
130
|
if (props.pagination) {
|
|
129
131
|
return table.slice(
|
|
130
132
|
(pageNo.value - 1) * pageSize.value,
|
|
@@ -246,6 +248,13 @@ watch(
|
|
|
246
248
|
function handleSelectChange(val) {
|
|
247
249
|
selectedArr.value = copyObj(val);
|
|
248
250
|
}
|
|
251
|
+
function judgeSelectable(row) {
|
|
252
|
+
if (props.selectableFn) {
|
|
253
|
+
return props.selectableFn(row);
|
|
254
|
+
} else {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
249
258
|
|
|
250
259
|
const teleportStatus = ref(false);
|
|
251
260
|
const sortObj = computed({
|
package/packages/echarts/base.js
CHANGED
|
@@ -589,7 +589,8 @@
|
|
|
589
589
|
font-size: 15px;
|
|
590
590
|
--el-table-header-text-color: var(--ct-font-color);
|
|
591
591
|
--el-table-header-bg-color: #F0F3F9;
|
|
592
|
-
--el-table-row-hover-bg-color: #F7F9FD;
|
|
592
|
+
// --el-table-row-hover-bg-color: #F7F9FD;
|
|
593
|
+
--el-table-row-hover-bg-color: #FAFAFC;
|
|
593
594
|
|
|
594
595
|
.cell {}
|
|
595
596
|
|