el-plus 0.0.17 → 0.0.19
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 +241 -115
- 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 +240 -115
- 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 +2 -2
- package/es/components/form/src/form-item.d.ts +1 -1
- 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/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 -30
- package/es/components/search-list-page/src/search-list-page.d.ts +1 -1
- package/es/components/search-list-page/src/search-list-page.mjs +3 -3
- 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 -11
- 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 +4 -4
- 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 +98 -38
- 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/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 +2 -2
- package/lib/components/form/src/form-item.d.ts +1 -1
- 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/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 -30
- package/lib/components/search-list-page/src/search-list-page.d.ts +1 -1
- package/lib/components/search-list-page/src/search-list-page.js +3 -3
- 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 -11
- 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 +4 -4
- 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 +97 -37
- 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/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/custom-column.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/link.css +1 -0
- package/theme-chalk/src/custom-column.scss +6 -4
- 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.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! ElPlus v0.0.
|
|
1
|
+
/*! ElPlus v0.0.19 */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus'), require('@vue/shared'), require('axios'), require('js-cookie'), require('defu'), require('qs'), require('element-plus/es/components/table/src/table/defaults'), require('@element-plus/icons-vue'), require('mitt'), require('@vueuse/core'), require('vue-router')) :
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus', '@vue/shared', 'axios', 'js-cookie', 'defu', 'qs', 'element-plus/es/components/table/src/table/defaults', '@element-plus/icons-vue', 'mitt', '@vueuse/core', 'vue-router'], factory) :
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ElPlus = {}, global.Vue, global.ElementPlus, global.shared, global.axios, global.Cookies, global.defu, global.qs, global.elTableProps, global.iconsVue, global.mitt, global.core, global.vueRouter));
|
|
7
|
-
})(this, (function (exports, vue, elementPlus, shared, axios, Cookies, defu, qs, elTableProps, iconsVue, mitt, core, vueRouter) { 'use strict';
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus'), require('@vue/shared'), require('axios'), require('js-cookie'), require('defu'), require('qs'), require('element-plus/es/components/table/src/table/defaults'), require('@element-plus/icons-vue'), require('mitt'), require('lodash-unified'), require('@vueuse/core'), require('vue-router')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus', '@vue/shared', 'axios', 'js-cookie', 'defu', 'qs', 'element-plus/es/components/table/src/table/defaults', '@element-plus/icons-vue', 'mitt', 'lodash-unified', '@vueuse/core', 'vue-router'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ElPlus = {}, global.Vue, global.ElementPlus, global.shared, global.axios, global.Cookies, global.defu, global.qs, global.elTableProps, global.iconsVue, global.mitt, global.lodashUnified, global.core, global.vueRouter));
|
|
7
|
+
})(this, (function (exports, vue, elementPlus, shared, axios, Cookies, defu, qs, elTableProps, iconsVue, mitt, lodashUnified, core, vueRouter) { 'use strict';
|
|
8
8
|
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
|
10
10
|
var n = Object.create(null);
|
|
@@ -949,7 +949,9 @@
|
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
951
|
if (render) {
|
|
952
|
-
scopedSlots.default =
|
|
952
|
+
scopedSlots.default = () => {
|
|
953
|
+
return render(attrs["table-scope"]);
|
|
954
|
+
};
|
|
953
955
|
}
|
|
954
956
|
return {
|
|
955
957
|
scopedSlots
|
|
@@ -1054,7 +1056,7 @@
|
|
|
1054
1056
|
}
|
|
1055
1057
|
});
|
|
1056
1058
|
|
|
1057
|
-
var _sfc_main$
|
|
1059
|
+
var _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
1058
1060
|
...{
|
|
1059
1061
|
name: "EpForm",
|
|
1060
1062
|
inheritAttrs: false
|
|
@@ -1152,7 +1154,7 @@
|
|
|
1152
1154
|
}
|
|
1153
1155
|
});
|
|
1154
1156
|
|
|
1155
|
-
const EpForm = withInstall(_sfc_main$
|
|
1157
|
+
const EpForm = withInstall(_sfc_main$9);
|
|
1156
1158
|
|
|
1157
1159
|
const { t: t$2 } = useLocale();
|
|
1158
1160
|
const inputProps = {
|
|
@@ -1181,7 +1183,7 @@
|
|
|
1181
1183
|
};
|
|
1182
1184
|
const inputEmitsKeys = Object.keys(inputEmits);
|
|
1183
1185
|
|
|
1184
|
-
var _sfc_main$
|
|
1186
|
+
var _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
1185
1187
|
...{
|
|
1186
1188
|
name: "EpInput",
|
|
1187
1189
|
inheritAttrs: false
|
|
@@ -1315,7 +1317,7 @@
|
|
|
1315
1317
|
}
|
|
1316
1318
|
});
|
|
1317
1319
|
|
|
1318
|
-
const EpInput = withInstall(_sfc_main$
|
|
1320
|
+
const EpInput = withInstall(_sfc_main$8);
|
|
1319
1321
|
|
|
1320
1322
|
function _isSlot$1(s) {
|
|
1321
1323
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
@@ -1408,6 +1410,7 @@
|
|
|
1408
1410
|
} = useLocale();
|
|
1409
1411
|
const {
|
|
1410
1412
|
scopedSlots = {},
|
|
1413
|
+
instance,
|
|
1411
1414
|
render,
|
|
1412
1415
|
destroyOnClose,
|
|
1413
1416
|
onConfirm,
|
|
@@ -1483,10 +1486,10 @@
|
|
|
1483
1486
|
});
|
|
1484
1487
|
if (render) {
|
|
1485
1488
|
const container = document.createElement("div");
|
|
1486
|
-
const
|
|
1489
|
+
const newInstance = instance || vue.getCurrentInstance();
|
|
1487
1490
|
const vnode = vue.h(Dialog);
|
|
1488
|
-
if (
|
|
1489
|
-
vnode.appContext =
|
|
1491
|
+
if (newInstance && newInstance.appContext) {
|
|
1492
|
+
vnode.appContext = newInstance.appContext;
|
|
1490
1493
|
}
|
|
1491
1494
|
vue.render(vnode, container);
|
|
1492
1495
|
document.body.appendChild(container);
|
|
@@ -1636,7 +1639,7 @@
|
|
|
1636
1639
|
}
|
|
1637
1640
|
};
|
|
1638
1641
|
|
|
1639
|
-
var _sfc_main$
|
|
1642
|
+
var _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
1640
1643
|
...{
|
|
1641
1644
|
name: "EpCustomColumn",
|
|
1642
1645
|
inheritAttrs: false
|
|
@@ -1841,7 +1844,7 @@
|
|
|
1841
1844
|
}
|
|
1842
1845
|
});
|
|
1843
1846
|
|
|
1844
|
-
const EpCustomColumn = withInstall(_sfc_main$
|
|
1847
|
+
const EpCustomColumn = withInstall(_sfc_main$7);
|
|
1845
1848
|
|
|
1846
1849
|
const inheritTableProps = {
|
|
1847
1850
|
...elTableProps,
|
|
@@ -1915,8 +1918,8 @@
|
|
|
1915
1918
|
type: Array,
|
|
1916
1919
|
default: () => []
|
|
1917
1920
|
},
|
|
1918
|
-
//
|
|
1919
|
-
|
|
1921
|
+
// 格式化列
|
|
1922
|
+
formatColumns: {
|
|
1920
1923
|
type: Array,
|
|
1921
1924
|
default: () => []
|
|
1922
1925
|
},
|
|
@@ -1938,6 +1941,38 @@
|
|
|
1938
1941
|
const tableEmits = [...elementPlus.ElTable.emits, "single-selection-change"];
|
|
1939
1942
|
const tableEmitsKeys = tableEmits;
|
|
1940
1943
|
|
|
1944
|
+
const bem$1 = createNameSpace("form-dialog");
|
|
1945
|
+
const useFormDialog = (options = {}) => {
|
|
1946
|
+
const {
|
|
1947
|
+
dialogProps,
|
|
1948
|
+
title,
|
|
1949
|
+
...formProps
|
|
1950
|
+
} = options;
|
|
1951
|
+
const formRef = vue.ref();
|
|
1952
|
+
let formData = formProps.formData || vue.reactive({});
|
|
1953
|
+
return useDialog({
|
|
1954
|
+
class: bem$1.b(),
|
|
1955
|
+
width: "80%",
|
|
1956
|
+
title,
|
|
1957
|
+
render: (props) => {
|
|
1958
|
+
return vue.createVNode(EpForm, vue.mergeProps({
|
|
1959
|
+
"ref": formRef,
|
|
1960
|
+
"modelValue": formData,
|
|
1961
|
+
"onUpdate:modelValue": ($event) => formData = $event
|
|
1962
|
+
}, {
|
|
1963
|
+
col: 1,
|
|
1964
|
+
"label-width": "auto",
|
|
1965
|
+
...formProps
|
|
1966
|
+
}), null);
|
|
1967
|
+
},
|
|
1968
|
+
onConfirm: async (resolve) => {
|
|
1969
|
+
await formRef.value.validate();
|
|
1970
|
+
resolve(formData);
|
|
1971
|
+
},
|
|
1972
|
+
...dialogProps
|
|
1973
|
+
});
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1941
1976
|
const useTable$1 = (props) => {
|
|
1942
1977
|
const elFormRef = vue.useTemplateRef("elFormRef");
|
|
1943
1978
|
const elTableRef = vue.useTemplateRef("elTableRef");
|
|
@@ -1973,14 +2008,11 @@
|
|
|
1973
2008
|
}
|
|
1974
2009
|
});
|
|
1975
2010
|
const customColumns = vue.ref([]);
|
|
2011
|
+
const attrs = vue.useAttrs();
|
|
1976
2012
|
const search = async (init = false, isPagination = false) => {
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
customColumns.value = columns;
|
|
1981
|
-
bus.on("loadedCustomColumn", (columns2) => {
|
|
1982
|
-
customColumns.value = columns2;
|
|
1983
|
-
});
|
|
2013
|
+
const beforeSearch = attrs["before-search"];
|
|
2014
|
+
if (typeof beforeSearch === "function") {
|
|
2015
|
+
await beforeSearch?.();
|
|
1984
2016
|
}
|
|
1985
2017
|
if (init) {
|
|
1986
2018
|
pagination.pageNo = 1;
|
|
@@ -1998,7 +2030,8 @@
|
|
|
1998
2030
|
if (props.api) {
|
|
1999
2031
|
requestFn({
|
|
2000
2032
|
pageNo: pagination.pageNo,
|
|
2001
|
-
pageSize: pagination.pageSize
|
|
2033
|
+
pageSize: pagination.pageSize,
|
|
2034
|
+
pageNum: pagination.pageNo
|
|
2002
2035
|
});
|
|
2003
2036
|
} else if (props.data?.length) {
|
|
2004
2037
|
customData.value = props.data;
|
|
@@ -2009,9 +2042,20 @@
|
|
|
2009
2042
|
pagination,
|
|
2010
2043
|
paginationProps
|
|
2011
2044
|
} = usePagination(props, search);
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2045
|
+
(async () => {
|
|
2046
|
+
if (props.isInitSearch) {
|
|
2047
|
+
if (props.customColumnModule) {
|
|
2048
|
+
loading.value = true;
|
|
2049
|
+
const columns = await bus.once("loadedCustomColumn");
|
|
2050
|
+
loading.value = false;
|
|
2051
|
+
customColumns.value = columns;
|
|
2052
|
+
bus.on("loadedCustomColumn", (columns2) => {
|
|
2053
|
+
customColumns.value = columns2;
|
|
2054
|
+
});
|
|
2055
|
+
}
|
|
2056
|
+
search(true);
|
|
2057
|
+
}
|
|
2058
|
+
})();
|
|
2015
2059
|
const validate = () => {
|
|
2016
2060
|
return elFormRef.value.validate();
|
|
2017
2061
|
};
|
|
@@ -2075,6 +2119,7 @@
|
|
|
2075
2119
|
};
|
|
2076
2120
|
};
|
|
2077
2121
|
const useTableColumn = (props, tableData, customColumns) => {
|
|
2122
|
+
const instance = vue.getCurrentInstance();
|
|
2078
2123
|
const columnProps = (column) => {
|
|
2079
2124
|
const attrs = {
|
|
2080
2125
|
"show-overflow-tooltip": true,
|
|
@@ -2087,16 +2132,50 @@
|
|
|
2087
2132
|
if (typeof column.required === "function") {
|
|
2088
2133
|
required = column.required();
|
|
2089
2134
|
}
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
"
|
|
2097
|
-
},
|
|
2098
|
-
|
|
2099
|
-
|
|
2135
|
+
const editable = column.editable;
|
|
2136
|
+
attrs["renderHeader"] = () => {
|
|
2137
|
+
return vue.createVNode("span", null, [required ? vue.createVNode("span", {
|
|
2138
|
+
"style": "color:var(--el-color-danger)"
|
|
2139
|
+
}, [vue.createTextVNode(" * ")]) : "", vue.createVNode("span", {
|
|
2140
|
+
"class": {
|
|
2141
|
+
"is-edit": editable
|
|
2142
|
+
},
|
|
2143
|
+
"onClick": editable ? async () => {
|
|
2144
|
+
const cloneColumn = {
|
|
2145
|
+
...column
|
|
2146
|
+
};
|
|
2147
|
+
delete cloneColumn.editable;
|
|
2148
|
+
const rawRender = cloneColumn.render;
|
|
2149
|
+
const formData = vue.reactive({});
|
|
2150
|
+
if (rawRender) {
|
|
2151
|
+
cloneColumn.render = () => {
|
|
2152
|
+
return rawRender({
|
|
2153
|
+
row: formData
|
|
2154
|
+
});
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
const formDialog = useFormDialog({
|
|
2158
|
+
title: cloneColumn.label,
|
|
2159
|
+
dialogProps: {
|
|
2160
|
+
destroyOnClose: true,
|
|
2161
|
+
instance
|
|
2162
|
+
},
|
|
2163
|
+
formItemList: [cloneColumn],
|
|
2164
|
+
formData
|
|
2165
|
+
// formData: reactive({}),
|
|
2166
|
+
});
|
|
2167
|
+
const data = await formDialog.open();
|
|
2168
|
+
(tableData.value || []).forEach((item) => {
|
|
2169
|
+
item[column.prop] = data[column.prop];
|
|
2170
|
+
});
|
|
2171
|
+
if (typeof editable === "function") {
|
|
2172
|
+
editable(vue.toRaw(data));
|
|
2173
|
+
}
|
|
2174
|
+
} : void 0
|
|
2175
|
+
}, [column.label, editable ? vue.createVNode(elementPlus.ElIcon, null, {
|
|
2176
|
+
default: () => [vue.createVNode(iconsVue.EditPen, null, null)]
|
|
2177
|
+
}) : ""])]);
|
|
2178
|
+
};
|
|
2100
2179
|
}
|
|
2101
2180
|
if (column.filter) {
|
|
2102
2181
|
const arr = tableData.value.map((item) => item[column.prop]);
|
|
@@ -2110,29 +2189,31 @@
|
|
|
2110
2189
|
return row[column.prop] === value;
|
|
2111
2190
|
};
|
|
2112
2191
|
}
|
|
2192
|
+
if (column.type === "EpLink") {
|
|
2193
|
+
attrs.className = "table-column-link";
|
|
2194
|
+
}
|
|
2113
2195
|
return {
|
|
2114
2196
|
...attrs,
|
|
2115
2197
|
...prepareProps(column)
|
|
2116
2198
|
};
|
|
2117
2199
|
};
|
|
2118
2200
|
const columnList = vue.computed(() => {
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
if (props.
|
|
2125
|
-
const
|
|
2126
|
-
if (
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
list: [linkColumn],
|
|
2131
|
-
type: "text",
|
|
2132
|
-
...column.props
|
|
2201
|
+
const columns = props.customColumnModule ? customColumns.value : props.columns;
|
|
2202
|
+
return columns.map((column) => {
|
|
2203
|
+
let newColumn = {
|
|
2204
|
+
...column
|
|
2205
|
+
};
|
|
2206
|
+
if (props.formatColumns.length) {
|
|
2207
|
+
const formatColumn = props.formatColumns.find((item) => item.prop === column.prop);
|
|
2208
|
+
if (formatColumn) {
|
|
2209
|
+
newColumn = {
|
|
2210
|
+
...newColumn,
|
|
2211
|
+
...formatColumn
|
|
2133
2212
|
};
|
|
2134
2213
|
}
|
|
2135
2214
|
}
|
|
2215
|
+
return newColumn;
|
|
2216
|
+
}).filter((column) => {
|
|
2136
2217
|
if ("show" in column) {
|
|
2137
2218
|
return typeof column.show === "function" ? column.show(column) : column.show;
|
|
2138
2219
|
} else if ("hide" in column) {
|
|
@@ -2147,7 +2228,8 @@
|
|
|
2147
2228
|
};
|
|
2148
2229
|
};
|
|
2149
2230
|
const useTableFormItem = (props) => {
|
|
2150
|
-
const formItemProps = (scope,
|
|
2231
|
+
const formItemProps = (scope, rawItem) => {
|
|
2232
|
+
const item = lodashUnified.cloneDeep(rawItem);
|
|
2151
2233
|
let required = item.required;
|
|
2152
2234
|
if (typeof required === "function") {
|
|
2153
2235
|
required = required();
|
|
@@ -2182,10 +2264,19 @@
|
|
|
2182
2264
|
}
|
|
2183
2265
|
});
|
|
2184
2266
|
}
|
|
2267
|
+
if (item.type === "EpLink") {
|
|
2268
|
+
(item.props ? item.props : item.props = {}).content = item.props.content || scope.row[item.prop];
|
|
2269
|
+
}
|
|
2185
2270
|
for (const key in item) {
|
|
2186
2271
|
if (key.startsWith("on") && typeof item[key] === "function") {
|
|
2187
2272
|
const fn = item[key];
|
|
2188
|
-
item[key] = (...args) =>
|
|
2273
|
+
item[key] = (...args) => {
|
|
2274
|
+
let event;
|
|
2275
|
+
if (args[0] instanceof Event) {
|
|
2276
|
+
event = args.shift();
|
|
2277
|
+
}
|
|
2278
|
+
return fn(...args, scope, event);
|
|
2279
|
+
};
|
|
2189
2280
|
}
|
|
2190
2281
|
}
|
|
2191
2282
|
return {
|
|
@@ -2207,7 +2298,7 @@
|
|
|
2207
2298
|
};
|
|
2208
2299
|
};
|
|
2209
2300
|
|
|
2210
|
-
var _sfc_main$
|
|
2301
|
+
var _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
2211
2302
|
...{
|
|
2212
2303
|
name: "EpTable",
|
|
2213
2304
|
inheritAttrs: false
|
|
@@ -2355,12 +2446,13 @@
|
|
|
2355
2446
|
}, {
|
|
2356
2447
|
ref_for: true
|
|
2357
2448
|
}, vue.unref(columnProps)(item)), {
|
|
2358
|
-
default: vue.withCtx((scope) => [item.type ? (vue.openBlock(), vue.createBlock(vue.unref(EpFormItem), vue.mergeProps({
|
|
2449
|
+
default: vue.withCtx((scope) => [item.type || item.render ? (vue.openBlock(), vue.createBlock(vue.unref(EpFormItem), vue.mergeProps({
|
|
2359
2450
|
key: 0,
|
|
2360
|
-
"form-data": scope.row
|
|
2451
|
+
"form-data": scope.row,
|
|
2452
|
+
"table-scope": scope
|
|
2361
2453
|
}, {
|
|
2362
2454
|
ref_for: true
|
|
2363
|
-
}, vue.unref(formItemProps)(scope, item)), null, 16, ["form-data"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
2455
|
+
}, vue.unref(formItemProps)(scope, item)), null, 16, ["form-data", "table-scope"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
2364
2456
|
key: 1
|
|
2365
2457
|
}, [vue.createTextVNode(vue.toDisplayString(scope.row[item.prop]), 1)], 64))]),
|
|
2366
2458
|
_: 2
|
|
@@ -2392,7 +2484,7 @@
|
|
|
2392
2484
|
}
|
|
2393
2485
|
});
|
|
2394
2486
|
|
|
2395
|
-
const EpTable = withInstall(_sfc_main$
|
|
2487
|
+
const EpTable = withInstall(_sfc_main$6);
|
|
2396
2488
|
|
|
2397
2489
|
const searchListPageProps = {
|
|
2398
2490
|
...apiProps,
|
|
@@ -2426,9 +2518,9 @@
|
|
|
2426
2518
|
actionButtons: {
|
|
2427
2519
|
...tableProps.actionButtons
|
|
2428
2520
|
},
|
|
2429
|
-
//
|
|
2430
|
-
|
|
2431
|
-
...tableProps.
|
|
2521
|
+
// 格式化列
|
|
2522
|
+
formatColumns: {
|
|
2523
|
+
...tableProps.formatColumns
|
|
2432
2524
|
},
|
|
2433
2525
|
showSelectionCol: Boolean,
|
|
2434
2526
|
showSingleSelectionCol: Boolean,
|
|
@@ -2483,7 +2575,8 @@
|
|
|
2483
2575
|
search,
|
|
2484
2576
|
reset,
|
|
2485
2577
|
tableRef,
|
|
2486
|
-
formRef
|
|
2578
|
+
formRef,
|
|
2579
|
+
beforeSearch: validate
|
|
2487
2580
|
};
|
|
2488
2581
|
};
|
|
2489
2582
|
const useTable = (props, config) => {
|
|
@@ -2500,7 +2593,7 @@
|
|
|
2500
2593
|
showSelectionCol: props.showSelectionCol,
|
|
2501
2594
|
showSingleSelectionCol: props.showSingleSelectionCol,
|
|
2502
2595
|
actionButtons: props.actionButtons,
|
|
2503
|
-
|
|
2596
|
+
formatColumns: props.formatColumns,
|
|
2504
2597
|
api: props.api,
|
|
2505
2598
|
reqData: props.formData,
|
|
2506
2599
|
customColumnModule: props.customColumnModule,
|
|
@@ -2620,12 +2713,11 @@
|
|
|
2620
2713
|
};
|
|
2621
2714
|
});
|
|
2622
2715
|
const search = async (isInitSearch = false) => {
|
|
2623
|
-
await validate();
|
|
2624
2716
|
tableRef.value.search(isInitSearch);
|
|
2625
2717
|
};
|
|
2626
2718
|
const reset = async () => {
|
|
2627
2719
|
resetFields();
|
|
2628
|
-
search();
|
|
2720
|
+
search(true);
|
|
2629
2721
|
};
|
|
2630
2722
|
const searchButtons = [
|
|
2631
2723
|
{
|
|
@@ -2646,7 +2738,7 @@
|
|
|
2646
2738
|
};
|
|
2647
2739
|
};
|
|
2648
2740
|
|
|
2649
|
-
var _sfc_main$
|
|
2741
|
+
var _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
2650
2742
|
...{ name: "EpSearchListPage" },
|
|
2651
2743
|
__name: "search-list-page",
|
|
2652
2744
|
props: searchListPageProps,
|
|
@@ -2661,7 +2753,8 @@
|
|
|
2661
2753
|
reset,
|
|
2662
2754
|
tableRef,
|
|
2663
2755
|
formRef,
|
|
2664
|
-
tableProps
|
|
2756
|
+
tableProps,
|
|
2757
|
+
beforeSearch
|
|
2665
2758
|
} = useSearchListPage(props);
|
|
2666
2759
|
__expose({
|
|
2667
2760
|
search,
|
|
@@ -2692,13 +2785,13 @@
|
|
|
2692
2785
|
], 2)
|
|
2693
2786
|
]),
|
|
2694
2787
|
vue.renderSlot(_ctx.$slots, "tableBefore"),
|
|
2695
|
-
vue.createVNode(vue.unref(EpTable), vue.
|
|
2788
|
+
vue.createVNode(vue.unref(EpTable), vue.mergeProps(vue.unref(tableProps), { "before-search": vue.unref(beforeSearch) }), null, 16, ["before-search"])
|
|
2696
2789
|
], 6);
|
|
2697
2790
|
};
|
|
2698
2791
|
}
|
|
2699
2792
|
});
|
|
2700
2793
|
|
|
2701
|
-
const EpSearchListPage = withInstall(_sfc_main$
|
|
2794
|
+
const EpSearchListPage = withInstall(_sfc_main$5);
|
|
2702
2795
|
|
|
2703
2796
|
const inheritSelectProps = {
|
|
2704
2797
|
...elementPlus.selectProps,
|
|
@@ -2824,7 +2917,7 @@
|
|
|
2824
2917
|
};
|
|
2825
2918
|
}
|
|
2826
2919
|
|
|
2827
|
-
var _sfc_main$
|
|
2920
|
+
var _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
2828
2921
|
...{
|
|
2829
2922
|
name: "EpSelect",
|
|
2830
2923
|
inheritAttrs: false
|
|
@@ -2903,7 +2996,7 @@
|
|
|
2903
2996
|
}
|
|
2904
2997
|
});
|
|
2905
2998
|
|
|
2906
|
-
const EpSelect = withInstall(_sfc_main$
|
|
2999
|
+
const EpSelect = withInstall(_sfc_main$4);
|
|
2907
3000
|
|
|
2908
3001
|
const titleProps = {
|
|
2909
3002
|
// 右侧按钮
|
|
@@ -2959,7 +3052,7 @@
|
|
|
2959
3052
|
};
|
|
2960
3053
|
};
|
|
2961
3054
|
|
|
2962
|
-
var _sfc_main$
|
|
3055
|
+
var _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
2963
3056
|
...{
|
|
2964
3057
|
name: "EpTitle",
|
|
2965
3058
|
inheritAttrs: false
|
|
@@ -3022,7 +3115,7 @@
|
|
|
3022
3115
|
}
|
|
3023
3116
|
});
|
|
3024
3117
|
|
|
3025
|
-
const EpTitle = withInstall(_sfc_main$
|
|
3118
|
+
const EpTitle = withInstall(_sfc_main$3);
|
|
3026
3119
|
|
|
3027
3120
|
const headerProps = {
|
|
3028
3121
|
// 页面模式
|
|
@@ -3133,7 +3226,7 @@
|
|
|
3133
3226
|
};
|
|
3134
3227
|
};
|
|
3135
3228
|
|
|
3136
|
-
var _sfc_main$
|
|
3229
|
+
var _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
3137
3230
|
...{
|
|
3138
3231
|
name: "EpHeader",
|
|
3139
3232
|
inheritAttrs: false
|
|
@@ -3166,7 +3259,7 @@
|
|
|
3166
3259
|
}
|
|
3167
3260
|
});
|
|
3168
3261
|
|
|
3169
|
-
const EpHeader = withInstall(_sfc_main$
|
|
3262
|
+
const EpHeader = withInstall(_sfc_main$2);
|
|
3170
3263
|
|
|
3171
3264
|
const { t } = useLocale();
|
|
3172
3265
|
const datePickerRangeProps = {
|
|
@@ -3236,7 +3329,7 @@
|
|
|
3236
3329
|
};
|
|
3237
3330
|
const datePickerRangeEmits = {};
|
|
3238
3331
|
|
|
3239
|
-
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
3332
|
+
var _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
3240
3333
|
...{
|
|
3241
3334
|
name: "EpDatePickerRange",
|
|
3242
3335
|
inheritAttrs: false
|
|
@@ -3292,7 +3385,69 @@
|
|
|
3292
3385
|
}
|
|
3293
3386
|
});
|
|
3294
3387
|
|
|
3295
|
-
const EpDatePickerRange = withInstall(_sfc_main);
|
|
3388
|
+
const EpDatePickerRange = withInstall(_sfc_main$1);
|
|
3389
|
+
|
|
3390
|
+
const linkProps = {
|
|
3391
|
+
...elementPlus.linkProps,
|
|
3392
|
+
content: {
|
|
3393
|
+
type: String
|
|
3394
|
+
},
|
|
3395
|
+
type: {
|
|
3396
|
+
...elementPlus.linkProps.type,
|
|
3397
|
+
default: "primary"
|
|
3398
|
+
},
|
|
3399
|
+
underline: {
|
|
3400
|
+
...elementPlus.linkProps.underline,
|
|
3401
|
+
default: "never"
|
|
3402
|
+
}
|
|
3403
|
+
};
|
|
3404
|
+
|
|
3405
|
+
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
3406
|
+
...{
|
|
3407
|
+
name: "EpLink",
|
|
3408
|
+
inheritAttrs: false
|
|
3409
|
+
},
|
|
3410
|
+
__name: "link",
|
|
3411
|
+
props: linkProps,
|
|
3412
|
+
setup(__props) {
|
|
3413
|
+
const bem = createNameSpace("link");
|
|
3414
|
+
const props = __props;
|
|
3415
|
+
const attrs = vue.useAttrs();
|
|
3416
|
+
const slots = vue.computed(() => {
|
|
3417
|
+
return Object.keys(vue.useSlots());
|
|
3418
|
+
});
|
|
3419
|
+
return (_ctx, _cache) => {
|
|
3420
|
+
const _component_el_link = vue.resolveComponent("el-link");
|
|
3421
|
+
return vue.openBlock(), vue.createBlock(_component_el_link, vue.mergeProps({
|
|
3422
|
+
class: `${vue.unref(bem).b()} ${vue.unref(prepareClassNames)()}`,
|
|
3423
|
+
style: {
|
|
3424
|
+
...vue.unref(prepareStyles)()
|
|
3425
|
+
}
|
|
3426
|
+
}, {
|
|
3427
|
+
...props,
|
|
3428
|
+
...vue.unref(attrs)
|
|
3429
|
+
}), vue.createSlots({
|
|
3430
|
+
default: vue.withCtx(() => [
|
|
3431
|
+
_ctx.content ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
3432
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.content), 1)
|
|
3433
|
+
], 64)) : vue.createCommentVNode("", true)
|
|
3434
|
+
]),
|
|
3435
|
+
_: 2
|
|
3436
|
+
}, [
|
|
3437
|
+
vue.renderList(slots.value, (name) => {
|
|
3438
|
+
return {
|
|
3439
|
+
name,
|
|
3440
|
+
fn: vue.withCtx((scope) => [
|
|
3441
|
+
vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(scope)))
|
|
3442
|
+
])
|
|
3443
|
+
};
|
|
3444
|
+
})
|
|
3445
|
+
]), 1040, ["class", "style"]);
|
|
3446
|
+
};
|
|
3447
|
+
}
|
|
3448
|
+
});
|
|
3449
|
+
|
|
3450
|
+
const EpLink = withInstall(_sfc_main);
|
|
3296
3451
|
|
|
3297
3452
|
var components = [
|
|
3298
3453
|
EpButtons,
|
|
@@ -3304,10 +3459,11 @@
|
|
|
3304
3459
|
EpTitle,
|
|
3305
3460
|
EpHeader,
|
|
3306
3461
|
EpDatePickerRange,
|
|
3307
|
-
EpCustomColumn
|
|
3462
|
+
EpCustomColumn,
|
|
3463
|
+
EpLink
|
|
3308
3464
|
];
|
|
3309
3465
|
|
|
3310
|
-
var version = "0.0.
|
|
3466
|
+
var version = "0.0.19";
|
|
3311
3467
|
|
|
3312
3468
|
var globalProperties = {
|
|
3313
3469
|
install(app) {
|
|
@@ -3320,7 +3476,7 @@
|
|
|
3320
3476
|
globalProperties: globalProperties
|
|
3321
3477
|
});
|
|
3322
3478
|
|
|
3323
|
-
const bem
|
|
3479
|
+
const bem = createNameSpace("choose-dialog");
|
|
3324
3480
|
const useChooseDialog = (options = {}) => {
|
|
3325
3481
|
const {
|
|
3326
3482
|
t
|
|
@@ -3337,12 +3493,12 @@
|
|
|
3337
3493
|
if (!showSingleSelectionCol) {
|
|
3338
3494
|
scopedSlots.footerPrepend = () => {
|
|
3339
3495
|
return vue.createVNode("span", {
|
|
3340
|
-
"class": bem
|
|
3496
|
+
"class": bem.e("selected-count")
|
|
3341
3497
|
}, [t("ep.chooseDialog.selected"), selections.length, t("ep.chooseDialog.unit")]);
|
|
3342
3498
|
};
|
|
3343
3499
|
}
|
|
3344
3500
|
return useDialog({
|
|
3345
|
-
class: bem
|
|
3501
|
+
class: bem.b(),
|
|
3346
3502
|
width: "80%",
|
|
3347
3503
|
showFooter: !showSingleSelectionCol,
|
|
3348
3504
|
scopedSlots,
|
|
@@ -3379,38 +3535,6 @@
|
|
|
3379
3535
|
});
|
|
3380
3536
|
};
|
|
3381
3537
|
|
|
3382
|
-
const bem = createNameSpace("form-dialog");
|
|
3383
|
-
const useFormDialog = (options = {}) => {
|
|
3384
|
-
const {
|
|
3385
|
-
dialogProps,
|
|
3386
|
-
title,
|
|
3387
|
-
...formProps
|
|
3388
|
-
} = options;
|
|
3389
|
-
const formRef = vue.ref();
|
|
3390
|
-
let formData = formProps.formData || vue.reactive({});
|
|
3391
|
-
return useDialog({
|
|
3392
|
-
class: bem.b(),
|
|
3393
|
-
width: "80%",
|
|
3394
|
-
title,
|
|
3395
|
-
render: (props) => {
|
|
3396
|
-
return vue.createVNode(EpForm, vue.mergeProps({
|
|
3397
|
-
"ref": formRef,
|
|
3398
|
-
"modelValue": formData,
|
|
3399
|
-
"onUpdate:modelValue": ($event) => formData = $event
|
|
3400
|
-
}, {
|
|
3401
|
-
col: 1,
|
|
3402
|
-
"label-width": "auto",
|
|
3403
|
-
...formProps
|
|
3404
|
-
}), null);
|
|
3405
|
-
},
|
|
3406
|
-
onConfirm: async (resolve) => {
|
|
3407
|
-
await formRef.value.validate();
|
|
3408
|
-
resolve(formData);
|
|
3409
|
-
},
|
|
3410
|
-
...dialogProps
|
|
3411
|
-
});
|
|
3412
|
-
};
|
|
3413
|
-
|
|
3414
3538
|
const useNavigation = () => {
|
|
3415
3539
|
const router = vueRouter.useRouter();
|
|
3416
3540
|
const $goto = (r) => {
|
|
@@ -3494,6 +3618,7 @@
|
|
|
3494
3618
|
exports.EpFormItem = EpFormItem;
|
|
3495
3619
|
exports.EpHeader = EpHeader;
|
|
3496
3620
|
exports.EpInput = EpInput;
|
|
3621
|
+
exports.EpLink = EpLink;
|
|
3497
3622
|
exports.EpSearchListPage = EpSearchListPage;
|
|
3498
3623
|
exports.EpSelect = EpSelect;
|
|
3499
3624
|
exports.EpTable = EpTable;
|
|
@@ -3519,6 +3644,7 @@
|
|
|
3519
3644
|
exports.inputEmitsKeys = inputEmitsKeys;
|
|
3520
3645
|
exports.inputProps = inputProps;
|
|
3521
3646
|
exports.install = install;
|
|
3647
|
+
exports.linkProps = linkProps;
|
|
3522
3648
|
exports.searchListPageProps = searchListPageProps;
|
|
3523
3649
|
exports.selectEmits = selectEmits;
|
|
3524
3650
|
exports.selectEmitsKeys = selectEmitsKeys;
|