ct-component-plus 0.0.20 → 0.0.22
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
|
@@ -18,13 +18,14 @@ import dialog from "./dialog";
|
|
|
18
18
|
import messageBox from './message-box';
|
|
19
19
|
import CtMessage from './message';
|
|
20
20
|
|
|
21
|
+
import CtPage from './page';
|
|
22
|
+
|
|
21
23
|
import ElementPlus from 'element-plus'
|
|
22
24
|
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
|
23
25
|
import cingtaIcon from 'cingta-icon';
|
|
24
26
|
// import cingtaIcon from '../../icon/components/index';
|
|
25
27
|
import { isObject } from '../utils';
|
|
26
|
-
// import '../style
|
|
27
|
-
// import '../style/element.less';
|
|
28
|
+
// import '../style';
|
|
28
29
|
|
|
29
30
|
const components = [
|
|
30
31
|
button,
|
|
@@ -44,7 +45,8 @@ const components = [
|
|
|
44
45
|
empty,
|
|
45
46
|
dialog,
|
|
46
47
|
messageBox,
|
|
47
|
-
CtMessage
|
|
48
|
+
CtMessage,
|
|
49
|
+
CtPage
|
|
48
50
|
]
|
|
49
51
|
|
|
50
52
|
const serviceConfig = {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { h, reactive, resolveComponent } from "vue";
|
|
3
|
+
import { useNamespace } from "../../../hooks";
|
|
4
|
+
import SearchBox from "../../search-box";
|
|
5
|
+
import tableBox from "../../table";
|
|
6
|
+
export default {
|
|
7
|
+
name: "PageComponent",
|
|
8
|
+
props: {},
|
|
9
|
+
setup(props, { emit, slots }) {
|
|
10
|
+
const getSelfSlots = (name) => {
|
|
11
|
+
console.log(slots);
|
|
12
|
+
if (!name) return null;
|
|
13
|
+
const key = `_${name}-`;
|
|
14
|
+
const res = {};
|
|
15
|
+
Object.keys(slots).forEach((slotName) => {
|
|
16
|
+
if (slotName.startsWith(key)) {
|
|
17
|
+
res[slotName.replace(key, "")] = slots[slotName];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return res;
|
|
21
|
+
};
|
|
22
|
+
const tableProps = reactive({
|
|
23
|
+
columnData: [
|
|
24
|
+
{ label: "序号", value: "index" },
|
|
25
|
+
{ label: "校验结果", value: "result" },
|
|
26
|
+
{ label: "处理状态", value: "status" },
|
|
27
|
+
{ label: "操作", value: "id" },
|
|
28
|
+
],
|
|
29
|
+
tableData: [
|
|
30
|
+
{ index: 1, result: 3, status: "暂未处理" },
|
|
31
|
+
{ index: 2, result: 0, status: "无需处理" },
|
|
32
|
+
{ index: 3, result: 3, status: "处理中" },
|
|
33
|
+
{ index: 4, result: 0, status: "处理完成" },
|
|
34
|
+
],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const tableDom = h(
|
|
38
|
+
tableBox,
|
|
39
|
+
{
|
|
40
|
+
"table-props": tableProps,
|
|
41
|
+
},
|
|
42
|
+
{ ...getSelfSlots("table") }
|
|
43
|
+
);
|
|
44
|
+
const searchDom = h(
|
|
45
|
+
SearchBox,
|
|
46
|
+
{
|
|
47
|
+
"search-list": [],
|
|
48
|
+
"have-reset": true,
|
|
49
|
+
},
|
|
50
|
+
{ ...slots }
|
|
51
|
+
);
|
|
52
|
+
const ns = useNamespace("page-component");
|
|
53
|
+
return () =>
|
|
54
|
+
h("div", { class: ns.b() }, [
|
|
55
|
+
h("div", { class: ns.e("container") }, [
|
|
56
|
+
h("div", { class: ns.e("header") }, [
|
|
57
|
+
h(
|
|
58
|
+
"div",
|
|
59
|
+
slots.header
|
|
60
|
+
? slots.header()
|
|
61
|
+
: h("div", { class: ns.em("header", "default") }, [
|
|
62
|
+
slots.headerBefore ? slots.headerBefore() : null,
|
|
63
|
+
h("div", { class: ns.e("header-search") }, [searchDom]),
|
|
64
|
+
slots.headerAfter ? slots.headerAfter() : null,
|
|
65
|
+
])
|
|
66
|
+
),
|
|
67
|
+
// h('ct-search-box', {
|
|
68
|
+
// searchList: searchList,
|
|
69
|
+
// haveReset: true,
|
|
70
|
+
// onDoSearch: doSearch
|
|
71
|
+
// })
|
|
72
|
+
]),
|
|
73
|
+
h("div", { class: ns.e("content") }, [tableDom]),
|
|
74
|
+
]),
|
|
75
|
+
]);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
</script>
|