el-plus 0.0.18 → 0.0.20
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/CHANGELOG.md +12 -0
- package/dist/index.css +1 -1
- package/dist/index.full.js +327 -200
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +326 -200
- package/es/components/date-picker-range/index.d.ts +3 -3
- package/es/components/date-picker-range/src/date-picker-range.vue.d.ts +1 -1
- package/es/components/form/src/form-item-vue.d.ts +5 -2
- package/es/components/form/src/form-item.d.ts +2 -1
- package/es/components/form/src/form-item.mjs +2 -2
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/hooks/use-form-item.mjs +3 -1
- package/es/components/form/src/hooks/use-form-item.mjs.map +1 -1
- package/es/components/header/index.d.ts +6 -6
- package/es/components/header/src/header.d.ts +1 -1
- package/es/components/header/src/header.mjs.map +1 -1
- package/es/components/header/src/header.vue.d.ts +3 -3
- package/es/components/header/src/use-header.mjs +4 -7
- package/es/components/header/src/use-header.mjs.map +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/index.mjs.map +1 -1
- package/es/components/input/style/css.d.ts +1 -1
- package/es/components/input/style/css.mjs +1 -1
- package/es/components/input/style/index.d.ts +1 -1
- package/es/components/input/style/index.mjs +1 -1
- package/es/components/link/index.d.ts +118 -0
- package/es/components/link/index.mjs +8 -0
- package/es/components/link/index.mjs.map +1 -0
- package/es/components/link/src/link.d.ts +30 -0
- package/es/components/link/src/link.mjs +19 -0
- package/es/components/link/src/link.mjs.map +1 -0
- package/es/components/link/src/link.vue.d.ts +73 -0
- package/es/components/link/src/link.vue.mjs +6 -0
- package/es/components/link/src/link.vue.mjs.map +1 -0
- package/es/components/link/src/link.vue2.mjs +52 -0
- package/es/components/link/src/link.vue2.mjs.map +1 -0
- package/es/components/link/style/css.d.ts +2 -0
- package/es/components/link/style/css.mjs +5 -0
- package/es/components/link/style/css.mjs.map +1 -0
- package/es/components/link/style/index.d.ts +2 -0
- package/es/components/link/style/index.mjs +5 -0
- package/es/components/link/style/index.mjs.map +1 -0
- package/es/components/search-list-page/index.d.ts +51 -39
- package/es/components/search-list-page/src/search-list-page.d.ts +1 -4
- package/es/components/search-list-page/src/search-list-page.mjs +6 -9
- package/es/components/search-list-page/src/search-list-page.mjs.map +1 -1
- package/es/components/search-list-page/src/search-list-page.vue.d.ts +16 -17
- package/es/components/search-list-page/src/search-list-page.vue2.mjs +4 -3
- package/es/components/search-list-page/src/search-list-page.vue2.mjs.map +1 -1
- package/es/components/search-list-page/src/use-search-list-page.d.ts +15 -9
- package/es/components/search-list-page/src/use-search-list-page.mjs +22 -22
- package/es/components/search-list-page/src/use-search-list-page.mjs.map +1 -1
- package/es/components/table/index.d.ts +11 -6
- package/es/components/table/src/table.d.ts +2 -1
- package/es/components/table/src/table.mjs +2 -2
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.vue.d.ts +4 -3
- package/es/components/table/src/table.vue2.mjs +4 -3
- package/es/components/table/src/table.vue2.mjs.map +1 -1
- package/es/components/table/src/use-table.d.ts +71 -12
- package/es/components/table/src/use-table.mjs +84 -27
- package/es/components/table/src/use-table.mjs.map +1 -1
- package/es/components.mjs +3 -1
- package/es/components.mjs.map +1 -1
- package/es/hooks/dialog/use-dialog.d.ts +2 -0
- package/es/hooks/dialog/use-dialog.mjs +4 -3
- package/es/hooks/dialog/use-dialog.mjs.map +1 -1
- package/es/hooks/use-navigation.d.ts +5 -0
- package/es/hooks/use-navigation.mjs +14 -2
- package/es/hooks/use-navigation.mjs.map +1 -1
- package/es/index.mjs +2 -0
- package/es/index.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/es/utils/file.d.ts +18 -0
- package/es/utils/file.mjs +133 -0
- package/es/utils/file.mjs.map +1 -0
- package/es/utils/http/core/types.d.ts +1 -0
- package/global.d.ts +6 -4
- package/lib/components/date-picker-range/index.d.ts +3 -3
- package/lib/components/date-picker-range/src/date-picker-range.vue.d.ts +1 -1
- package/lib/components/form/src/form-item-vue.d.ts +5 -2
- package/lib/components/form/src/form-item.d.ts +2 -1
- package/lib/components/form/src/form-item.js +2 -2
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/hooks/use-form-item.js +3 -1
- package/lib/components/form/src/hooks/use-form-item.js.map +1 -1
- package/lib/components/header/index.d.ts +6 -6
- package/lib/components/header/src/header.d.ts +1 -1
- package/lib/components/header/src/header.js.map +1 -1
- package/lib/components/header/src/header.vue.d.ts +3 -3
- package/lib/components/header/src/use-header.js +3 -6
- package/lib/components/header/src/use-header.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +4 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/style/css.d.ts +1 -1
- package/lib/components/input/style/css.js +1 -1
- package/lib/components/input/style/index.d.ts +1 -1
- package/lib/components/input/style/index.js +1 -1
- package/lib/components/link/index.d.ts +118 -0
- package/lib/components/link/index.js +14 -0
- package/lib/components/link/index.js.map +1 -0
- package/lib/components/link/src/link.d.ts +30 -0
- package/lib/components/link/src/link.js +21 -0
- package/lib/components/link/src/link.js.map +1 -0
- package/lib/components/link/src/link.vue.d.ts +73 -0
- package/lib/components/link/src/link.vue.js +10 -0
- package/lib/components/link/src/link.vue.js.map +1 -0
- package/lib/components/link/src/link.vue2.js +56 -0
- package/lib/components/link/src/link.vue2.js.map +1 -0
- package/lib/components/link/style/css.d.ts +2 -0
- package/lib/components/link/style/css.js +7 -0
- package/lib/components/link/style/css.js.map +1 -0
- package/lib/components/link/style/index.d.ts +2 -0
- package/lib/components/link/style/index.js +7 -0
- package/lib/components/link/style/index.js.map +1 -0
- package/lib/components/search-list-page/index.d.ts +51 -39
- package/lib/components/search-list-page/src/search-list-page.d.ts +1 -4
- package/lib/components/search-list-page/src/search-list-page.js +6 -9
- package/lib/components/search-list-page/src/search-list-page.js.map +1 -1
- package/lib/components/search-list-page/src/search-list-page.vue.d.ts +16 -17
- package/lib/components/search-list-page/src/search-list-page.vue2.js +3 -2
- package/lib/components/search-list-page/src/search-list-page.vue2.js.map +1 -1
- package/lib/components/search-list-page/src/use-search-list-page.d.ts +15 -9
- package/lib/components/search-list-page/src/use-search-list-page.js +22 -22
- package/lib/components/search-list-page/src/use-search-list-page.js.map +1 -1
- package/lib/components/table/index.d.ts +11 -6
- package/lib/components/table/src/table.d.ts +2 -1
- package/lib/components/table/src/table.js +2 -2
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.vue.d.ts +4 -3
- package/lib/components/table/src/table.vue2.js +4 -3
- package/lib/components/table/src/table.vue2.js.map +1 -1
- package/lib/components/table/src/use-table.d.ts +71 -12
- package/lib/components/table/src/use-table.js +83 -26
- package/lib/components/table/src/use-table.js.map +1 -1
- package/lib/components.js +3 -1
- package/lib/components.js.map +1 -1
- package/lib/hooks/dialog/use-dialog.d.ts +2 -0
- package/lib/hooks/dialog/use-dialog.js +4 -3
- package/lib/hooks/dialog/use-dialog.js.map +1 -1
- package/lib/hooks/use-navigation.d.ts +5 -0
- package/lib/hooks/use-navigation.js +13 -1
- package/lib/hooks/use-navigation.js.map +1 -1
- package/lib/index.js +10 -6
- package/lib/index.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/lib/utils/file.d.ts +18 -0
- package/lib/utils/file.js +136 -0
- package/lib/utils/file.js.map +1 -0
- package/lib/utils/http/core/types.d.ts +1 -0
- package/package.json +1 -1
- package/theme-chalk/base.css +1 -1
- package/theme-chalk/custom-column.css +1 -1
- package/theme-chalk/header.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/link.css +1 -0
- package/theme-chalk/src/base.scss +1 -0
- package/theme-chalk/src/common/common.scss +4 -0
- package/theme-chalk/src/custom-column.scss +6 -4
- package/theme-chalk/src/header.scss +1 -0
- package/theme-chalk/src/index.scss +2 -1
- package/theme-chalk/src/link.scss +6 -0
- package/theme-chalk/src/table.scss +20 -1
- package/theme-chalk/table.css +1 -1
package/dist/index.full.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
/*! ElPlus v0.0.
|
|
1
|
+
/*! ElPlus v0.0.20 */
|
|
2
2
|
|
|
3
|
-
import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode } from 'vue';
|
|
4
|
-
import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, ElDialog, ElButton, ElTable, selectProps as selectProps$1, selectEmits as selectEmits$1,
|
|
3
|
+
import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw } from 'vue';
|
|
4
|
+
import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1 } from 'element-plus';
|
|
5
5
|
import { isFunction } from '@vue/shared';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
import Cookies from 'js-cookie';
|
|
8
8
|
import defu from 'defu';
|
|
9
9
|
import * as qs from 'qs';
|
|
10
10
|
import elTableProps from 'element-plus/es/components/table/src/table/defaults';
|
|
11
|
-
import { ArrowUp, ArrowDown } from '@element-plus/icons-vue';
|
|
11
|
+
import { ArrowUp, ArrowDown, EditPen } from '@element-plus/icons-vue';
|
|
12
12
|
import mitt from 'mitt';
|
|
13
|
+
import { cloneDeep } from 'lodash-unified';
|
|
13
14
|
import { useToggle } from '@vueuse/core';
|
|
14
15
|
import { useRouter, useRoute } from 'vue-router';
|
|
15
16
|
|
|
@@ -937,7 +938,9 @@ const useFormItemSlots = (props) => {
|
|
|
937
938
|
});
|
|
938
939
|
}
|
|
939
940
|
if (render) {
|
|
940
|
-
scopedSlots.default =
|
|
941
|
+
scopedSlots.default = () => {
|
|
942
|
+
return render(attrs["table-scope"]);
|
|
943
|
+
};
|
|
941
944
|
}
|
|
942
945
|
return {
|
|
943
946
|
scopedSlots
|
|
@@ -981,8 +984,8 @@ const useFormItemRules = (props) => {
|
|
|
981
984
|
|
|
982
985
|
const expandFormItemProps = {
|
|
983
986
|
type: {
|
|
984
|
-
type: String
|
|
985
|
-
|
|
987
|
+
type: String,
|
|
988
|
+
default: "EpInput"
|
|
986
989
|
},
|
|
987
990
|
col: Number,
|
|
988
991
|
render: Function,
|
|
@@ -1042,7 +1045,7 @@ var EpFormItem = /* @__PURE__ */ defineComponent({
|
|
|
1042
1045
|
}
|
|
1043
1046
|
});
|
|
1044
1047
|
|
|
1045
|
-
var _sfc_main$
|
|
1048
|
+
var _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1046
1049
|
...{
|
|
1047
1050
|
name: "EpForm",
|
|
1048
1051
|
inheritAttrs: false
|
|
@@ -1140,7 +1143,7 @@ var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1140
1143
|
}
|
|
1141
1144
|
});
|
|
1142
1145
|
|
|
1143
|
-
const EpForm = withInstall(_sfc_main$
|
|
1146
|
+
const EpForm = withInstall(_sfc_main$9);
|
|
1144
1147
|
|
|
1145
1148
|
const { t: t$2 } = useLocale();
|
|
1146
1149
|
const inputProps = {
|
|
@@ -1169,7 +1172,7 @@ const inputEmits = {
|
|
|
1169
1172
|
};
|
|
1170
1173
|
const inputEmitsKeys = Object.keys(inputEmits);
|
|
1171
1174
|
|
|
1172
|
-
var _sfc_main$
|
|
1175
|
+
var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1173
1176
|
...{
|
|
1174
1177
|
name: "EpInput",
|
|
1175
1178
|
inheritAttrs: false
|
|
@@ -1303,7 +1306,7 @@ var _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1303
1306
|
}
|
|
1304
1307
|
});
|
|
1305
1308
|
|
|
1306
|
-
const EpInput = withInstall(_sfc_main$
|
|
1309
|
+
const EpInput = withInstall(_sfc_main$8);
|
|
1307
1310
|
|
|
1308
1311
|
function _isSlot$1(s) {
|
|
1309
1312
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
@@ -1396,6 +1399,7 @@ const useDialog = (options = {}) => {
|
|
|
1396
1399
|
} = useLocale();
|
|
1397
1400
|
const {
|
|
1398
1401
|
scopedSlots = {},
|
|
1402
|
+
instance,
|
|
1399
1403
|
render: render$1,
|
|
1400
1404
|
destroyOnClose,
|
|
1401
1405
|
onConfirm,
|
|
@@ -1471,10 +1475,10 @@ const useDialog = (options = {}) => {
|
|
|
1471
1475
|
});
|
|
1472
1476
|
if (render$1) {
|
|
1473
1477
|
const container = document.createElement("div");
|
|
1474
|
-
const
|
|
1478
|
+
const newInstance = instance || getCurrentInstance();
|
|
1475
1479
|
const vnode = h(Dialog);
|
|
1476
|
-
if (
|
|
1477
|
-
vnode.appContext =
|
|
1480
|
+
if (newInstance && newInstance.appContext) {
|
|
1481
|
+
vnode.appContext = newInstance.appContext;
|
|
1478
1482
|
}
|
|
1479
1483
|
render(vnode, container);
|
|
1480
1484
|
document.body.appendChild(container);
|
|
@@ -1624,7 +1628,7 @@ const gotoTaskTrace = (workflowId) => {
|
|
|
1624
1628
|
}
|
|
1625
1629
|
};
|
|
1626
1630
|
|
|
1627
|
-
var _sfc_main$
|
|
1631
|
+
var _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1628
1632
|
...{
|
|
1629
1633
|
name: "EpCustomColumn",
|
|
1630
1634
|
inheritAttrs: false
|
|
@@ -1829,7 +1833,7 @@ var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1829
1833
|
}
|
|
1830
1834
|
});
|
|
1831
1835
|
|
|
1832
|
-
const EpCustomColumn = withInstall(_sfc_main$
|
|
1836
|
+
const EpCustomColumn = withInstall(_sfc_main$7);
|
|
1833
1837
|
|
|
1834
1838
|
const inheritTableProps = {
|
|
1835
1839
|
...elTableProps,
|
|
@@ -1903,8 +1907,8 @@ const expandTableProps = {
|
|
|
1903
1907
|
type: Array,
|
|
1904
1908
|
default: () => []
|
|
1905
1909
|
},
|
|
1906
|
-
//
|
|
1907
|
-
|
|
1910
|
+
// 格式化列
|
|
1911
|
+
formatColumns: {
|
|
1908
1912
|
type: Array,
|
|
1909
1913
|
default: () => []
|
|
1910
1914
|
},
|
|
@@ -1926,6 +1930,38 @@ const expandTablePropsKeys = Object.keys(expandTableProps);
|
|
|
1926
1930
|
const tableEmits = [...ElTable.emits, "single-selection-change"];
|
|
1927
1931
|
const tableEmitsKeys = tableEmits;
|
|
1928
1932
|
|
|
1933
|
+
const bem$1 = createNameSpace("form-dialog");
|
|
1934
|
+
const useFormDialog = (options = {}) => {
|
|
1935
|
+
const {
|
|
1936
|
+
dialogProps,
|
|
1937
|
+
title,
|
|
1938
|
+
...formProps
|
|
1939
|
+
} = options;
|
|
1940
|
+
const formRef = ref();
|
|
1941
|
+
let formData = formProps.formData || reactive({});
|
|
1942
|
+
return useDialog({
|
|
1943
|
+
class: bem$1.b(),
|
|
1944
|
+
width: "80%",
|
|
1945
|
+
title,
|
|
1946
|
+
render: (props) => {
|
|
1947
|
+
return createVNode(EpForm, mergeProps({
|
|
1948
|
+
"ref": formRef,
|
|
1949
|
+
"modelValue": formData,
|
|
1950
|
+
"onUpdate:modelValue": ($event) => formData = $event
|
|
1951
|
+
}, {
|
|
1952
|
+
col: 1,
|
|
1953
|
+
"label-width": "auto",
|
|
1954
|
+
...formProps
|
|
1955
|
+
}), null);
|
|
1956
|
+
},
|
|
1957
|
+
onConfirm: async (resolve) => {
|
|
1958
|
+
await formRef.value.validate();
|
|
1959
|
+
resolve(formData);
|
|
1960
|
+
},
|
|
1961
|
+
...dialogProps
|
|
1962
|
+
});
|
|
1963
|
+
};
|
|
1964
|
+
|
|
1929
1965
|
const useTable$1 = (props) => {
|
|
1930
1966
|
const elFormRef = useTemplateRef("elFormRef");
|
|
1931
1967
|
const elTableRef = useTemplateRef("elTableRef");
|
|
@@ -1961,7 +1997,12 @@ const useTable$1 = (props) => {
|
|
|
1961
1997
|
}
|
|
1962
1998
|
});
|
|
1963
1999
|
const customColumns = ref([]);
|
|
2000
|
+
const attrs = useAttrs();
|
|
1964
2001
|
const search = async (init = false, isPagination = false) => {
|
|
2002
|
+
const beforeSearch = attrs["before-search"];
|
|
2003
|
+
if (typeof beforeSearch === "function") {
|
|
2004
|
+
await beforeSearch?.();
|
|
2005
|
+
}
|
|
1965
2006
|
if (init) {
|
|
1966
2007
|
pagination.pageNo = 1;
|
|
1967
2008
|
}
|
|
@@ -1995,6 +2036,7 @@ const useTable$1 = (props) => {
|
|
|
1995
2036
|
if (props.customColumnModule) {
|
|
1996
2037
|
loading.value = true;
|
|
1997
2038
|
const columns = await bus.once("loadedCustomColumn");
|
|
2039
|
+
loading.value = false;
|
|
1998
2040
|
customColumns.value = columns;
|
|
1999
2041
|
bus.on("loadedCustomColumn", (columns2) => {
|
|
2000
2042
|
customColumns.value = columns2;
|
|
@@ -2066,6 +2108,7 @@ const usePagination = function(props, search) {
|
|
|
2066
2108
|
};
|
|
2067
2109
|
};
|
|
2068
2110
|
const useTableColumn = (props, tableData, customColumns) => {
|
|
2111
|
+
const instance = getCurrentInstance();
|
|
2069
2112
|
const columnProps = (column) => {
|
|
2070
2113
|
const attrs = {
|
|
2071
2114
|
"show-overflow-tooltip": true,
|
|
@@ -2078,16 +2121,50 @@ const useTableColumn = (props, tableData, customColumns) => {
|
|
|
2078
2121
|
if (typeof column.required === "function") {
|
|
2079
2122
|
required = column.required();
|
|
2080
2123
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
"
|
|
2088
|
-
},
|
|
2089
|
-
|
|
2090
|
-
|
|
2124
|
+
const editable = column.editable;
|
|
2125
|
+
attrs["renderHeader"] = () => {
|
|
2126
|
+
return createVNode("span", null, [required ? createVNode("span", {
|
|
2127
|
+
"style": "color:var(--el-color-danger)"
|
|
2128
|
+
}, [createTextVNode(" * ")]) : "", createVNode("span", {
|
|
2129
|
+
"class": {
|
|
2130
|
+
"is-edit": editable
|
|
2131
|
+
},
|
|
2132
|
+
"onClick": editable ? async () => {
|
|
2133
|
+
const cloneColumn = {
|
|
2134
|
+
...column
|
|
2135
|
+
};
|
|
2136
|
+
delete cloneColumn.editable;
|
|
2137
|
+
const rawRender = cloneColumn.render;
|
|
2138
|
+
const formData = reactive({});
|
|
2139
|
+
if (rawRender) {
|
|
2140
|
+
cloneColumn.render = () => {
|
|
2141
|
+
return rawRender({
|
|
2142
|
+
row: formData
|
|
2143
|
+
});
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
const formDialog = useFormDialog({
|
|
2147
|
+
title: cloneColumn.label,
|
|
2148
|
+
dialogProps: {
|
|
2149
|
+
destroyOnClose: true,
|
|
2150
|
+
instance
|
|
2151
|
+
},
|
|
2152
|
+
formItemList: [cloneColumn],
|
|
2153
|
+
formData
|
|
2154
|
+
// formData: reactive({}),
|
|
2155
|
+
});
|
|
2156
|
+
const data = await formDialog.open();
|
|
2157
|
+
(tableData.value || []).forEach((item) => {
|
|
2158
|
+
item[column.prop] = data[column.prop];
|
|
2159
|
+
});
|
|
2160
|
+
if (typeof editable === "function") {
|
|
2161
|
+
editable(toRaw(data));
|
|
2162
|
+
}
|
|
2163
|
+
} : void 0
|
|
2164
|
+
}, [column.label, editable ? createVNode(ElIcon, null, {
|
|
2165
|
+
default: () => [createVNode(EditPen, null, null)]
|
|
2166
|
+
}) : ""])]);
|
|
2167
|
+
};
|
|
2091
2168
|
}
|
|
2092
2169
|
if (column.filter) {
|
|
2093
2170
|
const arr = tableData.value.map((item) => item[column.prop]);
|
|
@@ -2101,29 +2178,31 @@ const useTableColumn = (props, tableData, customColumns) => {
|
|
|
2101
2178
|
return row[column.prop] === value;
|
|
2102
2179
|
};
|
|
2103
2180
|
}
|
|
2181
|
+
if (column.type === "EpLink") {
|
|
2182
|
+
attrs.className = "table-column-link";
|
|
2183
|
+
}
|
|
2104
2184
|
return {
|
|
2105
2185
|
...attrs,
|
|
2106
2186
|
...prepareProps(column)
|
|
2107
2187
|
};
|
|
2108
2188
|
};
|
|
2109
2189
|
const columnList = computed(() => {
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
if (props.
|
|
2116
|
-
const
|
|
2117
|
-
if (
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
list: [linkColumn],
|
|
2122
|
-
type: "text",
|
|
2123
|
-
...column.props
|
|
2190
|
+
const columns = props.customColumnModule ? customColumns.value : props.columns;
|
|
2191
|
+
return columns.map((column) => {
|
|
2192
|
+
let newColumn = {
|
|
2193
|
+
...column
|
|
2194
|
+
};
|
|
2195
|
+
if (props.formatColumns.length) {
|
|
2196
|
+
const formatColumn = props.formatColumns.find((item) => item.prop === column.prop);
|
|
2197
|
+
if (formatColumn) {
|
|
2198
|
+
newColumn = {
|
|
2199
|
+
...newColumn,
|
|
2200
|
+
...formatColumn
|
|
2124
2201
|
};
|
|
2125
2202
|
}
|
|
2126
2203
|
}
|
|
2204
|
+
return newColumn;
|
|
2205
|
+
}).filter((column) => {
|
|
2127
2206
|
if ("show" in column) {
|
|
2128
2207
|
return typeof column.show === "function" ? column.show(column) : column.show;
|
|
2129
2208
|
} else if ("hide" in column) {
|
|
@@ -2138,7 +2217,8 @@ const useTableColumn = (props, tableData, customColumns) => {
|
|
|
2138
2217
|
};
|
|
2139
2218
|
};
|
|
2140
2219
|
const useTableFormItem = (props) => {
|
|
2141
|
-
const formItemProps = (scope,
|
|
2220
|
+
const formItemProps = (scope, rawItem) => {
|
|
2221
|
+
const item = cloneDeep(rawItem);
|
|
2142
2222
|
let required = item.required;
|
|
2143
2223
|
if (typeof required === "function") {
|
|
2144
2224
|
required = required();
|
|
@@ -2173,10 +2253,19 @@ const useTableFormItem = (props) => {
|
|
|
2173
2253
|
}
|
|
2174
2254
|
});
|
|
2175
2255
|
}
|
|
2256
|
+
if (item.type === "EpLink") {
|
|
2257
|
+
(item.props ? item.props : item.props = {}).content = item.props.content || scope.row[item.prop];
|
|
2258
|
+
}
|
|
2176
2259
|
for (const key in item) {
|
|
2177
2260
|
if (key.startsWith("on") && typeof item[key] === "function") {
|
|
2178
2261
|
const fn = item[key];
|
|
2179
|
-
item[key] = (...args) =>
|
|
2262
|
+
item[key] = (...args) => {
|
|
2263
|
+
let event;
|
|
2264
|
+
if (args[0] instanceof Event) {
|
|
2265
|
+
event = args.shift();
|
|
2266
|
+
}
|
|
2267
|
+
return fn(...args, scope, event);
|
|
2268
|
+
};
|
|
2180
2269
|
}
|
|
2181
2270
|
}
|
|
2182
2271
|
return {
|
|
@@ -2198,7 +2287,7 @@ const useTableFormItem = (props) => {
|
|
|
2198
2287
|
};
|
|
2199
2288
|
};
|
|
2200
2289
|
|
|
2201
|
-
var _sfc_main$
|
|
2290
|
+
var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2202
2291
|
...{
|
|
2203
2292
|
name: "EpTable",
|
|
2204
2293
|
inheritAttrs: false
|
|
@@ -2346,12 +2435,13 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2346
2435
|
}, {
|
|
2347
2436
|
ref_for: true
|
|
2348
2437
|
}, unref(columnProps)(item)), {
|
|
2349
|
-
default: withCtx((scope) => [item.type ? (openBlock(), createBlock(unref(EpFormItem), mergeProps({
|
|
2438
|
+
default: withCtx((scope) => [item.type || item.render ? (openBlock(), createBlock(unref(EpFormItem), mergeProps({
|
|
2350
2439
|
key: 0,
|
|
2351
|
-
"form-data": scope.row
|
|
2440
|
+
"form-data": scope.row,
|
|
2441
|
+
"table-scope": scope
|
|
2352
2442
|
}, {
|
|
2353
2443
|
ref_for: true
|
|
2354
|
-
}, unref(formItemProps)(scope, item)), null, 16, ["form-data"])) : (openBlock(), createElementBlock(Fragment, {
|
|
2444
|
+
}, unref(formItemProps)(scope, item)), null, 16, ["form-data", "table-scope"])) : (openBlock(), createElementBlock(Fragment, {
|
|
2355
2445
|
key: 1
|
|
2356
2446
|
}, [createTextVNode(toDisplayString(scope.row[item.prop]), 1)], 64))]),
|
|
2357
2447
|
_: 2
|
|
@@ -2383,7 +2473,7 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2383
2473
|
}
|
|
2384
2474
|
});
|
|
2385
2475
|
|
|
2386
|
-
const EpTable = withInstall(_sfc_main$
|
|
2476
|
+
const EpTable = withInstall(_sfc_main$6);
|
|
2387
2477
|
|
|
2388
2478
|
const searchListPageProps = {
|
|
2389
2479
|
...apiProps,
|
|
@@ -2417,9 +2507,9 @@ const searchListPageProps = {
|
|
|
2417
2507
|
actionButtons: {
|
|
2418
2508
|
...tableProps.actionButtons
|
|
2419
2509
|
},
|
|
2420
|
-
//
|
|
2421
|
-
|
|
2422
|
-
...tableProps.
|
|
2510
|
+
// 格式化列
|
|
2511
|
+
formatColumns: {
|
|
2512
|
+
...tableProps.formatColumns
|
|
2423
2513
|
},
|
|
2424
2514
|
showSelectionCol: Boolean,
|
|
2425
2515
|
showSingleSelectionCol: Boolean,
|
|
@@ -2429,12 +2519,9 @@ const searchListPageProps = {
|
|
|
2429
2519
|
},
|
|
2430
2520
|
add: Function,
|
|
2431
2521
|
// 新增
|
|
2432
|
-
templateDownloadApi: String,
|
|
2433
|
-
//
|
|
2434
|
-
|
|
2435
|
-
// 导入
|
|
2436
|
-
exportApi: String,
|
|
2437
|
-
// 导出
|
|
2522
|
+
// templateDownloadApi: String, // 模板下载
|
|
2523
|
+
// importApi: String, // 导入
|
|
2524
|
+
// exportApi: String, // 导出
|
|
2438
2525
|
// 表格额外距离
|
|
2439
2526
|
offsetTop: {
|
|
2440
2527
|
type: Number,
|
|
@@ -2474,7 +2561,8 @@ const useSearchListPage = (props, config = {}) => {
|
|
|
2474
2561
|
search,
|
|
2475
2562
|
reset,
|
|
2476
2563
|
tableRef,
|
|
2477
|
-
formRef
|
|
2564
|
+
formRef,
|
|
2565
|
+
beforeSearch: validate
|
|
2478
2566
|
};
|
|
2479
2567
|
};
|
|
2480
2568
|
const useTable = (props, config) => {
|
|
@@ -2491,7 +2579,7 @@ const useTable = (props, config) => {
|
|
|
2491
2579
|
showSelectionCol: props.showSelectionCol,
|
|
2492
2580
|
showSingleSelectionCol: props.showSingleSelectionCol,
|
|
2493
2581
|
actionButtons: props.actionButtons,
|
|
2494
|
-
|
|
2582
|
+
formatColumns: props.formatColumns,
|
|
2495
2583
|
api: props.api,
|
|
2496
2584
|
reqData: props.formData,
|
|
2497
2585
|
customColumnModule: props.customColumnModule,
|
|
@@ -2564,25 +2652,25 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
|
|
|
2564
2652
|
onClick: () => {
|
|
2565
2653
|
props.add?.();
|
|
2566
2654
|
}
|
|
2567
|
-
},
|
|
2568
|
-
{
|
|
2569
|
-
name: t("ep.searchListPage.templateDownload"),
|
|
2570
|
-
prop: "templateDownload",
|
|
2571
|
-
permission: props.name ? `${props.name}:TEMPLATEDOWNLOAD` : "",
|
|
2572
|
-
show: !!props.templateDownloadApi
|
|
2573
|
-
},
|
|
2574
|
-
{
|
|
2575
|
-
name: t("ep.searchListPage.import"),
|
|
2576
|
-
prop: "import",
|
|
2577
|
-
permission: props.name ? `${props.name}:IMPORT` : "",
|
|
2578
|
-
show: !!props.importApi
|
|
2579
|
-
},
|
|
2580
|
-
{
|
|
2581
|
-
name: t("ep.searchListPage.export"),
|
|
2582
|
-
prop: "export",
|
|
2583
|
-
permission: props.name ? `${props.name}:EXPORT` : "",
|
|
2584
|
-
show: !!props.exportApi
|
|
2585
2655
|
}
|
|
2656
|
+
// {
|
|
2657
|
+
// name: t('ep.searchListPage.templateDownload'),
|
|
2658
|
+
// prop: 'templateDownload',
|
|
2659
|
+
// permission: props.name ? `${props.name}:TEMPLATEDOWNLOAD` : '',
|
|
2660
|
+
// show: !!props.templateDownloadApi,
|
|
2661
|
+
// },
|
|
2662
|
+
// {
|
|
2663
|
+
// name: t('ep.searchListPage.import'),
|
|
2664
|
+
// prop: 'import',
|
|
2665
|
+
// permission: props.name ? `${props.name}:IMPORT` : '',
|
|
2666
|
+
// show: !!props.importApi,
|
|
2667
|
+
// },
|
|
2668
|
+
// {
|
|
2669
|
+
// name: t('ep.searchListPage.export'),
|
|
2670
|
+
// prop: 'export',
|
|
2671
|
+
// permission: props.name ? `${props.name}:EXPORT` : '',
|
|
2672
|
+
// show: !!props.exportApi,
|
|
2673
|
+
// },
|
|
2586
2674
|
];
|
|
2587
2675
|
const list = mergeListByKey(defaultButtons, props.leftButtons);
|
|
2588
2676
|
if (props.customColumnModule) {
|
|
@@ -2611,12 +2699,11 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
|
|
|
2611
2699
|
};
|
|
2612
2700
|
});
|
|
2613
2701
|
const search = async (isInitSearch = false) => {
|
|
2614
|
-
await validate();
|
|
2615
2702
|
tableRef.value.search(isInitSearch);
|
|
2616
2703
|
};
|
|
2617
2704
|
const reset = async () => {
|
|
2618
2705
|
resetFields();
|
|
2619
|
-
search();
|
|
2706
|
+
search(true);
|
|
2620
2707
|
};
|
|
2621
2708
|
const searchButtons = [
|
|
2622
2709
|
{
|
|
@@ -2637,7 +2724,7 @@ const useButtons$1 = (props, { validate, resetFields, tableRef }) => {
|
|
|
2637
2724
|
};
|
|
2638
2725
|
};
|
|
2639
2726
|
|
|
2640
|
-
var _sfc_main$
|
|
2727
|
+
var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2641
2728
|
...{ name: "EpSearchListPage" },
|
|
2642
2729
|
__name: "search-list-page",
|
|
2643
2730
|
props: searchListPageProps,
|
|
@@ -2652,7 +2739,8 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2652
2739
|
reset,
|
|
2653
2740
|
tableRef,
|
|
2654
2741
|
formRef,
|
|
2655
|
-
tableProps
|
|
2742
|
+
tableProps,
|
|
2743
|
+
beforeSearch
|
|
2656
2744
|
} = useSearchListPage(props);
|
|
2657
2745
|
__expose({
|
|
2658
2746
|
search,
|
|
@@ -2683,13 +2771,13 @@ var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2683
2771
|
], 2)
|
|
2684
2772
|
]),
|
|
2685
2773
|
renderSlot(_ctx.$slots, "tableBefore"),
|
|
2686
|
-
createVNode(unref(EpTable),
|
|
2774
|
+
createVNode(unref(EpTable), mergeProps(unref(tableProps), { "before-search": unref(beforeSearch) }), null, 16, ["before-search"])
|
|
2687
2775
|
], 6);
|
|
2688
2776
|
};
|
|
2689
2777
|
}
|
|
2690
2778
|
});
|
|
2691
2779
|
|
|
2692
|
-
const EpSearchListPage = withInstall(_sfc_main$
|
|
2780
|
+
const EpSearchListPage = withInstall(_sfc_main$5);
|
|
2693
2781
|
|
|
2694
2782
|
const inheritSelectProps = {
|
|
2695
2783
|
...selectProps$1,
|
|
@@ -2815,7 +2903,7 @@ function useSelect(props, emit) {
|
|
|
2815
2903
|
};
|
|
2816
2904
|
}
|
|
2817
2905
|
|
|
2818
|
-
var _sfc_main$
|
|
2906
|
+
var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2819
2907
|
...{
|
|
2820
2908
|
name: "EpSelect",
|
|
2821
2909
|
inheritAttrs: false
|
|
@@ -2894,7 +2982,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2894
2982
|
}
|
|
2895
2983
|
});
|
|
2896
2984
|
|
|
2897
|
-
const EpSelect = withInstall(_sfc_main$
|
|
2985
|
+
const EpSelect = withInstall(_sfc_main$4);
|
|
2898
2986
|
|
|
2899
2987
|
const titleProps = {
|
|
2900
2988
|
// 右侧按钮
|
|
@@ -2950,7 +3038,7 @@ const useTitle = (emit) => {
|
|
|
2950
3038
|
};
|
|
2951
3039
|
};
|
|
2952
3040
|
|
|
2953
|
-
var _sfc_main$
|
|
3041
|
+
var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2954
3042
|
...{
|
|
2955
3043
|
name: "EpTitle",
|
|
2956
3044
|
inheritAttrs: false
|
|
@@ -3013,7 +3101,7 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3013
3101
|
}
|
|
3014
3102
|
});
|
|
3015
3103
|
|
|
3016
|
-
const EpTitle = withInstall(_sfc_main$
|
|
3104
|
+
const EpTitle = withInstall(_sfc_main$3);
|
|
3017
3105
|
|
|
3018
3106
|
const headerProps = {
|
|
3019
3107
|
// 页面模式
|
|
@@ -3040,6 +3128,81 @@ const headerProps = {
|
|
|
3040
3128
|
};
|
|
3041
3129
|
const headerEmits = {};
|
|
3042
3130
|
|
|
3131
|
+
const useNavigation = () => {
|
|
3132
|
+
const router = useRouter();
|
|
3133
|
+
const $goto = (r) => {
|
|
3134
|
+
const item = {
|
|
3135
|
+
id: Date.now(),
|
|
3136
|
+
name: "",
|
|
3137
|
+
url: ""
|
|
3138
|
+
};
|
|
3139
|
+
const openTab = window.parent.openMenuSelect;
|
|
3140
|
+
if (r.url) {
|
|
3141
|
+
item.url = r.url;
|
|
3142
|
+
item.name = r.name;
|
|
3143
|
+
if (openTab) {
|
|
3144
|
+
openTab(item);
|
|
3145
|
+
} else {
|
|
3146
|
+
window.open(item.url);
|
|
3147
|
+
}
|
|
3148
|
+
return;
|
|
3149
|
+
}
|
|
3150
|
+
const routes = router.getRoutes() || [];
|
|
3151
|
+
const projectRootPath = window.location.pathname;
|
|
3152
|
+
const findRoute = (routes2, distRoute) => {
|
|
3153
|
+
let queen = [...routes2];
|
|
3154
|
+
while (queen.length) {
|
|
3155
|
+
const first = queen.shift();
|
|
3156
|
+
if (first.children) {
|
|
3157
|
+
queen = queen.concat(first.children);
|
|
3158
|
+
}
|
|
3159
|
+
if (first.name == distRoute.name) {
|
|
3160
|
+
return first;
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
};
|
|
3164
|
+
const route = findRoute(routes, r);
|
|
3165
|
+
if (route) {
|
|
3166
|
+
item.id = r.id || item.id;
|
|
3167
|
+
item.name = r.title || (window.$hxt ? window.$hxt(route.meta.title) : route.meta.title);
|
|
3168
|
+
item.url = `${projectRootPath}#${route.path}${qs.stringify(r.query, { encode: false })}`;
|
|
3169
|
+
if (openTab) {
|
|
3170
|
+
openTab(item);
|
|
3171
|
+
} else {
|
|
3172
|
+
router.push(r);
|
|
3173
|
+
}
|
|
3174
|
+
} else {
|
|
3175
|
+
console.error("\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u7684\u8DEF\u7531");
|
|
3176
|
+
}
|
|
3177
|
+
};
|
|
3178
|
+
const $closeTag = () => {
|
|
3179
|
+
if (!window.parent.selectedRouterTags) {
|
|
3180
|
+
return;
|
|
3181
|
+
}
|
|
3182
|
+
const currentRouterTagIndex = window.parent.currentRouterTagIndex;
|
|
3183
|
+
const preIndex = window.parent.currentRouterTagIndex - 1;
|
|
3184
|
+
const currentTag = window.parent.selectedRouterTags[currentRouterTagIndex];
|
|
3185
|
+
const preTag = window.parent.selectedRouterTags[preIndex];
|
|
3186
|
+
window.parent?.closeTag?.(currentTag);
|
|
3187
|
+
window.parent?.openMenuSelect?.(preTag);
|
|
3188
|
+
};
|
|
3189
|
+
const mode = computed(() => {
|
|
3190
|
+
const { query } = useRoute();
|
|
3191
|
+
return query.mode;
|
|
3192
|
+
});
|
|
3193
|
+
const isBrowse = computed(() => mode.value === "browse");
|
|
3194
|
+
const isEdit = computed(() => mode.value === "edit");
|
|
3195
|
+
const isAdd = computed(() => mode.value === "add");
|
|
3196
|
+
return {
|
|
3197
|
+
$goto,
|
|
3198
|
+
$closeTag,
|
|
3199
|
+
mode,
|
|
3200
|
+
isBrowse,
|
|
3201
|
+
isEdit,
|
|
3202
|
+
isAdd
|
|
3203
|
+
};
|
|
3204
|
+
};
|
|
3205
|
+
|
|
3043
3206
|
const useHeader = (props, emit) => {
|
|
3044
3207
|
const router = useRouter();
|
|
3045
3208
|
const isShowBack = computed(() => {
|
|
@@ -3061,13 +3224,9 @@ const useHeader = (props, emit) => {
|
|
|
3061
3224
|
};
|
|
3062
3225
|
const useButtons = (props, emit) => {
|
|
3063
3226
|
const { t } = useLocale();
|
|
3227
|
+
const { mode: defaultMode } = useNavigation();
|
|
3064
3228
|
const mode = computed(() => {
|
|
3065
|
-
|
|
3066
|
-
let mode2 = props.mode;
|
|
3067
|
-
if (query.mode) {
|
|
3068
|
-
mode2 = query.mode;
|
|
3069
|
-
}
|
|
3070
|
-
return mode2;
|
|
3229
|
+
return props.mode || defaultMode;
|
|
3071
3230
|
});
|
|
3072
3231
|
let defaultButtons = [
|
|
3073
3232
|
{
|
|
@@ -3124,7 +3283,7 @@ const useButtons = (props, emit) => {
|
|
|
3124
3283
|
};
|
|
3125
3284
|
};
|
|
3126
3285
|
|
|
3127
|
-
var _sfc_main$
|
|
3286
|
+
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3128
3287
|
...{
|
|
3129
3288
|
name: "EpHeader",
|
|
3130
3289
|
inheritAttrs: false
|
|
@@ -3157,7 +3316,7 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
3157
3316
|
}
|
|
3158
3317
|
});
|
|
3159
3318
|
|
|
3160
|
-
const EpHeader = withInstall(_sfc_main$
|
|
3319
|
+
const EpHeader = withInstall(_sfc_main$2);
|
|
3161
3320
|
|
|
3162
3321
|
const { t } = useLocale();
|
|
3163
3322
|
const datePickerRangeProps = {
|
|
@@ -3227,7 +3386,7 @@ const datePickerRangeProps = {
|
|
|
3227
3386
|
};
|
|
3228
3387
|
const datePickerRangeEmits = {};
|
|
3229
3388
|
|
|
3230
|
-
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3389
|
+
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3231
3390
|
...{
|
|
3232
3391
|
name: "EpDatePickerRange",
|
|
3233
3392
|
inheritAttrs: false
|
|
@@ -3283,7 +3442,69 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3283
3442
|
}
|
|
3284
3443
|
});
|
|
3285
3444
|
|
|
3286
|
-
const EpDatePickerRange = withInstall(_sfc_main);
|
|
3445
|
+
const EpDatePickerRange = withInstall(_sfc_main$1);
|
|
3446
|
+
|
|
3447
|
+
const linkProps = {
|
|
3448
|
+
...linkProps$1,
|
|
3449
|
+
content: {
|
|
3450
|
+
type: String
|
|
3451
|
+
},
|
|
3452
|
+
type: {
|
|
3453
|
+
...linkProps$1.type,
|
|
3454
|
+
default: "primary"
|
|
3455
|
+
},
|
|
3456
|
+
underline: {
|
|
3457
|
+
...linkProps$1.underline,
|
|
3458
|
+
default: "never"
|
|
3459
|
+
}
|
|
3460
|
+
};
|
|
3461
|
+
|
|
3462
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3463
|
+
...{
|
|
3464
|
+
name: "EpLink",
|
|
3465
|
+
inheritAttrs: false
|
|
3466
|
+
},
|
|
3467
|
+
__name: "link",
|
|
3468
|
+
props: linkProps,
|
|
3469
|
+
setup(__props) {
|
|
3470
|
+
const bem = createNameSpace("link");
|
|
3471
|
+
const props = __props;
|
|
3472
|
+
const attrs = useAttrs();
|
|
3473
|
+
const slots = computed(() => {
|
|
3474
|
+
return Object.keys(useSlots());
|
|
3475
|
+
});
|
|
3476
|
+
return (_ctx, _cache) => {
|
|
3477
|
+
const _component_el_link = resolveComponent("el-link");
|
|
3478
|
+
return openBlock(), createBlock(_component_el_link, mergeProps({
|
|
3479
|
+
class: `${unref(bem).b()} ${unref(prepareClassNames)()}`,
|
|
3480
|
+
style: {
|
|
3481
|
+
...unref(prepareStyles)()
|
|
3482
|
+
}
|
|
3483
|
+
}, {
|
|
3484
|
+
...props,
|
|
3485
|
+
...unref(attrs)
|
|
3486
|
+
}), createSlots({
|
|
3487
|
+
default: withCtx(() => [
|
|
3488
|
+
_ctx.content ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3489
|
+
createTextVNode(toDisplayString(_ctx.content), 1)
|
|
3490
|
+
], 64)) : createCommentVNode("", true)
|
|
3491
|
+
]),
|
|
3492
|
+
_: 2
|
|
3493
|
+
}, [
|
|
3494
|
+
renderList(slots.value, (name) => {
|
|
3495
|
+
return {
|
|
3496
|
+
name,
|
|
3497
|
+
fn: withCtx((scope) => [
|
|
3498
|
+
renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(scope)))
|
|
3499
|
+
])
|
|
3500
|
+
};
|
|
3501
|
+
})
|
|
3502
|
+
]), 1040, ["class", "style"]);
|
|
3503
|
+
};
|
|
3504
|
+
}
|
|
3505
|
+
});
|
|
3506
|
+
|
|
3507
|
+
const EpLink = withInstall(_sfc_main);
|
|
3287
3508
|
|
|
3288
3509
|
var components = [
|
|
3289
3510
|
EpButtons,
|
|
@@ -3295,10 +3516,11 @@ var components = [
|
|
|
3295
3516
|
EpTitle,
|
|
3296
3517
|
EpHeader,
|
|
3297
3518
|
EpDatePickerRange,
|
|
3298
|
-
EpCustomColumn
|
|
3519
|
+
EpCustomColumn,
|
|
3520
|
+
EpLink
|
|
3299
3521
|
];
|
|
3300
3522
|
|
|
3301
|
-
var version = "0.0.
|
|
3523
|
+
var version = "0.0.20";
|
|
3302
3524
|
|
|
3303
3525
|
var globalProperties = {
|
|
3304
3526
|
install(app) {
|
|
@@ -3311,7 +3533,7 @@ var plugins = /*#__PURE__*/Object.freeze({
|
|
|
3311
3533
|
globalProperties: globalProperties
|
|
3312
3534
|
});
|
|
3313
3535
|
|
|
3314
|
-
const bem
|
|
3536
|
+
const bem = createNameSpace("choose-dialog");
|
|
3315
3537
|
const useChooseDialog = (options = {}) => {
|
|
3316
3538
|
const {
|
|
3317
3539
|
t
|
|
@@ -3328,12 +3550,12 @@ const useChooseDialog = (options = {}) => {
|
|
|
3328
3550
|
if (!showSingleSelectionCol) {
|
|
3329
3551
|
scopedSlots.footerPrepend = () => {
|
|
3330
3552
|
return createVNode("span", {
|
|
3331
|
-
"class": bem
|
|
3553
|
+
"class": bem.e("selected-count")
|
|
3332
3554
|
}, [t("ep.chooseDialog.selected"), selections.length, t("ep.chooseDialog.unit")]);
|
|
3333
3555
|
};
|
|
3334
3556
|
}
|
|
3335
3557
|
return useDialog({
|
|
3336
|
-
class: bem
|
|
3558
|
+
class: bem.b(),
|
|
3337
3559
|
width: "80%",
|
|
3338
3560
|
showFooter: !showSingleSelectionCol,
|
|
3339
3561
|
scopedSlots,
|
|
@@ -3370,102 +3592,6 @@ const useChooseDialog = (options = {}) => {
|
|
|
3370
3592
|
});
|
|
3371
3593
|
};
|
|
3372
3594
|
|
|
3373
|
-
const bem = createNameSpace("form-dialog");
|
|
3374
|
-
const useFormDialog = (options = {}) => {
|
|
3375
|
-
const {
|
|
3376
|
-
dialogProps,
|
|
3377
|
-
title,
|
|
3378
|
-
...formProps
|
|
3379
|
-
} = options;
|
|
3380
|
-
const formRef = ref();
|
|
3381
|
-
let formData = formProps.formData || reactive({});
|
|
3382
|
-
return useDialog({
|
|
3383
|
-
class: bem.b(),
|
|
3384
|
-
width: "80%",
|
|
3385
|
-
title,
|
|
3386
|
-
render: (props) => {
|
|
3387
|
-
return createVNode(EpForm, mergeProps({
|
|
3388
|
-
"ref": formRef,
|
|
3389
|
-
"modelValue": formData,
|
|
3390
|
-
"onUpdate:modelValue": ($event) => formData = $event
|
|
3391
|
-
}, {
|
|
3392
|
-
col: 1,
|
|
3393
|
-
"label-width": "auto",
|
|
3394
|
-
...formProps
|
|
3395
|
-
}), null);
|
|
3396
|
-
},
|
|
3397
|
-
onConfirm: async (resolve) => {
|
|
3398
|
-
await formRef.value.validate();
|
|
3399
|
-
resolve(formData);
|
|
3400
|
-
},
|
|
3401
|
-
...dialogProps
|
|
3402
|
-
});
|
|
3403
|
-
};
|
|
3404
|
-
|
|
3405
|
-
const useNavigation = () => {
|
|
3406
|
-
const router = useRouter();
|
|
3407
|
-
const $goto = (r) => {
|
|
3408
|
-
const item = {
|
|
3409
|
-
id: Date.now(),
|
|
3410
|
-
name: "",
|
|
3411
|
-
url: ""
|
|
3412
|
-
};
|
|
3413
|
-
const openTab = window.parent.openMenuSelect;
|
|
3414
|
-
if (r.url) {
|
|
3415
|
-
item.url = r.url;
|
|
3416
|
-
item.name = r.name;
|
|
3417
|
-
if (openTab) {
|
|
3418
|
-
openTab(item);
|
|
3419
|
-
} else {
|
|
3420
|
-
window.open(item.url);
|
|
3421
|
-
}
|
|
3422
|
-
return;
|
|
3423
|
-
}
|
|
3424
|
-
const routes = router.getRoutes() || [];
|
|
3425
|
-
const projectRootPath = window.location.pathname;
|
|
3426
|
-
const findRoute = (routes2, distRoute) => {
|
|
3427
|
-
let queen = [...routes2];
|
|
3428
|
-
while (queen.length) {
|
|
3429
|
-
const first = queen.shift();
|
|
3430
|
-
if (first.children) {
|
|
3431
|
-
queen = queen.concat(first.children);
|
|
3432
|
-
}
|
|
3433
|
-
if (first.name == distRoute.name) {
|
|
3434
|
-
return first;
|
|
3435
|
-
}
|
|
3436
|
-
}
|
|
3437
|
-
};
|
|
3438
|
-
const route = findRoute(routes, r);
|
|
3439
|
-
if (route) {
|
|
3440
|
-
item.id = r.id || item.id;
|
|
3441
|
-
item.name = r.title || (window.$hxt ? window.$hxt(route.meta.title) : route.meta.title);
|
|
3442
|
-
item.url = `${projectRootPath}#${route.path}${qs.stringify(r.query, { encode: false })}`;
|
|
3443
|
-
if (openTab) {
|
|
3444
|
-
openTab(item);
|
|
3445
|
-
} else {
|
|
3446
|
-
router.push(r);
|
|
3447
|
-
}
|
|
3448
|
-
} else {
|
|
3449
|
-
console.error("\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u7684\u8DEF\u7531");
|
|
3450
|
-
}
|
|
3451
|
-
};
|
|
3452
|
-
const $closeTag = () => {
|
|
3453
|
-
if (!window.parent.selectedRouterTags) {
|
|
3454
|
-
return;
|
|
3455
|
-
}
|
|
3456
|
-
const currentRouterTagIndex = window.parent.currentRouterTagIndex;
|
|
3457
|
-
const preIndex = window.parent.currentRouterTagIndex - 1;
|
|
3458
|
-
const currentTag = window.parent.selectedRouterTags[currentRouterTagIndex];
|
|
3459
|
-
const preTag = window.parent.selectedRouterTags[preIndex];
|
|
3460
|
-
window.parent?.closeTag?.(currentTag);
|
|
3461
|
-
window.parent?.openMenuSelect?.(preTag);
|
|
3462
|
-
};
|
|
3463
|
-
return {
|
|
3464
|
-
$goto,
|
|
3465
|
-
$closeTag
|
|
3466
|
-
};
|
|
3467
|
-
};
|
|
3468
|
-
|
|
3469
3595
|
const INSTALLED_KEY = /* @__PURE__ */ Symbol("INSTALLED_KEY");
|
|
3470
3596
|
const install = (app, options) => {
|
|
3471
3597
|
if (app[INSTALLED_KEY]) return;
|
|
@@ -3478,4 +3604,4 @@ const plugin = {
|
|
|
3478
3604
|
version
|
|
3479
3605
|
};
|
|
3480
3606
|
|
|
3481
|
-
export { EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpSearchListPage, EpSelect, EpTable, EpTitle, buttonsProps, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, useChooseDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };
|
|
3607
|
+
export { EpButtons, EpCustomColumn, EpDatePickerRange, EpForm, EpFormItem, EpHeader, EpInput, EpLink, EpSearchListPage, EpSelect, EpTable, EpTitle, buttonsProps, customColumnEmits, customColumnProps, datePickerRangeEmits, datePickerRangeProps, plugin as default, expandFormItemPropsKeys, expandFormPropsKeys, expandSelectPropsKeys, expandTablePropsKeys, formEmits, formEmitsKeys, formItemProps, formProps, headerEmits, headerProps, inheritSelectProps, inputEmits, inputEmitsKeys, inputProps, install, linkProps, searchListPageProps, selectEmits, selectEmitsKeys, selectProps, tableEmits, tableEmitsKeys, tableProps, titleEmits, titleProps, useChooseDialog, useDialog, useFormDialog, useLocale, useNavigation, useRequest, useTemplatePromise, vPermisson as vPermission, vRepeatClick };
|