@vipl520/dk-ui 1.0.57 → 1.0.59
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +39 -17
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -4
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +39 -17
- package/dist/web-types.json +1 -1
- package/es/group/index.d.ts +9 -0
- package/es/group/src/group.vue.d.ts +9 -0
- package/es/group/src/group.vue2.mjs +2 -1
- package/es/group/src/group.vue2.mjs.map +1 -1
- package/es/group/src/props.d.ts +4 -0
- package/es/group/src/props.mjs +4 -0
- package/es/group/src/props.mjs.map +1 -1
- package/es/table/index.d.ts +15 -0
- package/es/table/src/props.d.ts +4 -0
- package/es/table/src/props.mjs +6 -0
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue.d.ts +9 -0
- package/es/table/src/table.vue2.mjs +1 -1
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/utils/dkTable.d.ts +1 -1
- package/es/table/utils/dkTable.mjs +2 -2
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/es/table/utils/dkTableApi.d.ts +3 -1
- package/es/table/utils/dkTableApi.mjs +21 -12
- package/es/table/utils/dkTableApi.mjs.map +1 -1
- package/es/url-input/src/url-input-table.vue2.mjs +3 -1
- package/es/url-input/src/url-input-table.vue2.mjs.map +1 -1
- package/lib/group/index.d.ts +9 -0
- package/lib/group/src/group.vue.d.ts +9 -0
- package/lib/group/src/group.vue2.js +2 -1
- package/lib/group/src/group.vue2.js.map +1 -1
- package/lib/group/src/props.d.ts +4 -0
- package/lib/group/src/props.js +4 -0
- package/lib/group/src/props.js.map +1 -1
- package/lib/table/index.d.ts +15 -0
- package/lib/table/src/props.d.ts +4 -0
- package/lib/table/src/props.js +6 -0
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue.d.ts +9 -0
- package/lib/table/src/table.vue2.js +1 -1
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/utils/dkTable.d.ts +1 -1
- package/lib/table/utils/dkTable.js +2 -2
- package/lib/table/utils/dkTable.js.map +1 -1
- package/lib/table/utils/dkTableApi.d.ts +3 -1
- package/lib/table/utils/dkTableApi.js +21 -12
- package/lib/table/utils/dkTableApi.js.map +1 -1
- package/lib/url-input/src/url-input-table.vue2.js +3 -1
- package/lib/url-input/src/url-input-table.vue2.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -961,6 +961,10 @@ const groupProps = {
|
|
961
961
|
title: {
|
962
962
|
default: "",
|
963
963
|
type: String
|
964
|
+
},
|
965
|
+
accordion: {
|
966
|
+
type: Boolean,
|
967
|
+
default: true
|
964
968
|
}
|
965
969
|
};
|
966
970
|
|
@@ -985,7 +989,8 @@ var _sfc_main$1g = /* @__PURE__ */ defineComponent({
|
|
985
989
|
loading: true
|
986
990
|
});
|
987
991
|
const collapseComponentData = reactive({
|
988
|
-
modelValue: [0]
|
992
|
+
modelValue: [0],
|
993
|
+
accordion: props.accordion
|
989
994
|
});
|
990
995
|
const Type = data.form;
|
991
996
|
watch(
|
@@ -15811,6 +15816,12 @@ const tableProps = {
|
|
15811
15816
|
return [];
|
15812
15817
|
},
|
15813
15818
|
type: Array
|
15819
|
+
},
|
15820
|
+
query: {
|
15821
|
+
default: () => {
|
15822
|
+
return {};
|
15823
|
+
},
|
15824
|
+
type: Object
|
15814
15825
|
}
|
15815
15826
|
};
|
15816
15827
|
|
@@ -18839,31 +18850,40 @@ class dkTableApi {
|
|
18839
18850
|
actionUrl;
|
18840
18851
|
requestConfig = {};
|
18841
18852
|
// 新增:用于存储配置的request参数
|
18842
|
-
constructor(controllerUrl) {
|
18853
|
+
constructor(controllerUrl, query) {
|
18854
|
+
const qStr = this.objectToQuery(query);
|
18855
|
+
console.log("queryStr", qStr);
|
18843
18856
|
if (!controllerUrl.endsWith("/")) {
|
18844
18857
|
controllerUrl += "/";
|
18845
18858
|
}
|
18846
18859
|
this.controllerUrl = controllerUrl;
|
18847
18860
|
this.actionUrl = /* @__PURE__ */ new Map([
|
18848
|
-
["index", controllerUrl + "index"],
|
18849
|
-
["add", controllerUrl + "add"],
|
18850
|
-
["edit", controllerUrl + "edit"],
|
18851
|
-
["del", controllerUrl + "del"],
|
18852
|
-
["sortable", controllerUrl + "sortable"],
|
18853
|
-
["table", controllerUrl + "table"],
|
18861
|
+
["index", this.buildFullUrl(controllerUrl + "index", qStr)],
|
18862
|
+
["add", this.buildFullUrl(controllerUrl + "add", qStr)],
|
18863
|
+
["edit", this.buildFullUrl(controllerUrl + "edit", qStr)],
|
18864
|
+
["del", this.buildFullUrl(controllerUrl + "del", qStr)],
|
18865
|
+
["sortable", this.buildFullUrl(controllerUrl + "sortable", qStr)],
|
18866
|
+
["table", this.buildFullUrl(controllerUrl + "table", qStr)],
|
18854
18867
|
// 获取表格数据
|
18855
|
-
["form", controllerUrl + "form"],
|
18868
|
+
["form", this.buildFullUrl(controllerUrl + "form", qStr)],
|
18856
18869
|
// 获取表单
|
18857
|
-
["recycle", controllerUrl + "recycle"],
|
18870
|
+
["recycle", this.buildFullUrl(controllerUrl + "recycle", qStr)],
|
18858
18871
|
// 回收站
|
18859
|
-
["recycleTable", controllerUrl + "recycleTable"],
|
18872
|
+
["recycleTable", this.buildFullUrl(controllerUrl + "recycleTable", qStr)],
|
18860
18873
|
// 回收站表格
|
18861
|
-
["destroy", controllerUrl + "destroy"],
|
18874
|
+
["destroy", this.buildFullUrl(controllerUrl + "destroy", qStr)],
|
18862
18875
|
// 回收站销毁
|
18863
|
-
["restore", controllerUrl + "restore"]
|
18876
|
+
["restore", this.buildFullUrl(controllerUrl + "restore", qStr)]
|
18864
18877
|
// 回收站还原
|
18865
18878
|
]);
|
18866
18879
|
}
|
18880
|
+
// 新增方法用于构建完整的URL
|
18881
|
+
buildFullUrl(baseUrl, queryStr) {
|
18882
|
+
return queryStr ? `${baseUrl}?${queryStr}` : baseUrl;
|
18883
|
+
}
|
18884
|
+
objectToQuery(obj) {
|
18885
|
+
return Object.keys(obj).map((key) => encodeURIComponent(key) + "=" + encodeURIComponent(obj[key])).join("&");
|
18886
|
+
}
|
18867
18887
|
/**
|
18868
18888
|
* 配置request参数
|
18869
18889
|
* @param config 包含HTTP方法、请求头等额外参数的对象
|
@@ -19127,9 +19147,9 @@ class dkTable {
|
|
19127
19147
|
form: {},
|
19128
19148
|
fieldData: /* @__PURE__ */ new Map()
|
19129
19149
|
});
|
19130
|
-
constructor(url, before = {}, after = {}) {
|
19150
|
+
constructor(url, before = {}, after = {}, query) {
|
19131
19151
|
this.url = url;
|
19132
|
-
this.api = new dkTableApi(url);
|
19152
|
+
this.api = new dkTableApi(url, query);
|
19133
19153
|
this.before = before;
|
19134
19154
|
this.after = after;
|
19135
19155
|
this.buttonCallback = (event, data) => {
|
@@ -23479,7 +23499,7 @@ var _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
23479
23499
|
const props = __props;
|
23480
23500
|
const FormRef = ref();
|
23481
23501
|
const TableRef = ref();
|
23482
|
-
const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter);
|
23502
|
+
const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter, props.query);
|
23483
23503
|
provide("DkTable", DkTable);
|
23484
23504
|
onMounted(() => {
|
23485
23505
|
DkTable.getTable(props.cacheTable)?.then(() => {
|
@@ -27082,7 +27102,9 @@ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
27082
27102
|
ref: DkTableRef,
|
27083
27103
|
"table-api": __props.item.tableUrl,
|
27084
27104
|
"cache-table": __props.item.cacheTable,
|
27085
|
-
height: "300px"
|
27105
|
+
height: "300px",
|
27106
|
+
query: { _form: "url_input" },
|
27107
|
+
buttons: ["refresh", "add", "export_csv", "edit", "delete", "comSearch", "quickSearch", "columnDisplay"]
|
27086
27108
|
}, {
|
27087
27109
|
cate_id_slot: withCtx(({ row }) => [
|
27088
27110
|
createTextVNode(
|
package/dist/web-types.json
CHANGED
package/es/group/index.d.ts
CHANGED
@@ -71,6 +71,10 @@ export declare const Group: import("@vipl520/utils").WithInstall<import("vue").D
|
|
71
71
|
default: string;
|
72
72
|
type: StringConstructor;
|
73
73
|
};
|
74
|
+
accordion: {
|
75
|
+
type: BooleanConstructor;
|
76
|
+
default: boolean;
|
77
|
+
};
|
74
78
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "itemMounted" | "remove" | "add")[], "update:modelValue" | "change" | "itemMounted" | "remove" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
75
79
|
field: {
|
76
80
|
type: StringConstructor;
|
@@ -144,6 +148,10 @@ export declare const Group: import("@vipl520/utils").WithInstall<import("vue").D
|
|
144
148
|
default: string;
|
145
149
|
type: StringConstructor;
|
146
150
|
};
|
151
|
+
accordion: {
|
152
|
+
type: BooleanConstructor;
|
153
|
+
default: boolean;
|
154
|
+
};
|
147
155
|
}>> & {
|
148
156
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
149
157
|
onChange?: ((...args: any[]) => any) | undefined;
|
@@ -169,6 +177,7 @@ export declare const Group: import("@vipl520/utils").WithInstall<import("vue").D
|
|
169
177
|
onBeforeAdd: Function;
|
170
178
|
formCreateInject: Record<string, any>;
|
171
179
|
parse: Function;
|
180
|
+
accordion: boolean;
|
172
181
|
}, {}>>;
|
173
182
|
export default Group;
|
174
183
|
export * from './src/props';
|
@@ -71,6 +71,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
71
71
|
default: string;
|
72
72
|
type: StringConstructor;
|
73
73
|
};
|
74
|
+
accordion: {
|
75
|
+
type: BooleanConstructor;
|
76
|
+
default: boolean;
|
77
|
+
};
|
74
78
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "itemMounted" | "remove" | "add")[], "update:modelValue" | "change" | "itemMounted" | "remove" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
75
79
|
field: {
|
76
80
|
type: StringConstructor;
|
@@ -144,6 +148,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
144
148
|
default: string;
|
145
149
|
type: StringConstructor;
|
146
150
|
};
|
151
|
+
accordion: {
|
152
|
+
type: BooleanConstructor;
|
153
|
+
default: boolean;
|
154
|
+
};
|
147
155
|
}>> & {
|
148
156
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
149
157
|
onChange?: ((...args: any[]) => any) | undefined;
|
@@ -169,5 +177,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
169
177
|
onBeforeAdd: Function;
|
170
178
|
formCreateInject: Record<string, any>;
|
171
179
|
parse: Function;
|
180
|
+
accordion: boolean;
|
172
181
|
}, {}>;
|
173
182
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"group.vue2.mjs","sources":["../../../src/group/src/group.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkGroup',\n});\n</script>\n<template>\n <div :class=\"'dk-group _fc-group ' + (disabled ? '_fc-group-disabled' : '')\">\n <el-divider v-if=\"props.title\">{{ props.title }}</el-divider>\n <div v-if=\"data.sort.length === 0\">\n <el-button :key=\"'a_def'\" style=\"width: 100%\" type=\"primary\" @click=\"add\"> 添加数据 </el-button>\n </div>\n <draggable\n tag=\"el-collapse\"\n :list=\"props.modelValue\"\n :component-data=\"collapseComponentData\"\n item-key=\"id\"\n handle=\".collapse-title-rank\"\n >\n <template #item=\"{ element, index }\">\n <el-collapse-item :title=\"element.title\" :name=\"index\">\n <template #title>\n <div class=\"collapse-title\">\n <dk-icon icon=\"Rank\" class=\"collapse-title-rank\"></dk-icon>\n <span>{{ getTitle(index) }}</span>\n </div>\n </template>\n <template #default>\n <div :key=\"index\" class=\"_dk-group-container\">\n <Type\n :key=\"index\"\n :in-for=\"true\"\n :model-value=\"getFieldValue(index)\"\n :rule=\"data.cacheRule[index].rule\"\n :option=\"data.cacheRule[index].options\"\n :extend-option=\"true\"\n @update:modelValue=\"formData(index, $event)\"\n @emit-event=\"(name: any, ...args: any) => emitEvent(name, args, index)\"\n @update:api=\"($f: any) => add$f(index, $f)\"\n />\n <div class=\"_dk-group-handle\">\n <el-button-group>\n <el-button icon=\"Plus\" plain @click=\"add\">增加</el-button>\n <el-button icon=\"Delete\" plain @click=\"del(index, index + 1)\">删除</el-button>\n </el-button-group>\n </div>\n </div>\n </template>\n </el-collapse-item>\n </template>\n </draggable>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { markRaw, nextTick, reactive, watch, onMounted } from 'vue'\nimport { deepCopy, deepExtend, hasProperty } from '../utils/utils'\nimport extend from '../utils/extend'\n// import draggable from 'vuedraggable'\nimport { groupProps } from './props'\n\n\n\nconst props = defineProps(groupProps)\nconst emit = defineEmits(['update:modelValue', 'change', 'itemMounted', 'remove', 'add'])\nconst data: any = reactive({\n len: 0,\n cacheRule: {},\n cacheValue: {},\n sort: [],\n form: markRaw(props.formCreateInject.form.$form()),\n loading: true,\n})\n\nconst collapseComponentData = reactive({\n modelValue: [0],\n})\n\nconst Type = data.form\n\nwatch(\n () => props.rule, // 侦听 rule 属性\n (n, o) => {\n // 您原来的 handler 逻辑\n Object.keys(data.cacheRule).forEach((v) => {\n const item = data.cacheRule[v]\n if (item.$f) {\n const val = item.$f.formData()\n if (n === o) {\n item.$f.deferSyncValue(() => {\n deepExtend(item.rule, n, false)\n item.$f.setValue(val)\n }, true)\n } else {\n const val = item.$f.formData()\n item.$f.once('reloading', () => {\n item.$f.setValue(val)\n })\n item.rule = deepCopy(n)\n }\n }\n })\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => props.disabled, // 侦听 disabled 属性\n (n) => {\n // 您原来的 disabled 逻辑\n if (props.syncDisabled) {\n const lst = data.cacheRule\n Object.keys(lst).forEach((k) => {\n lst[k].$f.disabled(n)\n })\n }\n }\n)\n\nwatch(\n () => props.expand, // 侦听 expand 属性\n (n) => {\n // 您原来的 expand 逻辑\n const d = n - props.modelValue.length\n if (d > 0) {\n expandRule(d)\n }\n }\n)\n\nwatch(\n () => props.modelValue, // 侦听 modelValue 属性\n (n) => {\n // 您原来的 modelValue 逻辑\n n = n || []\n const keys = Object.keys(data.cacheRule)\n const total = keys.length // 缓存数\n const len = total - n.length // 缓存数-value数\n if (len < 0) {\n for (let i = len; i < 0; i++) {\n addRule(n.length - 1, true)\n }\n for (let i = 0; i < total; i++) {\n setValue(keys[i], n[i])\n }\n } else {\n if (len > 0) {\n for (let i = 0; i < len; i++) {\n console.log('keys[total - i - 1]', keys[total - i - 1])\n removeRule(keys[total - i - 1])\n }\n }\n n.forEach((val, i) => {\n setValue(keys[i], n[i])\n })\n }\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => ({ ...data.cacheRule }),\n (n) => {\n data.sort = Object.keys(n)\n },\n { immediate: true }\n)\n\nconst getFieldValue = (index: number) => {\n if (props.field) {\n return { [props.field]: _value(props.modelValue[index]) }\n } else {\n return props.modelValue[index]\n }\n}\n\nconst getTitle = (index: number) => {\n if (data.cacheRule[index]) {\n const { rule } = data.cacheRule[index]\n const defaultField = props.titleField ? props.titleField : rule[0]?.field\n return data.cacheRule[index].$f?.getValue(defaultField) || '点击展开'\n } else {\n return '点击展开'\n }\n}\nconst _value = (v: any) => {\n return v && hasProperty(v, props.field) ? v[props.field] : v\n}\nconst cache = (k: any, val: any) => {\n data.cacheValue[k] = JSON.stringify(val)\n}\nconst input = (value: any) => {\n emit('update:modelValue', value)\n emit('change', value)\n}\nconst formData = (index: any, formData: any) => {\n nextTick(() => {\n const keys = Object.keys(data.cacheRule)\n const value = keys.map((k: any) => {\n const _data = index === k ? formData : { ...data.cacheRule[k].$f.form }\n const value = props.field ? _data[props.field] || null : _data\n cache(k, value)\n return value\n })\n input(value)\n })\n}\n\nconst add$f = (index: any, $f: any) => {\n data.cacheRule[index].$f = $f\n nextTick(() => {\n if (props.syncDisabled) {\n $f.disabled(props.disabled)\n }\n emit('itemMounted', $f, Object.keys(data.cacheRule).indexOf(index))\n })\n}\n\nonMounted(() => {\n data.loading = false\n})\n\nconst setValue = (key: any, value: any) => {\n const field = props.field\n if (field) {\n value = { [field]: _value(value) }\n }\n if (data.cacheValue[key] === JSON.stringify(field ? value[field] : value)) {\n return\n }\n cache(key, value)\n}\nconst addRule = (index: any, isEmit = false) => {\n const rule = props.formCreateInject.form.copyRules(props.rule || [])\n const options: any = props.options\n ? { ...props.options }\n : {\n submitBtn: false,\n resetBtn: false,\n }\n if (props.defaultValue) {\n if (!options.formData) options.formData = {}\n const defVal = deepCopy(props.defaultValue)\n extend(options.formData, props.field ? { [props.field]: defVal } : defVal)\n }\n props.parse && props.parse({ rule, options, index: data.sort.length })\n data.cacheRule[index] = { rule, options }\n if (isEmit) {\n nextTick(() => emit('add', rule, Object.keys(data.cacheRule).length - 1))\n }\n}\n\nconst removeRule = (index: any, isEmit = false) => {\n delete data.cacheRule[index]\n delete data.cacheValue[index]\n if (isEmit) {\n nextTick(() => emit('remove', index))\n }\n}\nconst add = () => {\n if (props.disabled || props.onBeforeAdd(props.modelValue) === false) {\n return\n }\n const value = [...props.modelValue]\n value.push(props.defaultValue ? deepCopy(props.defaultValue) : props.field ? null : {})\n input(value)\n collapseComponentData.modelValue = [value.length - 1]\n}\nconst del = (index: number, key: number) => {\n if (props.disabled || props.onBeforeRemove(props.modelValue, index) === false) {\n return\n }\n const value = [...props.modelValue]\n value.splice(index, 1)\n input(value)\n}\n\nconst emitEvent = (name: any, args: any, index: any) => {\n emit(name, ...args, data.cacheRule[index].$f, index)\n}\n\nconst expandRule = (n: any) => {\n for (let i = 0; i < n; i++) {\n // eslint-disable-next-line vue/no-mutating-props\n props.modelValue.push(props.field ? null : {})\n }\n}\n\nconst d = (props.expand || 0) - props.modelValue.length\nfor (let i = 0; i < props.modelValue.length; i++) {\n addRule(i)\n}\nif (d > 0) {\n expandRule(d)\n}\n</script>\n"],"names":["__MACROS_defineComponent","val","d","formData","value"],"mappings":";;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6DD,IAAA,MAAM,OAAY,QAAS,CAAA;AAAA,MACzB,GAAK,EAAA,CAAA;AAAA,MACL,WAAW,EAAC;AAAA,MACZ,YAAY,EAAC;AAAA,MACb,MAAM,EAAC;AAAA,MACP,MAAM,OAAQ,CAAA,KAAA,CAAM,gBAAiB,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,MACjD,OAAS,EAAA,IAAA;AAAA,KACV,CAAA,CAAA;AAED,IAAA,MAAM,wBAAwB,QAAS,CAAA;AAAA,MACrC,UAAA,EAAY,CAAC,CAAC,CAAA;AAAA,KACf,CAAA,CAAA;AAED,IAAA,MAAM,OAAO,IAAK,CAAA,IAAA,CAAA;AAElB,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,IAAA;AAAA;AAAA,MACZ,CAAC,GAAG,CAAM,KAAA;AAER,QAAA,MAAA,CAAO,KAAK,IAAK,CAAA,SAAS,CAAE,CAAA,OAAA,CAAQ,CAAC,CAAM,KAAA;AACzC,UAAM,MAAA,IAAA,GAAO,IAAK,CAAA,SAAA,CAAU,CAAC,CAAA,CAAA;AAC7B,UAAA,IAAI,KAAK,EAAI,EAAA;AACX,YAAM,MAAA,GAAA,GAAM,IAAK,CAAA,EAAA,CAAG,QAAS,EAAA,CAAA;AAC7B,YAAA,IAAI,MAAM,CAAG,EAAA;AACX,cAAK,IAAA,CAAA,EAAA,CAAG,eAAe,MAAM;AAC3B,gBAAW,UAAA,CAAA,IAAA,CAAK,IAAM,EAAA,CAAA,EAAG,KAAK,CAAA,CAAA;AAC9B,gBAAK,IAAA,CAAA,EAAA,CAAG,SAAS,GAA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;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,CAAK,GAAA,CAAA,KAAA,CAAM,MAAU,IAAA,CAAA,IAAK,MAAM,UAAW,CAAA,MAAA,CAAA;AACjD,IAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,KAAM,CAAA,UAAA,CAAW,QAAQ,CAAK,EAAA,EAAA;AAChD,MAAA,OAAA,CAAQ,CAAC,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,IAAI,CAAG,EAAA;AACT,MAAA,UAAA,CAAW,CAAC,CAAA,CAAA;AAAA,KACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"group.vue2.mjs","sources":["../../../src/group/src/group.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkGroup',\n});\n</script>\n<template>\n <div :class=\"'dk-group _fc-group ' + (disabled ? '_fc-group-disabled' : '')\">\n <el-divider v-if=\"props.title\">{{ props.title }}</el-divider>\n <div v-if=\"data.sort.length === 0\">\n <el-button :key=\"'a_def'\" style=\"width: 100%\" type=\"primary\" @click=\"add\"> 添加数据 </el-button>\n </div>\n <draggable\n tag=\"el-collapse\"\n :list=\"props.modelValue\"\n :component-data=\"collapseComponentData\"\n item-key=\"id\"\n handle=\".collapse-title-rank\"\n >\n <template #item=\"{ element, index }\">\n <el-collapse-item :title=\"element.title\" :name=\"index\">\n <template #title>\n <div class=\"collapse-title\">\n <dk-icon icon=\"Rank\" class=\"collapse-title-rank\"></dk-icon>\n <span>{{ getTitle(index) }}</span>\n </div>\n </template>\n <template #default>\n <div :key=\"index\" class=\"_dk-group-container\">\n <Type\n :key=\"index\"\n :in-for=\"true\"\n :model-value=\"getFieldValue(index)\"\n :rule=\"data.cacheRule[index].rule\"\n :option=\"data.cacheRule[index].options\"\n :extend-option=\"true\"\n @update:modelValue=\"formData(index, $event)\"\n @emit-event=\"(name: any, ...args: any) => emitEvent(name, args, index)\"\n @update:api=\"($f: any) => add$f(index, $f)\"\n />\n <div class=\"_dk-group-handle\">\n <el-button-group>\n <el-button icon=\"Plus\" plain @click=\"add\">增加</el-button>\n <el-button icon=\"Delete\" plain @click=\"del(index, index + 1)\">删除</el-button>\n </el-button-group>\n </div>\n </div>\n </template>\n </el-collapse-item>\n </template>\n </draggable>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { markRaw, nextTick, reactive, watch, onMounted } from 'vue'\nimport { deepCopy, deepExtend, hasProperty } from '../utils/utils'\nimport extend from '../utils/extend'\n// import draggable from 'vuedraggable'\nimport { groupProps } from './props'\n\n\n\nconst props = defineProps(groupProps)\nconst emit = defineEmits(['update:modelValue', 'change', 'itemMounted', 'remove', 'add'])\nconst data: any = reactive({\n len: 0,\n cacheRule: {},\n cacheValue: {},\n sort: [],\n form: markRaw(props.formCreateInject.form.$form()),\n loading: true,\n})\n\nconst collapseComponentData = reactive({\n modelValue: [0],\n accordion: props.accordion,\n})\n\nconst Type = data.form\n\nwatch(\n () => props.rule, // 侦听 rule 属性\n (n, o) => {\n // 您原来的 handler 逻辑\n Object.keys(data.cacheRule).forEach((v) => {\n const item = data.cacheRule[v]\n if (item.$f) {\n const val = item.$f.formData()\n if (n === o) {\n item.$f.deferSyncValue(() => {\n deepExtend(item.rule, n, false)\n item.$f.setValue(val)\n }, true)\n } else {\n const val = item.$f.formData()\n item.$f.once('reloading', () => {\n item.$f.setValue(val)\n })\n item.rule = deepCopy(n)\n }\n }\n })\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => props.disabled, // 侦听 disabled 属性\n (n) => {\n // 您原来的 disabled 逻辑\n if (props.syncDisabled) {\n const lst = data.cacheRule\n Object.keys(lst).forEach((k) => {\n lst[k].$f.disabled(n)\n })\n }\n }\n)\n\nwatch(\n () => props.expand, // 侦听 expand 属性\n (n) => {\n // 您原来的 expand 逻辑\n const d = n - props.modelValue.length\n if (d > 0) {\n expandRule(d)\n }\n }\n)\n\nwatch(\n () => props.modelValue, // 侦听 modelValue 属性\n (n) => {\n // 您原来的 modelValue 逻辑\n n = n || []\n const keys = Object.keys(data.cacheRule)\n const total = keys.length // 缓存数\n const len = total - n.length // 缓存数-value数\n if (len < 0) {\n for (let i = len; i < 0; i++) {\n addRule(n.length - 1, true)\n }\n for (let i = 0; i < total; i++) {\n setValue(keys[i], n[i])\n }\n } else {\n if (len > 0) {\n for (let i = 0; i < len; i++) {\n console.log('keys[total - i - 1]', keys[total - i - 1])\n removeRule(keys[total - i - 1])\n }\n }\n n.forEach((val, i) => {\n setValue(keys[i], n[i])\n })\n }\n },\n { deep: true } // 深度侦听\n)\n\nwatch(\n () => ({ ...data.cacheRule }),\n (n) => {\n data.sort = Object.keys(n)\n },\n { immediate: true }\n)\n\nconst getFieldValue = (index: number) => {\n if (props.field) {\n return { [props.field]: _value(props.modelValue[index]) }\n } else {\n return props.modelValue[index]\n }\n}\n\nconst getTitle = (index: number) => {\n if (data.cacheRule[index]) {\n const { rule } = data.cacheRule[index]\n const defaultField = props.titleField ? props.titleField : rule[0]?.field\n return data.cacheRule[index].$f?.getValue(defaultField) || '点击展开'\n } else {\n return '点击展开'\n }\n}\nconst _value = (v: any) => {\n return v && hasProperty(v, props.field) ? v[props.field] : v\n}\nconst cache = (k: any, val: any) => {\n data.cacheValue[k] = JSON.stringify(val)\n}\nconst input = (value: any) => {\n emit('update:modelValue', value)\n emit('change', value)\n}\nconst formData = (index: any, formData: any) => {\n nextTick(() => {\n const keys = Object.keys(data.cacheRule)\n const value = keys.map((k: any) => {\n const _data = index === k ? formData : { ...data.cacheRule[k].$f.form }\n const value = props.field ? _data[props.field] || null : _data\n cache(k, value)\n return value\n })\n input(value)\n })\n}\n\nconst add$f = (index: any, $f: any) => {\n data.cacheRule[index].$f = $f\n nextTick(() => {\n if (props.syncDisabled) {\n $f.disabled(props.disabled)\n }\n emit('itemMounted', $f, Object.keys(data.cacheRule).indexOf(index))\n })\n}\n\nonMounted(() => {\n data.loading = false\n})\n\nconst setValue = (key: any, value: any) => {\n const field = props.field\n if (field) {\n value = { [field]: _value(value) }\n }\n if (data.cacheValue[key] === JSON.stringify(field ? value[field] : value)) {\n return\n }\n cache(key, value)\n}\nconst addRule = (index: any, isEmit = false) => {\n const rule = props.formCreateInject.form.copyRules(props.rule || [])\n const options: any = props.options\n ? { ...props.options }\n : {\n submitBtn: false,\n resetBtn: false,\n }\n if (props.defaultValue) {\n if (!options.formData) options.formData = {}\n const defVal = deepCopy(props.defaultValue)\n extend(options.formData, props.field ? { [props.field]: defVal } : defVal)\n }\n props.parse && props.parse({ rule, options, index: data.sort.length })\n data.cacheRule[index] = { rule, options }\n if (isEmit) {\n nextTick(() => emit('add', rule, Object.keys(data.cacheRule).length - 1))\n }\n}\n\nconst removeRule = (index: any, isEmit = false) => {\n delete data.cacheRule[index]\n delete data.cacheValue[index]\n if (isEmit) {\n nextTick(() => emit('remove', index))\n }\n}\nconst add = () => {\n if (props.disabled || props.onBeforeAdd(props.modelValue) === false) {\n return\n }\n const value = [...props.modelValue]\n value.push(props.defaultValue ? deepCopy(props.defaultValue) : props.field ? null : {})\n input(value)\n collapseComponentData.modelValue = [value.length - 1]\n}\nconst del = (index: number, key: number) => {\n if (props.disabled || props.onBeforeRemove(props.modelValue, index) === false) {\n return\n }\n const value = [...props.modelValue]\n value.splice(index, 1)\n input(value)\n}\n\nconst emitEvent = (name: any, args: any, index: any) => {\n emit(name, ...args, data.cacheRule[index].$f, index)\n}\n\nconst expandRule = (n: any) => {\n for (let i = 0; i < n; i++) {\n // eslint-disable-next-line vue/no-mutating-props\n props.modelValue.push(props.field ? null : {})\n }\n}\n\nconst d = (props.expand || 0) - props.modelValue.length\nfor (let i = 0; i < props.modelValue.length; i++)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A,KACF,CAAA;AAEA,IAAA,MAAM,CAAK,GAAA,CAAA,KAAA,CAAM,MAAU,IAAA,CAAA,IAAK,MAAM,UAAW,CAAA,MAAA,CAAA;AACjD,IAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,KAAM,CAAA,UAAA,CAAW,QAAQ,CAAK,EAAA,EAAA;AAChD,MAAA,OAAA,CAAQ,CAAC,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,IAAI,CAAG,EAAA;AACT,MAAA,UAAA,CAAW,CAAC,CAAA,CAAA;AAAA,KACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/group/src/props.d.ts
CHANGED
package/es/group/src/props.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.mjs","sources":["../../../src/group/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const groupProps = {\n field: {\n type: String,\n default: '',\n },\n titleField: {\n type: String,\n default: '',\n },\n rule: {\n type: Array,\n default: () => [],\n },\n expand: {\n type: Number,\n default: 0,\n },\n options: {\n type: Object,\n default: () => {},\n },\n button: {\n type: Boolean,\n default: true,\n },\n max: {\n type: Number,\n default: 0,\n },\n min: {\n type: Number,\n default: 0,\n },\n modelValue: {\n type: Array,\n default: () => [],\n },\n defaultValue: {\n type: Object,\n default: () => {},\n },\n sortBtn: {\n type: Boolean,\n default: true,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n syncDisabled: {\n type: Boolean,\n default: true,\n },\n onBeforeRemove: {\n type: Function,\n default: () => {},\n },\n onBeforeAdd: {\n type: Function,\n default: () => {},\n },\n formCreateInject: {\n type: Object,\n default: () => {},\n },\n parse: {\n type: Function,\n default: () => {},\n },\n title: {\n default: '',\n type: String,\n },\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AAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,KAAO,EAAA;AAAA,IACL,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
1
|
+
{"version":3,"file":"props.mjs","sources":["../../../src/group/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const groupProps = {\n field: {\n type: String,\n default: '',\n },\n titleField: {\n type: String,\n default: '',\n },\n rule: {\n type: Array,\n default: () => [],\n },\n expand: {\n type: Number,\n default: 0,\n },\n options: {\n type: Object,\n default: () => {},\n },\n button: {\n type: Boolean,\n default: true,\n },\n max: {\n type: Number,\n default: 0,\n },\n min: {\n type: Number,\n default: 0,\n },\n modelValue: {\n type: Array,\n default: () => [],\n },\n defaultValue: {\n type: Object,\n default: () => {},\n },\n sortBtn: {\n type: Boolean,\n default: true,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n syncDisabled: {\n type: Boolean,\n default: true,\n },\n onBeforeRemove: {\n type: Function,\n default: () => {},\n },\n onBeforeAdd: {\n type: Function,\n default: () => {},\n },\n formCreateInject: {\n type: Object,\n default: () => {},\n },\n parse: {\n type: Function,\n default: () => {},\n },\n title: {\n default: '',\n type: String,\n },\n accordion: {\n type: Boolean,\n default: true,\n },\n}\n\nexport type GroupProps = ExtractPropTypes<typeof groupProps>\n"],"names":[],"mappings":"AAEO,MAAM,UAAa,GAAA;AAAA,EACxB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,KAAA;AAAA,IACN,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,MAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EACA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EACA,GAAK,EAAA;AAAA,IACH,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,CAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,KAAA;AAAA,IACN,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,MAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,WAAa,EAAA;AAAA,IACX,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,QAAA;AAAA,IACN,SAAS,MAAM;AAAA,KAAC;AAAA,GAClB;AAAA,EACA,KAAO,EAAA;AAAA,IACL,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF;;;;"}
|
package/es/table/index.d.ts
CHANGED
@@ -9,6 +9,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
9
9
|
tableAfter?: Record<string, any> | undefined;
|
10
10
|
buttons?: unknown[] | undefined;
|
11
11
|
hideButtons?: unknown[] | undefined;
|
12
|
+
query?: Record<string, any> | undefined;
|
12
13
|
style?: unknown;
|
13
14
|
key?: string | number | symbol | undefined;
|
14
15
|
ref?: import("vue").VNodeRef | undefined;
|
@@ -92,6 +93,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
92
93
|
default: () => never[];
|
93
94
|
type: ArrayConstructor;
|
94
95
|
};
|
96
|
+
query: {
|
97
|
+
default: () => {};
|
98
|
+
type: ObjectConstructor;
|
99
|
+
};
|
95
100
|
}>>, {
|
96
101
|
DkTable: import("./utils/dkTable").default;
|
97
102
|
TableRef: import("vue").Ref<any>;
|
@@ -103,6 +108,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
103
108
|
tableAfter: Record<string, any>;
|
104
109
|
buttons: unknown[];
|
105
110
|
hideButtons: unknown[];
|
111
|
+
query: Record<string, any>;
|
106
112
|
}, {}, string, {}> & {
|
107
113
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
108
114
|
created?: ((() => void) | (() => void)[]) | undefined;
|
@@ -148,6 +154,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
148
154
|
default: () => never[];
|
149
155
|
type: ArrayConstructor;
|
150
156
|
};
|
157
|
+
query: {
|
158
|
+
default: () => {};
|
159
|
+
type: ObjectConstructor;
|
160
|
+
};
|
151
161
|
}>> & import("vue").ShallowUnwrapRef<{
|
152
162
|
DkTable: import("./utils/dkTable").default;
|
153
163
|
TableRef: import("vue").Ref<any>;
|
@@ -181,6 +191,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
181
191
|
default: () => never[];
|
182
192
|
type: ArrayConstructor;
|
183
193
|
};
|
194
|
+
query: {
|
195
|
+
default: () => {};
|
196
|
+
type: ObjectConstructor;
|
197
|
+
};
|
184
198
|
}>>, {
|
185
199
|
DkTable: import("./utils/dkTable").default;
|
186
200
|
TableRef: import("vue").Ref<any>;
|
@@ -192,6 +206,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
192
206
|
tableAfter: Record<string, any>;
|
193
207
|
buttons: unknown[];
|
194
208
|
hideButtons: unknown[];
|
209
|
+
query: Record<string, any>;
|
195
210
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
196
211
|
$slots: Partial<Record<NonNullable<string | number>, (_: {}) => any>> & Partial<Record<string, (_: any) => any>> & {
|
197
212
|
columnPrepend?(_: {}): any;
|
package/es/table/src/props.d.ts
CHANGED
package/es/table/src/props.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.mjs","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return ['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay', 'recycle']\n },\n type: Array,\n },\n hideButtons: {\n default: () => {\n return []\n },\n type: Array,\n },\n}\n\nexport type TableProps = ExtractPropTypes<typeof tableProps>\n"],"names":[],"mappings":"AAGO,MAAM,UAAa,GAAA;AAAA,EACxB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,OAAS,EAAA;AAAA,IACP,SAAS,MAAM;AACb,MAAO,OAAA,CAAC,WAAW,KAAO,EAAA,YAAA,EAAc,QAAQ,QAAU,EAAA,WAAA,EAAa,aAAe,EAAA,eAAA,EAAiB,SAAS,CAAA,CAAA;AAAA,KAClH;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AACF;;;;"}
|
1
|
+
{"version":3,"file":"props.mjs","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return ['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay', 'recycle']\n },\n type: Array,\n },\n hideButtons: {\n default: () => {\n return []\n },\n type: Array,\n },\n query: {\n default: () => {\n return {}\n },\n type: Object,\n },\n}\n\nexport type TableProps = ExtractPropTypes<typeof tableProps>\n"],"names":[],"mappings":"AAGO,MAAM,UAAa,GAAA;AAAA,EACxB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,OAAS,EAAA;AAAA,IACP,SAAS,MAAM;AACb,MAAO,OAAA,CAAC,WAAW,KAAO,EAAA,YAAA,EAAc,QAAQ,QAAU,EAAA,WAAA,EAAa,aAAe,EAAA,eAAA,EAAiB,SAAS,CAAA,CAAA;AAAA,KAClH;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
@@ -24,6 +24,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
24
24
|
default: () => never[];
|
25
25
|
type: ArrayConstructor;
|
26
26
|
};
|
27
|
+
query: {
|
28
|
+
default: () => {};
|
29
|
+
type: ObjectConstructor;
|
30
|
+
};
|
27
31
|
}, {
|
28
32
|
DkTable: DkTableClass;
|
29
33
|
TableRef: import("vue").Ref<any>;
|
@@ -53,6 +57,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
53
57
|
default: () => never[];
|
54
58
|
type: ArrayConstructor;
|
55
59
|
};
|
60
|
+
query: {
|
61
|
+
default: () => {};
|
62
|
+
type: ObjectConstructor;
|
63
|
+
};
|
56
64
|
}>>, {
|
57
65
|
tableApi: string;
|
58
66
|
cacheTable: boolean;
|
@@ -60,6 +68,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
60
68
|
tableAfter: Record<string, any>;
|
61
69
|
buttons: unknown[];
|
62
70
|
hideButtons: unknown[];
|
71
|
+
query: Record<string, any>;
|
63
72
|
}, {}>, Partial<Record<NonNullable<string | number>, (_: {}) => any>> & Partial<Record<string, (_: any) => any>> & {
|
64
73
|
columnPrepend?(_: {}): any;
|
65
74
|
columnAppend?(_: {}): any;
|
@@ -17,7 +17,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
const props = __props;
|
18
18
|
const FormRef = ref();
|
19
19
|
const TableRef = ref();
|
20
|
-
const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter);
|
20
|
+
const DkTable = new dkTable(props.tableApi, props.tableBefore, props.tableAfter, props.query);
|
21
21
|
provide("DkTable", DkTable);
|
22
22
|
onMounted(() => {
|
23
23
|
DkTable.getTable(props.cacheTable)?.then(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.vue2.mjs","sources":["../../../src/table/src/table.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTable',\n});\n</script>\n<template>\n <div class=\"dk-table\">\n <!--顶部菜单-->\n <DkTableHeader size=\"default\" :buttons=\"effectiveButtons\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </DkTableHeader>\n <!--表格-->\n <el-table\n ref=\"TableRef\"\n v-loading=\"DkTable.table.loading\"\n class=\"dk-data-table w100\"\n header-cell-class-name=\"table-header-cell\"\n :default-expand-all=\"DkTable.table.expandAll\"\n :data=\"DkTable.table.data\"\n :row-key=\"DkTable.table.pk\"\n stripe\n v-bind=\"$attrs\"\n @select-all=\"onSelectAll\"\n @select=\"onSelect\"\n @selection-change=\"onSelectionChange\"\n @sort-change=\"onSortChange\"\n @cell-dblclick=\"ondblclick\"\n >\n <slot name=\"columnPrepend\"></slot>\n <template v-for=\"(item, key) in DkTable.table.column\">\n <template v-if=\"item.show !== false\">\n <!-- 渲染为 slot -->\n <el-table-column v-if=\"item.slotName\" :key=\"key\" v-bind=\"{ ...item }\">\n <template #default=\"scope\">\n <slot :name=\"item.slotName\" v-bind=\"scope\">\n <dk-field-render\n :key=\"\n key +\n '-' +\n scope.$index +\n '-' +\n item.render +\n '-' +\n (item.prop ? '-' + item.prop + '-' + scope.row[item.prop] : '')\n \"\n :field=\"item\"\n :row=\"scope.row\"\n :column=\"scope.column\"\n :index=\"scope.$index\"\n />\n </slot>\n </template>\n </el-table-column>\n <el-table-column v-else :key=\"key + 'default'\" v-bind=\"{ ...item }\"></el-table-column>\n </template>\n </template>\n <slot name=\"columnAppend\"></slot>\n </el-table>\n\n <div class=\"table-pagination\">\n <el-pagination\n :current-page=\"DkTable.table.filter!.page\"\n :page-size=\"DkTable.table.filter!.limit\"\n :page-sizes=\"pageSizes\"\n background\n :layout=\"'sizes,total, ->, prev, pager, next, jumper'\"\n :total=\"DkTable.table.total\"\n @size-change=\"onTableSizeChange\"\n @current-change=\"onTableCurrentChange\"\n ></el-pagination>\n </div>\n </div>\n <dk-form ref=\"FormRef\" :is-dialog=\"true\" @submit=\"DkTable.onSubmit\">\n <template #buttons>\n <el-button type=\"primary\" :loading=\"DkTable.form.ref.buttonLoading\" @click=\"DkTable.form.ref.checkForm\">\n {{ DkTable.form.operateIds!.length > 0 ? '保存并编辑下一项' : '提交' }}\n </el-button>\n </template>\n </dk-form>\n <RecycleDialog></RecycleDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, onMounted, nextTick, provide, computed } from 'vue'\nimport { tableProps } from './props'\nimport DkTableClass from '../utils/dkTable'\nimport DkTableHeader from './components/header.vue'\nimport DkFieldRender from './components/FieldRender.vue'\nimport RecycleDialog from './components/RecycleDialog.vue'\n\n\n\nconst props = defineProps(tableProps)\nconst FormRef = ref()\n// 表格的Ref\nconst TableRef = ref()\n// 表格的对象\nconst DkTable = new DkTableClass(props.tableApi, props.tableBefore, props.tableAfter)\n\nprovide('DkTable', DkTable)\n// 获取表格信息\nonMounted(() => {\n DkTable.getTable(props.cacheTable)?.then(() => {\n DkTable.getIndex()?.then(() => {\n nextTick(() => {\n DkTable.dragSort()\n })\n })\n DkTable.initComSearch()\n })\n DkTable.table.ref = TableRef.value\n DkTable.form.ref = FormRef.value\n})\n\nconst effectiveButtons = computed(() => {\n return [...new Set(props.buttons.filter((button) => !props.hideButtons.includes(button)))]\n})\n\nconst onTableSizeChange = (val: number) => {\n DkTable.onTableAction('page-size-change', { size: val })\n}\n\nconst onTableCurrentChange = (val: number) => {\n DkTable.onTableAction('current-page-change', { page: val })\n}\n\n// 双击\nconst ondblclick = (row: any) => {\n DkTable.toggleForm('Edit', [row[DkTable.table.pk!]])\n}\n\nconst onSortChange = ({ order, prop }: { order: string; prop: string }) => {\n DkTable.onTableAction('sort-change', {\n prop,\n order: order ? (order == 'ascending' ? 'asc' : 'desc') : '',\n })\n}\n\nconst pageSizes = computed(() => {\n const defaultSizes = [10, 20, 50, 100]\n if (DkTable.table.filter!.limit) {\n if (!defaultSizes.includes(DkTable.table.filter!.limit)) {\n defaultSizes.push(DkTable.table.filter!.limit)\n }\n }\n return defaultSizes\n})\n\n/*\n * 手动选择时,同时选择子级\n */\nconst onSelect = (selection: TableRow[], row: TableRow) => {\n if (\n selection.some((item: TableRow) => {\n return row[DkTable.table.pk!] === item[DkTable.table.pk!]\n })\n ) {\n if (row.children) {\n selectChildren(row.children, true)\n }\n } else {\n if (row.children) {\n selectChildren(row.children, false)\n }\n }\n}\n\n/**\n /*\n * 全选和取消全选\n * 实现子级同时选择和取消选中\n */\nconst onSelectAll = (selection: TableRow[]) => {\n if (isSelectAll(selection.map((row: TableRow) => row[DkTable.table.pk!].toString()))) {\n // eslint-disable-next-line array-callback-return\n selection.map((row: TableRow) => {\n if (row.children) {\n selectChildren(row.children, true)\n }\n })\n } else {\n TableRef.value?.clearSelection()\n }\n}\n\n/*\n * 是否是全选操作\n * 只检查第一个元素是否被选择\n * 全选时:selectIds为所有元素的id\n * 取消全选时:selectIds为所有子元素的id\n */\nconst isSelectAll = (selectIds: string[]) => {\n const data = DkTable.table.data as TableRow[]\n // eslint-disable-next-line no-unreachable-loop\n for (const key in data) {\n return selectIds.includes(data[key][DkTable.table.pk!].toString())\n }\n return false\n}\n\n/*\n * 选择子项-递归\n */\nconst selectChildren = (children: TableRow[], type: boolean) => {\n // eslint-disable-next-line array-callback-return\n children.map((j: TableRow) => {\n toggleSelection(j, type)\n if (j.children) {\n selectChildren(j.children, type)\n }\n })\n}\n\n/*\n * 执行选择操作\n */\nconst toggleSelection = (row: TableRow, type: boolean) => {\n if (row) {\n nextTick(() => {\n TableRef.value?.toggleRowSelection(row, type)\n })\n }\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-change', selection)\n}\n\n/*\n * 设置折叠所有-递归\n */\nconst setUnFoldAll = (children: TableRow[], unfold: boolean) => {\n for (const key in children) {\n TableRef.value?.toggleRowExpansion(children[key], unfold)\n if (children[key].children) {\n setUnFoldAll(children[key].children!, unfold)\n }\n }\n}\n\n/*\n * 折叠所有\n */\nconst unFoldAll = (unfold: boolean) => {\n setUnFoldAll(DkTable.table.data!, unfold)\n}\n\nconst slotNames = computed(() => {\n const column = DkTable.table.column\n const slotNames = []\n for (let i = 0; i < column.length; i++) {\n if (column[i].slotName) {\n slotNames.push(column[i].slotName)\n }\n }\n return slotNames\n})\n\nonMounted(() => {\n // injectTablePrimaryMethods()\n})\n\ndefineExpose({\n DkTable,\n TableRef,\n FormRef,\n})\n</script>\n<style lang=\"scss\"></style>\n"],"names":["__MACROS_defineComponent","DkTableClass","slotNames"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA4FD,IAAA,MAAM,UAAU,GAAI,EAAA,CAAA;AAEpB,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,IAAIC,OAAa,CAAA,KAAA,CAAM,UAAU,KAAM,CAAA,WAAA,EAAa,MAAM,UAAU,CAAA,CAAA;AAEpF,IAAA,OAAA,CAAQ,WAAW,OAAO,CAAA,CAAA;AAE1B,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,EAAG,KAAK,MAAM;AAC7C,QAAQ,OAAA,CAAA,QAAA,EAAY,EAAA,IAAA,CAAK,MAAM;AAC7B,UAAA,QAAA,CAAS,M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A,QAAA;AAAA,MACA,OAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"table.vue2.mjs","sources":["../../../src/table/src/table.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTable',\n});\n</script>\n<template>\n <div class=\"dk-table\">\n <!--顶部菜单-->\n <DkTableHeader size=\"default\" :buttons=\"effectiveButtons\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </DkTableHeader>\n <!--表格-->\n <el-table\n ref=\"TableRef\"\n v-loading=\"DkTable.table.loading\"\n class=\"dk-data-table w100\"\n header-cell-class-name=\"table-header-cell\"\n :default-expand-all=\"DkTable.table.expandAll\"\n :data=\"DkTable.table.data\"\n :row-key=\"DkTable.table.pk\"\n stripe\n v-bind=\"$attrs\"\n @select-all=\"onSelectAll\"\n @select=\"onSelect\"\n @selection-change=\"onSelectionChange\"\n @sort-change=\"onSortChange\"\n @cell-dblclick=\"ondblclick\"\n >\n <slot name=\"columnPrepend\"></slot>\n <template v-for=\"(item, key) in DkTable.table.column\">\n <template v-if=\"item.show !== false\">\n <!-- 渲染为 slot -->\n <el-table-column v-if=\"item.slotName\" :key=\"key\" v-bind=\"{ ...item }\">\n <template #default=\"scope\">\n <slot :name=\"item.slotName\" v-bind=\"scope\">\n <dk-field-render\n :key=\"\n key +\n '-' +\n scope.$index +\n '-' +\n item.render +\n '-' +\n (item.prop ? '-' + item.prop + '-' + scope.row[item.prop] : '')\n \"\n :field=\"item\"\n :row=\"scope.row\"\n :column=\"scope.column\"\n :index=\"scope.$index\"\n />\n </slot>\n </template>\n </el-table-column>\n <el-table-column v-else :key=\"key + 'default'\" v-bind=\"{ ...item }\"></el-table-column>\n </template>\n </template>\n <slot name=\"columnAppend\"></slot>\n </el-table>\n\n <div class=\"table-pagination\">\n <el-pagination\n :current-page=\"DkTable.table.filter!.page\"\n :page-size=\"DkTable.table.filter!.limit\"\n :page-sizes=\"pageSizes\"\n background\n :layout=\"'sizes,total, ->, prev, pager, next, jumper'\"\n :total=\"DkTable.table.total\"\n @size-change=\"onTableSizeChange\"\n @current-change=\"onTableCurrentChange\"\n ></el-pagination>\n </div>\n </div>\n <dk-form ref=\"FormRef\" :is-dialog=\"true\" @submit=\"DkTable.onSubmit\">\n <template #buttons>\n <el-button type=\"primary\" :loading=\"DkTable.form.ref.buttonLoading\" @click=\"DkTable.form.ref.checkForm\">\n {{ DkTable.form.operateIds!.length > 0 ? '保存并编辑下一项' : '提交' }}\n </el-button>\n </template>\n </dk-form>\n <RecycleDialog></RecycleDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, onMounted, nextTick, provide, computed } from 'vue'\nimport { tableProps } from './props'\nimport DkTableClass from '../utils/dkTable'\nimport DkTableHeader from './components/header.vue'\nimport DkFieldRender from './components/FieldRender.vue'\nimport RecycleDialog from './components/RecycleDialog.vue'\n\n\n\nconst props = defineProps(tableProps)\nconst FormRef = ref()\n// 表格的Ref\nconst TableRef = ref()\n// 表格的对象\nconst DkTable = new DkTableClass(props.tableApi, props.tableBefore, props.tableAfter, props.query)\n\nprovide('DkTable', DkTable)\n// 获取表格信息\nonMounted(() => {\n DkTable.getTable(props.cacheTable)?.then(() => {\n DkTable.getIndex()?.then(() => {\n nextTick(() => {\n DkTable.dragSort()\n })\n })\n DkTable.initComSearch()\n })\n DkTable.table.ref = TableRef.value\n DkTable.form.ref = FormRef.value\n})\n\nconst effectiveButtons = computed(() => {\n return [...new Set(props.buttons.filter((button) => !props.hideButtons.includes(button)))]\n})\n\nconst onTableSizeChange = (val: number) => {\n DkTable.onTableAction('page-size-change', { size: val })\n}\n\nconst onTableCurrentChange = (val: number) => {\n DkTable.onTableAction('current-page-change', { page: val })\n}\n\n// 双击\nconst ondblclick = (row: any) => {\n DkTable.toggleForm('Edit', [row[DkTable.table.pk!]])\n}\n\nconst onSortChange = ({ order, prop }: { order: string; prop: string }) => {\n DkTable.onTableAction('sort-change', {\n prop,\n order: order ? (order == 'ascending' ? 'asc' : 'desc') : '',\n })\n}\n\nconst pageSizes = computed(() => {\n const defaultSizes = [10, 20, 50, 100]\n if (DkTable.table.filter!.limit) {\n if (!defaultSizes.includes(DkTable.table.filter!.limit)) {\n defaultSizes.push(DkTable.table.filter!.limit)\n }\n }\n return defaultSizes\n})\n\n/*\n * 手动选择时,同时选择子级\n */\nconst onSelect = (selection: TableRow[], row: TableRow) => {\n if (\n selection.some((item: TableRow) => {\n return row[DkTable.table.pk!] === item[DkTable.table.pk!]\n })\n ) {\n if (row.children) {\n selectChildren(row.children, true)\n }\n } else {\n if (row.children) {\n selectChildren(row.children, false)\n }\n }\n}\n\n/**\n /*\n * 全选和取消全选\n * 实现子级同时选择和取消选中\n */\nconst onSelectAll = (selection: TableRow[]) => {\n if (isSelectAll(selection.map((row: TableRow) => row[DkTable.table.pk!].toString()))) {\n // eslint-disable-next-line array-callback-return\n selection.map((row: TableRow) => {\n if (row.children) {\n selectChildren(row.children, true)\n }\n })\n } else {\n TableRef.value?.clearSelection()\n }\n}\n\n/*\n * 是否是全选操作\n * 只检查第一个元素是否被选择\n * 全选时:selectIds为所有元素的id\n * 取消全选时:selectIds为所有子元素的id\n */\nconst isSelectAll = (selectIds: string[]) => {\n const data = DkTable.table.data as TableRow[]\n // eslint-disable-next-line no-unreachable-loop\n for (const key in data) {\n return selectIds.includes(data[key][DkTable.table.pk!].toString())\n }\n return false\n}\n\n/*\n * 选择子项-递归\n */\nconst selectChildren = (children: TableRow[], type: boolean) => {\n // eslint-disable-next-line array-callback-return\n children.map((j: TableRow) => {\n toggleSelection(j, type)\n if (j.children) {\n selectChildren(j.children, type)\n }\n })\n}\n\n/*\n * 执行选择操作\n */\nconst toggleSelection = (row: TableRow, type: boolean) => {\n if (row) {\n nextTick(() => {\n TableRef.value?.toggleRowSelection(row, type)\n })\n }\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-change', selection)\n}\n\n/*\n * 设置折叠所有-递归\n */\nconst setUnFoldAll = (children: TableRow[], unfold: boolean) => {\n for (const key in children) {\n TableRef.value?.toggleRowExpansion(children[key], unfold)\n if (children[key].children) {\n setUnFoldAll(children[key].children!, unfold)\n }\n }\n}\n\n/*\n * 折叠所有\n */\nconst unFoldAll = (unfold: boolean) => {\n setUnFoldAll(DkTable.table.data!, unfold)\n}\n\nconst slotNames = computed(() => {\n const column = DkTable.table.column\n const slotNames = []\n for (let i = 0; i < column.length; i++) {\n if (column[i].slotName) {\n slotNames.push(column[i].slotName)\n }\n }\n return slotNames\n})\n\nonMounted(() => {\n // injectTablePrimaryMethods()\n})\n\ndefineExpose({\n DkTable,\n TableRef,\n FormRef,\n})\n</script>\n<style lang=\"scss\"></style>\n"],"names":["__MACROS_defineComponent","DkTableClass","slotNames"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA4FD,IAAA,MAAM,UAAU,GAAI,EAAA,CAAA;AAEpB,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,IAAIC,OAAA,CAAa,KAAM,CAAA,QAAA,EAAU,MAAM,WAAa,EAAA,KAAA,CAAM,UAAY,EAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAEjG,IAAA,OAAA,CAAQ,WAAW,OAAO,CAAA,CAAA;AAE1B,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,OAAA,CAAQ,QAAS,CAAA,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CAAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,SAAA,CAAU,MAAM;AAAA,KAEf,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,OAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -10,7 +10,7 @@ export default class dkTable {
|
|
10
10
|
form: DkForm;
|
11
11
|
recycleTable: RecycleTable;
|
12
12
|
comSearch: ComSearch;
|
13
|
-
constructor(url: string, before
|
13
|
+
constructor(url: string, before: BaTableBefore | undefined, after: BaTableAfter | undefined, query: Object);
|
14
14
|
/**
|
15
15
|
* 表格内部鉴权方法
|
16
16
|
* 此方法在表头或表行组件内部自动调用,传递权限节点名,如:add、edit
|
@@ -60,9 +60,9 @@ class dkTable {
|
|
60
60
|
form: {},
|
61
61
|
fieldData: /* @__PURE__ */ new Map()
|
62
62
|
});
|
63
|
-
constructor(url, before = {}, after = {}) {
|
63
|
+
constructor(url, before = {}, after = {}, query) {
|
64
64
|
this.url = url;
|
65
|
-
this.api = new dkTableApi(url);
|
65
|
+
this.api = new dkTableApi(url, query);
|
66
66
|
this.before = before;
|
67
67
|
this.after = after;
|
68
68
|
this.buttonCallback = (event, data) => {
|