@dazhicheng/ui 1.5.199 → 1.5.201
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/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/api/dataTypeContext.js +17 -0
- package/dist/assets/img/empty_images/no_data.png.js +4 -0
- package/dist/assets/img/empty_images/search.png.js +4 -0
- package/dist/assets/img/image_status/develop.png.js +4 -0
- package/dist/assets/img/image_status/loading.gif.js +4 -0
- package/dist/assets/img/image_status/loading_fail.png.js +4 -0
- package/dist/assets/img/image_status/no_network.png.js +4 -0
- package/dist/assets/img/image_status/no_permission.png.js +4 -0
- package/dist/assets/svg/action_more.svg.js +4 -0
- package/dist/assets/svg/close.svg.js +4 -0
- package/dist/assets/svg/item_error.svg.js +4 -0
- package/dist/assets/svg/paixu-jiangxu.svg.js +4 -0
- package/dist/assets/svg/paixu-moren.svg.js +4 -0
- package/dist/assets/svg/paixu-shengxu.svg.js +4 -0
- package/dist/assets/svg/quanping.svg.js +4 -0
- package/dist/assets/svg/suoxiao.svg.js +4 -0
- package/dist/components/tt-api-component/index.js +7 -0
- package/dist/components/tt-api-component/index.vue.js +7 -0
- package/dist/components/tt-api-component/index.vue2.js +199 -0
- package/dist/components/tt-area/TtArea.vue.js +7 -0
- package/dist/components/tt-area/TtArea.vue2.js +36 -0
- package/dist/components/tt-button/components/AddButton.vue.js +24 -0
- package/dist/components/tt-button/components/AddButton.vue2.js +4 -0
- package/dist/components/tt-button/index.js +9 -0
- package/dist/components/tt-button/index.vue.js +7 -0
- package/dist/components/tt-button/index.vue2.js +68 -0
- package/dist/components/tt-checkbox/index.js +7 -0
- package/dist/components/tt-checkbox/index.vue.js +77 -0
- package/dist/components/tt-checkbox/index.vue2.js +4 -0
- package/dist/components/tt-drawer/index.js +14 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue.js +156 -0
- package/dist/components/tt-drawer/src/RenderDrawer.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue.js +56 -0
- package/dist/components/tt-drawer/src/components/DrawerFooter.vue3.js +5 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue.js +7 -0
- package/dist/components/tt-drawer/src/components/DrawerHeader.vue2.js +21 -0
- package/dist/components/tt-drawer/src/hooks/useDrawerRender.js +124 -0
- package/dist/components/tt-drawer/src/hooks/useResizable.js +98 -0
- package/dist/components/tt-drawer/src/index.js +17 -0
- package/dist/components/tt-drawer/src/props.js +72 -0
- package/dist/components/tt-drawer/src/utils/drawer-api.js +191 -0
- package/dist/components/tt-empty/index.js +34 -0
- package/dist/components/tt-form/index.js +65 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue2.js +38 -0
- package/dist/components/tt-form/src/components/ExpandableArrow.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormActions.vue2.js +177 -0
- package/dist/components/tt-form/src/components/FormActions.vue3.js +5 -0
- package/dist/components/tt-form/src/components/FormElInput.vue.js +80 -0
- package/dist/components/tt-form/src/components/FormElInput.vue2.js +4 -0
- package/dist/components/tt-form/src/components/Slot.js +28 -0
- package/dist/components/tt-form/src/config.js +57 -0
- package/dist/components/tt-form/src/form/FormControl.vue.js +16 -0
- package/dist/components/tt-form/src/form/FormControl.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormDescription.vue.js +21 -0
- package/dist/components/tt-form/src/form/FormDescription.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormItem.vue.js +20 -0
- package/dist/components/tt-form/src/form/FormItem.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormLabel.vue.js +19 -0
- package/dist/components/tt-form/src/form/FormLabel.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessage.vue.js +18 -0
- package/dist/components/tt-form/src/form/FormMessage.vue2.js +4 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue.js +30 -0
- package/dist/components/tt-form/src/form/FormMessageToolTip.vue2.js +4 -0
- package/dist/components/tt-form/src/form/RenderContent.vue.js +31 -0
- package/dist/components/tt-form/src/form/RenderContent.vue2.js +4 -0
- package/dist/components/tt-form/src/form/injectionKeys.js +4 -0
- package/dist/components/tt-form/src/form/useFormField.js +24 -0
- package/dist/components/tt-form/src/form-render/FormField.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormField.vue2.js +346 -0
- package/dist/components/tt-form/src/form-render/FormFieldContact.js +54 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue.js +4 -0
- package/dist/components/tt-form/src/form-render/FormLabel.vue2.js +102 -0
- package/dist/components/tt-form/src/form-render/array-register/FormArrayRegister.js +195 -0
- package/dist/components/tt-form/src/form-render/array-register/props.js +47 -0
- package/dist/components/tt-form/src/form-render/array-register/utils.js +12 -0
- package/dist/components/tt-form/src/form-render/context.js +15 -0
- package/dist/components/tt-form/src/form-render/dependencies.js +51 -0
- package/dist/components/tt-form/src/form-render/expandable.js +46 -0
- package/dist/components/tt-form/src/form-render/form.vue2.js +197 -0
- package/dist/components/tt-form/src/form-render/form.vue3.js +5 -0
- package/dist/components/tt-form/src/form-render/helper.js +22 -0
- package/dist/components/tt-form/src/form-render/rootWrapperClass.js +10 -0
- package/dist/components/tt-form/src/formApi.js +790 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue2.js +223 -0
- package/dist/components/tt-form/src/group-form/GroupForm.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue2.js +278 -0
- package/dist/components/tt-form/src/group-form/GroupSection.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue.js +153 -0
- package/dist/components/tt-form/src/group-form/LazyFormField.vue3.js +5 -0
- package/dist/components/tt-form/src/group-form/groupFormApi.js +700 -0
- package/dist/components/tt-form/src/group-form/lazyContext.js +38 -0
- package/dist/components/tt-form/src/group-form/useGroupForm.js +83 -0
- package/dist/components/tt-form/src/group-form/utils.js +106 -0
- package/dist/components/tt-form/src/hooks/useArrayRegistry.js +22 -0
- package/dist/components/tt-form/src/hooks/useFieldArray.js +137 -0
- package/dist/components/tt-form/src/hooks/useForwardPriorityValues.js +33 -0
- package/dist/components/tt-form/src/hooks/useSelectCollapse.js +81 -0
- package/dist/components/tt-form/src/index.vue2.js +149 -0
- package/dist/components/tt-form/src/index.vue3.js +5 -0
- package/dist/components/tt-form/src/shared/createContext.js +14 -0
- package/dist/components/tt-form/src/shared/global-state.js +22 -0
- package/dist/components/tt-form/src/shared/zod-defaults.js +47 -0
- package/dist/components/tt-form/src/types/forms.js +6 -0
- package/dist/components/tt-form/src/useForm.js +28 -0
- package/dist/components/tt-form/src/useFormContext.js +320 -0
- package/dist/components/tt-form/src/utils/array-path.js +18 -0
- package/dist/components/tt-form-item-error-tooltip/index.js +9 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue.js +183 -0
- package/dist/components/tt-form-item-error-tooltip/index.vue3.js +5 -0
- package/dist/components/tt-icon/components/AddIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/AddIcon.vue2.js +4 -0
- package/dist/components/tt-icon/components/SubIcon.vue.js +28 -0
- package/dist/components/tt-icon/components/SubIcon.vue2.js +4 -0
- package/dist/components/tt-icon/index.js +11 -0
- package/dist/components/tt-icon/index.vue.js +8 -0
- package/dist/components/tt-icon/index.vue2.js +115 -0
- package/dist/components/tt-image/index.js +9 -0
- package/dist/components/tt-image/src/components/ImageViewer.js +41 -0
- package/dist/components/tt-image/tt-image.js +55 -0
- package/dist/components/tt-loading/index.js +8 -0
- package/dist/components/tt-loading/src/directive.js +51 -0
- package/dist/components/tt-loading/src/loading.vue.js +7 -0
- package/dist/components/tt-loading/src/loading.vue2.js +75 -0
- package/dist/components/tt-loading/src/service.js +79 -0
- package/dist/components/tt-log/index.js +7 -0
- package/dist/components/tt-log/index.vue.js +30 -0
- package/dist/components/tt-log/index.vue2.js +4 -0
- package/dist/components/tt-modal/index.js +14 -0
- package/dist/components/tt-modal/src/RenderModal.vue.js +310 -0
- package/dist/components/tt-modal/src/RenderModal.vue3.js +5 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalFooter.vue2.js +74 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue.js +7 -0
- package/dist/components/tt-modal/src/components/ModalHeader.vue2.js +22 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue.js +48 -0
- package/dist/components/tt-modal/src/components/ModalWrapper.vue2.js +4 -0
- package/dist/components/tt-modal/src/hooks/useModalRender.js +131 -0
- package/dist/components/tt-modal/src/index.js +17 -0
- package/dist/components/tt-modal/src/props.js +75 -0
- package/dist/components/tt-modal/src/utils/modal-api.js +200 -0
- package/dist/components/tt-modal/src/utils/modal-stack.js +28 -0
- package/dist/components/tt-modal-form/hooks/useModalFormSlot.js +22 -0
- package/dist/components/tt-modal-form/index.vue.js +178 -0
- package/dist/components/tt-modal-form/index.vue2.js +4 -0
- package/dist/components/tt-modal-form/useModalForm.js +30 -0
- package/dist/components/tt-nav-anchor/index.js +8 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue.js +234 -0
- package/dist/components/tt-nav-anchor/src/TtNavAnchor.vue3.js +5 -0
- package/dist/components/tt-nav-anchor/src/constants.js +4 -0
- package/dist/components/tt-panel-select/index.js +7 -0
- package/dist/components/tt-panel-select/src/common.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue.js +56 -0
- package/dist/components/tt-panel-select/src/components/PanelLeft.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue.js +277 -0
- package/dist/components/tt-panel-select/src/components/PanelMiddle.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue.js +108 -0
- package/dist/components/tt-panel-select/src/components/PanelRight.vue2.js +4 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelData.js +184 -0
- package/dist/components/tt-panel-select/src/hooks/usePanelSelection.js +91 -0
- package/dist/components/tt-panel-select/src/index.vue.js +386 -0
- package/dist/components/tt-panel-select/src/index.vue2.js +4 -0
- package/dist/components/tt-select/index.js +8 -0
- package/dist/components/tt-select/src/Select.vue.js +315 -0
- package/dist/components/tt-select/src/Select.vue3.js +5 -0
- package/dist/components/tt-select/src/components/SelectTable.vue.js +86 -0
- package/dist/components/tt-select/src/components/SelectTable.vue3.js +5 -0
- package/dist/components/tt-select/src/components/Table.vue.js +307 -0
- package/dist/components/tt-select/src/components/Table.vue3.js +5 -0
- package/dist/components/tt-select/src/const.js +19 -0
- package/dist/components/tt-select/src/hooks/useDataSource.js +196 -0
- package/dist/components/tt-select/src/hooks/useGrid.js +97 -0
- package/dist/components/tt-select/src/hooks/useKeyboard.js +63 -0
- package/dist/components/tt-select/src/hooks/usePagination.js +45 -0
- package/dist/components/tt-select/src/hooks/useSelect.js +100 -0
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.d.ts +1 -1
- package/dist/components/tt-select/src/hooks/useSelectTableEvent.js +345 -0
- package/dist/components/tt-select/src/props.js +201 -0
- package/dist/components/tt-select/src/utils/index.js +16 -0
- package/dist/components/tt-table/index.js +33 -0
- package/dist/components/tt-table/src/Table.vue.js +623 -0
- package/dist/components/tt-table/src/Table.vue3.js +5 -0
- package/dist/components/tt-table/src/TableForm.vue.js +317 -0
- package/dist/components/tt-table/src/TableForm.vue2.js +4 -0
- package/dist/components/tt-table/src/componentMap.js +4 -0
- package/dist/components/tt-table/src/components/RowContext.js +24 -0
- package/dist/components/tt-table/src/components/TableAction.vue.js +222 -0
- package/dist/components/tt-table/src/components/TableAction.vue2.js +4 -0
- package/dist/components/tt-table/src/components/TableButtons.js +117 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue2.js +233 -0
- package/dist/components/tt-table/src/components/TableColumnModal.vue3.js +5 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue.js +87 -0
- package/dist/components/tt-table/src/components/TableToobalTools.vue2.js +4 -0
- package/dist/components/tt-table/src/emits.js +15 -0
- package/dist/components/tt-table/src/hooks/useCellArea.js +15 -0
- package/dist/components/tt-table/src/hooks/useColumns.js +275 -0
- package/dist/components/tt-table/src/hooks/useCustomColumns.js +53 -0
- package/dist/components/tt-table/src/hooks/useDataSource.js +224 -0
- package/dist/components/tt-table/src/hooks/useLeftRightSlot.js +64 -0
- package/dist/components/tt-table/src/hooks/usePagination.js +44 -0
- package/dist/components/tt-table/src/hooks/useRowSelection.js +84 -0
- package/dist/components/tt-table/src/hooks/useTableContext.js +20 -0
- package/dist/components/tt-table/src/hooks/useTableEvent.js +197 -0
- package/dist/components/tt-table/src/hooks/useTableForm.js +60 -0
- package/dist/components/tt-table/src/hooks/useTableRender.js +33 -0
- package/dist/components/tt-table/src/hooks/useTableSlot.js +17 -0
- package/dist/components/tt-table/src/props.js +482 -0
- package/dist/components/tt-table/src/toolProps.js +30 -0
- package/dist/components/tt-table/src/utils/context.js +17 -0
- package/dist/components/tt-table/src/utils/table-api.js +386 -0
- package/dist/components/tt-table/src/utils/table-form-api.js +122 -0
- package/dist/components/tt-text/index.js +7 -0
- package/dist/components/tt-text/index.vue.js +7 -0
- package/dist/components/tt-text/index.vue2.js +73 -0
- package/dist/components/tt-upload/index.js +9 -0
- package/dist/components/tt-upload/src/TtUpload.vue.js +305 -0
- package/dist/components/tt-upload/src/TtUpload.vue2.js +4 -0
- package/dist/components/tt-upload/src/typing.js +107 -0
- package/dist/directives/auto-tip/index.js +62 -0
- package/dist/directives/dialog-resize/index.js +49 -0
- package/dist/directives/dialog-resize/use-css-variable.js +44 -0
- package/dist/directives/dialog-resize/use-draggable.js +35 -0
- package/dist/directives/dialog-resize/use-fullscreen.js +38 -0
- package/dist/directives/dialog-resize/use-parse-translate.js +9 -0
- package/dist/directives/dialog-resize/use-resizer.js +37 -0
- package/dist/directives/disabled-tip/index.js +78 -0
- package/dist/directives/index.js +8 -0
- package/dist/hooks/useDataPermissionOptions.js +142 -0
- package/dist/hooks/useFormSchemasLink.js +261 -0
- package/dist/hooks/useFormat.js +44 -0
- package/dist/hooks/useLoading.js +22 -0
- package/dist/hooks/useScreenshotOss.js +69 -0
- package/dist/hooks/useSetup.js +59 -0
- package/dist/index.js +142 -60274
- package/dist/plugins/default/renderCellContent.js +58 -0
- package/dist/plugins/vxeTable/switchStatus.js +91 -0
- package/dist/plugins.js +4 -146
- package/dist/style.css +1 -1
- package/dist/utils/xhr.js +8 -0
- package/package.json +3 -1
- package/dist/index-NG5FNCLD.js +0 -3430
- package/dist/index.modern-4Cf3dcJP.js +0 -3069
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { h as i, defineComponent as w, shallowRef as b, onMounted as $ } from "vue";
|
|
2
|
+
import { isFunction as c } from "@dazhicheng/utils";
|
|
3
|
+
import { cloneDeep as f } from "lodash-es";
|
|
4
|
+
function E() {
|
|
5
|
+
return {
|
|
6
|
+
install(v) {
|
|
7
|
+
v.renderer.add("renderCellContent", {
|
|
8
|
+
renderTableDefault(F, h) {
|
|
9
|
+
const { row: u, column: n, $table: l } = h, e = F.props ?? {}, d = `${n.field}Option`;
|
|
10
|
+
if (l[d]) {
|
|
11
|
+
const t = l[d];
|
|
12
|
+
if (c(e.customRender))
|
|
13
|
+
return i(
|
|
14
|
+
e.customRender({
|
|
15
|
+
result: f(t),
|
|
16
|
+
row: u,
|
|
17
|
+
column: n,
|
|
18
|
+
$table: l
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
const r = t.find((o) => o[e.valueField] === n.field);
|
|
22
|
+
return i("div", null, (r == null ? void 0 : r[e.labelField]) ?? "");
|
|
23
|
+
}
|
|
24
|
+
const R = w({
|
|
25
|
+
name: "RenderCellContent",
|
|
26
|
+
setup() {
|
|
27
|
+
var s;
|
|
28
|
+
const t = b([]);
|
|
29
|
+
async function r() {
|
|
30
|
+
var m, C;
|
|
31
|
+
if (l[d]) return;
|
|
32
|
+
let a = {};
|
|
33
|
+
c(e.beforeFetch) && (a = await ((m = e.beforeFetch) == null ? void 0 : m.call(e, u, n)));
|
|
34
|
+
const p = await ((C = e.api) == null ? void 0 : C.call(e, a));
|
|
35
|
+
t.value = p, c(e.afterFetch) && (t.value = await e.afterFetch(t.value, u, n)), l[`${n.field}Option`] = f(t.value);
|
|
36
|
+
}
|
|
37
|
+
if ($(r), e.customRender)
|
|
38
|
+
return () => i(
|
|
39
|
+
e.customRender({
|
|
40
|
+
result: f(t.value),
|
|
41
|
+
row: u,
|
|
42
|
+
column: n,
|
|
43
|
+
$table: l
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
const o = (s = t.value) == null ? void 0 : s.find((a) => a[e.valueField] === n.field);
|
|
47
|
+
return () => i("div", null, (o == null ? void 0 : o[e.labelField]) ?? "");
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return i(R);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
E as createVxePluginRenderCellContent
|
|
58
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ElSwitch as L, ElMessageBox as x, ElMessage as A } from "element-plus";
|
|
2
|
+
import { omit as U } from "lodash-es";
|
|
3
|
+
import { h as w, defineComponent as _, ref as y } from "vue";
|
|
4
|
+
import { isFunction as u } from "@dazhicheng/utils";
|
|
5
|
+
import { kebabToCamelCase as I } from "@dazhicheng/hooks";
|
|
6
|
+
const D = [
|
|
7
|
+
"modelValue",
|
|
8
|
+
"onUpdate:modelValue",
|
|
9
|
+
"loading",
|
|
10
|
+
"api",
|
|
11
|
+
"beforeFetch",
|
|
12
|
+
"afterFetch",
|
|
13
|
+
"beforeChange"
|
|
14
|
+
];
|
|
15
|
+
function C(n) {
|
|
16
|
+
return Object.fromEntries(Object.entries(n).map(([t, l]) => [I(t), l]));
|
|
17
|
+
}
|
|
18
|
+
const M = "1", O = "0";
|
|
19
|
+
function j(n) {
|
|
20
|
+
const t = C(n);
|
|
21
|
+
return {
|
|
22
|
+
active: t.activeValue ?? M,
|
|
23
|
+
inactive: t.inactiveValue ?? O
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function z() {
|
|
27
|
+
return {
|
|
28
|
+
install(n) {
|
|
29
|
+
n.renderer.add("switchStatus", {
|
|
30
|
+
renderTableDefault(t, l) {
|
|
31
|
+
const { row: o, column: i } = l, e = t.props ?? {}, v = U(e, [...D]), E = C(v);
|
|
32
|
+
return w(
|
|
33
|
+
_({
|
|
34
|
+
name: "TtVxeSwitchCell",
|
|
35
|
+
setup: () => {
|
|
36
|
+
const s = y(!1), { active: r, inactive: m } = j(e);
|
|
37
|
+
return () => w(L, {
|
|
38
|
+
activeValue: r,
|
|
39
|
+
inactiveValue: m,
|
|
40
|
+
...E,
|
|
41
|
+
modelValue: o[i.field],
|
|
42
|
+
loading: s.value,
|
|
43
|
+
"onUpdate:modelValue": (a) => {
|
|
44
|
+
o[i.field] = a;
|
|
45
|
+
},
|
|
46
|
+
beforeChange: async () => {
|
|
47
|
+
var g;
|
|
48
|
+
const a = o[i.field];
|
|
49
|
+
if ((u(e.beforeChange) ? await ((g = e.beforeChange) == null ? void 0 : g.call(e, a)) : !0) === !1 || !u(e.api)) return !1;
|
|
50
|
+
const T = a === r ? m : r, b = `是否确认${a === r ? "关闭" : "开启"}`;
|
|
51
|
+
let d = !1;
|
|
52
|
+
return await x({
|
|
53
|
+
title: e.confirmTitle || "温馨提示",
|
|
54
|
+
message: b,
|
|
55
|
+
confirmButtonText: "确认",
|
|
56
|
+
cancelButtonText: "取消",
|
|
57
|
+
showCancelButton: !0,
|
|
58
|
+
type: "warning",
|
|
59
|
+
beforeClose: async (B, f, h) => {
|
|
60
|
+
var p, V;
|
|
61
|
+
if (B === "confirm") {
|
|
62
|
+
f.confirmButtonLoading = !0;
|
|
63
|
+
let c = { [i.field]: T, id: o.id };
|
|
64
|
+
if (s.value = !0, u(e.beforeFetch)) {
|
|
65
|
+
const S = await ((p = e.beforeFetch) == null ? void 0 : p.call(e, c, o, i));
|
|
66
|
+
c = {
|
|
67
|
+
...c,
|
|
68
|
+
...S
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const F = await e.api(c).finally(() => {
|
|
72
|
+
s.value = !1, f.confirmButtonLoading = !1;
|
|
73
|
+
});
|
|
74
|
+
(V = e.afterFetch) == null || V.call(e, F), A.success(a === r ? "禁用成功" : "启用成功"), f.confirmButtonLoading = !1, h(), d = !0;
|
|
75
|
+
} else
|
|
76
|
+
h();
|
|
77
|
+
}
|
|
78
|
+
}), d;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
z as createVxePluginSwitchStatus
|
|
91
|
+
};
|
package/dist/plugins.js
CHANGED
|
@@ -1,148 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { h as s, defineComponent as B, ref as D, shallowRef as O, onMounted as I } from "vue";
|
|
4
|
-
import "axios";
|
|
5
|
-
import { c as d } from "./index.modern-4Cf3dcJP.js";
|
|
6
|
-
import "xe-utils";
|
|
7
|
-
function M(l) {
|
|
8
|
-
return l.split("-").filter(Boolean).map((o, u) => u === 0 ? o : o.charAt(0).toUpperCase() + o.slice(1)).join("");
|
|
9
|
-
}
|
|
10
|
-
const $ = [
|
|
11
|
-
"modelValue",
|
|
12
|
-
"onUpdate:modelValue",
|
|
13
|
-
"loading",
|
|
14
|
-
"api",
|
|
15
|
-
"beforeFetch",
|
|
16
|
-
"afterFetch",
|
|
17
|
-
"beforeChange"
|
|
18
|
-
];
|
|
19
|
-
function A(l) {
|
|
20
|
-
return Object.fromEntries(Object.entries(l).map(([o, u]) => [M(o), u]));
|
|
21
|
-
}
|
|
22
|
-
const j = "1", K = "0";
|
|
23
|
-
function Y(l) {
|
|
24
|
-
const o = A(l);
|
|
25
|
-
return {
|
|
26
|
-
active: o.activeValue ?? j,
|
|
27
|
-
inactive: o.inactiveValue ?? K
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function J() {
|
|
31
|
-
return {
|
|
32
|
-
install(l) {
|
|
33
|
-
l.renderer.add("switchStatus", {
|
|
34
|
-
renderTableDefault(o, u) {
|
|
35
|
-
const { row: i, column: a } = u, e = o.props ?? {}, t = _(e, [...$]), m = A(t);
|
|
36
|
-
return s(
|
|
37
|
-
B({
|
|
38
|
-
name: "TtVxeSwitchCell",
|
|
39
|
-
setup: () => {
|
|
40
|
-
const h = D(!1), { active: n, inactive: c } = Y(e);
|
|
41
|
-
return () => s(x, {
|
|
42
|
-
activeValue: n,
|
|
43
|
-
inactiveValue: c,
|
|
44
|
-
...m,
|
|
45
|
-
modelValue: i[a.field],
|
|
46
|
-
loading: h.value,
|
|
47
|
-
"onUpdate:modelValue": (r) => {
|
|
48
|
-
i[a.field] = r;
|
|
49
|
-
},
|
|
50
|
-
beforeChange: async () => {
|
|
51
|
-
var p;
|
|
52
|
-
const r = i[a.field];
|
|
53
|
-
if ((d(e.beforeChange) ? await ((p = e.beforeChange) == null ? void 0 : p.call(e, r)) : !0) === !1 || !d(e.api)) return !1;
|
|
54
|
-
const f = r === n ? c : n, w = `是否确认${r === n ? "关闭" : "开启"}`;
|
|
55
|
-
let C = !1;
|
|
56
|
-
return await U({
|
|
57
|
-
title: e.confirmTitle || "温馨提示",
|
|
58
|
-
message: w,
|
|
59
|
-
confirmButtonText: "确认",
|
|
60
|
-
cancelButtonText: "取消",
|
|
61
|
-
showCancelButton: !0,
|
|
62
|
-
type: "warning",
|
|
63
|
-
beforeClose: async (L, V, E) => {
|
|
64
|
-
var b, T;
|
|
65
|
-
if (L === "confirm") {
|
|
66
|
-
V.confirmButtonLoading = !0;
|
|
67
|
-
let v = { [a.field]: f, id: i.id };
|
|
68
|
-
if (h.value = !0, d(e.beforeFetch)) {
|
|
69
|
-
const S = await ((b = e.beforeFetch) == null ? void 0 : b.call(e, v, i, a));
|
|
70
|
-
v = {
|
|
71
|
-
...v,
|
|
72
|
-
...S
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
const R = await e.api(v).finally(() => {
|
|
76
|
-
h.value = !1, V.confirmButtonLoading = !1;
|
|
77
|
-
});
|
|
78
|
-
(T = e.afterFetch) == null || T.call(e, R), y.success(r === n ? "禁用成功" : "启用成功"), V.confirmButtonLoading = !1, E(), C = !0;
|
|
79
|
-
} else
|
|
80
|
-
E();
|
|
81
|
-
}
|
|
82
|
-
}), C;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function Q() {
|
|
94
|
-
return {
|
|
95
|
-
install(l) {
|
|
96
|
-
l.renderer.add("renderCellContent", {
|
|
97
|
-
renderTableDefault(o, u) {
|
|
98
|
-
const { row: i, column: a, $table: e } = u, t = o.props ?? {}, m = `${a.field}Option`;
|
|
99
|
-
if (e[m]) {
|
|
100
|
-
const n = e[m];
|
|
101
|
-
if (d(t.customRender))
|
|
102
|
-
return s(
|
|
103
|
-
t.customRender({
|
|
104
|
-
result: F(n),
|
|
105
|
-
row: i,
|
|
106
|
-
column: a,
|
|
107
|
-
$table: e
|
|
108
|
-
})
|
|
109
|
-
);
|
|
110
|
-
const c = n.find((r) => r[t.valueField] === a.field);
|
|
111
|
-
return s("div", null, (c == null ? void 0 : c[t.labelField]) ?? "");
|
|
112
|
-
}
|
|
113
|
-
const h = B({
|
|
114
|
-
name: "RenderCellContent",
|
|
115
|
-
setup() {
|
|
116
|
-
var g;
|
|
117
|
-
const n = O([]);
|
|
118
|
-
async function c() {
|
|
119
|
-
var C, p;
|
|
120
|
-
if (e[m]) return;
|
|
121
|
-
let f = {};
|
|
122
|
-
d(t.beforeFetch) && (f = await ((C = t.beforeFetch) == null ? void 0 : C.call(t, i, a)));
|
|
123
|
-
const w = await ((p = t.api) == null ? void 0 : p.call(t, f));
|
|
124
|
-
n.value = w, d(t.afterFetch) && (n.value = await t.afterFetch(n.value, i, a)), e[`${a.field}Option`] = F(n.value);
|
|
125
|
-
}
|
|
126
|
-
if (I(c), t.customRender)
|
|
127
|
-
return () => s(
|
|
128
|
-
t.customRender({
|
|
129
|
-
result: F(n.value),
|
|
130
|
-
row: i,
|
|
131
|
-
column: a,
|
|
132
|
-
$table: e
|
|
133
|
-
})
|
|
134
|
-
);
|
|
135
|
-
const r = (g = n.value) == null ? void 0 : g.find((f) => f[t.valueField] === a.field);
|
|
136
|
-
return () => s("div", null, (r == null ? void 0 : r[t.labelField]) ?? "");
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
return s(h);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
1
|
+
import { createVxePluginSwitchStatus as r } from "./plugins/vxeTable/switchStatus.js";
|
|
2
|
+
import { createVxePluginRenderCellContent as o } from "./plugins/default/renderCellContent.js";
|
|
145
3
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
4
|
+
o as createVxePluginRenderCellContent,
|
|
5
|
+
r as createVxePluginSwitchStatus
|
|
148
6
|
};
|