@cgboiler/biz-mobile 0.1.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 +0 -0
- package/es/button/Button.d.ts +9 -0
- package/es/button/Button.js +31 -0
- package/es/button/_atomic.css +35 -0
- package/es/button/index.css +1 -0
- package/es/button/index.d.ts +3 -0
- package/es/button/index.js +5 -0
- package/es/button/index.less +3 -0
- package/es/button/style/index.d.ts +1 -0
- package/es/button/style/index.js +1 -0
- package/es/button/style/less.d.ts +1 -0
- package/es/button/style/less.js +1 -0
- package/es/button/types.d.ts +5 -0
- package/es/button/types.js +6 -0
- package/es/index.d.ts +10 -0
- package/es/index.js +29 -0
- package/es/project-list/ProjectList.d.ts +40 -0
- package/es/project-list/ProjectList.js +69 -0
- package/es/project-list/_atomic.css +32 -0
- package/es/project-list/index.css +1 -0
- package/es/project-list/index.d.ts +3 -0
- package/es/project-list/index.js +5 -0
- package/es/project-list/index.less +35 -0
- package/es/project-list/style/index.d.ts +1 -0
- package/es/project-list/style/index.js +1 -0
- package/es/project-list/style/less.d.ts +1 -0
- package/es/project-list/style/less.js +1 -0
- package/es/project-list/types.d.ts +22 -0
- package/es/project-list/types.js +19 -0
- package/es/project-list/useApi.d.ts +11 -0
- package/es/project-list/useApi.js +48 -0
- package/es/utils/useFetch.d.ts +5 -0
- package/es/utils/useFetch.js +72 -0
- package/es/vue-sfc-shim.d.ts +6 -0
- package/es/vue-tsx-shim.d.ts +24 -0
- package/lib/button/Button.d.ts +9 -0
- package/lib/button/Button.js +50 -0
- package/lib/button/_atomic.css +35 -0
- package/lib/button/index.css +1 -0
- package/lib/button/index.d.ts +3 -0
- package/lib/button/index.js +34 -0
- package/lib/button/index.less +3 -0
- package/lib/button/style/index.d.ts +1 -0
- package/lib/button/style/index.js +1 -0
- package/lib/button/style/less.d.ts +1 -0
- package/lib/button/style/less.js +1 -0
- package/lib/button/types.d.ts +5 -0
- package/lib/button/types.js +25 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +49 -0
- package/lib/project-list/ProjectList.d.ts +40 -0
- package/lib/project-list/ProjectList.js +88 -0
- package/lib/project-list/_atomic.css +32 -0
- package/lib/project-list/index.css +1 -0
- package/lib/project-list/index.d.ts +3 -0
- package/lib/project-list/index.js +34 -0
- package/lib/project-list/index.less +35 -0
- package/lib/project-list/style/index.d.ts +1 -0
- package/lib/project-list/style/index.js +1 -0
- package/lib/project-list/style/less.d.ts +1 -0
- package/lib/project-list/style/less.js +1 -0
- package/lib/project-list/types.d.ts +22 -0
- package/lib/project-list/types.js +38 -0
- package/lib/project-list/useApi.d.ts +11 -0
- package/lib/project-list/useApi.js +67 -0
- package/lib/utils/useFetch.d.ts +5 -0
- package/lib/utils/useFetch.js +89 -0
- package/lib/vue-sfc-shim.d.ts +6 -0
- package/lib/vue-tsx-shim.d.ts +24 -0
- package/package.json +58 -0
package/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
}>> & Readonly<{
|
|
7
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent } from "vue";
|
|
4
|
+
import { buttonProps } from "./types";
|
|
5
|
+
import { ElButton } from "element-plus";
|
|
6
|
+
import "./index.css";
|
|
7
|
+
var stdin_default = defineComponent({
|
|
8
|
+
name: "DemoButton",
|
|
9
|
+
props: buttonProps,
|
|
10
|
+
emits: ["click"],
|
|
11
|
+
setup(props, {
|
|
12
|
+
emit,
|
|
13
|
+
slots
|
|
14
|
+
}) {
|
|
15
|
+
return () => {
|
|
16
|
+
var _a;
|
|
17
|
+
return _createVNode("div", {
|
|
18
|
+
"class": "cg-atm"
|
|
19
|
+
}, [_createVNode("button", {
|
|
20
|
+
"class": "demo-button w-[120px] p-2"
|
|
21
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), _createVNode(ElButton, {
|
|
22
|
+
"type": "primary"
|
|
23
|
+
}, {
|
|
24
|
+
default: () => [_createTextVNode("123")]
|
|
25
|
+
})]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
stdin_default as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
.cgx-atm .flex {
|
|
3
|
+
align-items: initial;
|
|
4
|
+
flex-direction: initial;
|
|
5
|
+
justify-content: initial;
|
|
6
|
+
flex-wrap: initial;
|
|
7
|
+
}
|
|
8
|
+
.cgx-atm .flex-row {
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
}
|
|
11
|
+
.cgx-atm .flex-col {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
.cgx-atm .justify-center {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
.cgx-atm .justify-between {
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.cgx-atm .justify-around {
|
|
21
|
+
justify-content: space-around;
|
|
22
|
+
}
|
|
23
|
+
.cgx-atm .justify-end {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.cgx-atm .items-center {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
.cgx-atm .flex-wrap {
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* layer: default */
|
|
34
|
+
.cgx-atm .w-\[120px\]{width:120px;}
|
|
35
|
+
.cgx-atm .p-2{padding:0.5rem;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.a-b{color:#abcdef}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.less";
|
package/es/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./button";
|
|
2
|
+
export * from "./project-list";
|
|
3
|
+
declare namespace _default {
|
|
4
|
+
export { install };
|
|
5
|
+
export { version };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
export function install(app: any): void;
|
|
9
|
+
export const version: "0.0.1";
|
|
10
|
+
export { Button, ProjectList };
|
package/es/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button } from "./button";
|
|
2
|
+
import { ProjectList } from "./project-list";
|
|
3
|
+
const version = "0.0.1";
|
|
4
|
+
function install(app) {
|
|
5
|
+
const components = [
|
|
6
|
+
Button,
|
|
7
|
+
ProjectList
|
|
8
|
+
];
|
|
9
|
+
components.forEach((item) => {
|
|
10
|
+
if (item.install) {
|
|
11
|
+
app.use(item);
|
|
12
|
+
} else if (item.name) {
|
|
13
|
+
app.component(item.name, item);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export * from "./button";
|
|
18
|
+
export * from "./project-list";
|
|
19
|
+
var stdin_default = {
|
|
20
|
+
install,
|
|
21
|
+
version
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
Button,
|
|
25
|
+
ProjectList,
|
|
26
|
+
stdin_default as default,
|
|
27
|
+
install,
|
|
28
|
+
version
|
|
29
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ProjectItem } from './types';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: () => ProjectItem | null;
|
|
6
|
+
default: () => null;
|
|
7
|
+
};
|
|
8
|
+
show: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
'onUpdate:modelValue': {
|
|
13
|
+
type: import("vue").PropType<(val: ProjectItem | null) => void>;
|
|
14
|
+
};
|
|
15
|
+
'onUpdate:show': {
|
|
16
|
+
type: import("vue").PropType<(val: boolean) => void>;
|
|
17
|
+
};
|
|
18
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:show" | "update:modelValue")[], "update:show" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: () => ProjectItem | null;
|
|
21
|
+
default: () => null;
|
|
22
|
+
};
|
|
23
|
+
show: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
'onUpdate:modelValue': {
|
|
28
|
+
type: import("vue").PropType<(val: ProjectItem | null) => void>;
|
|
29
|
+
};
|
|
30
|
+
'onUpdate:show': {
|
|
31
|
+
type: import("vue").PropType<(val: boolean) => void>;
|
|
32
|
+
};
|
|
33
|
+
}>> & Readonly<{
|
|
34
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
modelValue: ProjectItem | null;
|
|
38
|
+
show: boolean;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
|
2
|
+
import "./_atomic.css";
|
|
3
|
+
import { defineComponent, ref, computed } from "vue";
|
|
4
|
+
import { ActionSheet, Search, List } from "vant";
|
|
5
|
+
import { projectListProps } from "./types";
|
|
6
|
+
import { useApi } from "./useApi";
|
|
7
|
+
import "./index.css";
|
|
8
|
+
var stdin_default = defineComponent({
|
|
9
|
+
name: "ProjectList",
|
|
10
|
+
props: projectListProps,
|
|
11
|
+
emits: ["update:show", "update:modelValue"],
|
|
12
|
+
setup(props, {
|
|
13
|
+
emit
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
projectList,
|
|
17
|
+
getProjectList
|
|
18
|
+
} = useApi();
|
|
19
|
+
getProjectList();
|
|
20
|
+
const handleSelect = (item) => {
|
|
21
|
+
emit("update:modelValue", item);
|
|
22
|
+
emit("update:show", false);
|
|
23
|
+
};
|
|
24
|
+
const keyword = ref("");
|
|
25
|
+
const loading = ref(false);
|
|
26
|
+
const finished = ref(true);
|
|
27
|
+
const filteredProjectList = computed(() => {
|
|
28
|
+
return projectList.value.filter((item) => {
|
|
29
|
+
return item.name.toLowerCase().includes(keyword.value.toLowerCase());
|
|
30
|
+
}).slice(0, 150);
|
|
31
|
+
});
|
|
32
|
+
const onLoad = () => {
|
|
33
|
+
finished.value = true;
|
|
34
|
+
};
|
|
35
|
+
return () => _createVNode(ActionSheet, {
|
|
36
|
+
"show": props.show,
|
|
37
|
+
"onUpdate:show": (val) => emit("update:show", val),
|
|
38
|
+
"title": "\u9009\u62E9\u9879\u76EE"
|
|
39
|
+
}, {
|
|
40
|
+
default: () => [_createVNode("div", {
|
|
41
|
+
"class": "project-list"
|
|
42
|
+
}, [_createVNode(Search, {
|
|
43
|
+
"modelValue": keyword.value,
|
|
44
|
+
"onUpdate:modelValue": ($event) => keyword.value = $event,
|
|
45
|
+
"placeholder": "\u641C\u7D22\u9879\u76EE",
|
|
46
|
+
"class": "search-bar"
|
|
47
|
+
}, null), _createVNode(List, {
|
|
48
|
+
"loading": loading.value,
|
|
49
|
+
"finished": finished.value,
|
|
50
|
+
"finished-text": "\u6CA1\u6709\u66F4\u591A\u4E86",
|
|
51
|
+
"onLoad": onLoad
|
|
52
|
+
}, {
|
|
53
|
+
default: () => [filteredProjectList.value.map((item, index) => {
|
|
54
|
+
var _a;
|
|
55
|
+
return _createVNode("div", {
|
|
56
|
+
"key": index,
|
|
57
|
+
"class": `project-item ${((_a = props.modelValue) == null ? void 0 : _a.id) === item.id ? "selected" : ""}`,
|
|
58
|
+
"onClick": () => handleSelect(item)
|
|
59
|
+
}, [_createVNode("div", {
|
|
60
|
+
"class": "project-name"
|
|
61
|
+
}, [item.name])]);
|
|
62
|
+
})]
|
|
63
|
+
})])]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
stdin_default as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
.cgx-atm .flex {
|
|
3
|
+
align-items: initial;
|
|
4
|
+
flex-direction: initial;
|
|
5
|
+
justify-content: initial;
|
|
6
|
+
flex-wrap: initial;
|
|
7
|
+
}
|
|
8
|
+
.cgx-atm .flex-row {
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
}
|
|
11
|
+
.cgx-atm .flex-col {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
.cgx-atm .justify-center {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
.cgx-atm .justify-between {
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.cgx-atm .justify-around {
|
|
21
|
+
justify-content: space-around;
|
|
22
|
+
}
|
|
23
|
+
.cgx-atm .justify-end {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.cgx-atm .items-center {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
.cgx-atm .flex-wrap {
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.project-list{height:70vh;display:flex;flex-direction:column}.project-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.project-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.project-list .project-item{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer}.project-list .project-item.selected{color:var(--van-primary-color)}.project-list .project-item .project-name{font-size:14px}.project-list .project-item:last-child{border-bottom:none}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.project-list {
|
|
2
|
+
height: 70vh;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
|
|
6
|
+
.search-bar {
|
|
7
|
+
position: sticky;
|
|
8
|
+
top: 0;
|
|
9
|
+
z-index: 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.van-list {
|
|
13
|
+
flex: 1;
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
padding: 0 16px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.project-item {
|
|
19
|
+
padding: 12px 0;
|
|
20
|
+
border-bottom: 1px solid #eee;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
|
|
23
|
+
&.selected {
|
|
24
|
+
color: var(--van-primary-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.project-name {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:last-child {
|
|
32
|
+
border-bottom: none;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../index.less";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
export interface ProjectItem {
|
|
3
|
+
id: string | number;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const projectListProps: {
|
|
7
|
+
modelValue: {
|
|
8
|
+
type: () => ProjectItem | null;
|
|
9
|
+
default: () => null;
|
|
10
|
+
};
|
|
11
|
+
show: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
'onUpdate:modelValue': {
|
|
16
|
+
type: PropType<(val: ProjectItem | null) => void>;
|
|
17
|
+
};
|
|
18
|
+
'onUpdate:show': {
|
|
19
|
+
type: PropType<(val: boolean) => void>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type ProjectListProps = ExtractPropTypes<typeof projectListProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const projectListProps = {
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: Object,
|
|
4
|
+
default: () => null
|
|
5
|
+
},
|
|
6
|
+
show: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: false
|
|
9
|
+
},
|
|
10
|
+
"onUpdate:modelValue": {
|
|
11
|
+
type: Function
|
|
12
|
+
},
|
|
13
|
+
"onUpdate:show": {
|
|
14
|
+
type: Function
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
projectListProps
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ProjectItem } from './types';
|
|
2
|
+
export declare const useApi: () => {
|
|
3
|
+
projectList: import("vue").Ref<{
|
|
4
|
+
id: string | number;
|
|
5
|
+
name: string;
|
|
6
|
+
}[], ProjectItem[] | {
|
|
7
|
+
id: string | number;
|
|
8
|
+
name: string;
|
|
9
|
+
}[]>;
|
|
10
|
+
getProjectList: () => Promise<void>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { ref } from "vue";
|
|
22
|
+
import { useFetch } from "../utils/useFetch";
|
|
23
|
+
const useApi = () => {
|
|
24
|
+
const projectList = ref([]);
|
|
25
|
+
const getProjectList = () => __async(void 0, null, function* () {
|
|
26
|
+
const res = yield useFetch(
|
|
27
|
+
"https://vx.cgboiler.com/v1/note/projects",
|
|
28
|
+
{
|
|
29
|
+
method: "GET"
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
if (res == null ? void 0 : res.d) {
|
|
33
|
+
projectList.value = res.d.filter((item) => item.projectName).map((item) => {
|
|
34
|
+
return {
|
|
35
|
+
id: item.id,
|
|
36
|
+
name: item.projectName
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
projectList,
|
|
43
|
+
getProjectList
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
useApi
|
|
48
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
var __async = (__this, __arguments, generator) => {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
var fulfilled = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.next(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var rejected = (value) => {
|
|
42
|
+
try {
|
|
43
|
+
step(generator.throw(value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
49
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const useFetch = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (url, config = {}) {
|
|
53
|
+
const _a = config, { params } = _a, restConfig = __objRest(_a, ["params"]);
|
|
54
|
+
const queryString = params ? "?" + Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`).join("&") : "";
|
|
55
|
+
const finalUrl = url + queryString;
|
|
56
|
+
const userInfo = localStorage.getItem("userInfo");
|
|
57
|
+
const token = userInfo ? JSON.parse(userInfo).token : "";
|
|
58
|
+
const response = yield fetch(finalUrl, __spreadProps(__spreadValues({}, restConfig), {
|
|
59
|
+
headers: __spreadValues({
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
token: token || ""
|
|
62
|
+
}, restConfig.headers)
|
|
63
|
+
}));
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
66
|
+
}
|
|
67
|
+
const data = yield response.json();
|
|
68
|
+
return data;
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
useFetch
|
|
72
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'vue';
|
|
2
|
+
|
|
3
|
+
type EventHandler = (...args: any[]) => void;
|
|
4
|
+
|
|
5
|
+
declare module 'vue' {
|
|
6
|
+
interface ComponentCustomProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
tabindex?: number;
|
|
10
|
+
onClick?: EventHandler;
|
|
11
|
+
onTouchend?: EventHandler;
|
|
12
|
+
onTouchmove?: EventHandler;
|
|
13
|
+
onTouchstart?: EventHandler;
|
|
14
|
+
onTouchcancel?: EventHandler;
|
|
15
|
+
onTouchmovePassive?: EventHandler;
|
|
16
|
+
onTouchstartPassive?: EventHandler;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface HTMLAttributes {
|
|
20
|
+
onTouchmovePassive?: EventHandler;
|
|
21
|
+
onTouchstartPassive?: EventHandler;
|
|
22
|
+
onClickCapture?: EventHandler;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
}>> & Readonly<{
|
|
7
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
default: () => stdin_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_atomic = require("./_atomic.css");
|
|
25
|
+
var import_vue2 = require("vue");
|
|
26
|
+
var import_types = require("./types");
|
|
27
|
+
var import_element_plus = require("element-plus");
|
|
28
|
+
var import_index = require("./index.css");
|
|
29
|
+
var stdin_default = (0, import_vue2.defineComponent)({
|
|
30
|
+
name: "DemoButton",
|
|
31
|
+
props: import_types.buttonProps,
|
|
32
|
+
emits: ["click"],
|
|
33
|
+
setup(props, {
|
|
34
|
+
emit,
|
|
35
|
+
slots
|
|
36
|
+
}) {
|
|
37
|
+
return () => {
|
|
38
|
+
var _a;
|
|
39
|
+
return (0, import_vue.createVNode)("div", {
|
|
40
|
+
"class": "cg-atm"
|
|
41
|
+
}, [(0, import_vue.createVNode)("button", {
|
|
42
|
+
"class": "demo-button w-[120px] p-2"
|
|
43
|
+
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)]), (0, import_vue.createVNode)(import_element_plus.ElButton, {
|
|
44
|
+
"type": "primary"
|
|
45
|
+
}, {
|
|
46
|
+
default: () => [(0, import_vue.createTextVNode)("123")]
|
|
47
|
+
})]);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|