@juzhenfe/page-model 3.10.3 → 3.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/page-model/type.d.ts +58 -15
- package/dist/index.es.js +15 -6
- package/dist/index.umd.js +3 -3
- package/package.json +1 -1
|
@@ -79,32 +79,63 @@ declare global {
|
|
|
79
79
|
*/
|
|
80
80
|
urlMode?: UrlMode;
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
/**
|
|
83
|
+
* 获取API地址
|
|
84
|
+
*/
|
|
83
85
|
getUrl?: string;
|
|
84
|
-
|
|
86
|
+
/**
|
|
87
|
+
* 获取method
|
|
88
|
+
*/
|
|
85
89
|
getMethod?: AjaxMethod;
|
|
86
|
-
|
|
90
|
+
/**
|
|
91
|
+
* 获取的其他参数
|
|
92
|
+
*/
|
|
87
93
|
otherParams?: AnyObject;
|
|
88
|
-
|
|
94
|
+
/**
|
|
95
|
+
* 获取的数据拿取方式(处理不同请求返回数据列表的方法)
|
|
96
|
+
*/
|
|
89
97
|
getReqResultProcessFn?: GetReqResultProcessFn<PageModelManager>;
|
|
90
98
|
|
|
91
|
-
|
|
99
|
+
/**
|
|
100
|
+
* 请求参数回调处理
|
|
101
|
+
* @param this
|
|
102
|
+
* @param data 列表数据
|
|
103
|
+
* @returns 列表数据
|
|
104
|
+
*/
|
|
92
105
|
getDataCallback?: (this: PageModelManager, data: MODEL[]) => ExtendKeys<MODEL>[];
|
|
93
106
|
|
|
94
|
-
|
|
107
|
+
/**
|
|
108
|
+
* 树形数据配置
|
|
109
|
+
*/
|
|
95
110
|
treeProps?: TreeProps;
|
|
96
111
|
|
|
97
|
-
|
|
112
|
+
/**
|
|
113
|
+
* 删除地址
|
|
114
|
+
*/
|
|
98
115
|
delUrl?: string;
|
|
99
|
-
|
|
116
|
+
/**
|
|
117
|
+
* 从row中获取删除参数的key
|
|
118
|
+
*/
|
|
100
119
|
delKey?: keyof MODEL;
|
|
101
|
-
|
|
120
|
+
/**
|
|
121
|
+
* 删除参数的rowKey键名称
|
|
122
|
+
*/
|
|
123
|
+
delParamsKey?: keyof MODEL;
|
|
124
|
+
/**
|
|
125
|
+
* 删除method
|
|
126
|
+
*/
|
|
102
127
|
delMethod?: AjaxMethod;
|
|
103
|
-
|
|
128
|
+
/**
|
|
129
|
+
* 删除参数
|
|
130
|
+
*/
|
|
104
131
|
delParams?: AnyObject | ((this: PageModelManager, data: MODEL) => AnyObject);
|
|
105
|
-
|
|
132
|
+
/**
|
|
133
|
+
* 删除的参数处理方法
|
|
134
|
+
*/
|
|
106
135
|
delReqDataProcessFn?: RequestProcessFn;
|
|
107
|
-
|
|
136
|
+
/**
|
|
137
|
+
* 删除的数据拿取方式
|
|
138
|
+
*/
|
|
108
139
|
delReqResultProcessFn?: RequestProcessFn;
|
|
109
140
|
|
|
110
141
|
// 更新地址
|
|
@@ -125,12 +156,24 @@ declare global {
|
|
|
125
156
|
// 新增按钮是否放置在多选操作
|
|
126
157
|
addButtonInSelectButtonsArea?: boolean;
|
|
127
158
|
|
|
128
|
-
|
|
159
|
+
/**
|
|
160
|
+
* 详情地址
|
|
161
|
+
*/
|
|
129
162
|
detailUrl?: string;
|
|
130
|
-
|
|
163
|
+
/**
|
|
164
|
+
* 提取详情参数的rowKey键名称
|
|
165
|
+
*/
|
|
131
166
|
detailKey?: keyof MODEL;
|
|
132
|
-
|
|
167
|
+
/**
|
|
168
|
+
* 详情请求参数的rowKey键名称
|
|
169
|
+
*/
|
|
170
|
+
detailParamsKey?: keyof MODEL;
|
|
171
|
+
/**
|
|
172
|
+
* 详情method
|
|
173
|
+
*/
|
|
133
174
|
detailMethod?: string;
|
|
175
|
+
// 详情的参数获取方式
|
|
176
|
+
detailReqDataProcessFn?: RequestProcessFn;
|
|
134
177
|
// 详情的数据拿取方式
|
|
135
178
|
detailReqResultProcessFn?: RequestProcessFn;
|
|
136
179
|
// 详情是否显示记载中
|
package/dist/index.es.js
CHANGED
|
@@ -3549,7 +3549,8 @@ const _PageModelManager = class extends Reflections {
|
|
|
3549
3549
|
const config = this.config;
|
|
3550
3550
|
let data = {};
|
|
3551
3551
|
if (config.delKey) {
|
|
3552
|
-
|
|
3552
|
+
const paramsKey = config.delParamsKey || config.delKey;
|
|
3553
|
+
data[paramsKey] = row[config.delKey];
|
|
3553
3554
|
}
|
|
3554
3555
|
if (typeof config.delParams) {
|
|
3555
3556
|
const processedData = config.delParams instanceof Function ? config.delParams.call(this, row) : config.delParams;
|
|
@@ -10571,12 +10572,20 @@ const _sfc_main$4 = defineComponent({
|
|
|
10571
10572
|
showForm();
|
|
10572
10573
|
nextTick(async () => {
|
|
10573
10574
|
const config = manager.config;
|
|
10574
|
-
if (config.useDetail && config.detailUrl) {
|
|
10575
|
+
if (config.useDetail && config.detailUrl && config.detailKey) {
|
|
10575
10576
|
try {
|
|
10576
10577
|
manager.loading();
|
|
10577
|
-
|
|
10578
|
-
|
|
10579
|
-
|
|
10578
|
+
const detailParamsKey = config.detailParamsKey || config.detailKey;
|
|
10579
|
+
let detailParams = {
|
|
10580
|
+
[detailParamsKey]: row[config.detailKey]
|
|
10581
|
+
};
|
|
10582
|
+
if (typeof config.detailReqDataProcessFn === "function") {
|
|
10583
|
+
detailParams = config.detailReqDataProcessFn.call(manager, detailParams);
|
|
10584
|
+
}
|
|
10585
|
+
row = await PageModelManager.request[config.detailMethod](
|
|
10586
|
+
config.detailUrl,
|
|
10587
|
+
detailParams
|
|
10588
|
+
);
|
|
10580
10589
|
} catch (error) {
|
|
10581
10590
|
} finally {
|
|
10582
10591
|
manager.stopLoading();
|
|
@@ -11741,7 +11750,7 @@ const defineEditableTable = function(config) {
|
|
|
11741
11750
|
};
|
|
11742
11751
|
var iconfont = "";
|
|
11743
11752
|
const name = "@juzhenfe/page-model";
|
|
11744
|
-
const version = "3.10.
|
|
11753
|
+
const version = "3.10.4";
|
|
11745
11754
|
const types = "dist/main.d.ts";
|
|
11746
11755
|
const main = "dist/index.umd.js";
|
|
11747
11756
|
const keywords = [
|