@cynnie/ui-antd 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 +35 -0
- package/dist/ProButton-CqnwsC_1.js +53 -0
- package/dist/ProButton-CqnwsC_1.js.map +1 -0
- package/dist/ProCheckboxGroup-Cgi80joE.js +48 -0
- package/dist/ProCheckboxGroup-Cgi80joE.js.map +1 -0
- package/dist/ProConfirmButton-BwTUXN3q.js +44 -0
- package/dist/ProConfirmButton-BwTUXN3q.js.map +1 -0
- package/dist/ProDescriptions-Bt7-Bj8s.js +46 -0
- package/dist/ProDescriptions-Bt7-Bj8s.js.map +1 -0
- package/dist/ProFormBuilder-C4qUATw1.js +1078 -0
- package/dist/ProFormBuilder-C4qUATw1.js.map +1 -0
- package/dist/ProInput-5zs6KNEY.js +40 -0
- package/dist/ProInput-5zs6KNEY.js.map +1 -0
- package/dist/ProModal-DJ5mCAGT.js +51 -0
- package/dist/ProModal-DJ5mCAGT.js.map +1 -0
- package/dist/ProRadioGroup-DQhMJA70.js +48 -0
- package/dist/ProRadioGroup-DQhMJA70.js.map +1 -0
- package/dist/ProSelect-9bs8QyA-.js +64 -0
- package/dist/ProSelect-9bs8QyA-.js.map +1 -0
- package/dist/ProTable-DW3gXtOc.js +165 -0
- package/dist/ProTable-DW3gXtOc.js.map +1 -0
- package/dist/components/ProButton/ProCountdownButton.vue.d.ts +28 -0
- package/dist/components/ProButton/index.js +2 -0
- package/dist/components/ProButton/index.vue.d.ts +25 -0
- package/dist/components/ProCheckboxGroup/index.js +2 -0
- package/dist/components/ProCheckboxGroup/index.vue.d.ts +31 -0
- package/dist/components/ProConfirmButton/index.js +2 -0
- package/dist/components/ProConfirmButton/index.vue.d.ts +25 -0
- package/dist/components/ProDescriptions/index.js +2 -0
- package/dist/components/ProDescriptions/index.vue.d.ts +36 -0
- package/dist/components/ProFormBuilder/index.js +2 -0
- package/dist/components/ProFormBuilder/index.vue.d.ts +54 -0
- package/dist/components/ProInput/index.js +2 -0
- package/dist/components/ProInput/index.vue.d.ts +28 -0
- package/dist/components/ProModal/index.js +2 -0
- package/dist/components/ProModal/index.vue.d.ts +30 -0
- package/dist/components/ProRadioGroup/index.js +2 -0
- package/dist/components/ProRadioGroup/index.vue.d.ts +31 -0
- package/dist/components/ProSelect/index.js +2 -0
- package/dist/components/ProSelect/index.vue.d.ts +33 -0
- package/dist/components/ProTable/index.js +2 -0
- package/dist/components/ProTable/index.vue.d.ts +41 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/dist/openDialog-Bc1V5It3.js +75 -0
- package/dist/openDialog-Bc1V5It3.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/openDialog.d.ts +18 -0
- package/dist/utils/openDialog.js +2 -0
- package/dist/utils/uiMessage.d.ts +9 -0
- package/package.json +96 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { computed, createBlock, createSlots, defineComponent, guardReactiveProps, mergeModels, mergeProps, normalizeProps, openBlock, renderList, renderSlot, resolveComponent, unref, useModel, withCtx } from "vue";
|
|
2
|
+
import { useOptions } from "@cynnie/ui-core";
|
|
3
|
+
var ProSelect_default = /* @__PURE__ */ defineComponent({
|
|
4
|
+
name: "ProSelect",
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: /* @__PURE__ */ mergeModels({
|
|
8
|
+
options: {},
|
|
9
|
+
labelField: {},
|
|
10
|
+
valueField: {},
|
|
11
|
+
deps: {},
|
|
12
|
+
multiple: { type: Boolean }
|
|
13
|
+
}, {
|
|
14
|
+
"modelValue": {},
|
|
15
|
+
"modelModifiers": {}
|
|
16
|
+
}),
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const model = useModel(__props, "modelValue");
|
|
21
|
+
const { options: innerOptions, isLoading } = useOptions({
|
|
22
|
+
options: computed(() => props.options),
|
|
23
|
+
deps: computed(() => props.deps)
|
|
24
|
+
});
|
|
25
|
+
function toOption(item) {
|
|
26
|
+
if (item && typeof item === "object" && "label" in item) return item;
|
|
27
|
+
return {
|
|
28
|
+
label: props.labelField ? item[props.labelField] : item,
|
|
29
|
+
value: props.valueField ? item[props.valueField] : item
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const selectProps = computed(() => {
|
|
33
|
+
const { options: _o, labelField: _l, valueField: _v, deps: _d, multiple, ...rest } = props;
|
|
34
|
+
return {
|
|
35
|
+
...rest,
|
|
36
|
+
mode: multiple ? "multiple" : rest.mode
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
const _component_a_select = resolveComponent("a-select");
|
|
41
|
+
return openBlock(), createBlock(_component_a_select, mergeProps({
|
|
42
|
+
..._ctx.$attrs,
|
|
43
|
+
...selectProps.value
|
|
44
|
+
}, {
|
|
45
|
+
value: model.value,
|
|
46
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
47
|
+
options: unref(innerOptions).map(toOption),
|
|
48
|
+
loading: unref(isLoading) || void 0
|
|
49
|
+
}), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
|
|
50
|
+
return {
|
|
51
|
+
name,
|
|
52
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))])
|
|
53
|
+
};
|
|
54
|
+
})]), 1040, [
|
|
55
|
+
"value",
|
|
56
|
+
"options",
|
|
57
|
+
"loading"
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export { ProSelect_default as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=ProSelect-9bs8QyA-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProSelect-9bs8QyA-.js","names":["$attrs","$slots"],"sources":["../src/components/ProSelect/index.vue","../src/components/ProSelect/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useOptions } from \"@cynnie/ui-core\";\n\ndefineOptions({\n name: \"ProSelect\",\n inheritAttrs: false,\n});\n\nconst props = defineProps<{\n /** 选项数据源:静态数组 / 字符串数组 / 返回数组的函数(远程字典) */\n options?: any;\n /** options 里 label / value 的字段名,元素不是 {label, value} 结构时用 */\n labelField?: string;\n valueField?: string;\n /** 远程字典的依赖值,变化时自动重新拉取 */\n deps?: any;\n /** 是否多选(跨库统一布尔写法,内部转成 a-select 的 mode=\"multiple\") */\n multiple?: boolean;\n}>();\n\nconst model = defineModel<any>();\n\nconst { options: innerOptions, isLoading } = useOptions({\n options: computed(() => props.options),\n deps: computed(() => props.deps),\n});\n\nfunction toOption(item: any) {\n if (item && typeof item === \"object\" && \"label\" in item) return item;\n return {\n label: props.labelField ? item[props.labelField] : item,\n value: props.valueField ? item[props.valueField] : item,\n };\n}\n\nconst selectProps = computed(() => {\n // 剥掉封装层自己的字段,剩余的允许直接透传给 a-select;\n // multiple 布尔写法归一化为 a-select 需要的 mode=\"multiple\"\n const { options: _o, labelField: _l, valueField: _v, deps: _d, multiple, ...rest } = props;\n return { ...rest, mode: multiple ? \"multiple\" : (rest as any).mode };\n});\n</script>\n\n<template>\n <a-select\n v-bind=\"{ ...$attrs, ...selectProps }\"\n v-model:value=\"model\"\n :options=\"innerOptions.map(toOption)\"\n :loading=\"isLoading || undefined\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\" :key=\"name\">\n <slot :name=\"name\" v-bind=\"slotProps\"></slot>\n </template>\n </a-select>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useOptions } from \"@cynnie/ui-core\";\n\ndefineOptions({\n name: \"ProSelect\",\n inheritAttrs: false,\n});\n\nconst props = defineProps<{\n /** 选项数据源:静态数组 / 字符串数组 / 返回数组的函数(远程字典) */\n options?: any;\n /** options 里 label / value 的字段名,元素不是 {label, value} 结构时用 */\n labelField?: string;\n valueField?: string;\n /** 远程字典的依赖值,变化时自动重新拉取 */\n deps?: any;\n /** 是否多选(跨库统一布尔写法,内部转成 a-select 的 mode=\"multiple\") */\n multiple?: boolean;\n}>();\n\nconst model = defineModel<any>();\n\nconst { options: innerOptions, isLoading } = useOptions({\n options: computed(() => props.options),\n deps: computed(() => props.deps),\n});\n\nfunction toOption(item: any) {\n if (item && typeof item === \"object\" && \"label\" in item) return item;\n return {\n label: props.labelField ? item[props.labelField] : item,\n value: props.valueField ? item[props.valueField] : item,\n };\n}\n\nconst selectProps = computed(() => {\n // 剥掉封装层自己的字段,剩余的允许直接透传给 a-select;\n // multiple 布尔写法归一化为 a-select 需要的 mode=\"multiple\"\n const { options: _o, labelField: _l, valueField: _v, deps: _d, multiple, ...rest } = props;\n return { ...rest, mode: multiple ? \"multiple\" : (rest as any).mode };\n});\n</script>\n\n<template>\n <a-select\n v-bind=\"{ ...$attrs, ...selectProps }\"\n v-model:value=\"model\"\n :options=\"innerOptions.map(toOption)\"\n :loading=\"isLoading || undefined\"\n >\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\" :key=\"name\">\n <slot :name=\"name\" v-bind=\"slotProps\"></slot>\n </template>\n </a-select>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;ECSA,MAAM,QAAQ;EAYd,MAAM,QAAQ,SAAgB,SAAA,aAAE;EAEhC,MAAM,EAAE,SAAS,cAAc,cAAc,WAAW;GACtD,SAAS,eAAe,MAAM,QAAQ;GACtC,MAAM,eAAe,MAAM,KAAK;GACjC,CAAC;EAEF,SAAS,SAAS,MAAW;AAC3B,OAAI,QAAQ,OAAO,SAAS,YAAY,WAAW,KAAM,QAAO;AAChE,UAAO;IACL,OAAO,MAAM,aAAa,KAAK,MAAM,cAAc;IACnD,OAAO,MAAM,aAAa,KAAK,MAAM,cAAc;IACpD;;EAGH,MAAM,cAAc,eAAe;GAGjC,MAAM,EAAE,SAAS,IAAI,YAAY,IAAI,YAAY,IAAI,MAAM,IAAI,UAAU,GAAG,SAAS;AACrF,UAAO;IAAE,GAAG;IAAM,MAAM,WAAW,aAAc,KAAa;IAAM;IACpE;;;uBAIA,YASW,qBATX,WASW;IAAA,GARIA,KAAAA;IAAM,GAAK,YAAA;IAAW,EAAA;IAC3B,OAAO,MAAA;kEAAK,QAAA;IACnB,SAAS,MAAA,aAAY,CAAC,IAAI,SAAQ;IAClC,SAAS,MAAA,UAAS,IAAI,KAAA;yCAEOC,KAAAA,SAAZ,GAAG,SAAI;;KAAc;kBAAQ,cAAS,CACtD,WAA6C,KAAA,QAAhC,MAAI,eAAA,mBAAU,UAAS,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { t as ProFormBuilder_default } from "./ProFormBuilder-C4qUATw1.js";
|
|
2
|
+
import { t as openDialog } from "./openDialog-Bc1V5It3.js";
|
|
3
|
+
import { createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, mergeModels, openBlock, ref, renderSlot, resolveComponent, shallowRef, useModel, useTemplateRef, withCtx } from "vue";
|
|
4
|
+
import { Modal, message } from "ant-design-vue";
|
|
5
|
+
var ProTableForm_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
name: "ProTableForm",
|
|
7
|
+
__name: "ProTableForm",
|
|
8
|
+
props: {
|
|
9
|
+
formItems: {},
|
|
10
|
+
rules: {},
|
|
11
|
+
formData: {},
|
|
12
|
+
requestApi: { type: Function }
|
|
13
|
+
},
|
|
14
|
+
setup(__props, { expose: __expose }) {
|
|
15
|
+
const props = __props;
|
|
16
|
+
const data = ref({ ...props.formData });
|
|
17
|
+
const formRef = useTemplateRef("formRef");
|
|
18
|
+
__expose({ async submit() {
|
|
19
|
+
await formRef.value.validate();
|
|
20
|
+
return props.requestApi({ ...data.value });
|
|
21
|
+
} });
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createBlock(ProFormBuilder_default, {
|
|
24
|
+
ref_key: "formRef",
|
|
25
|
+
ref: formRef,
|
|
26
|
+
modelValue: data.value,
|
|
27
|
+
"form-items": _ctx.formItems,
|
|
28
|
+
rules: _ctx.rules
|
|
29
|
+
}, null, 8, [
|
|
30
|
+
"modelValue",
|
|
31
|
+
"form-items",
|
|
32
|
+
"rules"
|
|
33
|
+
]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var ProTable_default = /* @__PURE__ */ defineComponent({
|
|
38
|
+
name: "ProTable",
|
|
39
|
+
__name: "index",
|
|
40
|
+
props: /* @__PURE__ */ mergeModels({
|
|
41
|
+
apis: {},
|
|
42
|
+
rowKey: {},
|
|
43
|
+
beforeCreate: { type: Function },
|
|
44
|
+
columns: {},
|
|
45
|
+
formItems: {},
|
|
46
|
+
rules: {}
|
|
47
|
+
}, {
|
|
48
|
+
"queryParams": { default: () => ({}) },
|
|
49
|
+
"queryParamsModifiers": {}
|
|
50
|
+
}),
|
|
51
|
+
emits: ["update:queryParams"],
|
|
52
|
+
setup(__props, { expose: __expose }) {
|
|
53
|
+
const props = __props;
|
|
54
|
+
const key = props.rowKey || "id";
|
|
55
|
+
const queryParams = useModel(__props, "queryParams");
|
|
56
|
+
const { get, create, update, remove } = props.apis;
|
|
57
|
+
const dataSource = ref([]);
|
|
58
|
+
const isLoading = ref(false);
|
|
59
|
+
function loadData() {
|
|
60
|
+
isLoading.value = true;
|
|
61
|
+
get(queryParams.value).then((res) => {
|
|
62
|
+
dataSource.value = res.data;
|
|
63
|
+
}).finally(() => {
|
|
64
|
+
isLoading.value = false;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const selectedRowKeys = ref([]);
|
|
68
|
+
const selectedRow = shallowRef();
|
|
69
|
+
function onSelectChange(keys, rows) {
|
|
70
|
+
selectedRowKeys.value = keys;
|
|
71
|
+
selectedRow.value = rows[0];
|
|
72
|
+
}
|
|
73
|
+
loadData();
|
|
74
|
+
function openForm(data) {
|
|
75
|
+
openDialog(ProTableForm_default, {
|
|
76
|
+
requestApi: data[key] ? update : create,
|
|
77
|
+
formItems: props.formItems,
|
|
78
|
+
rules: props.rules,
|
|
79
|
+
formData: data
|
|
80
|
+
}, {
|
|
81
|
+
title: data[key] ? "修改" : "新增",
|
|
82
|
+
onOk: () => {
|
|
83
|
+
loadData();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async function handleCreate() {
|
|
88
|
+
openForm({});
|
|
89
|
+
}
|
|
90
|
+
function handleUpdate() {
|
|
91
|
+
openForm(selectedRow.value);
|
|
92
|
+
}
|
|
93
|
+
function handleRemove() {
|
|
94
|
+
Modal.confirm({
|
|
95
|
+
title: "确定删除吗?",
|
|
96
|
+
onOk: () => {
|
|
97
|
+
remove(selectedRowKeys.value).then(loadData).catch(() => {
|
|
98
|
+
message.error("删除失败");
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
__expose({ refresh: loadData });
|
|
104
|
+
return (_ctx, _cache) => {
|
|
105
|
+
const _component_a_button = resolveComponent("a-button");
|
|
106
|
+
const _component_a_input_search = resolveComponent("a-input-search");
|
|
107
|
+
const _component_a_space = resolveComponent("a-space");
|
|
108
|
+
const _component_a_table = resolveComponent("a-table");
|
|
109
|
+
return openBlock(), createElementBlock("div", null, [createVNode(_component_a_space, { style: { "margin-bottom": "20px" } }, {
|
|
110
|
+
default: withCtx(() => [
|
|
111
|
+
createVNode(_component_a_button, {
|
|
112
|
+
type: "primary",
|
|
113
|
+
onClick: handleCreate
|
|
114
|
+
}, {
|
|
115
|
+
default: withCtx(() => _cache[1] || (_cache[1] = [createTextVNode("新增")])),
|
|
116
|
+
_: 1,
|
|
117
|
+
__: [1]
|
|
118
|
+
}),
|
|
119
|
+
createVNode(_component_a_button, {
|
|
120
|
+
type: "primary",
|
|
121
|
+
onClick: handleUpdate
|
|
122
|
+
}, {
|
|
123
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [createTextVNode("修改")])),
|
|
124
|
+
_: 1,
|
|
125
|
+
__: [2]
|
|
126
|
+
}),
|
|
127
|
+
createVNode(_component_a_button, {
|
|
128
|
+
type: "primary",
|
|
129
|
+
danger: "",
|
|
130
|
+
disabled: !selectedRowKeys.value.length,
|
|
131
|
+
onClick: handleRemove
|
|
132
|
+
}, {
|
|
133
|
+
default: withCtx(() => _cache[3] || (_cache[3] = [createTextVNode("删除")])),
|
|
134
|
+
_: 1,
|
|
135
|
+
__: [3]
|
|
136
|
+
}, 8, ["disabled"]),
|
|
137
|
+
renderSlot(_ctx.$slots, "search"),
|
|
138
|
+
createVNode(_component_a_input_search, {
|
|
139
|
+
value: queryParams.value.keyword,
|
|
140
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => queryParams.value.keyword = $event),
|
|
141
|
+
onSearch: loadData
|
|
142
|
+
}, null, 8, ["value"])
|
|
143
|
+
]),
|
|
144
|
+
_: 3
|
|
145
|
+
}), createVNode(_component_a_table, {
|
|
146
|
+
loading: isLoading.value,
|
|
147
|
+
"row-key": "id",
|
|
148
|
+
dataSource: dataSource.value,
|
|
149
|
+
columns: _ctx.columns,
|
|
150
|
+
"row-selection": {
|
|
151
|
+
selectedRowKeys: selectedRowKeys.value,
|
|
152
|
+
onChange: onSelectChange
|
|
153
|
+
}
|
|
154
|
+
}, null, 8, [
|
|
155
|
+
"loading",
|
|
156
|
+
"dataSource",
|
|
157
|
+
"columns",
|
|
158
|
+
"row-selection"
|
|
159
|
+
])]);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
export { ProTableForm_default as n, ProTable_default as t };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=ProTable-DW3gXtOc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProTable-DW3gXtOc.js","names":["formItems","rules","columns"],"sources":["../src/components/ProTable/ProTableForm.vue","../src/components/ProTable/ProTableForm.vue","../src/components/ProTable/index.vue","../src/components/ProTable/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref, useTemplateRef } from \"vue\";\nimport ProFormBuilder from \"../ProFormBuilder/index.vue\";\nimport type { FormInstance } from \"ant-design-vue\";\ndefineOptions({\n name: \"ProTableForm\",\n});\n\nconst props = defineProps<{\n formItems: any[];\n rules?: any;\n formData: Record<string, any>;\n requestApi: (data: Record<string, any>) => Promise<any>;\n}>();\n\nconst data = ref<Record<string, any>>({ ...props.formData });\nconst formRef = useTemplateRef<FormInstance>(\"formRef\");\n\ndefineExpose({\n async submit() {\n await formRef.value.validate();\n return props.requestApi({\n ...data.value,\n });\n },\n});\n</script>\n\n<template>\n <ProFormBuilder ref=\"formRef\" :modelValue=\"data\" :form-items=\"formItems\" :rules=\"rules\" />\n</template>\n","<script setup lang=\"ts\">\nimport { ref, useTemplateRef } from \"vue\";\nimport ProFormBuilder from \"../ProFormBuilder/index.vue\";\nimport type { FormInstance } from \"ant-design-vue\";\ndefineOptions({\n name: \"ProTableForm\",\n});\n\nconst props = defineProps<{\n formItems: any[];\n rules?: any;\n formData: Record<string, any>;\n requestApi: (data: Record<string, any>) => Promise<any>;\n}>();\n\nconst data = ref<Record<string, any>>({ ...props.formData });\nconst formRef = useTemplateRef<FormInstance>(\"formRef\");\n\ndefineExpose({\n async submit() {\n await formRef.value.validate();\n return props.requestApi({\n ...data.value,\n });\n },\n});\n</script>\n\n<template>\n <ProFormBuilder ref=\"formRef\" :modelValue=\"data\" :form-items=\"formItems\" :rules=\"rules\" />\n</template>\n","<script setup lang=\"ts\">\nimport { ref, shallowRef } from \"vue\";\nimport { openDialog } from \"../../utils/openDialog\";\nimport ProTableForm from \"./ProTableForm.vue\";\nimport { message, Modal } from \"ant-design-vue\";\n\ndefineOptions({\n name: \"ProTable\",\n});\n\ntype PromiseFn = (...args: any[]) => Promise<any>;\n\nconst props = defineProps<{\n apis: {\n get: PromiseFn;\n create: PromiseFn;\n update: PromiseFn;\n remove: PromiseFn;\n };\n rowKey?: string;\n beforeCreate?: () => Promise<Record<string, any>>;\n columns: any[];\n formItems: any[];\n rules?: any;\n}>();\n\nconst key = props.rowKey || \"id\";\n\nconst queryParams = defineModel<any>(\"queryParams\", { default: () => ({}) });\n\nconst { get, create, update, remove } = props.apis;\nconst dataSource = ref<any[]>([]);\nconst isLoading = ref(false);\nfunction loadData() {\n isLoading.value = true;\n get(queryParams.value)\n .then((res) => {\n dataSource.value = res.data;\n })\n .finally(() => {\n isLoading.value = false;\n });\n}\n\nconst selectedRowKeys = ref<any[]>([]);\n\nconst selectedRow = shallowRef<Record<string, any>>();\nfunction onSelectChange(keys: any[], rows: any[]) {\n selectedRowKeys.value = keys;\n selectedRow.value = rows[0];\n}\n\nloadData();\n\nfunction openForm(data: Record<string, any>) {\n openDialog(\n ProTableForm,\n {\n requestApi: data[key] ? update : create,\n formItems: props.formItems,\n rules: props.rules,\n formData: data,\n },\n {\n title: data[key] ? \"修改\" : \"新增\",\n onOk: () => {\n loadData();\n },\n },\n );\n}\n\nasync function handleCreate() {\n openForm({});\n}\nfunction handleUpdate() {\n openForm(selectedRow.value);\n}\nfunction handleRemove() {\n Modal.confirm({\n title: \"确定删除吗?\",\n onOk: () => {\n remove(selectedRowKeys.value)\n .then(loadData)\n .catch(() => {\n message.error(\"删除失败\");\n });\n },\n });\n}\n\ndefineExpose({\n refresh: loadData,\n});\n</script>\n\n<template>\n <div>\n <a-space style=\"margin-bottom: 20px\">\n <a-button type=\"primary\" @click=\"handleCreate\">新增</a-button>\n <a-button type=\"primary\" @click=\"handleUpdate\">修改</a-button>\n <a-button type=\"primary\" danger :disabled=\"!selectedRowKeys.length\" @click=\"handleRemove\"\n >删除</a-button\n >\n <slot name=\"search\"></slot>\n <a-input-search v-model:value=\"queryParams.keyword\" @search=\"loadData\"></a-input-search>\n </a-space>\n\n <a-table\n :loading=\"isLoading\"\n row-key=\"id\"\n :dataSource=\"dataSource\"\n :columns=\"columns\"\n :row-selection=\"{\n selectedRowKeys: selectedRowKeys,\n onChange: onSelectChange,\n }\"\n >\n </a-table>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { ref, shallowRef } from \"vue\";\nimport { openDialog } from \"../../utils/openDialog\";\nimport ProTableForm from \"./ProTableForm.vue\";\nimport { message, Modal } from \"ant-design-vue\";\n\ndefineOptions({\n name: \"ProTable\",\n});\n\ntype PromiseFn = (...args: any[]) => Promise<any>;\n\nconst props = defineProps<{\n apis: {\n get: PromiseFn;\n create: PromiseFn;\n update: PromiseFn;\n remove: PromiseFn;\n };\n rowKey?: string;\n beforeCreate?: () => Promise<Record<string, any>>;\n columns: any[];\n formItems: any[];\n rules?: any;\n}>();\n\nconst key = props.rowKey || \"id\";\n\nconst queryParams = defineModel<any>(\"queryParams\", { default: () => ({}) });\n\nconst { get, create, update, remove } = props.apis;\nconst dataSource = ref<any[]>([]);\nconst isLoading = ref(false);\nfunction loadData() {\n isLoading.value = true;\n get(queryParams.value)\n .then((res) => {\n dataSource.value = res.data;\n })\n .finally(() => {\n isLoading.value = false;\n });\n}\n\nconst selectedRowKeys = ref<any[]>([]);\n\nconst selectedRow = shallowRef<Record<string, any>>();\nfunction onSelectChange(keys: any[], rows: any[]) {\n selectedRowKeys.value = keys;\n selectedRow.value = rows[0];\n}\n\nloadData();\n\nfunction openForm(data: Record<string, any>) {\n openDialog(\n ProTableForm,\n {\n requestApi: data[key] ? update : create,\n formItems: props.formItems,\n rules: props.rules,\n formData: data,\n },\n {\n title: data[key] ? \"修改\" : \"新增\",\n onOk: () => {\n loadData();\n },\n },\n );\n}\n\nasync function handleCreate() {\n openForm({});\n}\nfunction handleUpdate() {\n openForm(selectedRow.value);\n}\nfunction handleRemove() {\n Modal.confirm({\n title: \"确定删除吗?\",\n onOk: () => {\n remove(selectedRowKeys.value)\n .then(loadData)\n .catch(() => {\n message.error(\"删除失败\");\n });\n },\n });\n}\n\ndefineExpose({\n refresh: loadData,\n});\n</script>\n\n<template>\n <div>\n <a-space style=\"margin-bottom: 20px\">\n <a-button type=\"primary\" @click=\"handleCreate\">新增</a-button>\n <a-button type=\"primary\" @click=\"handleUpdate\">修改</a-button>\n <a-button type=\"primary\" danger :disabled=\"!selectedRowKeys.length\" @click=\"handleRemove\"\n >删除</a-button\n >\n <slot name=\"search\"></slot>\n <a-input-search v-model:value=\"queryParams.keyword\" @search=\"loadData\"></a-input-search>\n </a-space>\n\n <a-table\n :loading=\"isLoading\"\n row-key=\"id\"\n :dataSource=\"dataSource\"\n :columns=\"columns\"\n :row-selection=\"{\n selectedRowKeys: selectedRowKeys,\n onChange: onSelectChange,\n }\"\n >\n </a-table>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;ECQA,MAAM,QAAQ;EAOd,MAAM,OAAO,IAAyB,EAAE,GAAG,MAAM,UAAU,CAAC;EAC5D,MAAM,UAAU,eAA6B,UAAU;AAEvD,WAAa,EACX,MAAM,SAAS;AACb,SAAM,QAAQ,MAAM,UAAU;AAC9B,UAAO,MAAM,WAAW,EACtB,GAAG,KAAK,OACT,CAAC;KAEL,CAAC;;uBAIA,YAA0F,wBAAA;aAAtE;IAAJ,KAAI;IAAW,YAAY,KAAA;IAAO,cAAYA,KAAAA;IAAY,OAAOC,KAAAA;;;;;;;;;;;;;;;;;;;;;;;;;EEjBnF,MAAM,QAAQ;EAcd,MAAM,MAAM,MAAM,UAAU;EAE5B,MAAM,cAAc,SAAgB,SAAC,cAAuC;EAE5E,MAAM,EAAE,KAAK,QAAQ,QAAQ,WAAW,MAAM;EAC9C,MAAM,aAAa,IAAW,EAAE,CAAC;EACjC,MAAM,YAAY,IAAI,MAAM;EAC5B,SAAS,WAAW;AAClB,aAAU,QAAQ;AAClB,OAAI,YAAY,MAAK,CAClB,MAAM,QAAQ;AACb,eAAW,QAAQ,IAAI;KACxB,CACA,cAAc;AACb,cAAU,QAAQ;KAClB;;EAGN,MAAM,kBAAkB,IAAW,EAAE,CAAC;EAEtC,MAAM,cAAc,YAAiC;EACrD,SAAS,eAAe,MAAa,MAAa;AAChD,mBAAgB,QAAQ;AACxB,eAAY,QAAQ,KAAK;;AAG3B,YAAU;EAEV,SAAS,SAAS,MAA2B;AAC3C,cACE,sBACA;IACE,YAAY,KAAK,OAAO,SAAS;IACjC,WAAW,MAAM;IACjB,OAAO,MAAM;IACb,UAAU;IACX,EACD;IACE,OAAO,KAAK,OAAO,OAAO;IAC1B,YAAY;AACV,eAAU;;IAEb,CACF;;EAGH,eAAe,eAAe;AAC5B,YAAS,EAAE,CAAC;;EAEd,SAAS,eAAe;AACtB,YAAS,YAAY,MAAM;;EAE7B,SAAS,eAAe;AACtB,SAAM,QAAQ;IACZ,OAAO;IACP,YAAY;AACV,YAAO,gBAAgB,MAAK,CACzB,KAAK,SAAQ,CACb,YAAY;AACX,cAAQ,MAAM,OAAO;OACrB;;IAEP,CAAC;;AAGJ,WAAa,EACX,SAAS,UACV,CAAC;;;;;;uBAIA,mBAsBM,OAAA,MAAA,CArBJ,YAQU,oBAAA,EARD,OAAA,EAAA,iBAAA,QAA2B,EAAA,EAAA;2BAC0B;KAA5D,YAA4D,qBAAA;MAAlD,MAAK;MAAW,SAAO;;6BAAgB,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAF,KAAE,CAAA,EAAA;;;;KACjD,YAA4D,qBAAA;MAAlD,MAAK;MAAW,SAAO;;6BAAgB,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAF,KAAE,CAAA,EAAA;;;;KACjD,YAEC,qBAAA;MAFS,MAAK;MAAU,QAAA;MAAQ,UAAQ,CAAG,gBAAA,MAAgB;MAAS,SAAO;;6BACvE,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAF,KAAE,CAAA,EAAA;;;;KAEL,WAA2B,KAAA,QAAA,SAAA;KAC3B,YAAwF,2BAAA;MAAhE,OAAO,YAAA,MAAY;0EAAZ,MAAY,UAAO;MAAG,UAAQ;;;;OAG/D,YAUU,oBAAA;IATP,SAAS,UAAA;IACV,WAAQ;IACP,YAAY,WAAA;IACZ,SAASC,KAAAA;IACT,iBAAa;sBAA6B,gBAAA;eAAmC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 倒计时秒数 */
|
|
3
|
+
seconds?: number;
|
|
4
|
+
/** 倒计时期间按钮文案,{} 会替换为剩余秒数 */
|
|
5
|
+
countingText?: string;
|
|
6
|
+
/** 点击处理函数:返回 Promise 且 resolve 后才开始倒计时(适合发验证码接口) */
|
|
7
|
+
onClick?: (...args: any[]) => any;
|
|
8
|
+
};
|
|
9
|
+
declare function __VLS_template(): {
|
|
10
|
+
attrs: Partial<{}>;
|
|
11
|
+
slots: {
|
|
12
|
+
default?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {};
|
|
15
|
+
rootEl: any;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
19
|
+
seconds: number;
|
|
20
|
+
countingText: string;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 点击后 delay 毫秒内再次点击不生效(防抖) */
|
|
3
|
+
debounce?: number;
|
|
4
|
+
/** 点击处理函数:返回 Promise 时按钮自动进入 loading 直到结束 */
|
|
5
|
+
onClick?: (...args: any[]) => any;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
debounce: number;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 选项数据源:静态数组 / 字符串数组 / 返回数组的函数(远程字典) */
|
|
3
|
+
options?: any;
|
|
4
|
+
/** options 里 label / value 的字段名 */
|
|
5
|
+
labelField?: string;
|
|
6
|
+
valueField?: string;
|
|
7
|
+
/** 远程字典的依赖值,变化时自动重新拉取 */
|
|
8
|
+
deps?: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = {
|
|
11
|
+
modelValue?: any[];
|
|
12
|
+
} & __VLS_Props;
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: any;
|
|
16
|
+
refs: {};
|
|
17
|
+
rootEl: any;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: any[]) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: (value: any[]) => any;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 气泡确认框标题 */
|
|
3
|
+
title?: string;
|
|
4
|
+
/** 确认执行函数:返回 Promise 时确认按钮自动进入 loading */
|
|
5
|
+
onConfirm?: () => Promise<any> | any;
|
|
6
|
+
};
|
|
7
|
+
declare function __VLS_template(): {
|
|
8
|
+
attrs: Partial<{}>;
|
|
9
|
+
slots: {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
refs: {};
|
|
13
|
+
rootEl: any;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
title: string;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface DescriptionItem {
|
|
2
|
+
/** 标签 */
|
|
3
|
+
label: string;
|
|
4
|
+
/** 字段名 */
|
|
5
|
+
key: string;
|
|
6
|
+
/** 自定义渲染,返回字符串或 vnode */
|
|
7
|
+
render?: (value: any, record: Record<string, any>) => any;
|
|
8
|
+
}
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
/** 描述项配置 */
|
|
11
|
+
items: DescriptionItem[];
|
|
12
|
+
/** 数据对象 */
|
|
13
|
+
data: Record<string, any>;
|
|
14
|
+
/** 空值占位符 */
|
|
15
|
+
emptyText?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function __VLS_template(): {
|
|
18
|
+
attrs: Partial<{}>;
|
|
19
|
+
slots: {
|
|
20
|
+
value?(_: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: any;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: any;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
interface FormItem extends Record<string, any> {
|
|
3
|
+
label?: string;
|
|
4
|
+
key: string;
|
|
5
|
+
/** 内置类型:input / textarea / number / date / select / checkbox / modal;也可直接传组件 */
|
|
6
|
+
type?: string | Component;
|
|
7
|
+
/** 隐藏该项(配合 computed 可做联动显隐) */
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
/** 栅格数(24 分制),不传用组件的 span */
|
|
10
|
+
span?: number;
|
|
11
|
+
/** 直接透传给渲染组件的 props(设置后其余顶层字段不再透传) */
|
|
12
|
+
props?: Record<string, any>;
|
|
13
|
+
/** 配置式插槽:{ 默认插槽名或函数 },传给渲染的组件 */
|
|
14
|
+
slots?: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
type __VLS_Props = {
|
|
17
|
+
formItems: FormItem[];
|
|
18
|
+
rules?: Record<string, any>;
|
|
19
|
+
/** 全局栅格数,单项可用 item.span 覆盖 */
|
|
20
|
+
span?: number;
|
|
21
|
+
/** 透传给 a-form 的其他配置(layout / labelCol / labelWidth 等) */
|
|
22
|
+
formConfig?: Record<string, any>;
|
|
23
|
+
};
|
|
24
|
+
declare function validate(): Promise<{
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>;
|
|
27
|
+
type __VLS_PublicProps = {
|
|
28
|
+
modelValue?: Record<string, any>;
|
|
29
|
+
} & __VLS_Props;
|
|
30
|
+
declare function __VLS_template(): {
|
|
31
|
+
attrs: Partial<{}>;
|
|
32
|
+
slots: Partial<Record<string, (_: {}) => any>>;
|
|
33
|
+
refs: {
|
|
34
|
+
formRef: unknown;
|
|
35
|
+
};
|
|
36
|
+
rootEl: any;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
40
|
+
validate: typeof validate;
|
|
41
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
42
|
+
"update:modelValue": (value: Record<string, any>) => any;
|
|
43
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
44
|
+
"onUpdate:modelValue"?: (value: Record<string, any>) => any;
|
|
45
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
46
|
+
formRef: unknown;
|
|
47
|
+
}, any>;
|
|
48
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
49
|
+
export default _default;
|
|
50
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
51
|
+
new (): {
|
|
52
|
+
$slots: S;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 输入停止 delay 毫秒后才同步 v-model(防抖) */
|
|
3
|
+
debounce?: number;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
modelValue?: any;
|
|
7
|
+
} & __VLS_Props;
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: any;
|
|
11
|
+
refs: {};
|
|
12
|
+
rootEl: any;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: any) => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
19
|
+
}>, {
|
|
20
|
+
debounce: number;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 点确定时先执行:返回 false 或 reject 则不关闭(适合放校验/保存逻辑) */
|
|
3
|
+
beforeOk?: () => Promise<any> | any;
|
|
4
|
+
};
|
|
5
|
+
type __VLS_PublicProps = {
|
|
6
|
+
"open"?: boolean;
|
|
7
|
+
} & __VLS_Props;
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: {
|
|
11
|
+
default?(_: {}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
ok: (...args: any[]) => void;
|
|
19
|
+
"update:open": (value: boolean) => void;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
onOk?: (...args: any[]) => any;
|
|
22
|
+
"onUpdate:open"?: (value: boolean) => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 选项数据源:静态数组 / 字符串数组 / 返回数组的函数(远程字典) */
|
|
3
|
+
options?: any;
|
|
4
|
+
/** options 里 label / value 的字段名 */
|
|
5
|
+
labelField?: string;
|
|
6
|
+
valueField?: string;
|
|
7
|
+
/** 远程字典的依赖值,变化时自动重新拉取 */
|
|
8
|
+
deps?: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = {
|
|
11
|
+
modelValue?: any;
|
|
12
|
+
} & __VLS_Props;
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: any;
|
|
16
|
+
refs: {};
|
|
17
|
+
rootEl: any;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: any) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
23
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** 选项数据源:静态数组 / 字符串数组 / 返回数组的函数(远程字典) */
|
|
3
|
+
options?: any;
|
|
4
|
+
/** options 里 label / value 的字段名,元素不是 {label, value} 结构时用 */
|
|
5
|
+
labelField?: string;
|
|
6
|
+
valueField?: string;
|
|
7
|
+
/** 远程字典的依赖值,变化时自动重新拉取 */
|
|
8
|
+
deps?: any;
|
|
9
|
+
/** 是否多选(跨库统一布尔写法,内部转成 a-select 的 mode="multiple") */
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = {
|
|
13
|
+
modelValue?: any;
|
|
14
|
+
} & __VLS_Props;
|
|
15
|
+
declare function __VLS_template(): {
|
|
16
|
+
attrs: Partial<{}>;
|
|
17
|
+
slots: any;
|
|
18
|
+
refs: {};
|
|
19
|
+
rootEl: any;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
"update:modelValue": (value: any) => any;
|
|
24
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: (value: any) => any;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|