sd-data-grid 1.2.69 → 1.2.71
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/0.sd-data-grid.js +3815 -0
- package/dist/0.sd-data-grid.js.map +1 -0
- package/dist/sd-data-grid.js +6243 -3492
- package/dist/sd-data-grid.js.map +1 -1
- package/package.json +1 -3
|
@@ -0,0 +1,3815 @@
|
|
|
1
|
+
webpackJsonpsd_data_grid([0],Array(128).concat([
|
|
2
|
+
/* 128 */
|
|
3
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
7
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__routes__ = __webpack_require__(141);
|
|
8
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__runtime__ = __webpack_require__(130);
|
|
9
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__api_mock_api__ = __webpack_require__(131);
|
|
10
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "openCustomQuery", function() { return __WEBPACK_IMPORTED_MODULE_0__routes__["b"]; });
|
|
11
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ensureCustomQueryRoutes", function() { return __WEBPACK_IMPORTED_MODULE_0__routes__["a"]; });
|
|
12
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ROUTE_NAMES", function() { return __WEBPACK_IMPORTED_MODULE_1__runtime__["b"]; });
|
|
13
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "setCustomQueryApi", function() { return __WEBPACK_IMPORTED_MODULE_1__runtime__["f"]; });
|
|
14
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "getCustomQueryApi", function() { return __WEBPACK_IMPORTED_MODULE_1__runtime__["d"]; });
|
|
15
|
+
/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mockApi", function() { return __WEBPACK_IMPORTED_MODULE_2__api_mock_api__["a"]; });
|
|
16
|
+
/**
|
|
17
|
+
* 自定义查询 - 组件入口
|
|
18
|
+
*
|
|
19
|
+
* 仅导出轻量函数/常量:入口本身不静态引入任何 .vue 组件,
|
|
20
|
+
* 页面组件均由 routes.js 通过动态 import 代码分割,按需加载(避免打入宿主主包、降低构建内存)。
|
|
21
|
+
*
|
|
22
|
+
* 宿主用法(零路由配置):
|
|
23
|
+
* import { openCustomQuery } from '_c/custom-query'
|
|
24
|
+
* openCustomQuery(this.$router, { mark })
|
|
25
|
+
* 可选注入真实接口(默认 mock):
|
|
26
|
+
* import { setCustomQueryApi } from '_c/custom-query'
|
|
27
|
+
* setCustomQueryApi({ ...realApi })
|
|
28
|
+
*
|
|
29
|
+
* 如需按需使用视图组件(自行组页/一体化内部切换),请直接从子路径引入:
|
|
30
|
+
* import CustomQuery from '_c/custom-query/custom-query.vue'
|
|
31
|
+
* import QueryConfig from '_c/custom-query/views/query-config.vue'
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// 默认导出「打开新页面」入口
|
|
38
|
+
/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__routes__["b" /* openCustomQuery */]);
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/***/ }),
|
|
43
|
+
/* 129 */,
|
|
44
|
+
/* 130 */
|
|
45
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
46
|
+
|
|
47
|
+
"use strict";
|
|
48
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ROUTE_NAMES; });
|
|
49
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ROUTE_PATHS; });
|
|
50
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return PAYLOAD_KEY; });
|
|
51
|
+
/* harmony export (immutable) */ __webpack_exports__["e"] = openRouteInNewTab;
|
|
52
|
+
/* harmony export (immutable) */ __webpack_exports__["f"] = setCustomQueryApi;
|
|
53
|
+
/* harmony export (immutable) */ __webpack_exports__["d"] = getCustomQueryApi;
|
|
54
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api_mock_api__ = __webpack_require__(131);
|
|
55
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__api_real_api__ = __webpack_require__(142);
|
|
56
|
+
/**
|
|
57
|
+
* 自定义查询 - 运行时配置
|
|
58
|
+
*
|
|
59
|
+
* 因为路由页由 router 实例化(宿主无法通过模板 props 注入接口),
|
|
60
|
+
* 这里用模块级单例保存接口与传参,宿主只需在启动时可选地调用 setCustomQueryApi 覆盖。
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
// 路由名(宿主无需关心,内部自注册)
|
|
66
|
+
var ROUTE_NAMES = {
|
|
67
|
+
config: 'customQuery',
|
|
68
|
+
history: 'customQueryHistory',
|
|
69
|
+
result: 'customQueryResult'
|
|
70
|
+
|
|
71
|
+
// 路由路径
|
|
72
|
+
};var ROUTE_PATHS = {
|
|
73
|
+
config: '/com/model/custom-query',
|
|
74
|
+
history: '/com/model/custom-query-history',
|
|
75
|
+
result: '/com/model/custom-query-result'
|
|
76
|
+
|
|
77
|
+
// 「执行查询」配置页 -> 结果页 传参用 localStorage key(跨新开页面共享,sessionStorage 不随 window.open 传递)
|
|
78
|
+
};var PAYLOAD_KEY = 'CUSTOM_QUERY_PAYLOAD';
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 在新页面(新标签页)打开组件内部路由
|
|
82
|
+
* 组件所有跳转均为打开新页面,不在当前页面内切换
|
|
83
|
+
* @param {VueRouter} router 宿主 router 实例
|
|
84
|
+
* @param {Object} location 路由定位对象 { name, query }
|
|
85
|
+
*/
|
|
86
|
+
function openRouteInNewTab(router, location) {
|
|
87
|
+
if (!router) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
var href = router.resolve(location).href; // hash 模式下形如 "#/com/model/xxx?query"
|
|
91
|
+
var base = window.location.href.split('#')[0];
|
|
92
|
+
window.open(base + href, '_blank');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 当前接口实现(默认:真实接口对接的方法 + 其余回退 mock,宿主可再覆盖)
|
|
96
|
+
var currentApi = Object.assign({}, __WEBPACK_IMPORTED_MODULE_0__api_mock_api__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__api_real_api__["a" /* default */]);
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 宿主注入真实接口(可只覆盖部分方法,未覆盖的回退 mock/内置真实接口)
|
|
100
|
+
* @param {Object} api
|
|
101
|
+
*/
|
|
102
|
+
function setCustomQueryApi(api) {
|
|
103
|
+
currentApi = Object.assign({}, __WEBPACK_IMPORTED_MODULE_0__api_mock_api__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__api_real_api__["a" /* default */], api || {});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 获取当前接口
|
|
107
|
+
function getCustomQueryApi() {
|
|
108
|
+
return currentApi;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/***/ }),
|
|
112
|
+
/* 131 */
|
|
113
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
114
|
+
|
|
115
|
+
"use strict";
|
|
116
|
+
/**
|
|
117
|
+
* 自定义查询组件 - 内置 mock 接口(默认兜底实现)
|
|
118
|
+
*
|
|
119
|
+
* 说明:这是组件自带的占位实现,便于脱离后端独立运行/演示。
|
|
120
|
+
* 宿主可通过组件的 `api` prop 注入真实接口覆盖同名方法(未注入的自动回退到此 mock)。
|
|
121
|
+
*
|
|
122
|
+
* 接口契约(宿主注入时需保持同样的签名与返回结构):
|
|
123
|
+
* getMainTables(mark) -> Promise<[{name,label}]>
|
|
124
|
+
* getTableFields(tableName) -> Promise<[{name,label,code}]>
|
|
125
|
+
* getOperators() -> Promise<[{value,label}]>
|
|
126
|
+
* getLogicOps() -> Promise<[{value,label}]>
|
|
127
|
+
* executeQuery(payload, pageNo, pageSize) -> Promise<{rows,total,columns}>
|
|
128
|
+
* saveTemplate(payload) -> Promise<{success,id}>
|
|
129
|
+
* getTemplatePage({keyword,pageNo,pageSize}) -> Promise<{rows,total}>
|
|
130
|
+
* deleteTemplate(id) -> Promise<{success}>
|
|
131
|
+
* getTemplateDetail(id) -> Promise<template|null>
|
|
132
|
+
*/
|
|
133
|
+
|
|
134
|
+
function delay(data) {
|
|
135
|
+
var ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
136
|
+
|
|
137
|
+
return new Promise(function (resolve) {
|
|
138
|
+
return setTimeout(function () {
|
|
139
|
+
return resolve(data);
|
|
140
|
+
}, ms);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
var MOCK_MAIN_TABLES = [{ name: 'ryjbxxzb', label: '人员基本信息总表(排第一位)' }, { name: 'jbxx', label: '监室基本信息' }, { name: 'ajxx', label: '案件信息' }, { name: 'ssxx', label: '诉讼信息' }];
|
|
145
|
+
|
|
146
|
+
var MOCK_TABLE_FIELDS = {
|
|
147
|
+
ryjbxxzb: [{ name: 'jsbh', label: '监所编号', code: 'jsbh' }, { name: 'rybh', label: '人员编号', code: 'rybh' }, { name: 'xm', label: '姓名', code: 'xm' }, { name: 'zw', label: '职务', code: 'zw' }, { name: 'xb', label: '性别', code: 'xb', fieldType: 'varchar', dicName: 'XBDM' }, { name: 'jsh', label: '监室号', code: 'jsh' }, { name: 'zjh', label: '证件号', code: 'zjh' }, { name: 'ajlb', label: '案件类别', code: 'ajlb' }, { name: 'rssj', label: '入所时间', code: 'rssj', fieldType: 'timestamp' }, { name: 'jyqx', label: '羁押期限', code: 'jyqx', fieldType: 'date' }, { name: 'sshj', label: '诉讼环节', code: 'sshj' }, { name: 'ryzt', label: '人员状态', code: 'ryzt' }],
|
|
148
|
+
jbxx: [{ name: 'jsbh', label: '监所编号', code: 'jsbh' }, { name: 'jsh', label: '监室号', code: 'jsh' }, { name: 'jsmc', label: '监室名称', code: 'jsmc' }, { name: 'rsrs', label: '容纳人数', code: 'rsrs', fieldType: 'number' }],
|
|
149
|
+
ajxx: [{ name: 'ajbh', label: '案件编号', code: 'ajbh' }, { name: 'ajmc', label: '案件名称', code: 'ajmc' }, { name: 'ajlb', label: '案件类别', code: 'ajlb' }, { name: 'larq', label: '立案日期', code: 'larq', fieldType: 'date' }],
|
|
150
|
+
ssxx: [{ name: 'ssbh', label: '诉讼编号', code: 'ssbh' }, { name: 'sshj', label: '诉讼环节', code: 'sshj' }, { name: 'cbdw', label: '承办单位', code: 'cbdw' }]
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
var MOCK_OPERATORS = [{ value: 'eq', label: '等于' }, { value: 'ne', label: '不等于' }, { value: 'gt', label: '大于' }, { value: 'lt', label: '小于' }, { value: 'ge', label: '大于等于' }, { value: 'le', label: '小于等于' }, { value: 'like', label: '包含' }, { value: 'between', label: '介于' }];
|
|
154
|
+
|
|
155
|
+
var MOCK_LOGIC_OPS = [{ value: 'and', label: '并且' }, { value: 'or', label: '或者' }];
|
|
156
|
+
|
|
157
|
+
var MOCK_TEMPLATES = [{ id: '1', name: '2024年度财务凭证查询', description: '按日期范围和凭证类型筛选年度财...', mainTableName: 'fin_voucher', conditionSummary: ['凭证日期 介于 "2024-01-01 ~ 2024-12-31"', '凭证类型 等于 "记账凭证"', '金额 大于 "10,000"'], createTime: '2025-12-20 14:30' }, { id: '2', name: '在职员工信息快速查询', description: '查询当前在职员工的基本信息及部...', mainTableName: 'hr_employee', conditionSummary: ['员工状态 等于 "在职"', '部门 等于 "技术部"'], createTime: '2025-12-18 09:15' }, { id: '3', name: '项目成本超标预警', description: '筛选预算超支的项目,用于管理层...', mainTableName: 'pm_project', conditionSummary: ['实际成本 大于 "预算金额"', '项目状态 等于 "进行中"'], createTime: '2025-12-15 16:00' }, { id: '4', name: '供应商付款账明细', description: '按应商查询未结清的应付账款', mainTableName: 'ap_invoice', conditionSummary: ['付款状态 等于 "未付"', '发票日期 大于等于 "2025-01-01"', '供应商名称 包含 "科技"'], createTime: '2025-12-10 11:20' }, { id: '5', name: '销售合同到期提醒', description: '查询未来30天内到期的销售合同列表', mainTableName: 'crm_contract', conditionSummary: ['合同到期日 介于 "today ~ today+30d"', '合同状态 等于 "生效中"'], createTime: '2025-12-05 08:45' }, { id: '6', name: '库存预警商品清单', description: '查询库存量低于安全库存的所有商品', mainTableName: 'wms_product', conditionSummary: ['当前库存 小于 "安全库存"', '仓库 等于 "主仓库"'], createTime: '2025-12-01 10:00' }];
|
|
158
|
+
|
|
159
|
+
var mockApi = {
|
|
160
|
+
getMainTables: function getMainTables() {
|
|
161
|
+
return delay(MOCK_MAIN_TABLES.slice());
|
|
162
|
+
},
|
|
163
|
+
getTableFields: function getTableFields(tableName) {
|
|
164
|
+
return delay((MOCK_TABLE_FIELDS[tableName] || []).slice());
|
|
165
|
+
},
|
|
166
|
+
getOperators: function getOperators() {
|
|
167
|
+
return Promise.resolve(MOCK_OPERATORS.slice());
|
|
168
|
+
},
|
|
169
|
+
getLogicOps: function getLogicOps() {
|
|
170
|
+
return Promise.resolve(MOCK_LOGIC_OPS.slice());
|
|
171
|
+
},
|
|
172
|
+
executeQuery: function executeQuery(payload) {
|
|
173
|
+
var pageNo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
174
|
+
var pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
175
|
+
|
|
176
|
+
var showFields = payload && payload.showFields || [];
|
|
177
|
+
var columns = showFields.map(function (f) {
|
|
178
|
+
return { title: f.label, key: f.name };
|
|
179
|
+
});
|
|
180
|
+
var sampleNames = ['张果', '王珊', '李四', '赵力'];
|
|
181
|
+
var gen = {
|
|
182
|
+
xm: function xm() {
|
|
183
|
+
return sampleNames[Math.floor(Math.random() * sampleNames.length)];
|
|
184
|
+
},
|
|
185
|
+
rybh: function rybh() {
|
|
186
|
+
return '11000011320250726090' + Math.floor(Math.random() * 9);
|
|
187
|
+
},
|
|
188
|
+
xb: function xb() {
|
|
189
|
+
return Math.random() > 0.5 ? '男' : '女';
|
|
190
|
+
},
|
|
191
|
+
jsh: function jsh() {
|
|
192
|
+
return '东101';
|
|
193
|
+
},
|
|
194
|
+
zjh: function zjh() {
|
|
195
|
+
return '330783198501134819';
|
|
196
|
+
},
|
|
197
|
+
ajlb: function ajlb() {
|
|
198
|
+
return '贩卖毒品罪';
|
|
199
|
+
},
|
|
200
|
+
rssj: function rssj() {
|
|
201
|
+
return '2025-6-12';
|
|
202
|
+
},
|
|
203
|
+
jyqx: function jyqx() {
|
|
204
|
+
return '2030-6-22';
|
|
205
|
+
},
|
|
206
|
+
sshj: function sshj() {
|
|
207
|
+
return ['刑事拘留', '逮捕', '一审'][Math.floor(Math.random() * 3)];
|
|
208
|
+
},
|
|
209
|
+
ryzt: function ryzt() {
|
|
210
|
+
return Math.random() > 0.5 ? '在所' : '历史';
|
|
211
|
+
},
|
|
212
|
+
jsbh: function jsbh() {
|
|
213
|
+
return 'JS' + Math.floor(Math.random() * 1000);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
var total = 96;
|
|
217
|
+
var rows = [];
|
|
218
|
+
var start = (pageNo - 1) * pageSize;
|
|
219
|
+
|
|
220
|
+
var _loop = function _loop(i) {
|
|
221
|
+
var row = {};
|
|
222
|
+
columns.forEach(function (col) {
|
|
223
|
+
row[col.key] = gen[col.key] ? gen[col.key]() : '--';
|
|
224
|
+
});
|
|
225
|
+
rows.push(row);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
for (var i = 0; i < pageSize && start + i < total; i++) {
|
|
229
|
+
_loop(i);
|
|
230
|
+
}
|
|
231
|
+
return delay({ rows: rows, total: total, columns: columns });
|
|
232
|
+
},
|
|
233
|
+
saveTemplate: function saveTemplate(payload) {
|
|
234
|
+
var id = String(MOCK_TEMPLATES.length + 1);
|
|
235
|
+
MOCK_TEMPLATES.unshift({
|
|
236
|
+
id: id,
|
|
237
|
+
name: payload.name,
|
|
238
|
+
description: payload.description || '',
|
|
239
|
+
mainTableName: payload.mainTableName || '',
|
|
240
|
+
conditionSummary: payload.conditionSummary || [],
|
|
241
|
+
createTime: payload.createTime || ''
|
|
242
|
+
});
|
|
243
|
+
return delay({ success: true, id: id });
|
|
244
|
+
},
|
|
245
|
+
getTemplatePage: function getTemplatePage() {
|
|
246
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
247
|
+
|
|
248
|
+
var keyword = (params.keyword || '').trim();
|
|
249
|
+
var list = MOCK_TEMPLATES.slice();
|
|
250
|
+
if (keyword) {
|
|
251
|
+
list = list.filter(function (t) {
|
|
252
|
+
return t.name && t.name.indexOf(keyword) > -1 || t.mainTableName && t.mainTableName.indexOf(keyword) > -1 || t.description && t.description.indexOf(keyword) > -1;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
var pageNo = params.pageNo || 1;
|
|
256
|
+
var pageSize = params.pageSize || 5;
|
|
257
|
+
return delay({ rows: list.slice((pageNo - 1) * pageSize, pageNo * pageSize), total: list.length });
|
|
258
|
+
},
|
|
259
|
+
deleteTemplate: function deleteTemplate(id) {
|
|
260
|
+
MOCK_TEMPLATES = MOCK_TEMPLATES.filter(function (t) {
|
|
261
|
+
return t.id !== id;
|
|
262
|
+
});
|
|
263
|
+
return delay({ success: true });
|
|
264
|
+
},
|
|
265
|
+
getTemplateDetail: function getTemplateDetail(id) {
|
|
266
|
+
var record = MOCK_TEMPLATES.find(function (t) {
|
|
267
|
+
return t.id === id;
|
|
268
|
+
});
|
|
269
|
+
return delay(record ? Object.assign({}, record) : null);
|
|
270
|
+
},
|
|
271
|
+
getQueryScript: function getQueryScript() {
|
|
272
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
273
|
+
|
|
274
|
+
var queryJson = typeof params.queryJson === 'string' ? params.queryJson : JSON.stringify(params.queryJson || {}, null, 2);
|
|
275
|
+
return delay({
|
|
276
|
+
success: true,
|
|
277
|
+
sql: 'SELECT *\nFROM demo_table\nWHERE 1 = 1\n AND status = 1',
|
|
278
|
+
debugSql: '-- queryJson:\n-- ' + queryJson.replace(/\n/g, '\n-- ') + '\nSELECT *\nFROM demo_table\nWHERE 1 = 1\n AND status = 1'
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
/* harmony default export */ __webpack_exports__["a"] = (mockApi);
|
|
284
|
+
|
|
285
|
+
/***/ }),
|
|
286
|
+
/* 132 */
|
|
287
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
288
|
+
|
|
289
|
+
"use strict";
|
|
290
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__views_query_config_vue__ = __webpack_require__(148);
|
|
291
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__runtime__ = __webpack_require__(130);
|
|
292
|
+
//
|
|
293
|
+
//
|
|
294
|
+
//
|
|
295
|
+
//
|
|
296
|
+
//
|
|
297
|
+
//
|
|
298
|
+
//
|
|
299
|
+
//
|
|
300
|
+
//
|
|
301
|
+
//
|
|
302
|
+
//
|
|
303
|
+
//
|
|
304
|
+
//
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
310
|
+
name: 'custom-query-config-page',
|
|
311
|
+
components: { queryConfig: __WEBPACK_IMPORTED_MODULE_0__views_query_config_vue__["a" /* default */] },
|
|
312
|
+
data: function data() {
|
|
313
|
+
return {
|
|
314
|
+
mark: '',
|
|
315
|
+
templateId: '',
|
|
316
|
+
templateName: '',
|
|
317
|
+
api: Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["d" /* getCustomQueryApi */])()
|
|
318
|
+
};
|
|
319
|
+
},
|
|
320
|
+
created: function created() {
|
|
321
|
+
this.mark = this.$route.query.mark || '';
|
|
322
|
+
this.templateId = this.$route.query.templateId || '';
|
|
323
|
+
this.templateName = this.$route.query.templateName || '';
|
|
324
|
+
},
|
|
325
|
+
|
|
326
|
+
methods: {
|
|
327
|
+
onExecute: function onExecute(payload) {
|
|
328
|
+
// 用 localStorage 传参,保证在新开页面可读取
|
|
329
|
+
localStorage.setItem(__WEBPACK_IMPORTED_MODULE_1__runtime__["a" /* PAYLOAD_KEY */], JSON.stringify(payload));
|
|
330
|
+
Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["e" /* openRouteInNewTab */])(this.$router, { name: __WEBPACK_IMPORTED_MODULE_1__runtime__["b" /* ROUTE_NAMES */].result, query: { mark: this.mark } });
|
|
331
|
+
},
|
|
332
|
+
goHistory: function goHistory() {
|
|
333
|
+
Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["e" /* openRouteInNewTab */])(this.$router, { name: __WEBPACK_IMPORTED_MODULE_1__runtime__["b" /* ROUTE_NAMES */].history, query: { mark: this.mark } });
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
/***/ }),
|
|
339
|
+
/* 133 */
|
|
340
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
341
|
+
|
|
342
|
+
"use strict";
|
|
343
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_save_template_modal_vue__ = __webpack_require__(151);
|
|
344
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_script_modal_vue__ = __webpack_require__(135);
|
|
345
|
+
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
|
346
|
+
|
|
347
|
+
//
|
|
348
|
+
//
|
|
349
|
+
//
|
|
350
|
+
//
|
|
351
|
+
//
|
|
352
|
+
//
|
|
353
|
+
//
|
|
354
|
+
//
|
|
355
|
+
//
|
|
356
|
+
//
|
|
357
|
+
//
|
|
358
|
+
//
|
|
359
|
+
//
|
|
360
|
+
//
|
|
361
|
+
//
|
|
362
|
+
//
|
|
363
|
+
//
|
|
364
|
+
//
|
|
365
|
+
//
|
|
366
|
+
//
|
|
367
|
+
//
|
|
368
|
+
//
|
|
369
|
+
//
|
|
370
|
+
//
|
|
371
|
+
//
|
|
372
|
+
//
|
|
373
|
+
//
|
|
374
|
+
//
|
|
375
|
+
//
|
|
376
|
+
//
|
|
377
|
+
//
|
|
378
|
+
//
|
|
379
|
+
//
|
|
380
|
+
//
|
|
381
|
+
//
|
|
382
|
+
//
|
|
383
|
+
//
|
|
384
|
+
//
|
|
385
|
+
//
|
|
386
|
+
//
|
|
387
|
+
//
|
|
388
|
+
//
|
|
389
|
+
//
|
|
390
|
+
//
|
|
391
|
+
//
|
|
392
|
+
//
|
|
393
|
+
//
|
|
394
|
+
//
|
|
395
|
+
//
|
|
396
|
+
//
|
|
397
|
+
//
|
|
398
|
+
//
|
|
399
|
+
//
|
|
400
|
+
//
|
|
401
|
+
//
|
|
402
|
+
//
|
|
403
|
+
//
|
|
404
|
+
//
|
|
405
|
+
//
|
|
406
|
+
//
|
|
407
|
+
//
|
|
408
|
+
//
|
|
409
|
+
//
|
|
410
|
+
//
|
|
411
|
+
//
|
|
412
|
+
//
|
|
413
|
+
//
|
|
414
|
+
//
|
|
415
|
+
//
|
|
416
|
+
//
|
|
417
|
+
//
|
|
418
|
+
//
|
|
419
|
+
//
|
|
420
|
+
//
|
|
421
|
+
//
|
|
422
|
+
//
|
|
423
|
+
//
|
|
424
|
+
//
|
|
425
|
+
//
|
|
426
|
+
//
|
|
427
|
+
//
|
|
428
|
+
//
|
|
429
|
+
//
|
|
430
|
+
//
|
|
431
|
+
//
|
|
432
|
+
//
|
|
433
|
+
//
|
|
434
|
+
//
|
|
435
|
+
//
|
|
436
|
+
//
|
|
437
|
+
//
|
|
438
|
+
//
|
|
439
|
+
//
|
|
440
|
+
//
|
|
441
|
+
//
|
|
442
|
+
//
|
|
443
|
+
//
|
|
444
|
+
//
|
|
445
|
+
//
|
|
446
|
+
//
|
|
447
|
+
//
|
|
448
|
+
//
|
|
449
|
+
//
|
|
450
|
+
//
|
|
451
|
+
//
|
|
452
|
+
//
|
|
453
|
+
//
|
|
454
|
+
//
|
|
455
|
+
//
|
|
456
|
+
//
|
|
457
|
+
//
|
|
458
|
+
//
|
|
459
|
+
//
|
|
460
|
+
//
|
|
461
|
+
//
|
|
462
|
+
//
|
|
463
|
+
//
|
|
464
|
+
//
|
|
465
|
+
//
|
|
466
|
+
//
|
|
467
|
+
//
|
|
468
|
+
//
|
|
469
|
+
//
|
|
470
|
+
//
|
|
471
|
+
//
|
|
472
|
+
//
|
|
473
|
+
//
|
|
474
|
+
//
|
|
475
|
+
//
|
|
476
|
+
//
|
|
477
|
+
//
|
|
478
|
+
//
|
|
479
|
+
//
|
|
480
|
+
//
|
|
481
|
+
//
|
|
482
|
+
//
|
|
483
|
+
//
|
|
484
|
+
//
|
|
485
|
+
//
|
|
486
|
+
//
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
492
|
+
name: 'query-config',
|
|
493
|
+
components: {
|
|
494
|
+
saveTemplateModal: __WEBPACK_IMPORTED_MODULE_0__components_save_template_modal_vue__["a" /* default */],
|
|
495
|
+
scriptModal: __WEBPACK_IMPORTED_MODULE_1__components_script_modal_vue__["a" /* default */]
|
|
496
|
+
},
|
|
497
|
+
props: {
|
|
498
|
+
api: {
|
|
499
|
+
type: Object,
|
|
500
|
+
required: true
|
|
501
|
+
},
|
|
502
|
+
mark: {
|
|
503
|
+
type: String,
|
|
504
|
+
default: ''
|
|
505
|
+
},
|
|
506
|
+
// 编辑回填模版 id
|
|
507
|
+
templateId: {
|
|
508
|
+
type: String,
|
|
509
|
+
default: ''
|
|
510
|
+
},
|
|
511
|
+
// 编辑回填模版名称(来自历史模版)
|
|
512
|
+
editTemplateName: {
|
|
513
|
+
type: String,
|
|
514
|
+
default: ''
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
data: function data() {
|
|
518
|
+
return {
|
|
519
|
+
templateName: '',
|
|
520
|
+
remark: '',
|
|
521
|
+
mainTables: [],
|
|
522
|
+
logicOps: [],
|
|
523
|
+
// 运算关系:字符串类型(varchar/text)用 strOpList,其余用 opNameList(对齐 model-query-form.vue)
|
|
524
|
+
opNameList: [{ value: '!=', label: '!=' }, { value: '<=', label: '<=' }, { value: '<', label: '<' }, { value: '>=', label: '>=' }, { value: '>', label: '>' }, { value: '=', label: '=' }, { value: 'between', label: 'between' }],
|
|
525
|
+
strOpList: [{ value: '=', label: '精确匹配' }, { value: 'like', label: '模糊匹配' }, { value: 'in', label: 'IN查询' }, { value: 'between', label: 'between' }, { value: 'join', label: 'sql脚本' }],
|
|
526
|
+
fieldsMap: {}, // { tableName: [fields] }
|
|
527
|
+
conditions: [],
|
|
528
|
+
checkedFields: [],
|
|
529
|
+
checkAll: false, // 表头字段全选状态(默认不勾选)
|
|
530
|
+
checkAllIndeterminate: false, // 表头字段半选状态
|
|
531
|
+
saveModalShow: false,
|
|
532
|
+
savePayload: {},
|
|
533
|
+
scriptModalShow: false, // 查看脚本弹窗
|
|
534
|
+
scriptQueryJson: null, // 传给脚本弹窗的查询配置
|
|
535
|
+
// 运算符 -> 中文说明(用于拼接查询条件的中文内容 queryCondition,对齐后端 operators 标签)
|
|
536
|
+
opCnMap: {
|
|
537
|
+
'=': '等于',
|
|
538
|
+
'!=': '不等于',
|
|
539
|
+
'>': '大于',
|
|
540
|
+
'>=': '大于等于',
|
|
541
|
+
'<': '小于',
|
|
542
|
+
'<=': '小于等于',
|
|
543
|
+
like: '包含',
|
|
544
|
+
leftLike: '左匹配',
|
|
545
|
+
rightLike: '右匹配',
|
|
546
|
+
in: '包含于',
|
|
547
|
+
notIn: '不包含于',
|
|
548
|
+
between: '介于',
|
|
549
|
+
isNull: '为空',
|
|
550
|
+
isNotNull: '不为空',
|
|
551
|
+
join: 'SQL脚本'
|
|
552
|
+
},
|
|
553
|
+
appId: '1934985431515009024' || serverConfig.APP_ID
|
|
554
|
+
};
|
|
555
|
+
},
|
|
556
|
+
|
|
557
|
+
computed: {
|
|
558
|
+
// 当前查询主表(单表查询:以第一行为准)
|
|
559
|
+
mainTableName: function mainTableName() {
|
|
560
|
+
return this.conditions.length && this.conditions[0].tableName ? this.conditions[0].tableName : '';
|
|
561
|
+
},
|
|
562
|
+
|
|
563
|
+
// 表头字段:取当前条件中第一个已选主表的字段
|
|
564
|
+
headerFields: function headerFields() {
|
|
565
|
+
var tableName = '';
|
|
566
|
+
for (var i = 0; i < this.conditions.length; i++) {
|
|
567
|
+
if (this.conditions[i].tableName) {
|
|
568
|
+
tableName = this.conditions[i].tableName;
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return tableName ? this.fieldsMap[tableName] || [] : [];
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
watch: {
|
|
576
|
+
// 已勾选字段变化时,同步全选/半选状态
|
|
577
|
+
checkedFields: function checkedFields() {
|
|
578
|
+
this.updateCheckAllState();
|
|
579
|
+
},
|
|
580
|
+
|
|
581
|
+
// 主表变化导致表头字段变化时,剔除不在当前字段范围内的已勾选项并同步状态
|
|
582
|
+
headerFields: function headerFields(fields) {
|
|
583
|
+
var names = fields.map(function (f) {
|
|
584
|
+
return f.name;
|
|
585
|
+
});
|
|
586
|
+
var pruned = this.checkedFields.filter(function (n) {
|
|
587
|
+
return names.indexOf(n) > -1;
|
|
588
|
+
});
|
|
589
|
+
if (pruned.length !== this.checkedFields.length) {
|
|
590
|
+
this.checkedFields = pruned;
|
|
591
|
+
}
|
|
592
|
+
this.updateCheckAllState();
|
|
593
|
+
}
|
|
594
|
+
},
|
|
595
|
+
created: function created() {
|
|
596
|
+
// 查询模板名称默认取当前日期
|
|
597
|
+
this.templateName = this.formatToday();
|
|
598
|
+
this.initData();
|
|
599
|
+
},
|
|
600
|
+
|
|
601
|
+
methods: {
|
|
602
|
+
// 生成当前日期时间字符串(yyyy-MM-dd HH:mm:ss)
|
|
603
|
+
formatToday: function formatToday() {
|
|
604
|
+
var d = new Date();
|
|
605
|
+
var m = String(d.getMonth() + 1).padStart(2, '0');
|
|
606
|
+
var day = String(d.getDate()).padStart(2, '0');
|
|
607
|
+
var hh = String(d.getHours()).padStart(2, '0');
|
|
608
|
+
var mi = String(d.getMinutes()).padStart(2, '0');
|
|
609
|
+
var ss = String(d.getSeconds()).padStart(2, '0');
|
|
610
|
+
return d.getFullYear() + m + day + hh + mi + ss;
|
|
611
|
+
},
|
|
612
|
+
initData: function initData() {
|
|
613
|
+
var _this = this;
|
|
614
|
+
|
|
615
|
+
Promise.all([this.api.getMainTables(this.appId), this.api.getLogicOps()]).then(function (_ref) {
|
|
616
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
617
|
+
tables = _ref2[0],
|
|
618
|
+
logics = _ref2[1];
|
|
619
|
+
|
|
620
|
+
_this.mainTables = tables;
|
|
621
|
+
_this.logicOps = logics;
|
|
622
|
+
if (_this.templateId) {
|
|
623
|
+
_this.loadTemplate();
|
|
624
|
+
} else {
|
|
625
|
+
_this.addCondition();
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
},
|
|
629
|
+
loadTemplate: function loadTemplate() {
|
|
630
|
+
var _this2 = this;
|
|
631
|
+
|
|
632
|
+
// 编辑时,保存模板名默认回填为当前模板名
|
|
633
|
+
if (this.editTemplateName) {
|
|
634
|
+
this.templateName = this.editTemplateName;
|
|
635
|
+
}
|
|
636
|
+
this.api.getTemplateDetail(this.templateId, this.editTemplateName).then(function (detail) {
|
|
637
|
+
if (!detail) {
|
|
638
|
+
_this2.addCondition();
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
console.log('loadTemplate detail:', detail);
|
|
642
|
+
// 模板名优先取详情返回值
|
|
643
|
+
if (detail.name) {
|
|
644
|
+
_this2.templateName = detail.name;
|
|
645
|
+
}
|
|
646
|
+
if (detail.remark) {
|
|
647
|
+
_this2.remark = detail.remark;
|
|
648
|
+
}
|
|
649
|
+
var mainTableName = detail.mainTableName;
|
|
650
|
+
if (!mainTableName) {
|
|
651
|
+
_this2.addCondition();
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
// 主表字段:优先用详情已带回的字段,避免再次请求;否则回退按主表名拉取
|
|
655
|
+
var fieldsReady = void 0;
|
|
656
|
+
if (detail.fields && detail.fields.length) {
|
|
657
|
+
_this2.$set(_this2.fieldsMap, mainTableName, detail.fields);
|
|
658
|
+
fieldsReady = Promise.resolve();
|
|
659
|
+
} else {
|
|
660
|
+
fieldsReady = _this2.loadFields(mainTableName);
|
|
661
|
+
}
|
|
662
|
+
fieldsReady.then(function () {
|
|
663
|
+
// 回填查询条件行(字段/运算符/字段值/且或关系)
|
|
664
|
+
var rows = (detail.conditions || []).map(function (c) {
|
|
665
|
+
return {
|
|
666
|
+
tableName: mainTableName,
|
|
667
|
+
fieldName: c.fieldName || '',
|
|
668
|
+
op: c.op || '',
|
|
669
|
+
value: c.value !== undefined ? c.value : '',
|
|
670
|
+
logic: String(c.relation || c.logic || 'and').toLowerCase()
|
|
671
|
+
};
|
|
672
|
+
});
|
|
673
|
+
_this2.conditions = rows.length ? rows : [{ tableName: mainTableName, fieldName: '', op: '', value: '', logic: 'and' }];
|
|
674
|
+
// 回填已勾选的表头字段
|
|
675
|
+
_this2.checkedFields = (detail.showFields || []).slice();
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
},
|
|
679
|
+
loadFields: function loadFields(tableName) {
|
|
680
|
+
var _this3 = this;
|
|
681
|
+
|
|
682
|
+
if (this.fieldsMap[tableName]) {
|
|
683
|
+
return Promise.resolve(this.fieldsMap[tableName]);
|
|
684
|
+
}
|
|
685
|
+
return this.api.getTableFields(tableName).then(function (fields) {
|
|
686
|
+
_this3.$set(_this3.fieldsMap, tableName, fields);
|
|
687
|
+
return fields;
|
|
688
|
+
});
|
|
689
|
+
},
|
|
690
|
+
|
|
691
|
+
// 某行主表下拉可选项:未选主表或首行时可选全部;已选主表后其余行仅显示该主表(单表限制,多表后续扩展)
|
|
692
|
+
tableOptionsFor: function tableOptionsFor(index) {
|
|
693
|
+
var main = this.mainTableName;
|
|
694
|
+
if (!main || index === 0) {
|
|
695
|
+
return this.mainTables;
|
|
696
|
+
}
|
|
697
|
+
var t = this.mainTables.find(function (x) {
|
|
698
|
+
return x.name === main;
|
|
699
|
+
});
|
|
700
|
+
return t ? [t] : this.mainTables;
|
|
701
|
+
},
|
|
702
|
+
onTableChange: function onTableChange(row) {
|
|
703
|
+
// 单表查询:主表变化时同步所有行到同一主表,并清空各行字段/值/运算符
|
|
704
|
+
this.conditions.forEach(function (r) {
|
|
705
|
+
r.tableName = row.tableName;
|
|
706
|
+
r.fieldName = '';
|
|
707
|
+
r.value = '';
|
|
708
|
+
r.op = '';
|
|
709
|
+
});
|
|
710
|
+
if (row.tableName) {
|
|
711
|
+
this.loadFields(row.tableName);
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
|
|
715
|
+
// 切换字段后清空已填字段值和运算符(类型变化后可选运算符不同)
|
|
716
|
+
onFieldChange: function onFieldChange(row) {
|
|
717
|
+
row.value = '';
|
|
718
|
+
row.op = '';
|
|
719
|
+
},
|
|
720
|
+
|
|
721
|
+
// 根据所选字段的 fieldType 返回可选运算关系:varchar/text 用 strOpList,其余用 opNameList
|
|
722
|
+
operatorsForRow: function operatorsForRow(row) {
|
|
723
|
+
var field = this.findField(row);
|
|
724
|
+
var type = field && field.fieldType ? String(field.fieldType).toLowerCase() : '';
|
|
725
|
+
if (type === 'varchar' || type === 'text') {
|
|
726
|
+
return this.strOpList;
|
|
727
|
+
}
|
|
728
|
+
return this.opNameList;
|
|
729
|
+
},
|
|
730
|
+
|
|
731
|
+
// 根据所选字段的 fieldType 推断字段值应使用的控件类型
|
|
732
|
+
valueControlType: function valueControlType(row) {
|
|
733
|
+
var field = this.findField(row);
|
|
734
|
+
if (!field) {
|
|
735
|
+
return 'text';
|
|
736
|
+
}
|
|
737
|
+
var type = field.fieldType ? String(field.fieldType).toLowerCase() : '';
|
|
738
|
+
if (type === 'timestamp' || type === 'datetime') {
|
|
739
|
+
return 'datetime';
|
|
740
|
+
}
|
|
741
|
+
if (type === 'date') {
|
|
742
|
+
return 'date';
|
|
743
|
+
}
|
|
744
|
+
if (type === 'time') {
|
|
745
|
+
return 'time';
|
|
746
|
+
}
|
|
747
|
+
if (['number', 'int', 'integer', 'bigint', 'decimal', 'double', 'float', 'numeric', 'long'].indexOf(type) > -1) {
|
|
748
|
+
return 'number';
|
|
749
|
+
}
|
|
750
|
+
// 文本类型(varchar 等)且配置了字典时,使用字典组件
|
|
751
|
+
if (field.dicName) {
|
|
752
|
+
return 'dic';
|
|
753
|
+
}
|
|
754
|
+
return 'text';
|
|
755
|
+
},
|
|
756
|
+
|
|
757
|
+
// 取某行所选字段对象
|
|
758
|
+
findField: function findField(row) {
|
|
759
|
+
if (!row.tableName || !row.fieldName) {
|
|
760
|
+
return null;
|
|
761
|
+
}
|
|
762
|
+
var fields = this.fieldsMap[row.tableName] || [];
|
|
763
|
+
return fields.find(function (f) {
|
|
764
|
+
return f.name === row.fieldName;
|
|
765
|
+
}) || null;
|
|
766
|
+
},
|
|
767
|
+
|
|
768
|
+
// 取某行所选字段的字典标识
|
|
769
|
+
fieldDicName: function fieldDicName(row) {
|
|
770
|
+
var field = this.findField(row);
|
|
771
|
+
return field ? field.dicName || '' : '';
|
|
772
|
+
},
|
|
773
|
+
addCondition: function addCondition() {
|
|
774
|
+
// 单表查询:新增行默认沿用已选主表
|
|
775
|
+
var main = this.mainTableName;
|
|
776
|
+
this.conditions.push({ tableName: main || '', fieldName: '', op: '', value: '', logic: 'and' });
|
|
777
|
+
if (main) {
|
|
778
|
+
this.loadFields(main);
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
removeCondition: function removeCondition(index) {
|
|
782
|
+
this.conditions.splice(index, 1);
|
|
783
|
+
},
|
|
784
|
+
|
|
785
|
+
// 表头字段全选/取消全选
|
|
786
|
+
onCheckAllChange: function onCheckAllChange(checked) {
|
|
787
|
+
this.checkedFields = checked ? this.headerFields.map(function (f) {
|
|
788
|
+
return f.name;
|
|
789
|
+
}) : [];
|
|
790
|
+
},
|
|
791
|
+
|
|
792
|
+
// 根据已勾选数量刷新全选框的选中/半选状态
|
|
793
|
+
updateCheckAllState: function updateCheckAllState() {
|
|
794
|
+
var _this4 = this;
|
|
795
|
+
|
|
796
|
+
var total = this.headerFields.length;
|
|
797
|
+
var names = this.headerFields.map(function (f) {
|
|
798
|
+
return f.name;
|
|
799
|
+
});
|
|
800
|
+
var checked = names.filter(function (n) {
|
|
801
|
+
return _this4.checkedFields.indexOf(n) > -1;
|
|
802
|
+
}).length;
|
|
803
|
+
this.checkAll = total > 0 && checked === total;
|
|
804
|
+
this.checkAllIndeterminate = checked > 0 && checked < total;
|
|
805
|
+
},
|
|
806
|
+
validate: function validate() {
|
|
807
|
+
var validRows = this.conditions.filter(function (r) {
|
|
808
|
+
return r.tableName && r.fieldName && r.op;
|
|
809
|
+
});
|
|
810
|
+
if (validRows.length < 1) {
|
|
811
|
+
this.$Message.error('至少要有1行完整的【查询条件配置】');
|
|
812
|
+
return false;
|
|
813
|
+
}
|
|
814
|
+
if (this.checkedFields.length < 3) {
|
|
815
|
+
this.$Message.error('需配置表头字段至少3个');
|
|
816
|
+
return false;
|
|
817
|
+
}
|
|
818
|
+
return true;
|
|
819
|
+
},
|
|
820
|
+
|
|
821
|
+
// 取主表对应的 tableId(resId)
|
|
822
|
+
tableIdOf: function tableIdOf(tableName) {
|
|
823
|
+
var t = this.mainTables.find(function (x) {
|
|
824
|
+
return x.name === tableName;
|
|
825
|
+
});
|
|
826
|
+
return t ? t.resId || t.name : tableName;
|
|
827
|
+
},
|
|
828
|
+
|
|
829
|
+
// 构建后端所需的 queryJson 结构
|
|
830
|
+
buildQueryJson: function buildQueryJson() {
|
|
831
|
+
var firstTableRow = this.conditions.find(function (r) {
|
|
832
|
+
return r.tableName;
|
|
833
|
+
});
|
|
834
|
+
var conditions = this.conditions.filter(function (r) {
|
|
835
|
+
return r.tableName && r.fieldName;
|
|
836
|
+
}).map(function (r) {
|
|
837
|
+
return {
|
|
838
|
+
fieldName: r.fieldName,
|
|
839
|
+
op: r.op,
|
|
840
|
+
value: r.value,
|
|
841
|
+
relation: (r.logic || 'and').toUpperCase()
|
|
842
|
+
};
|
|
843
|
+
});
|
|
844
|
+
return {
|
|
845
|
+
tableId: firstTableRow ? this.tableIdOf(firstTableRow.tableName) : '',
|
|
846
|
+
showFields: this.checkedFields.slice(),
|
|
847
|
+
conditions: conditions,
|
|
848
|
+
sortName: '',
|
|
849
|
+
sortType: ''
|
|
850
|
+
};
|
|
851
|
+
},
|
|
852
|
+
buildPayload: function buildPayload() {
|
|
853
|
+
var _this5 = this;
|
|
854
|
+
|
|
855
|
+
var fields = this.headerFields;
|
|
856
|
+
var showFields = this.checkedFields.map(function (name) {
|
|
857
|
+
var f = fields.find(function (x) {
|
|
858
|
+
return x.name === name;
|
|
859
|
+
});
|
|
860
|
+
return { name: name, label: f ? f.label : name };
|
|
861
|
+
});
|
|
862
|
+
var opLabel = function opLabel(r) {
|
|
863
|
+
var o = _this5.operatorsForRow(r).find(function (x) {
|
|
864
|
+
return x.value === r.op;
|
|
865
|
+
});
|
|
866
|
+
return o ? o.label : r.op;
|
|
867
|
+
};
|
|
868
|
+
var conditionSummary = this.conditions.filter(function (r) {
|
|
869
|
+
return r.tableName && r.fieldName;
|
|
870
|
+
}).map(function (r) {
|
|
871
|
+
var f = (_this5.fieldsMap[r.tableName] || []).find(function (x) {
|
|
872
|
+
return x.name === r.fieldName;
|
|
873
|
+
});
|
|
874
|
+
return (f ? f.label : r.fieldName) + ' ' + opLabel(r) + ' "' + (r.value || '') + '"';
|
|
875
|
+
});
|
|
876
|
+
var firstTableRow = this.conditions.find(function (r) {
|
|
877
|
+
return r.tableName;
|
|
878
|
+
});
|
|
879
|
+
return {
|
|
880
|
+
appId: this.appId,
|
|
881
|
+
mark: this.mark,
|
|
882
|
+
mainTableName: firstTableRow ? firstTableRow.tableName : '',
|
|
883
|
+
conditions: this.conditions.filter(function (r) {
|
|
884
|
+
return r.tableName && r.fieldName;
|
|
885
|
+
}),
|
|
886
|
+
showFields: showFields,
|
|
887
|
+
conditionSummary: conditionSummary,
|
|
888
|
+
// 查询条件拼接的中文内容(保存模板时随参数上送)
|
|
889
|
+
queryCondition: this.buildQueryCondition(),
|
|
890
|
+
queryJson: this.buildQueryJson()
|
|
891
|
+
};
|
|
892
|
+
},
|
|
893
|
+
|
|
894
|
+
// 字段值转展示文本:数组按「起 ~ 止」拼接(如 between),其余原样
|
|
895
|
+
conditionValueText: function conditionValueText(row) {
|
|
896
|
+
var v = row.value;
|
|
897
|
+
if (Array.isArray(v)) {
|
|
898
|
+
return v.join(' ~ ');
|
|
899
|
+
}
|
|
900
|
+
return v === undefined || v === null ? '' : String(v);
|
|
901
|
+
},
|
|
902
|
+
|
|
903
|
+
// 运算符中文说明
|
|
904
|
+
opCnLabel: function opCnLabel(op) {
|
|
905
|
+
return this.opCnMap[op] || op;
|
|
906
|
+
},
|
|
907
|
+
|
|
908
|
+
// 且/或关系中文说明:优先取后端 logicOps 标签,兜底「且/或」
|
|
909
|
+
logicCnLabel: function logicCnLabel(logic) {
|
|
910
|
+
var l = (this.logicOps || []).find(function (x) {
|
|
911
|
+
return x.value === logic;
|
|
912
|
+
});
|
|
913
|
+
if (l && l.label) {
|
|
914
|
+
return l.label;
|
|
915
|
+
}
|
|
916
|
+
return logic === 'or' || logic === 'OR' ? '或' : '且';
|
|
917
|
+
},
|
|
918
|
+
|
|
919
|
+
// 拼接查询条件的中文内容,不同条件换行展示,形如:
|
|
920
|
+
// 凭证日期 介于 "2024-01-01 ~ 2024-12-31"
|
|
921
|
+
// 且 金额 大于 "10,000"
|
|
922
|
+
buildQueryCondition: function buildQueryCondition() {
|
|
923
|
+
var _this6 = this;
|
|
924
|
+
|
|
925
|
+
var rows = this.conditions.filter(function (r) {
|
|
926
|
+
return r.tableName && r.fieldName && r.op;
|
|
927
|
+
});
|
|
928
|
+
var lines = [];
|
|
929
|
+
rows.forEach(function (r, i) {
|
|
930
|
+
var f = (_this6.fieldsMap[r.tableName] || []).find(function (x) {
|
|
931
|
+
return x.name === r.fieldName;
|
|
932
|
+
});
|
|
933
|
+
var label = f ? f.label : r.fieldName;
|
|
934
|
+
var opCn = _this6.opCnLabel(r.op);
|
|
935
|
+
// 为空/不为空无字段值
|
|
936
|
+
var noValue = r.op === 'isNull' || r.op === 'isNotNull';
|
|
937
|
+
var text = noValue ? label + ' ' + opCn : label + ' ' + opCn + ' "' + _this6.conditionValueText(r) + '"';
|
|
938
|
+
// 从第二个条件起,用当前条件自身的且/或关系作为与上一条件的连接词(与上送后端的 relation 保持一致)
|
|
939
|
+
if (i > 0) {
|
|
940
|
+
text = _this6.logicCnLabel(r.logic) + ' ' + text;
|
|
941
|
+
}
|
|
942
|
+
lines.push(text);
|
|
943
|
+
});
|
|
944
|
+
return lines.join('\n');
|
|
945
|
+
},
|
|
946
|
+
execute: function execute() {
|
|
947
|
+
if (!this.validate()) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
// 执行查询:不落库,直接携带 queryJson 跳转结果页拉取数据
|
|
951
|
+
this.$emit('execute', this.buildPayload());
|
|
952
|
+
},
|
|
953
|
+
|
|
954
|
+
// 查看脚本:用当前配置构建 queryJson 打开脚本弹窗
|
|
955
|
+
lookScript: function lookScript() {
|
|
956
|
+
if (!this.validate()) {
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
this.scriptQueryJson = this.buildQueryJson();
|
|
960
|
+
this.scriptModalShow = true;
|
|
961
|
+
},
|
|
962
|
+
openSaveModal: function openSaveModal() {
|
|
963
|
+
if (!this.validate()) {
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
this.savePayload = Object.assign(this.buildPayload(), {
|
|
967
|
+
appId: this.appId,
|
|
968
|
+
id: this.templateId || '',
|
|
969
|
+
remark: this.remark || '',
|
|
970
|
+
templateName: this.templateName,
|
|
971
|
+
queryJson: this.buildQueryJson()
|
|
972
|
+
});
|
|
973
|
+
this.saveModalShow = true;
|
|
974
|
+
},
|
|
975
|
+
onTemplateSaved: function onTemplateSaved() {
|
|
976
|
+
// 保存成功后停留在当前页
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
/***/ }),
|
|
982
|
+
/* 134 */
|
|
983
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
984
|
+
|
|
985
|
+
"use strict";
|
|
986
|
+
//
|
|
987
|
+
//
|
|
988
|
+
//
|
|
989
|
+
//
|
|
990
|
+
//
|
|
991
|
+
//
|
|
992
|
+
//
|
|
993
|
+
//
|
|
994
|
+
//
|
|
995
|
+
//
|
|
996
|
+
//
|
|
997
|
+
//
|
|
998
|
+
//
|
|
999
|
+
//
|
|
1000
|
+
//
|
|
1001
|
+
//
|
|
1002
|
+
//
|
|
1003
|
+
//
|
|
1004
|
+
//
|
|
1005
|
+
//
|
|
1006
|
+
//
|
|
1007
|
+
//
|
|
1008
|
+
//
|
|
1009
|
+
|
|
1010
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1011
|
+
name: 'save-template-modal',
|
|
1012
|
+
props: {
|
|
1013
|
+
value: {
|
|
1014
|
+
type: Boolean,
|
|
1015
|
+
default: false
|
|
1016
|
+
},
|
|
1017
|
+
api: {
|
|
1018
|
+
type: Object,
|
|
1019
|
+
required: true
|
|
1020
|
+
},
|
|
1021
|
+
// 待保存的查询配置
|
|
1022
|
+
payload: {
|
|
1023
|
+
type: Object,
|
|
1024
|
+
default: function _default() {
|
|
1025
|
+
return {};
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
data: function data() {
|
|
1030
|
+
return {
|
|
1031
|
+
visible: this.value,
|
|
1032
|
+
saving: false,
|
|
1033
|
+
form: {
|
|
1034
|
+
name: '',
|
|
1035
|
+
remark: ''
|
|
1036
|
+
},
|
|
1037
|
+
rules: {
|
|
1038
|
+
name: [{ required: true, message: '请输入模版名称', trigger: 'blur' }]
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
},
|
|
1042
|
+
|
|
1043
|
+
watch: {
|
|
1044
|
+
value: function value(val) {
|
|
1045
|
+
var _this = this;
|
|
1046
|
+
|
|
1047
|
+
this.visible = val;
|
|
1048
|
+
if (val) {
|
|
1049
|
+
this.form.remark = '';
|
|
1050
|
+
this.$nextTick(function () {
|
|
1051
|
+
// 先重置清空校验,再带出配置页的模板名称(默认当前日期)
|
|
1052
|
+
_this.$refs.tplForm && _this.$refs.tplForm.resetFields();
|
|
1053
|
+
_this.form.name = _this.payload && _this.payload.templateName ? _this.payload.templateName : '';
|
|
1054
|
+
_this.form.remark = _this.payload && _this.payload.remark ? _this.payload.remark : '';
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
},
|
|
1058
|
+
visible: function visible(val) {
|
|
1059
|
+
this.$emit('input', val);
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
methods: {
|
|
1063
|
+
onCancel: function onCancel() {
|
|
1064
|
+
this.visible = false;
|
|
1065
|
+
},
|
|
1066
|
+
onConfirm: function onConfirm() {
|
|
1067
|
+
var _this2 = this;
|
|
1068
|
+
|
|
1069
|
+
this.$refs.tplForm.validate(function (valid) {
|
|
1070
|
+
if (!valid) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
_this2.saving = true;
|
|
1074
|
+
_this2.api.saveQueryTemplate({
|
|
1075
|
+
appId: _this2.payload.appId,
|
|
1076
|
+
id: _this2.payload.id || '',
|
|
1077
|
+
templateName: _this2.form.name,
|
|
1078
|
+
remark: _this2.form.remark,
|
|
1079
|
+
// 查询条件拼接的中文内容
|
|
1080
|
+
queryCondition: _this2.payload.queryCondition || '',
|
|
1081
|
+
queryJson: _this2.payload.queryJson
|
|
1082
|
+
}).then(function (resp) {
|
|
1083
|
+
_this2.saving = false;
|
|
1084
|
+
if (resp && resp.success) {
|
|
1085
|
+
_this2.$Message.success('保存成功');
|
|
1086
|
+
_this2.visible = false;
|
|
1087
|
+
_this2.$emit('saved', resp);
|
|
1088
|
+
} else {
|
|
1089
|
+
_this2.$Message.error(resp && resp.msg || '保存失败');
|
|
1090
|
+
}
|
|
1091
|
+
}).catch(function () {
|
|
1092
|
+
_this2.saving = false;
|
|
1093
|
+
_this2.$Message.error('保存失败');
|
|
1094
|
+
});
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
});
|
|
1099
|
+
|
|
1100
|
+
/***/ }),
|
|
1101
|
+
/* 135 */
|
|
1102
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1103
|
+
|
|
1104
|
+
"use strict";
|
|
1105
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_script_modal_vue__ = __webpack_require__(136);
|
|
1106
|
+
/* unused harmony namespace reexport */
|
|
1107
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ee918d6e_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_script_modal_vue__ = __webpack_require__(157);
|
|
1108
|
+
function injectStyle (ssrContext) {
|
|
1109
|
+
__webpack_require__(155)
|
|
1110
|
+
}
|
|
1111
|
+
var normalizeComponent = __webpack_require__(0)
|
|
1112
|
+
/* script */
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
/* template */
|
|
1116
|
+
|
|
1117
|
+
/* template functional */
|
|
1118
|
+
var __vue_template_functional__ = false
|
|
1119
|
+
/* styles */
|
|
1120
|
+
var __vue_styles__ = injectStyle
|
|
1121
|
+
/* scopeId */
|
|
1122
|
+
var __vue_scopeId__ = "data-v-ee918d6e"
|
|
1123
|
+
/* moduleIdentifier (server only) */
|
|
1124
|
+
var __vue_module_identifier__ = null
|
|
1125
|
+
var Component = normalizeComponent(
|
|
1126
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_script_modal_vue__["a" /* default */],
|
|
1127
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_ee918d6e_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_script_modal_vue__["a" /* default */],
|
|
1128
|
+
__vue_template_functional__,
|
|
1129
|
+
__vue_styles__,
|
|
1130
|
+
__vue_scopeId__,
|
|
1131
|
+
__vue_module_identifier__
|
|
1132
|
+
)
|
|
1133
|
+
|
|
1134
|
+
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
/***/ }),
|
|
1138
|
+
/* 136 */
|
|
1139
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1140
|
+
|
|
1141
|
+
"use strict";
|
|
1142
|
+
//
|
|
1143
|
+
//
|
|
1144
|
+
//
|
|
1145
|
+
//
|
|
1146
|
+
//
|
|
1147
|
+
//
|
|
1148
|
+
//
|
|
1149
|
+
//
|
|
1150
|
+
//
|
|
1151
|
+
//
|
|
1152
|
+
//
|
|
1153
|
+
//
|
|
1154
|
+
//
|
|
1155
|
+
//
|
|
1156
|
+
//
|
|
1157
|
+
//
|
|
1158
|
+
//
|
|
1159
|
+
//
|
|
1160
|
+
//
|
|
1161
|
+
//
|
|
1162
|
+
//
|
|
1163
|
+
//
|
|
1164
|
+
//
|
|
1165
|
+
//
|
|
1166
|
+
//
|
|
1167
|
+
//
|
|
1168
|
+
//
|
|
1169
|
+
//
|
|
1170
|
+
//
|
|
1171
|
+
//
|
|
1172
|
+
//
|
|
1173
|
+
//
|
|
1174
|
+
//
|
|
1175
|
+
//
|
|
1176
|
+
//
|
|
1177
|
+
//
|
|
1178
|
+
//
|
|
1179
|
+
//
|
|
1180
|
+
|
|
1181
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1182
|
+
name: 'script-modal',
|
|
1183
|
+
props: {
|
|
1184
|
+
value: {
|
|
1185
|
+
type: Boolean,
|
|
1186
|
+
default: false
|
|
1187
|
+
},
|
|
1188
|
+
api: {
|
|
1189
|
+
type: Object,
|
|
1190
|
+
required: true
|
|
1191
|
+
},
|
|
1192
|
+
// 查询配置(queryJson,对象或字符串)
|
|
1193
|
+
queryJson: {
|
|
1194
|
+
type: [Object, String, Array],
|
|
1195
|
+
default: null
|
|
1196
|
+
},
|
|
1197
|
+
// 应用ID(可选,接口层会兜底解析)
|
|
1198
|
+
appId: {
|
|
1199
|
+
type: String,
|
|
1200
|
+
default: ''
|
|
1201
|
+
}
|
|
1202
|
+
},
|
|
1203
|
+
data: function data() {
|
|
1204
|
+
return {
|
|
1205
|
+
visible: this.value,
|
|
1206
|
+
loading: false,
|
|
1207
|
+
activeTab: 'sql',
|
|
1208
|
+
sql: '',
|
|
1209
|
+
debugSql: ''
|
|
1210
|
+
};
|
|
1211
|
+
},
|
|
1212
|
+
|
|
1213
|
+
watch: {
|
|
1214
|
+
value: function value(val) {
|
|
1215
|
+
this.visible = val;
|
|
1216
|
+
if (val) {
|
|
1217
|
+
this.activeTab = 'sql';
|
|
1218
|
+
this.fetchScript();
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
visible: function visible(val) {
|
|
1222
|
+
this.$emit('input', val);
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
methods: {
|
|
1226
|
+
fetchScript: function fetchScript() {
|
|
1227
|
+
var _this = this;
|
|
1228
|
+
|
|
1229
|
+
if (typeof this.api.getQueryScript !== 'function') {
|
|
1230
|
+
this.$Message.info('查看脚本功能待接入');
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
this.loading = true;
|
|
1234
|
+
this.sql = '';
|
|
1235
|
+
this.debugSql = '';
|
|
1236
|
+
Promise.resolve(this.api.getQueryScript({ appId: this.appId, queryJson: this.queryJson })).then(function (resp) {
|
|
1237
|
+
resp = resp || {};
|
|
1238
|
+
console.log('getQueryScript resp:', resp);
|
|
1239
|
+
if (resp.success === false) {
|
|
1240
|
+
_this.$Message.error(resp.msg || '获取脚本失败');
|
|
1241
|
+
}
|
|
1242
|
+
_this.sql = resp.sql || '';
|
|
1243
|
+
_this.debugSql = resp.debugSql || '';
|
|
1244
|
+
_this.loading = false;
|
|
1245
|
+
}).catch(function (err) {
|
|
1246
|
+
_this.loading = false;
|
|
1247
|
+
_this.$Message.error(err && err.message || '获取脚本失败');
|
|
1248
|
+
});
|
|
1249
|
+
},
|
|
1250
|
+
copy: function copy(text) {
|
|
1251
|
+
var _this2 = this;
|
|
1252
|
+
|
|
1253
|
+
text = text || '';
|
|
1254
|
+
if (!text) {
|
|
1255
|
+
this.$Message.info('暂无可复制内容');
|
|
1256
|
+
return;
|
|
1257
|
+
}
|
|
1258
|
+
// 优先使用剪贴板 API,失败时回退 execCommand
|
|
1259
|
+
var done = function done() {
|
|
1260
|
+
return _this2.$Message.success('已复制到剪贴板');
|
|
1261
|
+
};
|
|
1262
|
+
var fail = function fail() {
|
|
1263
|
+
return _this2.$Message.error('复制失败,请手动选择复制');
|
|
1264
|
+
};
|
|
1265
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
1266
|
+
navigator.clipboard.writeText(text).then(done).catch(function () {
|
|
1267
|
+
return _this2.fallbackCopy(text, done, fail);
|
|
1268
|
+
});
|
|
1269
|
+
} else {
|
|
1270
|
+
this.fallbackCopy(text, done, fail);
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
fallbackCopy: function fallbackCopy(text, done, fail) {
|
|
1274
|
+
var ta = document.createElement('textarea');
|
|
1275
|
+
ta.value = text;
|
|
1276
|
+
ta.style.position = 'fixed';
|
|
1277
|
+
ta.style.left = '-9999px';
|
|
1278
|
+
document.body.appendChild(ta);
|
|
1279
|
+
ta.select();
|
|
1280
|
+
try {
|
|
1281
|
+
document.execCommand('copy') ? done() : fail();
|
|
1282
|
+
} catch (e) {
|
|
1283
|
+
fail();
|
|
1284
|
+
}
|
|
1285
|
+
document.body.removeChild(ta);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
/***/ }),
|
|
1291
|
+
/* 137 */
|
|
1292
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1293
|
+
|
|
1294
|
+
"use strict";
|
|
1295
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__views_template_history_vue__ = __webpack_require__(163);
|
|
1296
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__runtime__ = __webpack_require__(130);
|
|
1297
|
+
//
|
|
1298
|
+
//
|
|
1299
|
+
//
|
|
1300
|
+
//
|
|
1301
|
+
//
|
|
1302
|
+
//
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1308
|
+
name: 'custom-query-history-page',
|
|
1309
|
+
components: { templateHistory: __WEBPACK_IMPORTED_MODULE_0__views_template_history_vue__["a" /* default */] },
|
|
1310
|
+
data: function data() {
|
|
1311
|
+
return {
|
|
1312
|
+
mark: '',
|
|
1313
|
+
api: Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["d" /* getCustomQueryApi */])()
|
|
1314
|
+
};
|
|
1315
|
+
},
|
|
1316
|
+
created: function created() {
|
|
1317
|
+
this.mark = this.$route.query.mark || '';
|
|
1318
|
+
},
|
|
1319
|
+
|
|
1320
|
+
methods: {
|
|
1321
|
+
onExecute: function onExecute(row) {
|
|
1322
|
+
row = row || {};
|
|
1323
|
+
// 历史模板执行:queryJson 取模板的 queryConfig,通过 localStorage 传给新开的结果页
|
|
1324
|
+
localStorage.setItem(__WEBPACK_IMPORTED_MODULE_1__runtime__["a" /* PAYLOAD_KEY */], JSON.stringify({ queryJson: row.queryConfig || '', templateId: row.id, templateName: row.templateName }));
|
|
1325
|
+
Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["e" /* openRouteInNewTab */])(this.$router, { name: __WEBPACK_IMPORTED_MODULE_1__runtime__["b" /* ROUTE_NAMES */].result, query: { mark: this.mark, templateId: row.id, templateName: row.templateName } });
|
|
1326
|
+
},
|
|
1327
|
+
onEdit: function onEdit(row) {
|
|
1328
|
+
row = row || {};
|
|
1329
|
+
Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["e" /* openRouteInNewTab */])(this.$router, { name: __WEBPACK_IMPORTED_MODULE_1__runtime__["b" /* ROUTE_NAMES */].config, query: { mark: this.mark, templateId: row.id, templateName: row.templateName } });
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
|
|
1334
|
+
/***/ }),
|
|
1335
|
+
/* 138 */
|
|
1336
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1337
|
+
|
|
1338
|
+
"use strict";
|
|
1339
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_script_modal_vue__ = __webpack_require__(135);
|
|
1340
|
+
//
|
|
1341
|
+
//
|
|
1342
|
+
//
|
|
1343
|
+
//
|
|
1344
|
+
//
|
|
1345
|
+
//
|
|
1346
|
+
//
|
|
1347
|
+
//
|
|
1348
|
+
//
|
|
1349
|
+
//
|
|
1350
|
+
//
|
|
1351
|
+
//
|
|
1352
|
+
//
|
|
1353
|
+
//
|
|
1354
|
+
//
|
|
1355
|
+
//
|
|
1356
|
+
//
|
|
1357
|
+
//
|
|
1358
|
+
//
|
|
1359
|
+
//
|
|
1360
|
+
//
|
|
1361
|
+
//
|
|
1362
|
+
//
|
|
1363
|
+
//
|
|
1364
|
+
//
|
|
1365
|
+
//
|
|
1366
|
+
//
|
|
1367
|
+
|
|
1368
|
+
|
|
1369
|
+
|
|
1370
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1371
|
+
name: 'template-history',
|
|
1372
|
+
components: { scriptModal: __WEBPACK_IMPORTED_MODULE_0__components_script_modal_vue__["a" /* default */] },
|
|
1373
|
+
props: {
|
|
1374
|
+
api: {
|
|
1375
|
+
type: Object,
|
|
1376
|
+
required: true
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
data: function data() {
|
|
1380
|
+
var _this = this;
|
|
1381
|
+
|
|
1382
|
+
return {
|
|
1383
|
+
keyword: '',
|
|
1384
|
+
loading: false,
|
|
1385
|
+
rows: [],
|
|
1386
|
+
total: 0,
|
|
1387
|
+
pageNo: 1,
|
|
1388
|
+
pageSize: 10,
|
|
1389
|
+
tableHeight: 500, // 表格可视高度(px),固定表头并出现纵向滚动条;随窗口自适应
|
|
1390
|
+
scriptModalShow: false, // 查看脚本弹窗
|
|
1391
|
+
scriptQueryJson: '', // 传给脚本弹窗的查询配置
|
|
1392
|
+
columns: [{ title: '模版名称', key: 'name', minWidth: 140, tooltip: true }, { title: '描述', key: 'description', minWidth: 180, tooltip: true }, {
|
|
1393
|
+
title: '主表名称',
|
|
1394
|
+
key: 'mainTableName',
|
|
1395
|
+
width: 230,
|
|
1396
|
+
render: function render(h, _ref) {
|
|
1397
|
+
var row = _ref.row;
|
|
1398
|
+
return h('span', { class: 'tpl-tag' }, row.mainTableName);
|
|
1399
|
+
}
|
|
1400
|
+
}, {
|
|
1401
|
+
title: '查询条件',
|
|
1402
|
+
key: 'queryCondition',
|
|
1403
|
+
minWidth: 220,
|
|
1404
|
+
// 不同搜索条件换行展示
|
|
1405
|
+
render: function render(h, _ref2) {
|
|
1406
|
+
var row = _ref2.row;
|
|
1407
|
+
return h('div', String(row.queryCondition || '').split('\n').filter(Boolean).map(function (item) {
|
|
1408
|
+
return h('div', { class: 'tpl-cond-item' }, item);
|
|
1409
|
+
}));
|
|
1410
|
+
}
|
|
1411
|
+
}, { title: '创建时间', key: 'createTime', width: 200 }, {
|
|
1412
|
+
title: '操作',
|
|
1413
|
+
key: 'action',
|
|
1414
|
+
width: 380,
|
|
1415
|
+
align: 'center',
|
|
1416
|
+
render: function render(h, _ref3) {
|
|
1417
|
+
var row = _ref3.row;
|
|
1418
|
+
|
|
1419
|
+
return h('div', [h('Button', { props: { type: 'success', size: 'small', icon: 'md-play' }, style: { marginRight: '6px' }, on: { click: function click() {
|
|
1420
|
+
return _this.$emit('execute', row);
|
|
1421
|
+
} } }, '执行查询'), h('Button', { props: { type: 'primary', size: 'small', icon: 'md-create' }, style: { marginRight: '6px' }, on: { click: function click() {
|
|
1422
|
+
return _this.$emit('edit', row);
|
|
1423
|
+
} } }, '编辑'), h('Button', { props: { type: 'error', size: 'small', icon: 'md-close' }, style: { marginRight: '6px' }, on: { click: function click() {
|
|
1424
|
+
return _this.onDelete(row);
|
|
1425
|
+
} } }, '删除'), h('Button', { props: { type: 'info', size: 'small', icon: 'md-eye' }, on: { click: function click() {
|
|
1426
|
+
return _this.lookScript(row);
|
|
1427
|
+
} } }, '查看脚本')]);
|
|
1428
|
+
}
|
|
1429
|
+
}]
|
|
1430
|
+
};
|
|
1431
|
+
},
|
|
1432
|
+
created: function created() {
|
|
1433
|
+
this.getData();
|
|
1434
|
+
},
|
|
1435
|
+
mounted: function mounted() {
|
|
1436
|
+
this.updateTableHeight();
|
|
1437
|
+
window.addEventListener('resize', this.updateTableHeight);
|
|
1438
|
+
},
|
|
1439
|
+
beforeDestroy: function beforeDestroy() {
|
|
1440
|
+
window.removeEventListener('resize', this.updateTableHeight);
|
|
1441
|
+
},
|
|
1442
|
+
|
|
1443
|
+
methods: {
|
|
1444
|
+
// 计算表格可视高度(约占视口 78%),iView Table 的 height 需为像素数值方可固定表头并出现滚动条
|
|
1445
|
+
updateTableHeight: function updateTableHeight() {
|
|
1446
|
+
this.tableHeight = Math.round(window.innerHeight * 0.78);
|
|
1447
|
+
},
|
|
1448
|
+
getData: function getData() {
|
|
1449
|
+
var _this2 = this;
|
|
1450
|
+
|
|
1451
|
+
this.loading = true;
|
|
1452
|
+
this.api.getTemplatePage({ searchValue: this.keyword, pageNo: this.pageNo, pageSize: this.pageSize }).then(function (resp) {
|
|
1453
|
+
_this2.rows = resp.rows || [];
|
|
1454
|
+
_this2.total = resp.total || 0;
|
|
1455
|
+
_this2.loading = false;
|
|
1456
|
+
}).catch(function () {
|
|
1457
|
+
_this2.loading = false;
|
|
1458
|
+
});
|
|
1459
|
+
},
|
|
1460
|
+
onSearch: function onSearch() {
|
|
1461
|
+
this.pageNo = 1;
|
|
1462
|
+
this.getData();
|
|
1463
|
+
},
|
|
1464
|
+
onReset: function onReset() {
|
|
1465
|
+
this.keyword = '';
|
|
1466
|
+
this.pageNo = 1;
|
|
1467
|
+
this.getData();
|
|
1468
|
+
},
|
|
1469
|
+
onPageChange: function onPageChange(pageNo) {
|
|
1470
|
+
this.pageNo = pageNo;
|
|
1471
|
+
this.getData();
|
|
1472
|
+
},
|
|
1473
|
+
onDelete: function onDelete(row) {
|
|
1474
|
+
var _this3 = this;
|
|
1475
|
+
|
|
1476
|
+
this.$Modal.confirm({
|
|
1477
|
+
title: '确认删除模版',
|
|
1478
|
+
content: '确定要删除模版 "' + row.templateName + '" 吗?<br/>此操作不可恢复,删除后该模版的配置将永久丢失。',
|
|
1479
|
+
okText: '确认删除',
|
|
1480
|
+
cancelText: '取消',
|
|
1481
|
+
loading: true,
|
|
1482
|
+
onOk: function onOk() {
|
|
1483
|
+
_this3.api.deleteTemplate(row.id, row.templateName).then(function (resp) {
|
|
1484
|
+
_this3.$Modal.remove();
|
|
1485
|
+
if (resp && resp.success) {
|
|
1486
|
+
_this3.$Message.success('删除成功');
|
|
1487
|
+
if (_this3.rows.length === 1 && _this3.pageNo > 1) {
|
|
1488
|
+
_this3.pageNo -= 1;
|
|
1489
|
+
}
|
|
1490
|
+
_this3.getData();
|
|
1491
|
+
} else {
|
|
1492
|
+
_this3.$Message.error('删除失败');
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
},
|
|
1498
|
+
lookScript: function lookScript(row) {
|
|
1499
|
+
// 用模板保存的查询配置(queryConfig 即 queryJson)获取脚本
|
|
1500
|
+
this.scriptQueryJson = row && row.queryConfig || '';
|
|
1501
|
+
this.scriptModalShow = true;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
/***/ }),
|
|
1507
|
+
/* 139 */
|
|
1508
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1509
|
+
|
|
1510
|
+
"use strict";
|
|
1511
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__views_query_result_vue__ = __webpack_require__(171);
|
|
1512
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__runtime__ = __webpack_require__(130);
|
|
1513
|
+
//
|
|
1514
|
+
//
|
|
1515
|
+
//
|
|
1516
|
+
//
|
|
1517
|
+
//
|
|
1518
|
+
//
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1524
|
+
name: 'custom-query-result-page',
|
|
1525
|
+
components: { queryResult: __WEBPACK_IMPORTED_MODULE_0__views_query_result_vue__["a" /* default */] },
|
|
1526
|
+
data: function data() {
|
|
1527
|
+
return {
|
|
1528
|
+
mark: '',
|
|
1529
|
+
templateId: '',
|
|
1530
|
+
templateName: '',
|
|
1531
|
+
payload: null,
|
|
1532
|
+
api: Object(__WEBPACK_IMPORTED_MODULE_1__runtime__["d" /* getCustomQueryApi */])()
|
|
1533
|
+
};
|
|
1534
|
+
},
|
|
1535
|
+
created: function created() {
|
|
1536
|
+
this.mark = this.$route.query.mark || '';
|
|
1537
|
+
this.templateId = this.$route.query.templateId || '';
|
|
1538
|
+
this.templateName = this.$route.query.templateName || '';
|
|
1539
|
+
// 读取缓存的查询配置:配置页执行为完整 payload;历史模板执行为 { queryJson, templateId, templateName }
|
|
1540
|
+
var cache = localStorage.getItem(__WEBPACK_IMPORTED_MODULE_1__runtime__["a" /* PAYLOAD_KEY */]);
|
|
1541
|
+
if (cache) {
|
|
1542
|
+
try {
|
|
1543
|
+
this.payload = JSON.parse(cache);
|
|
1544
|
+
} catch (e) {
|
|
1545
|
+
this.payload = null;
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
});
|
|
1550
|
+
|
|
1551
|
+
/***/ }),
|
|
1552
|
+
/* 140 */
|
|
1553
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1554
|
+
|
|
1555
|
+
"use strict";
|
|
1556
|
+
//
|
|
1557
|
+
//
|
|
1558
|
+
//
|
|
1559
|
+
//
|
|
1560
|
+
//
|
|
1561
|
+
//
|
|
1562
|
+
//
|
|
1563
|
+
//
|
|
1564
|
+
//
|
|
1565
|
+
//
|
|
1566
|
+
//
|
|
1567
|
+
//
|
|
1568
|
+
//
|
|
1569
|
+
//
|
|
1570
|
+
//
|
|
1571
|
+
//
|
|
1572
|
+
//
|
|
1573
|
+
//
|
|
1574
|
+
//
|
|
1575
|
+
//
|
|
1576
|
+
//
|
|
1577
|
+
//
|
|
1578
|
+
//
|
|
1579
|
+
//
|
|
1580
|
+
//
|
|
1581
|
+
//
|
|
1582
|
+
|
|
1583
|
+
/* harmony default export */ __webpack_exports__["a"] = ({
|
|
1584
|
+
name: 'query-result',
|
|
1585
|
+
props: {
|
|
1586
|
+
api: {
|
|
1587
|
+
type: Object,
|
|
1588
|
+
required: true
|
|
1589
|
+
},
|
|
1590
|
+
// 执行查询的配置(来自配置页)
|
|
1591
|
+
payload: {
|
|
1592
|
+
type: Object,
|
|
1593
|
+
default: null
|
|
1594
|
+
},
|
|
1595
|
+
// 从历史模版执行时的模版 id
|
|
1596
|
+
templateId: {
|
|
1597
|
+
type: String,
|
|
1598
|
+
default: ''
|
|
1599
|
+
},
|
|
1600
|
+
// 从历史模版执行时的模版名称
|
|
1601
|
+
templateName: {
|
|
1602
|
+
type: String,
|
|
1603
|
+
default: ''
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
data: function data() {
|
|
1607
|
+
return {
|
|
1608
|
+
loading: false,
|
|
1609
|
+
columns: [],
|
|
1610
|
+
rows: [],
|
|
1611
|
+
total: 0,
|
|
1612
|
+
pageNo: 1,
|
|
1613
|
+
pageSize: 10,
|
|
1614
|
+
tableHeight: 500 // 表格可视高度(px),固定表头并出现纵向滚动条;随窗口自适应
|
|
1615
|
+
};
|
|
1616
|
+
},
|
|
1617
|
+
|
|
1618
|
+
computed: {
|
|
1619
|
+
tableColumns: function tableColumns() {
|
|
1620
|
+
var seq = { title: '序号', type: 'index', width: 70, align: 'center' };
|
|
1621
|
+
var dynamic = this.columns.map(function (c) {
|
|
1622
|
+
return Object.assign({ align: 'center', tooltip: true, minWidth: 100 }, c);
|
|
1623
|
+
});
|
|
1624
|
+
return [seq].concat(dynamic);
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
created: function created() {
|
|
1628
|
+
this.getData();
|
|
1629
|
+
},
|
|
1630
|
+
mounted: function mounted() {
|
|
1631
|
+
this.updateTableHeight();
|
|
1632
|
+
window.addEventListener('resize', this.updateTableHeight);
|
|
1633
|
+
},
|
|
1634
|
+
beforeDestroy: function beforeDestroy() {
|
|
1635
|
+
window.removeEventListener('resize', this.updateTableHeight);
|
|
1636
|
+
},
|
|
1637
|
+
|
|
1638
|
+
methods: {
|
|
1639
|
+
// 计算表格可视高度,iView Table 的 height 需为像素数值方可固定表头并出现滚动条
|
|
1640
|
+
updateTableHeight: function updateTableHeight() {
|
|
1641
|
+
this.tableHeight = Math.round(window.innerHeight * 0.85);
|
|
1642
|
+
},
|
|
1643
|
+
getData: function getData() {
|
|
1644
|
+
var _this = this;
|
|
1645
|
+
|
|
1646
|
+
this.loading = true;
|
|
1647
|
+
// 从模版执行时优先带上 templateId,供真实接口按模版查询
|
|
1648
|
+
var payload = this.payload || {};
|
|
1649
|
+
if (this.templateId) {
|
|
1650
|
+
payload = Object.assign({}, payload, { templateId: this.templateId, templateName: this.templateName });
|
|
1651
|
+
}
|
|
1652
|
+
this.api.executeQuery(payload, this.pageNo, this.pageSize).then(function (resp) {
|
|
1653
|
+
console.log('executeQuery resp', resp);
|
|
1654
|
+
_this.columns = resp.columns || [];
|
|
1655
|
+
_this.rows = resp.rows || [];
|
|
1656
|
+
_this.total = resp.total || 0;
|
|
1657
|
+
if (resp && resp.success) {} else {
|
|
1658
|
+
resp && resp.msg ? _this.$Message.error(resp && resp.msg || '查询失败') : '';
|
|
1659
|
+
}
|
|
1660
|
+
_this.loading = false;
|
|
1661
|
+
}).catch(function () {
|
|
1662
|
+
_this.loading = false;
|
|
1663
|
+
});
|
|
1664
|
+
},
|
|
1665
|
+
onPageChange: function onPageChange(pageNo) {
|
|
1666
|
+
this.pageNo = pageNo;
|
|
1667
|
+
this.getData();
|
|
1668
|
+
},
|
|
1669
|
+
onPageSizeChange: function onPageSizeChange(size) {
|
|
1670
|
+
this.pageSize = size;
|
|
1671
|
+
this.pageNo = 1;
|
|
1672
|
+
this.getData();
|
|
1673
|
+
},
|
|
1674
|
+
exportExcel: function exportExcel() {
|
|
1675
|
+
var _this2 = this;
|
|
1676
|
+
|
|
1677
|
+
if (typeof this.api.exportData !== 'function') {
|
|
1678
|
+
this.$Message.info('导出功能待接入');
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
var payload = this.payload || {};
|
|
1682
|
+
if (this.templateId) {
|
|
1683
|
+
payload = Object.assign({}, payload, { templateId: this.templateId, templateName: this.templateName });
|
|
1684
|
+
}
|
|
1685
|
+
Promise.resolve(this.api.exportData(payload)).catch(function (err) {
|
|
1686
|
+
_this2.$Message.error(err && err.message || '导出失败');
|
|
1687
|
+
});
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
/***/ }),
|
|
1693
|
+
/* 141 */
|
|
1694
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1695
|
+
|
|
1696
|
+
"use strict";
|
|
1697
|
+
/* harmony export (immutable) */ __webpack_exports__["a"] = ensureCustomQueryRoutes;
|
|
1698
|
+
/* harmony export (immutable) */ __webpack_exports__["b"] = openCustomQuery;
|
|
1699
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__runtime__ = __webpack_require__(130);
|
|
1700
|
+
/**
|
|
1701
|
+
* 自定义查询 - 路由自注册与打开入口
|
|
1702
|
+
*
|
|
1703
|
+
* 宿主无需在项目里手写路由:首次打开时会把 3 个页面路由动态注入到宿主的 router,
|
|
1704
|
+
* 之后通过 window.open 打开新页面(组件所有跳转均为新开页面)。任何地方只要拿到 router 实例即可调用 openCustomQuery。
|
|
1705
|
+
*/
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
var routesAdded = false;
|
|
1709
|
+
|
|
1710
|
+
function buildRoutes() {
|
|
1711
|
+
return [{ path: __WEBPACK_IMPORTED_MODULE_0__runtime__["c" /* ROUTE_PATHS */].config, name: __WEBPACK_IMPORTED_MODULE_0__runtime__["b" /* ROUTE_NAMES */].config, meta: { title: '自定义查询', hideInMenu: true }, component: function component() {
|
|
1712
|
+
return new Promise(function(resolve) { resolve(); }).then(__webpack_require__.bind(null, 145));
|
|
1713
|
+
} }, { path: __WEBPACK_IMPORTED_MODULE_0__runtime__["c" /* ROUTE_PATHS */].history, name: __WEBPACK_IMPORTED_MODULE_0__runtime__["b" /* ROUTE_NAMES */].history, meta: { title: '历史查询模版', hideInMenu: true }, component: function component() {
|
|
1714
|
+
return new Promise(function(resolve) { resolve(); }).then(__webpack_require__.bind(null, 160));
|
|
1715
|
+
} }, { path: __WEBPACK_IMPORTED_MODULE_0__runtime__["c" /* ROUTE_PATHS */].result, name: __WEBPACK_IMPORTED_MODULE_0__runtime__["b" /* ROUTE_NAMES */].result, meta: { title: '查询结果', hideInMenu: true }, component: function component() {
|
|
1716
|
+
return new Promise(function(resolve) { resolve(); }).then(__webpack_require__.bind(null, 168));
|
|
1717
|
+
} }];
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
/**
|
|
1721
|
+
* 确保路由已注册到宿主 router(幂等)
|
|
1722
|
+
* @param {VueRouter} router
|
|
1723
|
+
*/
|
|
1724
|
+
function ensureCustomQueryRoutes(router) {
|
|
1725
|
+
if (!router) {
|
|
1726
|
+
console.warn('[custom-query] 缺少 router 实例,无法注册路由');
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
// 已存在则跳过(兼容热更新/多次调用)
|
|
1730
|
+
var existed = typeof router.getRoutes === 'function' && router.getRoutes().some(function (r) {
|
|
1731
|
+
return r.name === __WEBPACK_IMPORTED_MODULE_0__runtime__["b" /* ROUTE_NAMES */].config;
|
|
1732
|
+
});
|
|
1733
|
+
if (routesAdded || existed) {
|
|
1734
|
+
return;
|
|
1735
|
+
}
|
|
1736
|
+
var routes = buildRoutes();
|
|
1737
|
+
if (typeof router.addRoute === 'function') {
|
|
1738
|
+
routes.forEach(function (r) {
|
|
1739
|
+
return router.addRoute(r);
|
|
1740
|
+
});
|
|
1741
|
+
} else if (typeof router.addRoutes === 'function') {
|
|
1742
|
+
// 兼容 vue-router < 3.5
|
|
1743
|
+
router.addRoutes(routes);
|
|
1744
|
+
}
|
|
1745
|
+
routesAdded = true;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
/**
|
|
1749
|
+
* 打开自定义查询(配置页,新页面)
|
|
1750
|
+
* @param {VueRouter} router 宿主 router 实例(组件内 this.$router)
|
|
1751
|
+
* @param {Object} options { mark }
|
|
1752
|
+
*/
|
|
1753
|
+
function openCustomQuery(router) {
|
|
1754
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1755
|
+
|
|
1756
|
+
ensureCustomQueryRoutes(router);
|
|
1757
|
+
Object(__WEBPACK_IMPORTED_MODULE_0__runtime__["e" /* openRouteInNewTab */])(router, { name: __WEBPACK_IMPORTED_MODULE_0__runtime__["b" /* ROUTE_NAMES */].config, query: {} });
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/***/ }),
|
|
1761
|
+
/* 142 */
|
|
1762
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1763
|
+
|
|
1764
|
+
"use strict";
|
|
1765
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__store__ = __webpack_require__(143);
|
|
1766
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_qs__ = __webpack_require__(7);
|
|
1767
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_qs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_qs__);
|
|
1768
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
1769
|
+
|
|
1770
|
+
/**
|
|
1771
|
+
* 自定义查询组件 - 真实接口实现(对接后端)
|
|
1772
|
+
*
|
|
1773
|
+
* 说明:这里只实现已对接后端的方法,未实现的方法由 runtime 合并时自动回退到内置 mock。
|
|
1774
|
+
* getMainTables(appId) -> /bsp-com/com/statis/getStatisTables 获取可选主表
|
|
1775
|
+
* getTableFields(tableName) -> /bsp-ops/ops/res/field/getFieldAllData 获取主表字段
|
|
1776
|
+
*
|
|
1777
|
+
* 组件后续将单独打包发布,接口地址内聚在组件内部(不依赖项目 path 配置)。
|
|
1778
|
+
* 接口沿用项目统一的 store postRequest(自动带 access_token,x-www-form-urlencoded),
|
|
1779
|
+
* 返回体约定为 { success, rows, msg }。
|
|
1780
|
+
*/
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
// 组件内置接口地址(自定义查询专用,随组件一起打包发布)
|
|
1785
|
+
var API_URLS = {
|
|
1786
|
+
mainTables: '/bsp-com/com/statis/getStatisTables', // 获取可选主表
|
|
1787
|
+
tableFields: '/bsp-ops/ops/res/field/getFieldAllData', // 获取主表字段
|
|
1788
|
+
saveQueryTemplate: '/bsp-com/com/statis/saveQueryTemplate', // 保存/更新查询模板(模板名可不传)
|
|
1789
|
+
queryPageData: '/bsp-com/com/statis/getQueryPageData', // 执行查询,分页获取结果数据
|
|
1790
|
+
templatePage: '/bsp-com/com/statis/getQueryTemplatePage', // 分页获取历史查询模板
|
|
1791
|
+
deleteQueryTemplate: '/bsp-com/com/statis/deleteQueryTemplate', // 删除历史查询模板
|
|
1792
|
+
queryConfig: '/bsp-com/com/statis/getQueryConfig', // 获取自定义查询列表配置(执行/编辑回填)
|
|
1793
|
+
exportQueryData: '/bsp-com/com/statis/exportQueryData', // 导出查询结果 excel
|
|
1794
|
+
queryScript: '/bsp-com/com/statis/getQueryScript' // 获取查询脚本(标准sql / 调试sql)
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
// 应用ID:优先取入参,其次取全局 serverConfig.APP_ID
|
|
1798
|
+
};function resolveAppId(appId) {
|
|
1799
|
+
if (appId) {
|
|
1800
|
+
return '1934985431515009024'; // || serverConfig.APP_ID || appId
|
|
1801
|
+
}
|
|
1802
|
+
return '1934985431515009024'; // (typeof serverConfig !== 'undefined' && serverConfig && serverConfig.APP_ID) || ''
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
// 主表名 -> resId 映射(getFieldAllData 需要 resId,而组件仅按主表名回调 getTableFields)
|
|
1806
|
+
var tableResIdMap = {};
|
|
1807
|
+
|
|
1808
|
+
// 从对象里按候选 key 顺序取第一个有值的字段(兼容后端字段命名差异)
|
|
1809
|
+
function pick(obj, keys) {
|
|
1810
|
+
var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
1811
|
+
|
|
1812
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1813
|
+
var v = obj[keys[i]];
|
|
1814
|
+
if (v !== undefined && v !== null && v !== '') {
|
|
1815
|
+
return v;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
return fallback;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
function post(url, params) {
|
|
1822
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: url, params: params }).then(function (data) {
|
|
1823
|
+
if (data && data.success) {
|
|
1824
|
+
// 兼容两种返回:主表接口用 data,字段接口用 rows
|
|
1825
|
+
return data.rows || data.data || [];
|
|
1826
|
+
}
|
|
1827
|
+
return [];
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
var realApi = {
|
|
1832
|
+
getMainTables: function getMainTables(appId) {
|
|
1833
|
+
return post(API_URLS.mainTables, { appId: appId || '' }).then(function (rows) {
|
|
1834
|
+
return rows.map(function (r) {
|
|
1835
|
+
var name = pick(r, ['tableName', 'resName', 'name']);
|
|
1836
|
+
var resId = pick(r, ['resId', 'id']);
|
|
1837
|
+
// 缓存主表名到 resId 的映射,供 getTableFields 使用
|
|
1838
|
+
if (name) {
|
|
1839
|
+
tableResIdMap[name] = resId || name;
|
|
1840
|
+
}
|
|
1841
|
+
return {
|
|
1842
|
+
name: name,
|
|
1843
|
+
label: pick(r, ['tableCname', 'resCname', 'label'], name),
|
|
1844
|
+
resId: resId || name
|
|
1845
|
+
};
|
|
1846
|
+
});
|
|
1847
|
+
});
|
|
1848
|
+
},
|
|
1849
|
+
getTableFields: function getTableFields(tableName) {
|
|
1850
|
+
var resId = tableResIdMap[tableName] || tableName;
|
|
1851
|
+
return post(API_URLS.tableFields, { resId: resId }).then(function (rows) {
|
|
1852
|
+
return rows.map(function (f) {
|
|
1853
|
+
var name = pick(f, ['fieldName', 'name']);
|
|
1854
|
+
return {
|
|
1855
|
+
name: name,
|
|
1856
|
+
label: pick(f, ['fieldCname', 'fieldComment', 'label'], name),
|
|
1857
|
+
code: name,
|
|
1858
|
+
fieldType: pick(f, ['fieldType', 'jdbcType', 'type']), // 字段类型,用于字段值控件渲染
|
|
1859
|
+
dicName: pick(f, ['dicName']) // 字典标识,varchar 且存在时用字典组件
|
|
1860
|
+
};
|
|
1861
|
+
});
|
|
1862
|
+
});
|
|
1863
|
+
},
|
|
1864
|
+
|
|
1865
|
+
// 保存/更新查询模板;更新时传 id
|
|
1866
|
+
saveQueryTemplate: function saveQueryTemplate() {
|
|
1867
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1868
|
+
|
|
1869
|
+
var body = {
|
|
1870
|
+
appId: params.appId || '',
|
|
1871
|
+
queryJson: typeof params.queryJson === 'string' ? params.queryJson : JSON.stringify(params.queryJson || {})
|
|
1872
|
+
};
|
|
1873
|
+
if (params.templateName) {
|
|
1874
|
+
body.templateName = params.templateName;
|
|
1875
|
+
}
|
|
1876
|
+
// 模板描述
|
|
1877
|
+
if (params.remark !== undefined && params.remark !== null) {
|
|
1878
|
+
body.remark = params.remark;
|
|
1879
|
+
}
|
|
1880
|
+
// 查询条件拼接的中文内容
|
|
1881
|
+
if (params.queryCondition !== undefined && params.queryCondition !== null) {
|
|
1882
|
+
body.queryCondition = params.queryCondition;
|
|
1883
|
+
}
|
|
1884
|
+
if (params.id) {
|
|
1885
|
+
body.id = params.id;
|
|
1886
|
+
}
|
|
1887
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.saveQueryTemplate, params: body });
|
|
1888
|
+
},
|
|
1889
|
+
|
|
1890
|
+
// 执行查询:分页拉取结果数据,返回 { columns, rows, total }
|
|
1891
|
+
executeQuery: function executeQuery() {
|
|
1892
|
+
var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1893
|
+
var pageNo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
1894
|
+
var pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
1895
|
+
|
|
1896
|
+
var queryJson = payload.queryJson;
|
|
1897
|
+
var body = {
|
|
1898
|
+
appId: resolveAppId(payload.appId),
|
|
1899
|
+
queryJson: typeof queryJson === 'string' ? queryJson : JSON.stringify(queryJson || {}),
|
|
1900
|
+
pageNo: pageNo,
|
|
1901
|
+
pageSize: pageSize
|
|
1902
|
+
// 兼容从历史模板执行
|
|
1903
|
+
};if (payload.templateId) {
|
|
1904
|
+
body.id = payload.templateId;
|
|
1905
|
+
body.templateName = payload.templateName;
|
|
1906
|
+
}
|
|
1907
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.queryPageData, params: body }).then(function (data) {
|
|
1908
|
+
var rows = data && (data.rows || data.data) || [];
|
|
1909
|
+
// 列优先取后端返回的 header(字段元信息 { name,label,type,valueType,dicName })
|
|
1910
|
+
// 字段存在字典 dicName 时,取值字段改用 <字段>Name(展示字典翻译后的值)
|
|
1911
|
+
var header = data && data.header;
|
|
1912
|
+
var columns = [];
|
|
1913
|
+
if (header && (typeof header === 'undefined' ? 'undefined' : _typeof(header)) === 'object') {
|
|
1914
|
+
columns = Object.keys(header).map(function (k) {
|
|
1915
|
+
var h = header[k] || {};
|
|
1916
|
+
var name = h.name || k;
|
|
1917
|
+
return {
|
|
1918
|
+
title: h.label || name,
|
|
1919
|
+
key: h.dicName ? name + 'Name' : name
|
|
1920
|
+
};
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1923
|
+
// 兜底:header 缺失时,用配置的展示字段,其次从首行数据推断
|
|
1924
|
+
if (!columns.length) {
|
|
1925
|
+
columns = (payload.showFields || []).map(function (f) {
|
|
1926
|
+
return { title: f.label || f.name, key: f.name };
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
if (!columns.length && rows.length) {
|
|
1930
|
+
columns = Object.keys(rows[0]).map(function (k) {
|
|
1931
|
+
return { title: k, key: k };
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
return {
|
|
1935
|
+
columns: columns,
|
|
1936
|
+
rows: rows,
|
|
1937
|
+
success: data && data.success || false,
|
|
1938
|
+
total: data && data.total || 0,
|
|
1939
|
+
msg: data && data.msg || data && data.message || ''
|
|
1940
|
+
};
|
|
1941
|
+
});
|
|
1942
|
+
},
|
|
1943
|
+
|
|
1944
|
+
// 分页获取历史查询模板,返回 { rows, total }
|
|
1945
|
+
getTemplatePage: function getTemplatePage() {
|
|
1946
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1947
|
+
|
|
1948
|
+
var body = {
|
|
1949
|
+
appId: resolveAppId(params.appId),
|
|
1950
|
+
pageNo: params.pageNo || 1,
|
|
1951
|
+
pageSize: params.pageSize || 10,
|
|
1952
|
+
searchValue: params.searchValue || params.keyword || ''
|
|
1953
|
+
// 组件按 keyword 搜索,接口参数为 templateName
|
|
1954
|
+
};var templateName = params.templateName || params.keyword;
|
|
1955
|
+
if (templateName) {
|
|
1956
|
+
body.templateName = templateName;
|
|
1957
|
+
}
|
|
1958
|
+
if (params.tableId) {
|
|
1959
|
+
body.tableId = params.tableId;
|
|
1960
|
+
}
|
|
1961
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.templatePage, params: body }).then(function (data) {
|
|
1962
|
+
var list = data && (data.rows || data.data) || [];
|
|
1963
|
+
var rows = list.map(function (r) {
|
|
1964
|
+
return {
|
|
1965
|
+
id: pick(r, ['id']),
|
|
1966
|
+
name: pick(r, ['templateName', 'name']),
|
|
1967
|
+
templateName: pick(r, ['templateName', 'name']),
|
|
1968
|
+
description: pick(r, ['description', 'remark']),
|
|
1969
|
+
mainTableName: pick(r, ['tableCname', 'tableName', 'mainTableName']),
|
|
1970
|
+
queryCondition: pick(r, ['queryCondition']),
|
|
1971
|
+
queryConfig: pick(r, ['queryConfig', 'queryJson']),
|
|
1972
|
+
createTime: pick(r, ['createTime', 'addTime', 'updateTime'])
|
|
1973
|
+
};
|
|
1974
|
+
});
|
|
1975
|
+
return { rows: rows, total: data && data.total || 0 };
|
|
1976
|
+
});
|
|
1977
|
+
},
|
|
1978
|
+
|
|
1979
|
+
// 删除历史查询模板
|
|
1980
|
+
deleteTemplate: function deleteTemplate(id, templateName) {
|
|
1981
|
+
var body = {
|
|
1982
|
+
appId: resolveAppId(),
|
|
1983
|
+
id: id || ''
|
|
1984
|
+
};
|
|
1985
|
+
if (templateName) {
|
|
1986
|
+
body.templateName = templateName;
|
|
1987
|
+
}
|
|
1988
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.deleteQueryTemplate, params: body });
|
|
1989
|
+
},
|
|
1990
|
+
|
|
1991
|
+
// 获取自定义查询列表配置(历史模板执行/编辑时回填),返回 detail 对象或 null
|
|
1992
|
+
// 后端回显结构:{ tables:[{id,tableName,tableCname}], operators:[{value,label}],
|
|
1993
|
+
// fieldsByTable:{ <tableId>:[{fieldName,fieldCname,fieldType,dicName}] },
|
|
1994
|
+
// queryConfig:{ conditions:[{fieldName,op,value,relation}], showFields:[name] } }
|
|
1995
|
+
getTemplateDetail: function getTemplateDetail(id, templateName) {
|
|
1996
|
+
var body = {
|
|
1997
|
+
appId: resolveAppId(),
|
|
1998
|
+
id: id || ''
|
|
1999
|
+
};
|
|
2000
|
+
if (templateName) {
|
|
2001
|
+
body.templateName = templateName;
|
|
2002
|
+
}
|
|
2003
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.queryConfig, params: body }).then(function (data) {
|
|
2004
|
+
if (!data || !data.success) {
|
|
2005
|
+
return null;
|
|
2006
|
+
}
|
|
2007
|
+
var cfg = data.data || (Array.isArray(data.rows) ? data.rows[0] : data.rows) || {};
|
|
2008
|
+
|
|
2009
|
+
// 已保存的查询(条件/表头字段),兼容 queryConfig 与旧 queryJson,字符串统一解析
|
|
2010
|
+
var queryConfig = cfg.queryConfig !== undefined ? cfg.queryConfig : cfg.queryJson;
|
|
2011
|
+
if (typeof queryConfig === 'string') {
|
|
2012
|
+
try {
|
|
2013
|
+
queryConfig = JSON.parse(queryConfig);
|
|
2014
|
+
} catch (e) {
|
|
2015
|
+
queryConfig = {};
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
queryConfig = queryConfig || {};
|
|
2019
|
+
|
|
2020
|
+
// 已选主表:取 tables[0],兜底回退到 cfg/queryConfig 上的表名
|
|
2021
|
+
var tables = Array.isArray(cfg.tables) ? cfg.tables : [];
|
|
2022
|
+
var mainTable = tables[0] || {};
|
|
2023
|
+
var mainTableName = pick(mainTable, ['tableName', 'name']) || pick(cfg, ['tableName', 'mainTableName']) || pick(queryConfig, ['tableName']);
|
|
2024
|
+
var mainTableId = pick(mainTable, ['id', 'resId']);
|
|
2025
|
+
// 缓存主表名 -> resId,供 getTableFields 兜底取字段
|
|
2026
|
+
if (mainTableName && mainTableId) {
|
|
2027
|
+
tableResIdMap[mainTableName] = mainTableId;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
// 主表字段:fieldsByTable 以表 id 为键,归一化成组件字段结构
|
|
2031
|
+
var fieldsByTable = cfg.fieldsByTable || {};
|
|
2032
|
+
var rawFields = mainTableId && fieldsByTable[mainTableId] || [];
|
|
2033
|
+
var fields = rawFields.map(function (f) {
|
|
2034
|
+
var name = pick(f, ['fieldName', 'name']);
|
|
2035
|
+
return {
|
|
2036
|
+
name: name,
|
|
2037
|
+
label: pick(f, ['fieldCname', 'fieldComment', 'label'], name),
|
|
2038
|
+
code: name,
|
|
2039
|
+
fieldType: pick(f, ['fieldType', 'jdbcType', 'type']),
|
|
2040
|
+
dicName: pick(f, ['dicName'])
|
|
2041
|
+
};
|
|
2042
|
+
});
|
|
2043
|
+
|
|
2044
|
+
// 查询条件:保留原始运算符与关系(relation: AND/OR)
|
|
2045
|
+
var conditions = (queryConfig.conditions || []).map(function (c) {
|
|
2046
|
+
return {
|
|
2047
|
+
fieldName: pick(c, ['fieldName', 'name']),
|
|
2048
|
+
op: pick(c, ['op', 'operator']),
|
|
2049
|
+
value: c.value !== undefined ? c.value : '',
|
|
2050
|
+
relation: pick(c, ['relation', 'logic'], 'and')
|
|
2051
|
+
};
|
|
2052
|
+
});
|
|
2053
|
+
|
|
2054
|
+
// 已勾选表头字段:统一成字段名字符串数组
|
|
2055
|
+
var showFields = (queryConfig.showFields || []).map(function (s) {
|
|
2056
|
+
return typeof s === 'string' ? s : pick(s, ['name', 'fieldName']);
|
|
2057
|
+
});
|
|
2058
|
+
|
|
2059
|
+
return {
|
|
2060
|
+
id: pick(cfg, ['id'], id),
|
|
2061
|
+
name: pick(cfg, ['templateName', 'name'], templateName || ''),
|
|
2062
|
+
remark: pick(cfg.template, ['remark', 'description'], ''),
|
|
2063
|
+
mainTableName: mainTableName,
|
|
2064
|
+
mainTableId: mainTableId,
|
|
2065
|
+
fields: fields,
|
|
2066
|
+
conditions: conditions,
|
|
2067
|
+
showFields: showFields,
|
|
2068
|
+
operators: Array.isArray(cfg.operators) ? cfg.operators : [],
|
|
2069
|
+
queryJson: queryConfig
|
|
2070
|
+
};
|
|
2071
|
+
});
|
|
2072
|
+
},
|
|
2073
|
+
|
|
2074
|
+
// 导出查询结果 excel(浏览器下载)
|
|
2075
|
+
exportData: function exportData() {
|
|
2076
|
+
var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2077
|
+
|
|
2078
|
+
var queryJson = payload.queryJson;
|
|
2079
|
+
var body = {
|
|
2080
|
+
appId: resolveAppId(payload.appId),
|
|
2081
|
+
queryJson: typeof queryJson === 'string' ? queryJson : JSON.stringify(queryJson || {})
|
|
2082
|
+
};
|
|
2083
|
+
if (payload.templateId) {
|
|
2084
|
+
body.id = payload.templateId;
|
|
2085
|
+
}
|
|
2086
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('downloadPostRequest', { url: API_URLS.exportQueryData, params: __WEBPACK_IMPORTED_MODULE_1_qs___default.a.stringify(body), responseType: 'blob' }).then(function (data) {
|
|
2087
|
+
if (!data) {
|
|
2088
|
+
return;
|
|
2089
|
+
}
|
|
2090
|
+
// 导出失败时后端返回文本/JSON 错误信息
|
|
2091
|
+
if ((data.type === 'application/json' || data.type === 'text/plain') && typeof data.text === 'function') {
|
|
2092
|
+
return data.text().then(function (msg) {
|
|
2093
|
+
throw new Error(msg || '导出失败');
|
|
2094
|
+
});
|
|
2095
|
+
}
|
|
2096
|
+
var url = window.URL.createObjectURL(data);
|
|
2097
|
+
var a = document.createElement('a');
|
|
2098
|
+
a.href = url;
|
|
2099
|
+
a.download = (payload.templateName || '自定义查询') + '.xlsx';
|
|
2100
|
+
document.body.appendChild(a);
|
|
2101
|
+
a.click();
|
|
2102
|
+
window.URL.revokeObjectURL(url);
|
|
2103
|
+
document.body.removeChild(a);
|
|
2104
|
+
});
|
|
2105
|
+
},
|
|
2106
|
+
|
|
2107
|
+
// 获取查询脚本(标准sql / 调试sql),供“查看脚本”弹窗展示
|
|
2108
|
+
getQueryScript: function getQueryScript() {
|
|
2109
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2110
|
+
|
|
2111
|
+
var queryJson = params.queryJson;
|
|
2112
|
+
var body = {
|
|
2113
|
+
appId: resolveAppId(params.appId),
|
|
2114
|
+
queryJson: typeof queryJson === 'string' ? queryJson : JSON.stringify(queryJson || {})
|
|
2115
|
+
};
|
|
2116
|
+
return __WEBPACK_IMPORTED_MODULE_0__store__["a" /* default */].dispatch('postRequest', { url: API_URLS.queryScript, params: body }).then(function (data) {
|
|
2117
|
+
if (!data || !data.success) {
|
|
2118
|
+
return { success: false, sql: '', debugSql: '', params: [], msg: data && data.msg || '获取脚本失败' };
|
|
2119
|
+
}
|
|
2120
|
+
// sql/debugSql 直接位于响应根节点,兼容个别嵌套在 data 下的情况
|
|
2121
|
+
var d = data.data && (data.data.sql || data.data.debugSql) ? data.data : data;
|
|
2122
|
+
return {
|
|
2123
|
+
success: true,
|
|
2124
|
+
sql: pick(d, ['sql', 'standardSql', 'querySql'], ''),
|
|
2125
|
+
debugSql: pick(d, ['debugSql', 'debugSQL', 'debugsql'], ''),
|
|
2126
|
+
params: Array.isArray(d.params) ? d.params : []
|
|
2127
|
+
};
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
2131
|
+
|
|
2132
|
+
/* harmony default export */ __webpack_exports__["a"] = (realApi);
|
|
2133
|
+
|
|
2134
|
+
/***/ }),
|
|
2135
|
+
/* 143 */
|
|
2136
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2137
|
+
|
|
2138
|
+
"use strict";
|
|
2139
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(129);
|
|
2140
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
|
|
2141
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vuex__ = __webpack_require__(144);
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_1_vuex__["a" /* default */]);
|
|
2146
|
+
|
|
2147
|
+
/* harmony default export */ __webpack_exports__["a"] = (new __WEBPACK_IMPORTED_MODULE_1_vuex__["a" /* default */].Store());
|
|
2148
|
+
|
|
2149
|
+
/***/ }),
|
|
2150
|
+
/* 144 */
|
|
2151
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2152
|
+
|
|
2153
|
+
"use strict";
|
|
2154
|
+
/* WEBPACK VAR INJECTION */(function(global) {/* unused harmony export Store */
|
|
2155
|
+
/* unused harmony export createNamespacedHelpers */
|
|
2156
|
+
/* unused harmony export install */
|
|
2157
|
+
/* unused harmony export mapActions */
|
|
2158
|
+
/* unused harmony export mapGetters */
|
|
2159
|
+
/* unused harmony export mapMutations */
|
|
2160
|
+
/* unused harmony export mapState */
|
|
2161
|
+
/*!
|
|
2162
|
+
* vuex v3.4.0
|
|
2163
|
+
* (c) 2020 Evan You
|
|
2164
|
+
* @license MIT
|
|
2165
|
+
*/
|
|
2166
|
+
function applyMixin (Vue) {
|
|
2167
|
+
var version = Number(Vue.version.split('.')[0]);
|
|
2168
|
+
|
|
2169
|
+
if (version >= 2) {
|
|
2170
|
+
Vue.mixin({ beforeCreate: vuexInit });
|
|
2171
|
+
} else {
|
|
2172
|
+
// override init and inject vuex init procedure
|
|
2173
|
+
// for 1.x backwards compatibility.
|
|
2174
|
+
var _init = Vue.prototype._init;
|
|
2175
|
+
Vue.prototype._init = function (options) {
|
|
2176
|
+
if ( options === void 0 ) options = {};
|
|
2177
|
+
|
|
2178
|
+
options.init = options.init
|
|
2179
|
+
? [vuexInit].concat(options.init)
|
|
2180
|
+
: vuexInit;
|
|
2181
|
+
_init.call(this, options);
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
/**
|
|
2186
|
+
* Vuex init hook, injected into each instances init hooks list.
|
|
2187
|
+
*/
|
|
2188
|
+
|
|
2189
|
+
function vuexInit () {
|
|
2190
|
+
var options = this.$options;
|
|
2191
|
+
// store injection
|
|
2192
|
+
if (options.store) {
|
|
2193
|
+
this.$store = typeof options.store === 'function'
|
|
2194
|
+
? options.store()
|
|
2195
|
+
: options.store;
|
|
2196
|
+
} else if (options.parent && options.parent.$store) {
|
|
2197
|
+
this.$store = options.parent.$store;
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
var target = typeof window !== 'undefined'
|
|
2203
|
+
? window
|
|
2204
|
+
: typeof global !== 'undefined'
|
|
2205
|
+
? global
|
|
2206
|
+
: {};
|
|
2207
|
+
var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
2208
|
+
|
|
2209
|
+
function devtoolPlugin (store) {
|
|
2210
|
+
if (!devtoolHook) { return }
|
|
2211
|
+
|
|
2212
|
+
store._devtoolHook = devtoolHook;
|
|
2213
|
+
|
|
2214
|
+
devtoolHook.emit('vuex:init', store);
|
|
2215
|
+
|
|
2216
|
+
devtoolHook.on('vuex:travel-to-state', function (targetState) {
|
|
2217
|
+
store.replaceState(targetState);
|
|
2218
|
+
});
|
|
2219
|
+
|
|
2220
|
+
store.subscribe(function (mutation, state) {
|
|
2221
|
+
devtoolHook.emit('vuex:mutation', mutation, state);
|
|
2222
|
+
}, { prepend: true });
|
|
2223
|
+
|
|
2224
|
+
store.subscribeAction(function (action, state) {
|
|
2225
|
+
devtoolHook.emit('vuex:action', action, state);
|
|
2226
|
+
}, { prepend: true });
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* Get the first item that pass the test
|
|
2231
|
+
* by second argument function
|
|
2232
|
+
*
|
|
2233
|
+
* @param {Array} list
|
|
2234
|
+
* @param {Function} f
|
|
2235
|
+
* @return {*}
|
|
2236
|
+
*/
|
|
2237
|
+
|
|
2238
|
+
/**
|
|
2239
|
+
* forEach for object
|
|
2240
|
+
*/
|
|
2241
|
+
function forEachValue (obj, fn) {
|
|
2242
|
+
Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
function isObject (obj) {
|
|
2246
|
+
return obj !== null && typeof obj === 'object'
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
function isPromise (val) {
|
|
2250
|
+
return val && typeof val.then === 'function'
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
function assert (condition, msg) {
|
|
2254
|
+
if (!condition) { throw new Error(("[vuex] " + msg)) }
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
function partial (fn, arg) {
|
|
2258
|
+
return function () {
|
|
2259
|
+
return fn(arg)
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
// Base data struct for store's module, package with some attribute and method
|
|
2264
|
+
var Module = function Module (rawModule, runtime) {
|
|
2265
|
+
this.runtime = runtime;
|
|
2266
|
+
// Store some children item
|
|
2267
|
+
this._children = Object.create(null);
|
|
2268
|
+
// Store the origin module object which passed by programmer
|
|
2269
|
+
this._rawModule = rawModule;
|
|
2270
|
+
var rawState = rawModule.state;
|
|
2271
|
+
|
|
2272
|
+
// Store the origin module's state
|
|
2273
|
+
this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
|
|
2274
|
+
};
|
|
2275
|
+
|
|
2276
|
+
var prototypeAccessors = { namespaced: { configurable: true } };
|
|
2277
|
+
|
|
2278
|
+
prototypeAccessors.namespaced.get = function () {
|
|
2279
|
+
return !!this._rawModule.namespaced
|
|
2280
|
+
};
|
|
2281
|
+
|
|
2282
|
+
Module.prototype.addChild = function addChild (key, module) {
|
|
2283
|
+
this._children[key] = module;
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
Module.prototype.removeChild = function removeChild (key) {
|
|
2287
|
+
delete this._children[key];
|
|
2288
|
+
};
|
|
2289
|
+
|
|
2290
|
+
Module.prototype.getChild = function getChild (key) {
|
|
2291
|
+
return this._children[key]
|
|
2292
|
+
};
|
|
2293
|
+
|
|
2294
|
+
Module.prototype.hasChild = function hasChild (key) {
|
|
2295
|
+
return key in this._children
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
Module.prototype.update = function update (rawModule) {
|
|
2299
|
+
this._rawModule.namespaced = rawModule.namespaced;
|
|
2300
|
+
if (rawModule.actions) {
|
|
2301
|
+
this._rawModule.actions = rawModule.actions;
|
|
2302
|
+
}
|
|
2303
|
+
if (rawModule.mutations) {
|
|
2304
|
+
this._rawModule.mutations = rawModule.mutations;
|
|
2305
|
+
}
|
|
2306
|
+
if (rawModule.getters) {
|
|
2307
|
+
this._rawModule.getters = rawModule.getters;
|
|
2308
|
+
}
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2311
|
+
Module.prototype.forEachChild = function forEachChild (fn) {
|
|
2312
|
+
forEachValue(this._children, fn);
|
|
2313
|
+
};
|
|
2314
|
+
|
|
2315
|
+
Module.prototype.forEachGetter = function forEachGetter (fn) {
|
|
2316
|
+
if (this._rawModule.getters) {
|
|
2317
|
+
forEachValue(this._rawModule.getters, fn);
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
|
|
2321
|
+
Module.prototype.forEachAction = function forEachAction (fn) {
|
|
2322
|
+
if (this._rawModule.actions) {
|
|
2323
|
+
forEachValue(this._rawModule.actions, fn);
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2327
|
+
Module.prototype.forEachMutation = function forEachMutation (fn) {
|
|
2328
|
+
if (this._rawModule.mutations) {
|
|
2329
|
+
forEachValue(this._rawModule.mutations, fn);
|
|
2330
|
+
}
|
|
2331
|
+
};
|
|
2332
|
+
|
|
2333
|
+
Object.defineProperties( Module.prototype, prototypeAccessors );
|
|
2334
|
+
|
|
2335
|
+
var ModuleCollection = function ModuleCollection (rawRootModule) {
|
|
2336
|
+
// register root module (Vuex.Store options)
|
|
2337
|
+
this.register([], rawRootModule, false);
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
ModuleCollection.prototype.get = function get (path) {
|
|
2341
|
+
return path.reduce(function (module, key) {
|
|
2342
|
+
return module.getChild(key)
|
|
2343
|
+
}, this.root)
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2346
|
+
ModuleCollection.prototype.getNamespace = function getNamespace (path) {
|
|
2347
|
+
var module = this.root;
|
|
2348
|
+
return path.reduce(function (namespace, key) {
|
|
2349
|
+
module = module.getChild(key);
|
|
2350
|
+
return namespace + (module.namespaced ? key + '/' : '')
|
|
2351
|
+
}, '')
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
ModuleCollection.prototype.update = function update$1 (rawRootModule) {
|
|
2355
|
+
update([], this.root, rawRootModule);
|
|
2356
|
+
};
|
|
2357
|
+
|
|
2358
|
+
ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
|
|
2359
|
+
var this$1 = this;
|
|
2360
|
+
if ( runtime === void 0 ) runtime = true;
|
|
2361
|
+
|
|
2362
|
+
if ((false)) {
|
|
2363
|
+
assertRawModule(path, rawModule);
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
var newModule = new Module(rawModule, runtime);
|
|
2367
|
+
if (path.length === 0) {
|
|
2368
|
+
this.root = newModule;
|
|
2369
|
+
} else {
|
|
2370
|
+
var parent = this.get(path.slice(0, -1));
|
|
2371
|
+
parent.addChild(path[path.length - 1], newModule);
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
// register nested modules
|
|
2375
|
+
if (rawModule.modules) {
|
|
2376
|
+
forEachValue(rawModule.modules, function (rawChildModule, key) {
|
|
2377
|
+
this$1.register(path.concat(key), rawChildModule, runtime);
|
|
2378
|
+
});
|
|
2379
|
+
}
|
|
2380
|
+
};
|
|
2381
|
+
|
|
2382
|
+
ModuleCollection.prototype.unregister = function unregister (path) {
|
|
2383
|
+
var parent = this.get(path.slice(0, -1));
|
|
2384
|
+
var key = path[path.length - 1];
|
|
2385
|
+
if (!parent.getChild(key).runtime) { return }
|
|
2386
|
+
|
|
2387
|
+
parent.removeChild(key);
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
ModuleCollection.prototype.isRegistered = function isRegistered (path) {
|
|
2391
|
+
var parent = this.get(path.slice(0, -1));
|
|
2392
|
+
var key = path[path.length - 1];
|
|
2393
|
+
|
|
2394
|
+
return parent.hasChild(key)
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2397
|
+
function update (path, targetModule, newModule) {
|
|
2398
|
+
if ((false)) {
|
|
2399
|
+
assertRawModule(path, newModule);
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
// update target module
|
|
2403
|
+
targetModule.update(newModule);
|
|
2404
|
+
|
|
2405
|
+
// update nested modules
|
|
2406
|
+
if (newModule.modules) {
|
|
2407
|
+
for (var key in newModule.modules) {
|
|
2408
|
+
if (!targetModule.getChild(key)) {
|
|
2409
|
+
if ((false)) {
|
|
2410
|
+
console.warn(
|
|
2411
|
+
"[vuex] trying to add a new module '" + key + "' on hot reloading, " +
|
|
2412
|
+
'manual reload is needed'
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
return
|
|
2416
|
+
}
|
|
2417
|
+
update(
|
|
2418
|
+
path.concat(key),
|
|
2419
|
+
targetModule.getChild(key),
|
|
2420
|
+
newModule.modules[key]
|
|
2421
|
+
);
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
var functionAssert = {
|
|
2427
|
+
assert: function (value) { return typeof value === 'function'; },
|
|
2428
|
+
expected: 'function'
|
|
2429
|
+
};
|
|
2430
|
+
|
|
2431
|
+
var objectAssert = {
|
|
2432
|
+
assert: function (value) { return typeof value === 'function' ||
|
|
2433
|
+
(typeof value === 'object' && typeof value.handler === 'function'); },
|
|
2434
|
+
expected: 'function or object with "handler" function'
|
|
2435
|
+
};
|
|
2436
|
+
|
|
2437
|
+
var assertTypes = {
|
|
2438
|
+
getters: functionAssert,
|
|
2439
|
+
mutations: functionAssert,
|
|
2440
|
+
actions: objectAssert
|
|
2441
|
+
};
|
|
2442
|
+
|
|
2443
|
+
function assertRawModule (path, rawModule) {
|
|
2444
|
+
Object.keys(assertTypes).forEach(function (key) {
|
|
2445
|
+
if (!rawModule[key]) { return }
|
|
2446
|
+
|
|
2447
|
+
var assertOptions = assertTypes[key];
|
|
2448
|
+
|
|
2449
|
+
forEachValue(rawModule[key], function (value, type) {
|
|
2450
|
+
assert(
|
|
2451
|
+
assertOptions.assert(value),
|
|
2452
|
+
makeAssertionMessage(path, key, type, value, assertOptions.expected)
|
|
2453
|
+
);
|
|
2454
|
+
});
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
function makeAssertionMessage (path, key, type, value, expected) {
|
|
2459
|
+
var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
|
|
2460
|
+
if (path.length > 0) {
|
|
2461
|
+
buf += " in module \"" + (path.join('.')) + "\"";
|
|
2462
|
+
}
|
|
2463
|
+
buf += " is " + (JSON.stringify(value)) + ".";
|
|
2464
|
+
return buf
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
var Vue; // bind on install
|
|
2468
|
+
|
|
2469
|
+
var Store = function Store (options) {
|
|
2470
|
+
var this$1 = this;
|
|
2471
|
+
if ( options === void 0 ) options = {};
|
|
2472
|
+
|
|
2473
|
+
// Auto install if it is not done yet and `window` has `Vue`.
|
|
2474
|
+
// To allow users to avoid auto-installation in some cases,
|
|
2475
|
+
// this code should be placed here. See #731
|
|
2476
|
+
if (!Vue && typeof window !== 'undefined' && window.Vue) {
|
|
2477
|
+
install(window.Vue);
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
if ((false)) {
|
|
2481
|
+
assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
|
|
2482
|
+
assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
|
|
2483
|
+
assert(this instanceof Store, "store must be called with the new operator.");
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
|
|
2487
|
+
var strict = options.strict; if ( strict === void 0 ) strict = false;
|
|
2488
|
+
|
|
2489
|
+
// store internal state
|
|
2490
|
+
this._committing = false;
|
|
2491
|
+
this._actions = Object.create(null);
|
|
2492
|
+
this._actionSubscribers = [];
|
|
2493
|
+
this._mutations = Object.create(null);
|
|
2494
|
+
this._wrappedGetters = Object.create(null);
|
|
2495
|
+
this._modules = new ModuleCollection(options);
|
|
2496
|
+
this._modulesNamespaceMap = Object.create(null);
|
|
2497
|
+
this._subscribers = [];
|
|
2498
|
+
this._watcherVM = new Vue();
|
|
2499
|
+
this._makeLocalGettersCache = Object.create(null);
|
|
2500
|
+
|
|
2501
|
+
// bind commit and dispatch to self
|
|
2502
|
+
var store = this;
|
|
2503
|
+
var ref = this;
|
|
2504
|
+
var dispatch = ref.dispatch;
|
|
2505
|
+
var commit = ref.commit;
|
|
2506
|
+
this.dispatch = function boundDispatch (type, payload) {
|
|
2507
|
+
return dispatch.call(store, type, payload)
|
|
2508
|
+
};
|
|
2509
|
+
this.commit = function boundCommit (type, payload, options) {
|
|
2510
|
+
return commit.call(store, type, payload, options)
|
|
2511
|
+
};
|
|
2512
|
+
|
|
2513
|
+
// strict mode
|
|
2514
|
+
this.strict = strict;
|
|
2515
|
+
|
|
2516
|
+
var state = this._modules.root.state;
|
|
2517
|
+
|
|
2518
|
+
// init root module.
|
|
2519
|
+
// this also recursively registers all sub-modules
|
|
2520
|
+
// and collects all module getters inside this._wrappedGetters
|
|
2521
|
+
installModule(this, state, [], this._modules.root);
|
|
2522
|
+
|
|
2523
|
+
// initialize the store vm, which is responsible for the reactivity
|
|
2524
|
+
// (also registers _wrappedGetters as computed properties)
|
|
2525
|
+
resetStoreVM(this, state);
|
|
2526
|
+
|
|
2527
|
+
// apply plugins
|
|
2528
|
+
plugins.forEach(function (plugin) { return plugin(this$1); });
|
|
2529
|
+
|
|
2530
|
+
var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
|
|
2531
|
+
if (useDevtools) {
|
|
2532
|
+
devtoolPlugin(this);
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
|
|
2536
|
+
var prototypeAccessors$1 = { state: { configurable: true } };
|
|
2537
|
+
|
|
2538
|
+
prototypeAccessors$1.state.get = function () {
|
|
2539
|
+
return this._vm._data.$$state
|
|
2540
|
+
};
|
|
2541
|
+
|
|
2542
|
+
prototypeAccessors$1.state.set = function (v) {
|
|
2543
|
+
if ((false)) {
|
|
2544
|
+
assert(false, "use store.replaceState() to explicit replace store state.");
|
|
2545
|
+
}
|
|
2546
|
+
};
|
|
2547
|
+
|
|
2548
|
+
Store.prototype.commit = function commit (_type, _payload, _options) {
|
|
2549
|
+
var this$1 = this;
|
|
2550
|
+
|
|
2551
|
+
// check object-style commit
|
|
2552
|
+
var ref = unifyObjectStyle(_type, _payload, _options);
|
|
2553
|
+
var type = ref.type;
|
|
2554
|
+
var payload = ref.payload;
|
|
2555
|
+
var options = ref.options;
|
|
2556
|
+
|
|
2557
|
+
var mutation = { type: type, payload: payload };
|
|
2558
|
+
var entry = this._mutations[type];
|
|
2559
|
+
if (!entry) {
|
|
2560
|
+
if ((false)) {
|
|
2561
|
+
console.error(("[vuex] unknown mutation type: " + type));
|
|
2562
|
+
}
|
|
2563
|
+
return
|
|
2564
|
+
}
|
|
2565
|
+
this._withCommit(function () {
|
|
2566
|
+
entry.forEach(function commitIterator (handler) {
|
|
2567
|
+
handler(payload);
|
|
2568
|
+
});
|
|
2569
|
+
});
|
|
2570
|
+
|
|
2571
|
+
this._subscribers
|
|
2572
|
+
.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
|
2573
|
+
.forEach(function (sub) { return sub(mutation, this$1.state); });
|
|
2574
|
+
|
|
2575
|
+
if (
|
|
2576
|
+
false
|
|
2577
|
+
) {
|
|
2578
|
+
console.warn(
|
|
2579
|
+
"[vuex] mutation type: " + type + ". Silent option has been removed. " +
|
|
2580
|
+
'Use the filter functionality in the vue-devtools'
|
|
2581
|
+
);
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2584
|
+
|
|
2585
|
+
Store.prototype.dispatch = function dispatch (_type, _payload) {
|
|
2586
|
+
var this$1 = this;
|
|
2587
|
+
|
|
2588
|
+
// check object-style dispatch
|
|
2589
|
+
var ref = unifyObjectStyle(_type, _payload);
|
|
2590
|
+
var type = ref.type;
|
|
2591
|
+
var payload = ref.payload;
|
|
2592
|
+
|
|
2593
|
+
var action = { type: type, payload: payload };
|
|
2594
|
+
var entry = this._actions[type];
|
|
2595
|
+
if (!entry) {
|
|
2596
|
+
if ((false)) {
|
|
2597
|
+
console.error(("[vuex] unknown action type: " + type));
|
|
2598
|
+
}
|
|
2599
|
+
return
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
try {
|
|
2603
|
+
this._actionSubscribers
|
|
2604
|
+
.slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
|
|
2605
|
+
.filter(function (sub) { return sub.before; })
|
|
2606
|
+
.forEach(function (sub) { return sub.before(action, this$1.state); });
|
|
2607
|
+
} catch (e) {
|
|
2608
|
+
if ((false)) {
|
|
2609
|
+
console.warn("[vuex] error in before action subscribers: ");
|
|
2610
|
+
console.error(e);
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
var result = entry.length > 1
|
|
2615
|
+
? Promise.all(entry.map(function (handler) { return handler(payload); }))
|
|
2616
|
+
: entry[0](payload);
|
|
2617
|
+
|
|
2618
|
+
return new Promise(function (resolve, reject) {
|
|
2619
|
+
result.then(function (res) {
|
|
2620
|
+
try {
|
|
2621
|
+
this$1._actionSubscribers
|
|
2622
|
+
.filter(function (sub) { return sub.after; })
|
|
2623
|
+
.forEach(function (sub) { return sub.after(action, this$1.state); });
|
|
2624
|
+
} catch (e) {
|
|
2625
|
+
if ((false)) {
|
|
2626
|
+
console.warn("[vuex] error in after action subscribers: ");
|
|
2627
|
+
console.error(e);
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
resolve(res);
|
|
2631
|
+
}, function (error) {
|
|
2632
|
+
try {
|
|
2633
|
+
this$1._actionSubscribers
|
|
2634
|
+
.filter(function (sub) { return sub.error; })
|
|
2635
|
+
.forEach(function (sub) { return sub.error(action, this$1.state, error); });
|
|
2636
|
+
} catch (e) {
|
|
2637
|
+
if ((false)) {
|
|
2638
|
+
console.warn("[vuex] error in error action subscribers: ");
|
|
2639
|
+
console.error(e);
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
reject(error);
|
|
2643
|
+
});
|
|
2644
|
+
})
|
|
2645
|
+
};
|
|
2646
|
+
|
|
2647
|
+
Store.prototype.subscribe = function subscribe (fn, options) {
|
|
2648
|
+
return genericSubscribe(fn, this._subscribers, options)
|
|
2649
|
+
};
|
|
2650
|
+
|
|
2651
|
+
Store.prototype.subscribeAction = function subscribeAction (fn, options) {
|
|
2652
|
+
var subs = typeof fn === 'function' ? { before: fn } : fn;
|
|
2653
|
+
return genericSubscribe(subs, this._actionSubscribers, options)
|
|
2654
|
+
};
|
|
2655
|
+
|
|
2656
|
+
Store.prototype.watch = function watch (getter, cb, options) {
|
|
2657
|
+
var this$1 = this;
|
|
2658
|
+
|
|
2659
|
+
if ((false)) {
|
|
2660
|
+
assert(typeof getter === 'function', "store.watch only accepts a function.");
|
|
2661
|
+
}
|
|
2662
|
+
return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
Store.prototype.replaceState = function replaceState (state) {
|
|
2666
|
+
var this$1 = this;
|
|
2667
|
+
|
|
2668
|
+
this._withCommit(function () {
|
|
2669
|
+
this$1._vm._data.$$state = state;
|
|
2670
|
+
});
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
Store.prototype.registerModule = function registerModule (path, rawModule, options) {
|
|
2674
|
+
if ( options === void 0 ) options = {};
|
|
2675
|
+
|
|
2676
|
+
if (typeof path === 'string') { path = [path]; }
|
|
2677
|
+
|
|
2678
|
+
if ((false)) {
|
|
2679
|
+
assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
2680
|
+
assert(path.length > 0, 'cannot register the root module by using registerModule.');
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
this._modules.register(path, rawModule);
|
|
2684
|
+
installModule(this, this.state, path, this._modules.get(path), options.preserveState);
|
|
2685
|
+
// reset store to update getters...
|
|
2686
|
+
resetStoreVM(this, this.state);
|
|
2687
|
+
};
|
|
2688
|
+
|
|
2689
|
+
Store.prototype.unregisterModule = function unregisterModule (path) {
|
|
2690
|
+
var this$1 = this;
|
|
2691
|
+
|
|
2692
|
+
if (typeof path === 'string') { path = [path]; }
|
|
2693
|
+
|
|
2694
|
+
if ((false)) {
|
|
2695
|
+
assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
this._modules.unregister(path);
|
|
2699
|
+
this._withCommit(function () {
|
|
2700
|
+
var parentState = getNestedState(this$1.state, path.slice(0, -1));
|
|
2701
|
+
Vue.delete(parentState, path[path.length - 1]);
|
|
2702
|
+
});
|
|
2703
|
+
resetStore(this);
|
|
2704
|
+
};
|
|
2705
|
+
|
|
2706
|
+
Store.prototype.hasModule = function hasModule (path) {
|
|
2707
|
+
if (typeof path === 'string') { path = [path]; }
|
|
2708
|
+
|
|
2709
|
+
if ((false)) {
|
|
2710
|
+
assert(Array.isArray(path), "module path must be a string or an Array.");
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
return this._modules.isRegistered(path)
|
|
2714
|
+
};
|
|
2715
|
+
|
|
2716
|
+
Store.prototype.hotUpdate = function hotUpdate (newOptions) {
|
|
2717
|
+
this._modules.update(newOptions);
|
|
2718
|
+
resetStore(this, true);
|
|
2719
|
+
};
|
|
2720
|
+
|
|
2721
|
+
Store.prototype._withCommit = function _withCommit (fn) {
|
|
2722
|
+
var committing = this._committing;
|
|
2723
|
+
this._committing = true;
|
|
2724
|
+
fn();
|
|
2725
|
+
this._committing = committing;
|
|
2726
|
+
};
|
|
2727
|
+
|
|
2728
|
+
Object.defineProperties( Store.prototype, prototypeAccessors$1 );
|
|
2729
|
+
|
|
2730
|
+
function genericSubscribe (fn, subs, options) {
|
|
2731
|
+
if (subs.indexOf(fn) < 0) {
|
|
2732
|
+
options && options.prepend
|
|
2733
|
+
? subs.unshift(fn)
|
|
2734
|
+
: subs.push(fn);
|
|
2735
|
+
}
|
|
2736
|
+
return function () {
|
|
2737
|
+
var i = subs.indexOf(fn);
|
|
2738
|
+
if (i > -1) {
|
|
2739
|
+
subs.splice(i, 1);
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
function resetStore (store, hot) {
|
|
2745
|
+
store._actions = Object.create(null);
|
|
2746
|
+
store._mutations = Object.create(null);
|
|
2747
|
+
store._wrappedGetters = Object.create(null);
|
|
2748
|
+
store._modulesNamespaceMap = Object.create(null);
|
|
2749
|
+
var state = store.state;
|
|
2750
|
+
// init all modules
|
|
2751
|
+
installModule(store, state, [], store._modules.root, true);
|
|
2752
|
+
// reset vm
|
|
2753
|
+
resetStoreVM(store, state, hot);
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
function resetStoreVM (store, state, hot) {
|
|
2757
|
+
var oldVm = store._vm;
|
|
2758
|
+
|
|
2759
|
+
// bind store public getters
|
|
2760
|
+
store.getters = {};
|
|
2761
|
+
// reset local getters cache
|
|
2762
|
+
store._makeLocalGettersCache = Object.create(null);
|
|
2763
|
+
var wrappedGetters = store._wrappedGetters;
|
|
2764
|
+
var computed = {};
|
|
2765
|
+
forEachValue(wrappedGetters, function (fn, key) {
|
|
2766
|
+
// use computed to leverage its lazy-caching mechanism
|
|
2767
|
+
// direct inline function use will lead to closure preserving oldVm.
|
|
2768
|
+
// using partial to return function with only arguments preserved in closure environment.
|
|
2769
|
+
computed[key] = partial(fn, store);
|
|
2770
|
+
Object.defineProperty(store.getters, key, {
|
|
2771
|
+
get: function () { return store._vm[key]; },
|
|
2772
|
+
enumerable: true // for local getters
|
|
2773
|
+
});
|
|
2774
|
+
});
|
|
2775
|
+
|
|
2776
|
+
// use a Vue instance to store the state tree
|
|
2777
|
+
// suppress warnings just in case the user has added
|
|
2778
|
+
// some funky global mixins
|
|
2779
|
+
var silent = Vue.config.silent;
|
|
2780
|
+
Vue.config.silent = true;
|
|
2781
|
+
store._vm = new Vue({
|
|
2782
|
+
data: {
|
|
2783
|
+
$$state: state
|
|
2784
|
+
},
|
|
2785
|
+
computed: computed
|
|
2786
|
+
});
|
|
2787
|
+
Vue.config.silent = silent;
|
|
2788
|
+
|
|
2789
|
+
// enable strict mode for new vm
|
|
2790
|
+
if (store.strict) {
|
|
2791
|
+
enableStrictMode(store);
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
if (oldVm) {
|
|
2795
|
+
if (hot) {
|
|
2796
|
+
// dispatch changes in all subscribed watchers
|
|
2797
|
+
// to force getter re-evaluation for hot reloading.
|
|
2798
|
+
store._withCommit(function () {
|
|
2799
|
+
oldVm._data.$$state = null;
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
Vue.nextTick(function () { return oldVm.$destroy(); });
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
function installModule (store, rootState, path, module, hot) {
|
|
2807
|
+
var isRoot = !path.length;
|
|
2808
|
+
var namespace = store._modules.getNamespace(path);
|
|
2809
|
+
|
|
2810
|
+
// register in namespace map
|
|
2811
|
+
if (module.namespaced) {
|
|
2812
|
+
if (store._modulesNamespaceMap[namespace] && ("production" !== 'production')) {
|
|
2813
|
+
console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
|
|
2814
|
+
}
|
|
2815
|
+
store._modulesNamespaceMap[namespace] = module;
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
// set state
|
|
2819
|
+
if (!isRoot && !hot) {
|
|
2820
|
+
var parentState = getNestedState(rootState, path.slice(0, -1));
|
|
2821
|
+
var moduleName = path[path.length - 1];
|
|
2822
|
+
store._withCommit(function () {
|
|
2823
|
+
if ((false)) {
|
|
2824
|
+
if (moduleName in parentState) {
|
|
2825
|
+
console.warn(
|
|
2826
|
+
("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
|
|
2827
|
+
);
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
Vue.set(parentState, moduleName, module.state);
|
|
2831
|
+
});
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
var local = module.context = makeLocalContext(store, namespace, path);
|
|
2835
|
+
|
|
2836
|
+
module.forEachMutation(function (mutation, key) {
|
|
2837
|
+
var namespacedType = namespace + key;
|
|
2838
|
+
registerMutation(store, namespacedType, mutation, local);
|
|
2839
|
+
});
|
|
2840
|
+
|
|
2841
|
+
module.forEachAction(function (action, key) {
|
|
2842
|
+
var type = action.root ? key : namespace + key;
|
|
2843
|
+
var handler = action.handler || action;
|
|
2844
|
+
registerAction(store, type, handler, local);
|
|
2845
|
+
});
|
|
2846
|
+
|
|
2847
|
+
module.forEachGetter(function (getter, key) {
|
|
2848
|
+
var namespacedType = namespace + key;
|
|
2849
|
+
registerGetter(store, namespacedType, getter, local);
|
|
2850
|
+
});
|
|
2851
|
+
|
|
2852
|
+
module.forEachChild(function (child, key) {
|
|
2853
|
+
installModule(store, rootState, path.concat(key), child, hot);
|
|
2854
|
+
});
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
/**
|
|
2858
|
+
* make localized dispatch, commit, getters and state
|
|
2859
|
+
* if there is no namespace, just use root ones
|
|
2860
|
+
*/
|
|
2861
|
+
function makeLocalContext (store, namespace, path) {
|
|
2862
|
+
var noNamespace = namespace === '';
|
|
2863
|
+
|
|
2864
|
+
var local = {
|
|
2865
|
+
dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
|
|
2866
|
+
var args = unifyObjectStyle(_type, _payload, _options);
|
|
2867
|
+
var payload = args.payload;
|
|
2868
|
+
var options = args.options;
|
|
2869
|
+
var type = args.type;
|
|
2870
|
+
|
|
2871
|
+
if (!options || !options.root) {
|
|
2872
|
+
type = namespace + type;
|
|
2873
|
+
if (false) {
|
|
2874
|
+
console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
|
|
2875
|
+
return
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
return store.dispatch(type, payload)
|
|
2880
|
+
},
|
|
2881
|
+
|
|
2882
|
+
commit: noNamespace ? store.commit : function (_type, _payload, _options) {
|
|
2883
|
+
var args = unifyObjectStyle(_type, _payload, _options);
|
|
2884
|
+
var payload = args.payload;
|
|
2885
|
+
var options = args.options;
|
|
2886
|
+
var type = args.type;
|
|
2887
|
+
|
|
2888
|
+
if (!options || !options.root) {
|
|
2889
|
+
type = namespace + type;
|
|
2890
|
+
if (false) {
|
|
2891
|
+
console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
|
|
2892
|
+
return
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
store.commit(type, payload, options);
|
|
2897
|
+
}
|
|
2898
|
+
};
|
|
2899
|
+
|
|
2900
|
+
// getters and state object must be gotten lazily
|
|
2901
|
+
// because they will be changed by vm update
|
|
2902
|
+
Object.defineProperties(local, {
|
|
2903
|
+
getters: {
|
|
2904
|
+
get: noNamespace
|
|
2905
|
+
? function () { return store.getters; }
|
|
2906
|
+
: function () { return makeLocalGetters(store, namespace); }
|
|
2907
|
+
},
|
|
2908
|
+
state: {
|
|
2909
|
+
get: function () { return getNestedState(store.state, path); }
|
|
2910
|
+
}
|
|
2911
|
+
});
|
|
2912
|
+
|
|
2913
|
+
return local
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
function makeLocalGetters (store, namespace) {
|
|
2917
|
+
if (!store._makeLocalGettersCache[namespace]) {
|
|
2918
|
+
var gettersProxy = {};
|
|
2919
|
+
var splitPos = namespace.length;
|
|
2920
|
+
Object.keys(store.getters).forEach(function (type) {
|
|
2921
|
+
// skip if the target getter is not match this namespace
|
|
2922
|
+
if (type.slice(0, splitPos) !== namespace) { return }
|
|
2923
|
+
|
|
2924
|
+
// extract local getter type
|
|
2925
|
+
var localType = type.slice(splitPos);
|
|
2926
|
+
|
|
2927
|
+
// Add a port to the getters proxy.
|
|
2928
|
+
// Define as getter property because
|
|
2929
|
+
// we do not want to evaluate the getters in this time.
|
|
2930
|
+
Object.defineProperty(gettersProxy, localType, {
|
|
2931
|
+
get: function () { return store.getters[type]; },
|
|
2932
|
+
enumerable: true
|
|
2933
|
+
});
|
|
2934
|
+
});
|
|
2935
|
+
store._makeLocalGettersCache[namespace] = gettersProxy;
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
return store._makeLocalGettersCache[namespace]
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
function registerMutation (store, type, handler, local) {
|
|
2942
|
+
var entry = store._mutations[type] || (store._mutations[type] = []);
|
|
2943
|
+
entry.push(function wrappedMutationHandler (payload) {
|
|
2944
|
+
handler.call(store, local.state, payload);
|
|
2945
|
+
});
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
function registerAction (store, type, handler, local) {
|
|
2949
|
+
var entry = store._actions[type] || (store._actions[type] = []);
|
|
2950
|
+
entry.push(function wrappedActionHandler (payload) {
|
|
2951
|
+
var res = handler.call(store, {
|
|
2952
|
+
dispatch: local.dispatch,
|
|
2953
|
+
commit: local.commit,
|
|
2954
|
+
getters: local.getters,
|
|
2955
|
+
state: local.state,
|
|
2956
|
+
rootGetters: store.getters,
|
|
2957
|
+
rootState: store.state
|
|
2958
|
+
}, payload);
|
|
2959
|
+
if (!isPromise(res)) {
|
|
2960
|
+
res = Promise.resolve(res);
|
|
2961
|
+
}
|
|
2962
|
+
if (store._devtoolHook) {
|
|
2963
|
+
return res.catch(function (err) {
|
|
2964
|
+
store._devtoolHook.emit('vuex:error', err);
|
|
2965
|
+
throw err
|
|
2966
|
+
})
|
|
2967
|
+
} else {
|
|
2968
|
+
return res
|
|
2969
|
+
}
|
|
2970
|
+
});
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
function registerGetter (store, type, rawGetter, local) {
|
|
2974
|
+
if (store._wrappedGetters[type]) {
|
|
2975
|
+
if ((false)) {
|
|
2976
|
+
console.error(("[vuex] duplicate getter key: " + type));
|
|
2977
|
+
}
|
|
2978
|
+
return
|
|
2979
|
+
}
|
|
2980
|
+
store._wrappedGetters[type] = function wrappedGetter (store) {
|
|
2981
|
+
return rawGetter(
|
|
2982
|
+
local.state, // local state
|
|
2983
|
+
local.getters, // local getters
|
|
2984
|
+
store.state, // root state
|
|
2985
|
+
store.getters // root getters
|
|
2986
|
+
)
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
function enableStrictMode (store) {
|
|
2991
|
+
store._vm.$watch(function () { return this._data.$$state }, function () {
|
|
2992
|
+
if ((false)) {
|
|
2993
|
+
assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
|
|
2994
|
+
}
|
|
2995
|
+
}, { deep: true, sync: true });
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
function getNestedState (state, path) {
|
|
2999
|
+
return path.reduce(function (state, key) { return state[key]; }, state)
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
function unifyObjectStyle (type, payload, options) {
|
|
3003
|
+
if (isObject(type) && type.type) {
|
|
3004
|
+
options = payload;
|
|
3005
|
+
payload = type;
|
|
3006
|
+
type = type.type;
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
if ((false)) {
|
|
3010
|
+
assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
return { type: type, payload: payload, options: options }
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
function install (_Vue) {
|
|
3017
|
+
if (Vue && _Vue === Vue) {
|
|
3018
|
+
if ((false)) {
|
|
3019
|
+
console.error(
|
|
3020
|
+
'[vuex] already installed. Vue.use(Vuex) should be called only once.'
|
|
3021
|
+
);
|
|
3022
|
+
}
|
|
3023
|
+
return
|
|
3024
|
+
}
|
|
3025
|
+
Vue = _Vue;
|
|
3026
|
+
applyMixin(Vue);
|
|
3027
|
+
}
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* Reduce the code which written in Vue.js for getting the state.
|
|
3031
|
+
* @param {String} [namespace] - Module's namespace
|
|
3032
|
+
* @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
|
|
3033
|
+
* @param {Object}
|
|
3034
|
+
*/
|
|
3035
|
+
var mapState = normalizeNamespace(function (namespace, states) {
|
|
3036
|
+
var res = {};
|
|
3037
|
+
if (false) {
|
|
3038
|
+
console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
|
|
3039
|
+
}
|
|
3040
|
+
normalizeMap(states).forEach(function (ref) {
|
|
3041
|
+
var key = ref.key;
|
|
3042
|
+
var val = ref.val;
|
|
3043
|
+
|
|
3044
|
+
res[key] = function mappedState () {
|
|
3045
|
+
var state = this.$store.state;
|
|
3046
|
+
var getters = this.$store.getters;
|
|
3047
|
+
if (namespace) {
|
|
3048
|
+
var module = getModuleByNamespace(this.$store, 'mapState', namespace);
|
|
3049
|
+
if (!module) {
|
|
3050
|
+
return
|
|
3051
|
+
}
|
|
3052
|
+
state = module.context.state;
|
|
3053
|
+
getters = module.context.getters;
|
|
3054
|
+
}
|
|
3055
|
+
return typeof val === 'function'
|
|
3056
|
+
? val.call(this, state, getters)
|
|
3057
|
+
: state[val]
|
|
3058
|
+
};
|
|
3059
|
+
// mark vuex getter for devtools
|
|
3060
|
+
res[key].vuex = true;
|
|
3061
|
+
});
|
|
3062
|
+
return res
|
|
3063
|
+
});
|
|
3064
|
+
|
|
3065
|
+
/**
|
|
3066
|
+
* Reduce the code which written in Vue.js for committing the mutation
|
|
3067
|
+
* @param {String} [namespace] - Module's namespace
|
|
3068
|
+
* @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
|
3069
|
+
* @return {Object}
|
|
3070
|
+
*/
|
|
3071
|
+
var mapMutations = normalizeNamespace(function (namespace, mutations) {
|
|
3072
|
+
var res = {};
|
|
3073
|
+
if (false) {
|
|
3074
|
+
console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
|
|
3075
|
+
}
|
|
3076
|
+
normalizeMap(mutations).forEach(function (ref) {
|
|
3077
|
+
var key = ref.key;
|
|
3078
|
+
var val = ref.val;
|
|
3079
|
+
|
|
3080
|
+
res[key] = function mappedMutation () {
|
|
3081
|
+
var args = [], len = arguments.length;
|
|
3082
|
+
while ( len-- ) args[ len ] = arguments[ len ];
|
|
3083
|
+
|
|
3084
|
+
// Get the commit method from store
|
|
3085
|
+
var commit = this.$store.commit;
|
|
3086
|
+
if (namespace) {
|
|
3087
|
+
var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
|
|
3088
|
+
if (!module) {
|
|
3089
|
+
return
|
|
3090
|
+
}
|
|
3091
|
+
commit = module.context.commit;
|
|
3092
|
+
}
|
|
3093
|
+
return typeof val === 'function'
|
|
3094
|
+
? val.apply(this, [commit].concat(args))
|
|
3095
|
+
: commit.apply(this.$store, [val].concat(args))
|
|
3096
|
+
};
|
|
3097
|
+
});
|
|
3098
|
+
return res
|
|
3099
|
+
});
|
|
3100
|
+
|
|
3101
|
+
/**
|
|
3102
|
+
* Reduce the code which written in Vue.js for getting the getters
|
|
3103
|
+
* @param {String} [namespace] - Module's namespace
|
|
3104
|
+
* @param {Object|Array} getters
|
|
3105
|
+
* @return {Object}
|
|
3106
|
+
*/
|
|
3107
|
+
var mapGetters = normalizeNamespace(function (namespace, getters) {
|
|
3108
|
+
var res = {};
|
|
3109
|
+
if (false) {
|
|
3110
|
+
console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
|
|
3111
|
+
}
|
|
3112
|
+
normalizeMap(getters).forEach(function (ref) {
|
|
3113
|
+
var key = ref.key;
|
|
3114
|
+
var val = ref.val;
|
|
3115
|
+
|
|
3116
|
+
// The namespace has been mutated by normalizeNamespace
|
|
3117
|
+
val = namespace + val;
|
|
3118
|
+
res[key] = function mappedGetter () {
|
|
3119
|
+
if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
|
|
3120
|
+
return
|
|
3121
|
+
}
|
|
3122
|
+
if (false) {
|
|
3123
|
+
console.error(("[vuex] unknown getter: " + val));
|
|
3124
|
+
return
|
|
3125
|
+
}
|
|
3126
|
+
return this.$store.getters[val]
|
|
3127
|
+
};
|
|
3128
|
+
// mark vuex getter for devtools
|
|
3129
|
+
res[key].vuex = true;
|
|
3130
|
+
});
|
|
3131
|
+
return res
|
|
3132
|
+
});
|
|
3133
|
+
|
|
3134
|
+
/**
|
|
3135
|
+
* Reduce the code which written in Vue.js for dispatch the action
|
|
3136
|
+
* @param {String} [namespace] - Module's namespace
|
|
3137
|
+
* @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
|
|
3138
|
+
* @return {Object}
|
|
3139
|
+
*/
|
|
3140
|
+
var mapActions = normalizeNamespace(function (namespace, actions) {
|
|
3141
|
+
var res = {};
|
|
3142
|
+
if (false) {
|
|
3143
|
+
console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
|
|
3144
|
+
}
|
|
3145
|
+
normalizeMap(actions).forEach(function (ref) {
|
|
3146
|
+
var key = ref.key;
|
|
3147
|
+
var val = ref.val;
|
|
3148
|
+
|
|
3149
|
+
res[key] = function mappedAction () {
|
|
3150
|
+
var args = [], len = arguments.length;
|
|
3151
|
+
while ( len-- ) args[ len ] = arguments[ len ];
|
|
3152
|
+
|
|
3153
|
+
// get dispatch function from store
|
|
3154
|
+
var dispatch = this.$store.dispatch;
|
|
3155
|
+
if (namespace) {
|
|
3156
|
+
var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
|
|
3157
|
+
if (!module) {
|
|
3158
|
+
return
|
|
3159
|
+
}
|
|
3160
|
+
dispatch = module.context.dispatch;
|
|
3161
|
+
}
|
|
3162
|
+
return typeof val === 'function'
|
|
3163
|
+
? val.apply(this, [dispatch].concat(args))
|
|
3164
|
+
: dispatch.apply(this.$store, [val].concat(args))
|
|
3165
|
+
};
|
|
3166
|
+
});
|
|
3167
|
+
return res
|
|
3168
|
+
});
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
|
|
3172
|
+
* @param {String} namespace
|
|
3173
|
+
* @return {Object}
|
|
3174
|
+
*/
|
|
3175
|
+
var createNamespacedHelpers = function (namespace) { return ({
|
|
3176
|
+
mapState: mapState.bind(null, namespace),
|
|
3177
|
+
mapGetters: mapGetters.bind(null, namespace),
|
|
3178
|
+
mapMutations: mapMutations.bind(null, namespace),
|
|
3179
|
+
mapActions: mapActions.bind(null, namespace)
|
|
3180
|
+
}); };
|
|
3181
|
+
|
|
3182
|
+
/**
|
|
3183
|
+
* Normalize the map
|
|
3184
|
+
* normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
|
|
3185
|
+
* normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
|
|
3186
|
+
* @param {Array|Object} map
|
|
3187
|
+
* @return {Object}
|
|
3188
|
+
*/
|
|
3189
|
+
function normalizeMap (map) {
|
|
3190
|
+
if (!isValidMap(map)) {
|
|
3191
|
+
return []
|
|
3192
|
+
}
|
|
3193
|
+
return Array.isArray(map)
|
|
3194
|
+
? map.map(function (key) { return ({ key: key, val: key }); })
|
|
3195
|
+
: Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
|
|
3196
|
+
}
|
|
3197
|
+
|
|
3198
|
+
/**
|
|
3199
|
+
* Validate whether given map is valid or not
|
|
3200
|
+
* @param {*} map
|
|
3201
|
+
* @return {Boolean}
|
|
3202
|
+
*/
|
|
3203
|
+
function isValidMap (map) {
|
|
3204
|
+
return Array.isArray(map) || isObject(map)
|
|
3205
|
+
}
|
|
3206
|
+
|
|
3207
|
+
/**
|
|
3208
|
+
* Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
|
|
3209
|
+
* @param {Function} fn
|
|
3210
|
+
* @return {Function}
|
|
3211
|
+
*/
|
|
3212
|
+
function normalizeNamespace (fn) {
|
|
3213
|
+
return function (namespace, map) {
|
|
3214
|
+
if (typeof namespace !== 'string') {
|
|
3215
|
+
map = namespace;
|
|
3216
|
+
namespace = '';
|
|
3217
|
+
} else if (namespace.charAt(namespace.length - 1) !== '/') {
|
|
3218
|
+
namespace += '/';
|
|
3219
|
+
}
|
|
3220
|
+
return fn(namespace, map)
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
/**
|
|
3225
|
+
* Search a special module from store by namespace. if module not exist, print error message.
|
|
3226
|
+
* @param {Object} store
|
|
3227
|
+
* @param {String} helper
|
|
3228
|
+
* @param {String} namespace
|
|
3229
|
+
* @return {Object}
|
|
3230
|
+
*/
|
|
3231
|
+
function getModuleByNamespace (store, helper, namespace) {
|
|
3232
|
+
var module = store._modulesNamespaceMap[namespace];
|
|
3233
|
+
if (false) {
|
|
3234
|
+
console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
|
|
3235
|
+
}
|
|
3236
|
+
return module
|
|
3237
|
+
}
|
|
3238
|
+
|
|
3239
|
+
var index = {
|
|
3240
|
+
Store: Store,
|
|
3241
|
+
install: install,
|
|
3242
|
+
version: '3.4.0',
|
|
3243
|
+
mapState: mapState,
|
|
3244
|
+
mapMutations: mapMutations,
|
|
3245
|
+
mapGetters: mapGetters,
|
|
3246
|
+
mapActions: mapActions,
|
|
3247
|
+
createNamespacedHelpers: createNamespacedHelpers
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3250
|
+
/* harmony default export */ __webpack_exports__["a"] = (index);
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(39)))
|
|
3254
|
+
|
|
3255
|
+
/***/ }),
|
|
3256
|
+
/* 145 */
|
|
3257
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3258
|
+
|
|
3259
|
+
"use strict";
|
|
3260
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
3261
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_config_page_vue__ = __webpack_require__(132);
|
|
3262
|
+
/* empty harmony namespace reexport */
|
|
3263
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_baa2b592_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_config_page_vue__ = __webpack_require__(159);
|
|
3264
|
+
function injectStyle (ssrContext) {
|
|
3265
|
+
__webpack_require__(146)
|
|
3266
|
+
}
|
|
3267
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3268
|
+
/* script */
|
|
3269
|
+
|
|
3270
|
+
|
|
3271
|
+
/* template */
|
|
3272
|
+
|
|
3273
|
+
/* template functional */
|
|
3274
|
+
var __vue_template_functional__ = false
|
|
3275
|
+
/* styles */
|
|
3276
|
+
var __vue_styles__ = injectStyle
|
|
3277
|
+
/* scopeId */
|
|
3278
|
+
var __vue_scopeId__ = "data-v-baa2b592"
|
|
3279
|
+
/* moduleIdentifier (server only) */
|
|
3280
|
+
var __vue_module_identifier__ = null
|
|
3281
|
+
var Component = normalizeComponent(
|
|
3282
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_config_page_vue__["a" /* default */],
|
|
3283
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_baa2b592_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_config_page_vue__["a" /* default */],
|
|
3284
|
+
__vue_template_functional__,
|
|
3285
|
+
__vue_styles__,
|
|
3286
|
+
__vue_scopeId__,
|
|
3287
|
+
__vue_module_identifier__
|
|
3288
|
+
)
|
|
3289
|
+
|
|
3290
|
+
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
3291
|
+
|
|
3292
|
+
|
|
3293
|
+
/***/ }),
|
|
3294
|
+
/* 146 */
|
|
3295
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3296
|
+
|
|
3297
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3298
|
+
|
|
3299
|
+
// load the styles
|
|
3300
|
+
var content = __webpack_require__(147);
|
|
3301
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3302
|
+
if(content.locals) module.exports = content.locals;
|
|
3303
|
+
// add the styles to the DOM
|
|
3304
|
+
var update = __webpack_require__(2)("fa96d2c8", content, true, {});
|
|
3305
|
+
|
|
3306
|
+
/***/ }),
|
|
3307
|
+
/* 147 */
|
|
3308
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3309
|
+
|
|
3310
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3311
|
+
// imports
|
|
3312
|
+
|
|
3313
|
+
|
|
3314
|
+
// module
|
|
3315
|
+
exports.push([module.i, ".cq-page[data-v-baa2b592]{min-height:100%;background:#f0f2f5}", ""]);
|
|
3316
|
+
|
|
3317
|
+
// exports
|
|
3318
|
+
|
|
3319
|
+
|
|
3320
|
+
/***/ }),
|
|
3321
|
+
/* 148 */
|
|
3322
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3323
|
+
|
|
3324
|
+
"use strict";
|
|
3325
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_query_config_vue__ = __webpack_require__(133);
|
|
3326
|
+
/* unused harmony namespace reexport */
|
|
3327
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e0af88b2_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_query_config_vue__ = __webpack_require__(158);
|
|
3328
|
+
function injectStyle (ssrContext) {
|
|
3329
|
+
__webpack_require__(149)
|
|
3330
|
+
}
|
|
3331
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3332
|
+
/* script */
|
|
3333
|
+
|
|
3334
|
+
|
|
3335
|
+
/* template */
|
|
3336
|
+
|
|
3337
|
+
/* template functional */
|
|
3338
|
+
var __vue_template_functional__ = false
|
|
3339
|
+
/* styles */
|
|
3340
|
+
var __vue_styles__ = injectStyle
|
|
3341
|
+
/* scopeId */
|
|
3342
|
+
var __vue_scopeId__ = "data-v-e0af88b2"
|
|
3343
|
+
/* moduleIdentifier (server only) */
|
|
3344
|
+
var __vue_module_identifier__ = null
|
|
3345
|
+
var Component = normalizeComponent(
|
|
3346
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_query_config_vue__["a" /* default */],
|
|
3347
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e0af88b2_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_query_config_vue__["a" /* default */],
|
|
3348
|
+
__vue_template_functional__,
|
|
3349
|
+
__vue_styles__,
|
|
3350
|
+
__vue_scopeId__,
|
|
3351
|
+
__vue_module_identifier__
|
|
3352
|
+
)
|
|
3353
|
+
|
|
3354
|
+
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
/***/ }),
|
|
3358
|
+
/* 149 */
|
|
3359
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3360
|
+
|
|
3361
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3362
|
+
|
|
3363
|
+
// load the styles
|
|
3364
|
+
var content = __webpack_require__(150);
|
|
3365
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3366
|
+
if(content.locals) module.exports = content.locals;
|
|
3367
|
+
// add the styles to the DOM
|
|
3368
|
+
var update = __webpack_require__(2)("fff7b438", content, true, {});
|
|
3369
|
+
|
|
3370
|
+
/***/ }),
|
|
3371
|
+
/* 150 */
|
|
3372
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3373
|
+
|
|
3374
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3375
|
+
// imports
|
|
3376
|
+
|
|
3377
|
+
|
|
3378
|
+
// module
|
|
3379
|
+
exports.push([module.i, ".cq-config[data-v-e0af88b2]{padding:12px}.cq-config-main[data-v-e0af88b2]{height:calc(100vh - 80px);overflow-y:auto}.required[data-v-e0af88b2]{color:#ed4014;margin-right:2px}.cq-panel[data-v-e0af88b2]{background:#fff;border-radius:4px;margin-bottom:12px;padding:12px 16px 16px;box-shadow:0 1px 4px rgba(0,0,0,.04)}.cq-panel-head[data-v-e0af88b2]{display:flex;align-items:center;margin-bottom:12px}.cq-center[data-v-e0af88b2]{justify-content:space-between}.cq-panel-title-wrap[data-v-e0af88b2]{display:flex;align-items:center}.cq-panel-title[data-v-e0af88b2]{font-size:15px;font-weight:600}.cq-check-all[data-v-e0af88b2]{margin-left:auto}.cq-panel-tip[data-v-e0af88b2]{font-size:12px;color:#999;margin-left:12px}.cq-panel-head .ivu-btn[data-v-e0af88b2]{margin-left:auto}.cq-table[data-v-e0af88b2]{width:100%;border-collapse:collapse}.cq-table td[data-v-e0af88b2],.cq-table th[data-v-e0af88b2]{border:1px solid #dcdee2;padding:8px 10px;text-align:center}.cq-table th[data-v-e0af88b2]{background:#bcd4ef;font-weight:600;text-align:center;color:#17233d}.cq-op-cell[data-v-e0af88b2]{text-align:center}.cq-del[data-v-e0af88b2]{color:#ed4014}.cq-field-group[data-v-e0af88b2]{display:flex;flex-wrap:wrap}.cq-field-item[data-v-e0af88b2]{width:12.5%;margin:8px 0;font-size:14px}.cq-empty-tip[data-v-e0af88b2]{color:#999;font-size:13px;padding:8px 0}.cq-footer[data-v-e0af88b2]{background:#fff;border-radius:4px;padding:16px}.cq-save-check[data-v-e0af88b2]{color:#ed4014;font-size:12px;line-height:20px;text-align:right}.cq-footer-btns[data-v-e0af88b2]{text-align:right}.cq-footer-btns .ivu-btn[data-v-e0af88b2]{min-width:110px;margin-left:10px}", ""]);
|
|
3380
|
+
|
|
3381
|
+
// exports
|
|
3382
|
+
|
|
3383
|
+
|
|
3384
|
+
/***/ }),
|
|
3385
|
+
/* 151 */
|
|
3386
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3387
|
+
|
|
3388
|
+
"use strict";
|
|
3389
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_save_template_modal_vue__ = __webpack_require__(134);
|
|
3390
|
+
/* unused harmony namespace reexport */
|
|
3391
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a71241c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_save_template_modal_vue__ = __webpack_require__(154);
|
|
3392
|
+
function injectStyle (ssrContext) {
|
|
3393
|
+
__webpack_require__(152)
|
|
3394
|
+
}
|
|
3395
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3396
|
+
/* script */
|
|
3397
|
+
|
|
3398
|
+
|
|
3399
|
+
/* template */
|
|
3400
|
+
|
|
3401
|
+
/* template functional */
|
|
3402
|
+
var __vue_template_functional__ = false
|
|
3403
|
+
/* styles */
|
|
3404
|
+
var __vue_styles__ = injectStyle
|
|
3405
|
+
/* scopeId */
|
|
3406
|
+
var __vue_scopeId__ = "data-v-0a71241c"
|
|
3407
|
+
/* moduleIdentifier (server only) */
|
|
3408
|
+
var __vue_module_identifier__ = null
|
|
3409
|
+
var Component = normalizeComponent(
|
|
3410
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_save_template_modal_vue__["a" /* default */],
|
|
3411
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a71241c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_save_template_modal_vue__["a" /* default */],
|
|
3412
|
+
__vue_template_functional__,
|
|
3413
|
+
__vue_styles__,
|
|
3414
|
+
__vue_scopeId__,
|
|
3415
|
+
__vue_module_identifier__
|
|
3416
|
+
)
|
|
3417
|
+
|
|
3418
|
+
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
|
|
3419
|
+
|
|
3420
|
+
|
|
3421
|
+
/***/ }),
|
|
3422
|
+
/* 152 */
|
|
3423
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3424
|
+
|
|
3425
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3426
|
+
|
|
3427
|
+
// load the styles
|
|
3428
|
+
var content = __webpack_require__(153);
|
|
3429
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3430
|
+
if(content.locals) module.exports = content.locals;
|
|
3431
|
+
// add the styles to the DOM
|
|
3432
|
+
var update = __webpack_require__(2)("f1cb3c66", content, true, {});
|
|
3433
|
+
|
|
3434
|
+
/***/ }),
|
|
3435
|
+
/* 153 */
|
|
3436
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3437
|
+
|
|
3438
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3439
|
+
// imports
|
|
3440
|
+
|
|
3441
|
+
|
|
3442
|
+
// module
|
|
3443
|
+
exports.push([module.i, ".save-tpl-head[data-v-0a71241c]{display:flex;align-items:center;margin-bottom:18px}.save-tpl-icon[data-v-0a71241c]{font-size:24px;color:#2b5fd9;margin-right:8px}.save-tpl-title[data-v-0a71241c]{font-size:20px;font-weight:600}.save-tpl-label[data-v-0a71241c]{font-size:14px;margin-bottom:6px;color:#333}.save-tpl-label .required[data-v-0a71241c]{color:#ed4014}.save-tpl-footer[data-v-0a71241c]{text-align:right;margin-top:10px}.save-tpl-footer button[data-v-0a71241c]{min-width:88px;margin-left:10px}", ""]);
|
|
3444
|
+
|
|
3445
|
+
// exports
|
|
3446
|
+
|
|
3447
|
+
|
|
3448
|
+
/***/ }),
|
|
3449
|
+
/* 154 */
|
|
3450
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3451
|
+
|
|
3452
|
+
"use strict";
|
|
3453
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Modal',{attrs:{"width":520,"class-name":"save-template-modal","closable":false,"mask-closable":false,"footer-hide":""},model:{value:(_vm.visible),callback:function ($$v) {_vm.visible=$$v},expression:"visible"}},[_c('div',{staticClass:"save-tpl-head"},[_c('Icon',{staticClass:"save-tpl-icon",attrs:{"type":"ios-save"}}),_vm._v(" "),_c('span',{staticClass:"save-tpl-title"},[_vm._v("保存为查询模版")])],1),_vm._v(" "),_c('Form',{ref:"tplForm",attrs:{"model":_vm.form,"rules":_vm.rules,"label-width":0}},[_c('FormItem',{attrs:{"prop":"name"}},[_c('div',{staticClass:"save-tpl-label"},[_vm._v("模版名称 "),_c('span',{staticClass:"required"},[_vm._v("*")])]),_vm._v(" "),_c('Input',{attrs:{"maxlength":"50","placeholder":"请输入模版名称,如:2024年度财务凭证查询"},model:{value:(_vm.form.name),callback:function ($$v) {_vm.$set(_vm.form, "name", $$v)},expression:"form.name"}})],1),_vm._v(" "),_c('FormItem',{attrs:{"prop":"remark"}},[_c('div',{staticClass:"save-tpl-label"},[_vm._v("模版描述")]),_vm._v(" "),_c('Input',{attrs:{"type":"textarea","rows":8,"maxlength":"200","placeholder":"请简要描述查询模版用途、能力"},model:{value:(_vm.form.remark),callback:function ($$v) {_vm.$set(_vm.form, "remark", $$v)},expression:"form.remark"}})],1)],1),_vm._v(" "),_c('div',{staticClass:"save-tpl-footer"},[_c('Button',{on:{"click":_vm.onCancel}},[_vm._v("取消")]),_vm._v(" "),_c('Button',{attrs:{"type":"success","loading":_vm.saving},on:{"click":_vm.onConfirm}},[_vm._v("确认保存")])],1)],1)}
|
|
3454
|
+
var staticRenderFns = []
|
|
3455
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3456
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3457
|
+
|
|
3458
|
+
/***/ }),
|
|
3459
|
+
/* 155 */
|
|
3460
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3461
|
+
|
|
3462
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3463
|
+
|
|
3464
|
+
// load the styles
|
|
3465
|
+
var content = __webpack_require__(156);
|
|
3466
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3467
|
+
if(content.locals) module.exports = content.locals;
|
|
3468
|
+
// add the styles to the DOM
|
|
3469
|
+
var update = __webpack_require__(2)("791b0861", content, true, {});
|
|
3470
|
+
|
|
3471
|
+
/***/ }),
|
|
3472
|
+
/* 156 */
|
|
3473
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3474
|
+
|
|
3475
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3476
|
+
// imports
|
|
3477
|
+
|
|
3478
|
+
|
|
3479
|
+
// module
|
|
3480
|
+
exports.push([module.i, ".cq-script-head[data-v-ee918d6e]{display:flex;align-items:center;margin-bottom:12px}.cq-script-icon[data-v-ee918d6e]{font-size:22px;color:#2b5fd9;margin-right:8px}.cq-script-title[data-v-ee918d6e]{font-size:18px;font-weight:600}.cq-script-body[data-v-ee918d6e]{position:relative;min-height:160px}.cq-script-block[data-v-ee918d6e]{position:relative}.cq-script-toolbar[data-v-ee918d6e]{text-align:right;margin-bottom:8px}.cq-script-code[data-v-ee918d6e]{margin:0;padding:12px 14px;max-height:46vh;overflow:auto;background:#282c34;color:#abb2bf;border-radius:4px;font-family:Consolas,Monaco,Menlo,monospace;font-size:13px;line-height:20px;white-space:pre-wrap;word-break:break-all}.cq-script-empty[data-v-ee918d6e]{padding:24px 0;text-align:center;color:#999;font-size:13px}.cq-script-footer[data-v-ee918d6e]{text-align:right;margin-top:14px}", ""]);
|
|
3481
|
+
|
|
3482
|
+
// exports
|
|
3483
|
+
|
|
3484
|
+
|
|
3485
|
+
/***/ }),
|
|
3486
|
+
/* 157 */
|
|
3487
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3488
|
+
|
|
3489
|
+
"use strict";
|
|
3490
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Modal',{attrs:{"width":720,"class-name":"cq-script-modal","closable":true,"mask-closable":false,"footer-hide":""},model:{value:(_vm.visible),callback:function ($$v) {_vm.visible=$$v},expression:"visible"}},[_c('div',{staticClass:"cq-script-head"},[_c('Icon',{staticClass:"cq-script-icon",attrs:{"type":"ios-code-working"}}),_vm._v(" "),_c('span',{staticClass:"cq-script-title"},[_vm._v("查询脚本")])],1),_vm._v(" "),_c('div',{staticClass:"cq-script-body"},[(_vm.loading)?_c('Spin',{attrs:{"fix":""}},[_vm._v("加载中...")]):_vm._e(),_vm._v(" "),_c('Tabs',{staticClass:"cq-script-tabs",model:{value:(_vm.activeTab),callback:function ($$v) {_vm.activeTab=$$v},expression:"activeTab"}},[_c('TabPane',{attrs:{"label":"标准SQL","name":"sql"}},[_c('div',{staticClass:"cq-script-block"},[_c('div',{staticClass:"cq-script-toolbar"},[_c('Button',{attrs:{"size":"small","icon":"md-copy"},on:{"click":function($event){return _vm.copy(_vm.sql)}}},[_vm._v("复制")])],1),_vm._v(" "),(_vm.sql)?_c('pre',{staticClass:"cq-script-code"},[_vm._v(_vm._s(_vm.sql))]):_c('p',{staticClass:"cq-script-empty"},[_vm._v("暂无标准SQL")])])]),_vm._v(" "),_c('TabPane',{attrs:{"label":"调试SQL","name":"debugSql"}},[_c('div',{staticClass:"cq-script-block"},[_c('div',{staticClass:"cq-script-toolbar"},[_c('Button',{attrs:{"size":"small","icon":"md-copy"},on:{"click":function($event){return _vm.copy(_vm.debugSql)}}},[_vm._v("复制")])],1),_vm._v(" "),(_vm.debugSql)?_c('pre',{staticClass:"cq-script-code"},[_vm._v(_vm._s(_vm.debugSql))]):_c('p',{staticClass:"cq-script-empty"},[_vm._v("暂无调试SQL")])])])],1)],1),_vm._v(" "),_c('div',{staticClass:"cq-script-footer"},[_c('Button',{on:{"click":function($event){_vm.visible = false}}},[_vm._v("关闭")])],1)])}
|
|
3491
|
+
var staticRenderFns = []
|
|
3492
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3493
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3494
|
+
|
|
3495
|
+
/***/ }),
|
|
3496
|
+
/* 158 */
|
|
3497
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3498
|
+
|
|
3499
|
+
"use strict";
|
|
3500
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"cq-config"},[_c('div',{staticClass:"cq-config-main"},[_c('div',{staticClass:"cq-panel"},[_c('div',{staticClass:"cq-panel-head cq-center"},[_c('div',{staticClass:"cq-panel-title-wrap"},[_c('p',{staticClass:"cq-panel-title"},[_c('span',{staticClass:"required"},[_vm._v("*")]),_vm._v("查询模板名称: "),_c('Input',{staticStyle:{"width":"200px"},attrs:{"placeholder":"请输入查询模板名称"},model:{value:(_vm.templateName),callback:function ($$v) {_vm.templateName=$$v},expression:"templateName"}})],1)]),_vm._v(" "),_c('div',[_c('Button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.lookScript}},[_vm._v("查看脚本")]),_vm._v(" \n "),_c('Button',{attrs:{"type":"primary","size":"small"},on:{"click":_vm.addCondition}},[_vm._v("增 行")])],1)]),_vm._v(" "),_c('div',{staticClass:"cq-panel-body"},[_c('table',{staticClass:"cq-table"},[_vm._m(0),_vm._v(" "),_c('tbody',_vm._l((_vm.conditions),function(row,index){return _c('tr',{key:index},[_c('td',[_c('Select',{attrs:{"placeholder":"请选择","filterable":"","transfer":""},on:{"on-change":function($event){return _vm.onTableChange(row)}},model:{value:(row.tableName),callback:function ($$v) {_vm.$set(row, "tableName", $$v)},expression:"row.tableName"}},_vm._l((_vm.tableOptionsFor(index)),function(t){return _c('Option',{key:t.name,attrs:{"value":t.name}},[_vm._v(_vm._s(t.label))])}),1)],1),_vm._v(" "),_c('td',[_c('Select',{attrs:{"placeholder":"请选择","filterable":"","transfer":""},on:{"on-change":function($event){return _vm.onFieldChange(row)}},model:{value:(row.fieldName),callback:function ($$v) {_vm.$set(row, "fieldName", $$v)},expression:"row.fieldName"}},_vm._l(((_vm.fieldsMap[row.tableName] || [])),function(f){return _c('Option',{key:f.name,attrs:{"value":f.name}},[_vm._v(_vm._s(f.label))])}),1)],1),_vm._v(" "),_c('td',[_c('Select',{attrs:{"placeholder":"请选择","filterable":"","transfer":""},model:{value:(row.op),callback:function ($$v) {_vm.$set(row, "op", $$v)},expression:"row.op"}},_vm._l((_vm.operatorsForRow(row)),function(o){return _c('Option',{key:o.value,attrs:{"value":o.value}},[_vm._v(_vm._s(o.label))])}),1)],1),_vm._v(" "),_c('td',[(_vm.valueControlType(row) === 'dic')?_c('s-dicgrid',{staticStyle:{"width":"100%"},attrs:{"dicName":_vm.fieldDicName(row)},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}}):(_vm.valueControlType(row) === 'datetime')?_c('el-date-picker',{staticStyle:{"width":"100%"},attrs:{"type":"datetime","format":"yyyy-MM-dd HH:mm:ss","value-format":"yyyy-MM-dd HH:mm:ss","placeholder":"请选择","size":"small"},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}}):(_vm.valueControlType(row) === 'date')?_c('el-date-picker',{staticStyle:{"width":"100%"},attrs:{"type":"date","format":"yyyy-MM-dd","value-format":"yyyy-MM-dd","placeholder":"请选择","size":"small"},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}}):(_vm.valueControlType(row) === 'time')?_c('el-time-picker',{staticStyle:{"width":"100%"},attrs:{"format":"HH:mm:ss","value-format":"HH:mm:ss","placeholder":"请选择","size":"small"},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}}):(_vm.valueControlType(row) === 'number')?_c('InputNumber',{staticStyle:{"width":"100%"},attrs:{"placeholder":"请输入"},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}}):_c('Input',{attrs:{"placeholder":"请输入"},model:{value:(row.value),callback:function ($$v) {_vm.$set(row, "value", $$v)},expression:"row.value"}})],1),_vm._v(" "),_c('td',[_c('Select',{attrs:{"placeholder":"请选择","filterable":"","transfer":""},model:{value:(row.logic),callback:function ($$v) {_vm.$set(row, "logic", $$v)},expression:"row.logic"}},_vm._l((_vm.logicOps),function(l){return _c('Option',{key:l.value,attrs:{"value":l.value}},[_vm._v(_vm._s(l.label))])}),1)],1),_vm._v(" "),_c('td',{staticClass:"cq-op-cell"},[(index > 0)?_c('a',{staticClass:"cq-del",on:{"click":function($event){return _vm.removeCondition(index)}}},[_vm._v("删除")]):_vm._e()])])}),0)])])]),_vm._v(" "),_c('div',{staticClass:"cq-panel"},[_c('div',{staticClass:"cq-panel-head"},[_vm._m(1),_vm._v(" "),_c('span',{staticClass:"cq-panel-tip"},[_vm._v("请先选择数据主表,然后勾选您希望在查询表格中展示的字段。")]),_vm._v(" "),(_vm.headerFields.length > 0)?_c('Checkbox',{staticClass:"cq-check-all",attrs:{"value":_vm.checkAll,"indeterminate":_vm.checkAllIndeterminate},on:{"on-change":_vm.onCheckAllChange}},[_vm._v("全选")]):_vm._e()],1),_vm._v(" "),_c('div',{staticClass:"cq-panel-body"},[_c('CheckboxGroup',{staticClass:"cq-field-group",model:{value:(_vm.checkedFields),callback:function ($$v) {_vm.checkedFields=$$v},expression:"checkedFields"}},_vm._l((_vm.headerFields),function(f){return _c('Checkbox',{key:f.name,staticClass:"cq-field-item",attrs:{"label":f.name}},[_vm._v(_vm._s(f.label))])}),1),_vm._v(" "),(_vm.headerFields.length === 0)?_c('p',{staticClass:"cq-empty-tip"},[_vm._v("请先在查询条件中选择主表")]):_vm._e()],1)])]),_vm._v(" "),_c('div',{staticClass:"cq-footer"},[_c('div',{staticClass:"cq-footer-btns"},[_c('Button',{attrs:{"type":"primary"},on:{"click":function($event){return _vm.$emit('open-history')}}},[_vm._v("历史查询模版")]),_vm._v(" "),_c('Button',{attrs:{"type":"primary"},on:{"click":_vm.openSaveModal}},[_vm._v("保存为查询模版")]),_vm._v(" "),_c('Button',{attrs:{"type":"primary"},on:{"click":_vm.execute}},[_vm._v("执行查询")])],1)]),_vm._v(" "),_c('save-template-modal',{attrs:{"api":_vm.api,"payload":_vm.savePayload},on:{"saved":_vm.onTemplateSaved},model:{value:(_vm.saveModalShow),callback:function ($$v) {_vm.saveModalShow=$$v},expression:"saveModalShow"}}),_vm._v(" "),_c('script-modal',{attrs:{"api":_vm.api,"query-json":_vm.scriptQueryJson,"app-id":_vm.appId},model:{value:(_vm.scriptModalShow),callback:function ($$v) {_vm.scriptModalShow=$$v},expression:"scriptModalShow"}})],1)}
|
|
3501
|
+
var staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('thead',[_c('tr',[_c('th',{staticStyle:{"width":"20%"}},[_vm._v("主表名称")]),_vm._v(" "),_c('th',{staticStyle:{"width":"20%"}},[_vm._v("主表字段")]),_vm._v(" "),_c('th',{staticStyle:{"width":"15%"}},[_vm._v("运算关系")]),_vm._v(" "),_c('th',{staticStyle:{"width":"18%"}},[_vm._v("字段值")]),_vm._v(" "),_c('th',{staticStyle:{"width":"15%"}},[_vm._v("且/或关系")]),_vm._v(" "),_c('th',{staticStyle:{"width":"12%"}},[_vm._v("操作")])])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"cq-panel-title"},[_c('span',{staticClass:"required"},[_vm._v("*")]),_vm._v("列表表头配置")])}]
|
|
3502
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3503
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3504
|
+
|
|
3505
|
+
/***/ }),
|
|
3506
|
+
/* 159 */
|
|
3507
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3508
|
+
|
|
3509
|
+
"use strict";
|
|
3510
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"cq-page"},[_c('query-config',{attrs:{"api":_vm.api,"mark":_vm.mark,"template-id":_vm.templateId,"edit-template-name":_vm.templateName},on:{"execute":_vm.onExecute,"open-history":_vm.goHistory}})],1)}
|
|
3511
|
+
var staticRenderFns = []
|
|
3512
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3513
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3514
|
+
|
|
3515
|
+
/***/ }),
|
|
3516
|
+
/* 160 */
|
|
3517
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3518
|
+
|
|
3519
|
+
"use strict";
|
|
3520
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
3521
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_history_page_vue__ = __webpack_require__(137);
|
|
3522
|
+
/* empty harmony namespace reexport */
|
|
3523
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_8125c358_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_history_page_vue__ = __webpack_require__(167);
|
|
3524
|
+
function injectStyle (ssrContext) {
|
|
3525
|
+
__webpack_require__(161)
|
|
3526
|
+
}
|
|
3527
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3528
|
+
/* script */
|
|
3529
|
+
|
|
3530
|
+
|
|
3531
|
+
/* template */
|
|
3532
|
+
|
|
3533
|
+
/* template functional */
|
|
3534
|
+
var __vue_template_functional__ = false
|
|
3535
|
+
/* styles */
|
|
3536
|
+
var __vue_styles__ = injectStyle
|
|
3537
|
+
/* scopeId */
|
|
3538
|
+
var __vue_scopeId__ = "data-v-8125c358"
|
|
3539
|
+
/* moduleIdentifier (server only) */
|
|
3540
|
+
var __vue_module_identifier__ = null
|
|
3541
|
+
var Component = normalizeComponent(
|
|
3542
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_history_page_vue__["a" /* default */],
|
|
3543
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_8125c358_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_history_page_vue__["a" /* default */],
|
|
3544
|
+
__vue_template_functional__,
|
|
3545
|
+
__vue_styles__,
|
|
3546
|
+
__vue_scopeId__,
|
|
3547
|
+
__vue_module_identifier__
|
|
3548
|
+
)
|
|
3549
|
+
|
|
3550
|
+
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
3551
|
+
|
|
3552
|
+
|
|
3553
|
+
/***/ }),
|
|
3554
|
+
/* 161 */
|
|
3555
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3556
|
+
|
|
3557
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3558
|
+
|
|
3559
|
+
// load the styles
|
|
3560
|
+
var content = __webpack_require__(162);
|
|
3561
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3562
|
+
if(content.locals) module.exports = content.locals;
|
|
3563
|
+
// add the styles to the DOM
|
|
3564
|
+
var update = __webpack_require__(2)("71da1cc1", content, true, {});
|
|
3565
|
+
|
|
3566
|
+
/***/ }),
|
|
3567
|
+
/* 162 */
|
|
3568
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3569
|
+
|
|
3570
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3571
|
+
// imports
|
|
3572
|
+
|
|
3573
|
+
|
|
3574
|
+
// module
|
|
3575
|
+
exports.push([module.i, ".cq-page[data-v-8125c358]{min-height:100%;background:#f0f2f5}", ""]);
|
|
3576
|
+
|
|
3577
|
+
// exports
|
|
3578
|
+
|
|
3579
|
+
|
|
3580
|
+
/***/ }),
|
|
3581
|
+
/* 163 */
|
|
3582
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3583
|
+
|
|
3584
|
+
"use strict";
|
|
3585
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_template_history_vue__ = __webpack_require__(138);
|
|
3586
|
+
/* unused harmony namespace reexport */
|
|
3587
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf413f7c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_template_history_vue__ = __webpack_require__(166);
|
|
3588
|
+
function injectStyle (ssrContext) {
|
|
3589
|
+
__webpack_require__(164)
|
|
3590
|
+
}
|
|
3591
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3592
|
+
/* script */
|
|
3593
|
+
|
|
3594
|
+
|
|
3595
|
+
/* template */
|
|
3596
|
+
|
|
3597
|
+
/* template functional */
|
|
3598
|
+
var __vue_template_functional__ = false
|
|
3599
|
+
/* styles */
|
|
3600
|
+
var __vue_styles__ = injectStyle
|
|
3601
|
+
/* scopeId */
|
|
3602
|
+
var __vue_scopeId__ = "data-v-cf413f7c"
|
|
3603
|
+
/* moduleIdentifier (server only) */
|
|
3604
|
+
var __vue_module_identifier__ = null
|
|
3605
|
+
var Component = normalizeComponent(
|
|
3606
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_template_history_vue__["a" /* default */],
|
|
3607
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf413f7c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_template_history_vue__["a" /* default */],
|
|
3608
|
+
__vue_template_functional__,
|
|
3609
|
+
__vue_styles__,
|
|
3610
|
+
__vue_scopeId__,
|
|
3611
|
+
__vue_module_identifier__
|
|
3612
|
+
)
|
|
3613
|
+
|
|
3614
|
+
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
|
|
3615
|
+
|
|
3616
|
+
|
|
3617
|
+
/***/ }),
|
|
3618
|
+
/* 164 */
|
|
3619
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3620
|
+
|
|
3621
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3622
|
+
|
|
3623
|
+
// load the styles
|
|
3624
|
+
var content = __webpack_require__(165);
|
|
3625
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3626
|
+
if(content.locals) module.exports = content.locals;
|
|
3627
|
+
// add the styles to the DOM
|
|
3628
|
+
var update = __webpack_require__(2)("34c621d9", content, true, {});
|
|
3629
|
+
|
|
3630
|
+
/***/ }),
|
|
3631
|
+
/* 165 */
|
|
3632
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3633
|
+
|
|
3634
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3635
|
+
// imports
|
|
3636
|
+
|
|
3637
|
+
|
|
3638
|
+
// module
|
|
3639
|
+
exports.push([module.i, ".tpl-history[data-v-cf413f7c]{padding:12px}.tpl-panel[data-v-cf413f7c]{background:#fff;border-radius:4px;padding:16px 20px 20px;box-shadow:0 1px 4px rgba(0,0,0,.04)}.tpl-head[data-v-cf413f7c]{display:flex;align-items:center}.tpl-head-icon[data-v-cf413f7c]{font-size:22px;color:#2b5fd9;margin-right:8px}.tpl-head-title[data-v-cf413f7c]{font-size:18px;font-weight:600}.tpl-head-desc[data-v-cf413f7c]{color:#999;font-size:12px;margin:6px 0 16px}.tpl-search[data-v-cf413f7c]{display:flex;align-items:center;margin-bottom:16px}.tpl-search-input[data-v-cf413f7c]{width:360px;margin-right:8px}.tpl-reset[data-v-cf413f7c]{margin-left:auto}.tpl-page[data-v-cf413f7c]{display:flex;align-items:center;justify-content:space-between;margin-top:16px}.tpl-total[data-v-cf413f7c]{color:#666;font-size:13px}[data-v-cf413f7c].tpl-tag{display:inline-block;padding:2px 10px;background:#e8fff3;color:#19be6b;border-radius:12px;font-size:12px}[data-v-cf413f7c].tpl-cond-item{color:#2b5fd9;font-size:12px;line-height:20px}", ""]);
|
|
3640
|
+
|
|
3641
|
+
// exports
|
|
3642
|
+
|
|
3643
|
+
|
|
3644
|
+
/***/ }),
|
|
3645
|
+
/* 166 */
|
|
3646
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3647
|
+
|
|
3648
|
+
"use strict";
|
|
3649
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tpl-history"},[_c('div',{staticClass:"tpl-panel"},[_c('div',{staticClass:"tpl-head"},[_c('Icon',{staticClass:"tpl-head-icon",attrs:{"type":"ios-list-box-outline"}}),_vm._v(" "),_c('span',{staticClass:"tpl-head-title"},[_vm._v("历史查询模版")])],1),_vm._v(" "),_c('p',{staticClass:"tpl-head-desc"},[_vm._v("管理和使用已保存的自定义查询模版,支持一键执行查询、编辑配置或删除")]),_vm._v(" "),_c('div',{staticClass:"tpl-search"},[_c('Input',{staticClass:"tpl-search-input",attrs:{"placeholder":"搜索模版名称、主表名称、描述..."},on:{"on-enter":_vm.onSearch},model:{value:(_vm.keyword),callback:function ($$v) {_vm.keyword=$$v},expression:"keyword"}}),_vm._v(" "),_c('Button',{attrs:{"type":"primary","icon":"ios-search"},on:{"click":_vm.onSearch}},[_vm._v("搜索")]),_vm._v(" "),_c('Button',{staticClass:"tpl-reset",attrs:{"icon":"md-refresh"},on:{"click":_vm.onReset}},[_vm._v("重置")])],1),_vm._v(" "),_c('Table',{attrs:{"height":_vm.tableHeight,"columns":_vm.columns,"data":_vm.rows,"loading":_vm.loading,"stripe":""}}),_vm._v(" "),_c('div',{staticClass:"tpl-page"},[_c('span',{staticClass:"tpl-total"},[_vm._v("共 "+_vm._s(_vm.total)+" 条记录")]),_vm._v(" "),_c('Page',{attrs:{"total":_vm.total,"current":_vm.pageNo,"page-size":_vm.pageSize,"size":"small","show-elevator":""},on:{"on-change":_vm.onPageChange}})],1)],1),_vm._v(" "),_c('script-modal',{attrs:{"api":_vm.api,"query-json":_vm.scriptQueryJson},model:{value:(_vm.scriptModalShow),callback:function ($$v) {_vm.scriptModalShow=$$v},expression:"scriptModalShow"}})],1)}
|
|
3650
|
+
var staticRenderFns = []
|
|
3651
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3652
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3653
|
+
|
|
3654
|
+
/***/ }),
|
|
3655
|
+
/* 167 */
|
|
3656
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3657
|
+
|
|
3658
|
+
"use strict";
|
|
3659
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"cq-page"},[_c('template-history',{attrs:{"api":_vm.api},on:{"execute":_vm.onExecute,"edit":_vm.onEdit}})],1)}
|
|
3660
|
+
var staticRenderFns = []
|
|
3661
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3662
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3663
|
+
|
|
3664
|
+
/***/ }),
|
|
3665
|
+
/* 168 */
|
|
3666
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3667
|
+
|
|
3668
|
+
"use strict";
|
|
3669
|
+
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
3670
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_result_page_vue__ = __webpack_require__(139);
|
|
3671
|
+
/* empty harmony namespace reexport */
|
|
3672
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1cc20f4c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_result_page_vue__ = __webpack_require__(175);
|
|
3673
|
+
function injectStyle (ssrContext) {
|
|
3674
|
+
__webpack_require__(169)
|
|
3675
|
+
}
|
|
3676
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3677
|
+
/* script */
|
|
3678
|
+
|
|
3679
|
+
|
|
3680
|
+
/* template */
|
|
3681
|
+
|
|
3682
|
+
/* template functional */
|
|
3683
|
+
var __vue_template_functional__ = false
|
|
3684
|
+
/* styles */
|
|
3685
|
+
var __vue_styles__ = injectStyle
|
|
3686
|
+
/* scopeId */
|
|
3687
|
+
var __vue_scopeId__ = "data-v-1cc20f4c"
|
|
3688
|
+
/* moduleIdentifier (server only) */
|
|
3689
|
+
var __vue_module_identifier__ = null
|
|
3690
|
+
var Component = normalizeComponent(
|
|
3691
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_result_page_vue__["a" /* default */],
|
|
3692
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1cc20f4c_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_result_page_vue__["a" /* default */],
|
|
3693
|
+
__vue_template_functional__,
|
|
3694
|
+
__vue_styles__,
|
|
3695
|
+
__vue_scopeId__,
|
|
3696
|
+
__vue_module_identifier__
|
|
3697
|
+
)
|
|
3698
|
+
|
|
3699
|
+
/* harmony default export */ __webpack_exports__["default"] = (Component.exports);
|
|
3700
|
+
|
|
3701
|
+
|
|
3702
|
+
/***/ }),
|
|
3703
|
+
/* 169 */
|
|
3704
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3705
|
+
|
|
3706
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3707
|
+
|
|
3708
|
+
// load the styles
|
|
3709
|
+
var content = __webpack_require__(170);
|
|
3710
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3711
|
+
if(content.locals) module.exports = content.locals;
|
|
3712
|
+
// add the styles to the DOM
|
|
3713
|
+
var update = __webpack_require__(2)("debef09c", content, true, {});
|
|
3714
|
+
|
|
3715
|
+
/***/ }),
|
|
3716
|
+
/* 170 */
|
|
3717
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3718
|
+
|
|
3719
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3720
|
+
// imports
|
|
3721
|
+
|
|
3722
|
+
|
|
3723
|
+
// module
|
|
3724
|
+
exports.push([module.i, ".cq-page[data-v-1cc20f4c]{min-height:100%;background:#f0f2f5}", ""]);
|
|
3725
|
+
|
|
3726
|
+
// exports
|
|
3727
|
+
|
|
3728
|
+
|
|
3729
|
+
/***/ }),
|
|
3730
|
+
/* 171 */
|
|
3731
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3732
|
+
|
|
3733
|
+
"use strict";
|
|
3734
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_query_result_vue__ = __webpack_require__(140);
|
|
3735
|
+
/* unused harmony namespace reexport */
|
|
3736
|
+
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1ae600dc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_query_result_vue__ = __webpack_require__(174);
|
|
3737
|
+
function injectStyle (ssrContext) {
|
|
3738
|
+
__webpack_require__(172)
|
|
3739
|
+
}
|
|
3740
|
+
var normalizeComponent = __webpack_require__(0)
|
|
3741
|
+
/* script */
|
|
3742
|
+
|
|
3743
|
+
|
|
3744
|
+
/* template */
|
|
3745
|
+
|
|
3746
|
+
/* template functional */
|
|
3747
|
+
var __vue_template_functional__ = false
|
|
3748
|
+
/* styles */
|
|
3749
|
+
var __vue_styles__ = injectStyle
|
|
3750
|
+
/* scopeId */
|
|
3751
|
+
var __vue_scopeId__ = "data-v-1ae600dc"
|
|
3752
|
+
/* moduleIdentifier (server only) */
|
|
3753
|
+
var __vue_module_identifier__ = null
|
|
3754
|
+
var Component = normalizeComponent(
|
|
3755
|
+
__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_modules_iview_loader_index_js_ref_5_query_result_vue__["a" /* default */],
|
|
3756
|
+
__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1ae600dc_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_modules_iview_loader_index_js_ref_5_query_result_vue__["a" /* default */],
|
|
3757
|
+
__vue_template_functional__,
|
|
3758
|
+
__vue_styles__,
|
|
3759
|
+
__vue_scopeId__,
|
|
3760
|
+
__vue_module_identifier__
|
|
3761
|
+
)
|
|
3762
|
+
|
|
3763
|
+
/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
|
|
3764
|
+
|
|
3765
|
+
|
|
3766
|
+
/***/ }),
|
|
3767
|
+
/* 172 */
|
|
3768
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3769
|
+
|
|
3770
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
3771
|
+
|
|
3772
|
+
// load the styles
|
|
3773
|
+
var content = __webpack_require__(173);
|
|
3774
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
3775
|
+
if(content.locals) module.exports = content.locals;
|
|
3776
|
+
// add the styles to the DOM
|
|
3777
|
+
var update = __webpack_require__(2)("7a8709ba", content, true, {});
|
|
3778
|
+
|
|
3779
|
+
/***/ }),
|
|
3780
|
+
/* 173 */
|
|
3781
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3782
|
+
|
|
3783
|
+
exports = module.exports = __webpack_require__(1)(false);
|
|
3784
|
+
// imports
|
|
3785
|
+
|
|
3786
|
+
|
|
3787
|
+
// module
|
|
3788
|
+
exports.push([module.i, ".cq-result[data-v-1ae600dc]{padding:12px}.cq-result-panel[data-v-1ae600dc]{background:#fff;border-radius:4px;padding:16px 20px 20px;box-shadow:0 1px 4px rgba(0,0,0,.04)}.cq-result-toolbar[data-v-1ae600dc]{text-align:right;margin-bottom:12px}.cq-result-page-bar[data-v-1ae600dc]{text-align:right;margin-top:16px;display:flex;align-items:center;justify-content:space-between}", ""]);
|
|
3789
|
+
|
|
3790
|
+
// exports
|
|
3791
|
+
|
|
3792
|
+
|
|
3793
|
+
/***/ }),
|
|
3794
|
+
/* 174 */
|
|
3795
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3796
|
+
|
|
3797
|
+
"use strict";
|
|
3798
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"cq-result"},[_c('div',{staticClass:"cq-result-panel"},[_c('div',{staticClass:"cq-result-toolbar"},[_c('Button',{attrs:{"type":"primary","icon":"md-refresh"},on:{"click":_vm.getData}},[_vm._v("刷新")]),_vm._v(" \n "),_c('Button',{attrs:{"type":"primary","icon":"md-download"},on:{"click":_vm.exportExcel}},[_vm._v("导出excel")])],1),_vm._v(" "),_c('Table',{attrs:{"height":_vm.tableHeight,"columns":_vm.tableColumns,"data":_vm.rows,"loading":_vm.loading,"border":"","stripe":""}}),_vm._v(" "),_c('div',{staticClass:"cq-result-page-bar"},[_c('span',{staticClass:"tpl-total"},[_vm._v("共 "+_vm._s(_vm.total)+" 条记录")]),_vm._v(" "),_c('Page',{attrs:{"total":_vm.total,"current":_vm.pageNo,"page-size":_vm.pageSize,"page-size-opts":[10, 20, 50, 100],"show-sizer":"","show-elevator":"","transfer":""},on:{"on-change":_vm.onPageChange,"on-page-size-change":_vm.onPageSizeChange}})],1)],1)])}
|
|
3799
|
+
var staticRenderFns = []
|
|
3800
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3801
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3802
|
+
|
|
3803
|
+
/***/ }),
|
|
3804
|
+
/* 175 */
|
|
3805
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3806
|
+
|
|
3807
|
+
"use strict";
|
|
3808
|
+
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"cq-page"},[_c('query-result',{attrs:{"api":_vm.api,"payload":_vm.payload,"template-id":_vm.templateId,"template-name":_vm.templateName}})],1)}
|
|
3809
|
+
var staticRenderFns = []
|
|
3810
|
+
var esExports = { render: render, staticRenderFns: staticRenderFns }
|
|
3811
|
+
/* harmony default export */ __webpack_exports__["a"] = (esExports);
|
|
3812
|
+
|
|
3813
|
+
/***/ })
|
|
3814
|
+
]));
|
|
3815
|
+
//# sourceMappingURL=0.sd-data-grid.js.map
|