@panpanzhao/component-ui 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component-ui.common.js +2914 -101
- package/lib/components/crud.js +83 -70
- package/lib/components/dialog.js +540 -0
- package/lib/components/form-dialog.js +50 -49
- package/lib/components/form-group.js +39 -39
- package/lib/components/form-input.js +58 -46
- package/lib/components/form-item.js +6 -6
- package/lib/components/form-view-dialog.js +46 -45
- package/lib/components/form-view-group.js +35 -35
- package/lib/components/form-view.js +11 -10
- package/lib/components/form.js +15 -14
- package/lib/components/formula.js +2655 -0
- package/lib/components/table-column.js +14 -14
- package/lib/components/table-editable.js +12 -12
- package/lib/components/table-search.js +6 -6
- package/lib/components/table.js +8 -8
- package/lib/index.js +1 -1
- package/lib/styles/code-mirror.css +1 -0
- package/lib/styles/component-ui.css +6 -1
- package/lib/styles/crud.css +0 -0
- package/lib/styles/dialog.css +1 -0
- package/lib/styles/form-dialog.css +0 -0
- package/lib/styles/form-group.css +0 -0
- package/lib/styles/form-input.css +0 -0
- package/lib/styles/form-item.css +0 -0
- package/lib/styles/form-view-dialog.css +0 -0
- package/lib/styles/form-view-group.css +0 -0
- package/lib/styles/form-view.css +0 -0
- package/lib/styles/formula.css +6 -0
- package/lib/styles/index.css +6 -1
- package/lib/styles/table-column.css +0 -0
- package/lib/styles/table-search.css +0 -0
- package/lib/utils/formula/doc.js +1547 -0
- package/lib/utils/formula/evalutor.js +17 -17
- package/lib/utils/helper.js +48 -0
- package/package.json +3 -3
|
@@ -0,0 +1,2655 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "/dist/";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 72);
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ 0:
|
|
91
|
+
/***/ (function(module, exports) {
|
|
92
|
+
|
|
93
|
+
module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ 21:
|
|
98
|
+
/***/ (function(module, exports) {
|
|
99
|
+
|
|
100
|
+
module.exports = require("element-ui/lib/input");
|
|
101
|
+
|
|
102
|
+
/***/ }),
|
|
103
|
+
|
|
104
|
+
/***/ 28:
|
|
105
|
+
/***/ (function(module, exports) {
|
|
106
|
+
|
|
107
|
+
module.exports = require("codemirror");
|
|
108
|
+
|
|
109
|
+
/***/ }),
|
|
110
|
+
|
|
111
|
+
/***/ 5:
|
|
112
|
+
/***/ (function(module, exports) {
|
|
113
|
+
|
|
114
|
+
module.exports = require("element-ui/lib/tabs");
|
|
115
|
+
|
|
116
|
+
/***/ }),
|
|
117
|
+
|
|
118
|
+
/***/ 58:
|
|
119
|
+
/***/ (function(module, exports) {
|
|
120
|
+
|
|
121
|
+
module.exports = require("element-ui/lib/tree");
|
|
122
|
+
|
|
123
|
+
/***/ }),
|
|
124
|
+
|
|
125
|
+
/***/ 59:
|
|
126
|
+
/***/ (function(module, exports) {
|
|
127
|
+
|
|
128
|
+
module.exports = require("element-ui/lib/badge");
|
|
129
|
+
|
|
130
|
+
/***/ }),
|
|
131
|
+
|
|
132
|
+
/***/ 6:
|
|
133
|
+
/***/ (function(module, exports) {
|
|
134
|
+
|
|
135
|
+
module.exports = require("element-ui/lib/tab-pane");
|
|
136
|
+
|
|
137
|
+
/***/ }),
|
|
138
|
+
|
|
139
|
+
/***/ 60:
|
|
140
|
+
/***/ (function(module, exports) {
|
|
141
|
+
|
|
142
|
+
module.exports = require("@panpanzhao/component-ui/lib/utils/helper");
|
|
143
|
+
|
|
144
|
+
/***/ }),
|
|
145
|
+
|
|
146
|
+
/***/ 61:
|
|
147
|
+
/***/ (function(module, exports) {
|
|
148
|
+
|
|
149
|
+
module.exports = require("element-ui/lib/message");
|
|
150
|
+
|
|
151
|
+
/***/ }),
|
|
152
|
+
|
|
153
|
+
/***/ 65:
|
|
154
|
+
/***/ (function(module, exports) {
|
|
155
|
+
|
|
156
|
+
module.exports = require("codemirror/mode/javascript/javascript");
|
|
157
|
+
|
|
158
|
+
/***/ }),
|
|
159
|
+
|
|
160
|
+
/***/ 66:
|
|
161
|
+
/***/ (function(module, exports) {
|
|
162
|
+
|
|
163
|
+
module.exports = require("codemirror/mode/htmlmixed/htmlmixed");
|
|
164
|
+
|
|
165
|
+
/***/ }),
|
|
166
|
+
|
|
167
|
+
/***/ 67:
|
|
168
|
+
/***/ (function(module, exports) {
|
|
169
|
+
|
|
170
|
+
module.exports = require("codemirror/addon/mode/simple");
|
|
171
|
+
|
|
172
|
+
/***/ }),
|
|
173
|
+
|
|
174
|
+
/***/ 68:
|
|
175
|
+
/***/ (function(module, exports) {
|
|
176
|
+
|
|
177
|
+
module.exports = require("codemirror/addon/mode/multiplex");
|
|
178
|
+
|
|
179
|
+
/***/ }),
|
|
180
|
+
|
|
181
|
+
/***/ 7:
|
|
182
|
+
/***/ (function(module, exports) {
|
|
183
|
+
|
|
184
|
+
module.exports = require("element-ui/lib/collapse");
|
|
185
|
+
|
|
186
|
+
/***/ }),
|
|
187
|
+
|
|
188
|
+
/***/ 72:
|
|
189
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
190
|
+
|
|
191
|
+
"use strict";
|
|
192
|
+
// ESM COMPAT FLAG
|
|
193
|
+
__webpack_require__.r(__webpack_exports__);
|
|
194
|
+
|
|
195
|
+
// EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
|
|
196
|
+
var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
|
|
197
|
+
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
|
|
198
|
+
|
|
199
|
+
// EXTERNAL MODULE: external "codemirror"
|
|
200
|
+
var external_codemirror_ = __webpack_require__(28);
|
|
201
|
+
var external_codemirror_default = /*#__PURE__*/__webpack_require__.n(external_codemirror_);
|
|
202
|
+
|
|
203
|
+
// EXTERNAL MODULE: external "codemirror/mode/javascript/javascript"
|
|
204
|
+
var javascript_ = __webpack_require__(65);
|
|
205
|
+
|
|
206
|
+
// EXTERNAL MODULE: external "codemirror/mode/htmlmixed/htmlmixed"
|
|
207
|
+
var htmlmixed_ = __webpack_require__(66);
|
|
208
|
+
|
|
209
|
+
// EXTERNAL MODULE: external "codemirror/addon/mode/simple"
|
|
210
|
+
var simple_ = __webpack_require__(67);
|
|
211
|
+
|
|
212
|
+
// EXTERNAL MODULE: external "codemirror/addon/mode/multiplex"
|
|
213
|
+
var multiplex_ = __webpack_require__(68);
|
|
214
|
+
|
|
215
|
+
// CONCATENATED MODULE: ./src/components/formula/src/codeMirror.js
|
|
216
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
217
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
218
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
/* harmony default export */ var codeMirror = ({
|
|
225
|
+
name: "CodeMirror",
|
|
226
|
+
inheritAttrs: false,
|
|
227
|
+
components: {},
|
|
228
|
+
props: {
|
|
229
|
+
className: String,
|
|
230
|
+
value: String,
|
|
231
|
+
options: Object,
|
|
232
|
+
editorFactory: Function,
|
|
233
|
+
editorDidMount: Function,
|
|
234
|
+
on: {
|
|
235
|
+
type: Object,
|
|
236
|
+
default: function _default() {
|
|
237
|
+
return {};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
watch: {
|
|
242
|
+
value: function value(val) {
|
|
243
|
+
this.setValue(val);
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
data: function data() {
|
|
247
|
+
return {
|
|
248
|
+
editor: null,
|
|
249
|
+
unmounted: false
|
|
250
|
+
};
|
|
251
|
+
},
|
|
252
|
+
mounted: function mounted() {
|
|
253
|
+
var _this = this;
|
|
254
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
255
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
256
|
+
while (1) switch (_context.prev = _context.next) {
|
|
257
|
+
case 0:
|
|
258
|
+
if (!_this.unmounted) {
|
|
259
|
+
_context.next = 2;
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
return _context.abrupt("return");
|
|
263
|
+
case 2:
|
|
264
|
+
_this.editor = _this.editorFactory && _this.editorFactory(_this.$refs.codeMirrorRef, external_codemirror_default.a, _this.options) || external_codemirror_default()(_this.$refs.codeMirrorRef, {
|
|
265
|
+
value: _this.value || ''
|
|
266
|
+
});
|
|
267
|
+
_this.editorDidMount(external_codemirror_default.a, _this.editor);
|
|
268
|
+
_this.editor.on('change', _this.handleChange);
|
|
269
|
+
_this.editor.on('blur', _this.handleBlur);
|
|
270
|
+
_this.editor.on('focus', _this.handleFocus);
|
|
271
|
+
_this.$nextTick(function () {
|
|
272
|
+
_this.editor.refresh();
|
|
273
|
+
});
|
|
274
|
+
case 8:
|
|
275
|
+
case "end":
|
|
276
|
+
return _context.stop();
|
|
277
|
+
}
|
|
278
|
+
}, _callee);
|
|
279
|
+
}))();
|
|
280
|
+
},
|
|
281
|
+
beforeDestroy: function beforeDestroy() {
|
|
282
|
+
this.unmounted = true;
|
|
283
|
+
this.editor.off('change', this.handleChange);
|
|
284
|
+
this.editor.off('blur', this.handleBlur);
|
|
285
|
+
this.editor.off('focus', this.handleFocus);
|
|
286
|
+
},
|
|
287
|
+
methods: {
|
|
288
|
+
setValue: function setValue(value) {
|
|
289
|
+
var doc = this.editor.getDoc();
|
|
290
|
+
if (value && value !== doc.getValue()) {
|
|
291
|
+
var cursor = doc.getCursor();
|
|
292
|
+
doc.setValue(value);
|
|
293
|
+
doc.setCursor(cursor);
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
handleChange: function handleChange(editor) {
|
|
297
|
+
this.$emit("change", editor.getValue());
|
|
298
|
+
},
|
|
299
|
+
handleBlur: function handleBlur(editor) {
|
|
300
|
+
this.$emit("blur", editor);
|
|
301
|
+
},
|
|
302
|
+
handleFocus: function handleFocus(editor) {
|
|
303
|
+
this.$emit("focus", editor);
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
render: function render(h) {
|
|
307
|
+
return h("div", {
|
|
308
|
+
"ref": "codeMirrorRef",
|
|
309
|
+
"class": ["formula-codeMirror", this.className]
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
// EXTERNAL MODULE: external "element-ui/lib/input"
|
|
314
|
+
var input_ = __webpack_require__(21);
|
|
315
|
+
var input_default = /*#__PURE__*/__webpack_require__.n(input_);
|
|
316
|
+
|
|
317
|
+
// EXTERNAL MODULE: external "element-ui/lib/collapse"
|
|
318
|
+
var collapse_ = __webpack_require__(7);
|
|
319
|
+
var collapse_default = /*#__PURE__*/__webpack_require__.n(collapse_);
|
|
320
|
+
|
|
321
|
+
// EXTERNAL MODULE: external "element-ui/lib/collapse-item"
|
|
322
|
+
var collapse_item_ = __webpack_require__(8);
|
|
323
|
+
var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
324
|
+
|
|
325
|
+
// CONCATENATED MODULE: ./src/components/formula/src/funcList.js
|
|
326
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
/* harmony default export */ var funcList = ({
|
|
331
|
+
name: "FuncList",
|
|
332
|
+
componentName: "FuncList",
|
|
333
|
+
components: {
|
|
334
|
+
elInput: input_default.a,
|
|
335
|
+
elCollapse: collapse_default.a,
|
|
336
|
+
elCollapseItem: collapse_item_default.a
|
|
337
|
+
},
|
|
338
|
+
props: {
|
|
339
|
+
className: String,
|
|
340
|
+
data: Array
|
|
341
|
+
},
|
|
342
|
+
data: function data() {
|
|
343
|
+
return {
|
|
344
|
+
filteredFuncs: [],
|
|
345
|
+
activeFunc: null,
|
|
346
|
+
searchVal: null
|
|
347
|
+
};
|
|
348
|
+
},
|
|
349
|
+
created: function created() {
|
|
350
|
+
this.filteredFuncs = this.data || [];
|
|
351
|
+
},
|
|
352
|
+
methods: {
|
|
353
|
+
handleSearch: function handleSearch(val) {
|
|
354
|
+
this.searchVal = val;
|
|
355
|
+
var filtered = this.data.map(function (group) {
|
|
356
|
+
return _extends({}, group, {
|
|
357
|
+
items: val ? group.items.filter(function (item) {
|
|
358
|
+
return ~item.name.indexOf(val.toUpperCase());
|
|
359
|
+
}) : group.items
|
|
360
|
+
});
|
|
361
|
+
}).filter(function (group) {
|
|
362
|
+
return group.items.length;
|
|
363
|
+
});
|
|
364
|
+
console.log(filtered);
|
|
365
|
+
this.filteredFuncs = filtered;
|
|
366
|
+
},
|
|
367
|
+
setActiveFunc: function setActiveFunc(item) {
|
|
368
|
+
console.log(item);
|
|
369
|
+
this.activeFunc = item;
|
|
370
|
+
},
|
|
371
|
+
onSelect: function onSelect(item) {
|
|
372
|
+
this.$emit("select", item);
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
render: function render(h) {
|
|
376
|
+
var _this = this;
|
|
377
|
+
var Param = {
|
|
378
|
+
attrs: Object.assign({}, this.$attrs),
|
|
379
|
+
on: Object.assign({}, this.$listeners),
|
|
380
|
+
slots: this.$slots,
|
|
381
|
+
scopedSlots: this.$scopedSlots
|
|
382
|
+
};
|
|
383
|
+
return h("div", {
|
|
384
|
+
"class": ["FormulaEditor-FuncList", this.className]
|
|
385
|
+
}, [h("div", {
|
|
386
|
+
"class": "FormulaEditor-panel"
|
|
387
|
+
}, [h("div", {
|
|
388
|
+
"class": "FormulaEditor-panel-header"
|
|
389
|
+
}, ["\u51FD\u6570"]), h("div", {
|
|
390
|
+
"class": "FormulaEditor-panel-body"
|
|
391
|
+
}, [h("div", {
|
|
392
|
+
"class": "FormulaEditor-FuncList-searchBox"
|
|
393
|
+
}, [h("el-input", {
|
|
394
|
+
"attrs": {
|
|
395
|
+
"value": this.searchVal,
|
|
396
|
+
"prefix-icon": "el-icon-search",
|
|
397
|
+
"clearable": true
|
|
398
|
+
},
|
|
399
|
+
"on": {
|
|
400
|
+
"input": this.handleSearch
|
|
401
|
+
}
|
|
402
|
+
})]), h("div", {
|
|
403
|
+
"class": ["FormulaEditor-FuncList-body"]
|
|
404
|
+
}, [h("el-collapse", {
|
|
405
|
+
"attrs": {
|
|
406
|
+
"accordion": true
|
|
407
|
+
}
|
|
408
|
+
}, [this.filteredFuncs.map(function (group) {
|
|
409
|
+
return h("el-collapse-item", {
|
|
410
|
+
"attrs": {
|
|
411
|
+
"name": group.groupName,
|
|
412
|
+
"title": group.groupName
|
|
413
|
+
}
|
|
414
|
+
}, [group.items.map(function (item) {
|
|
415
|
+
return h("div", {
|
|
416
|
+
"class": ["FormulaEditor-FuncList-item", {
|
|
417
|
+
'is-active': item.name === (_this.activeFunc && _this.activeFunc.name)
|
|
418
|
+
}],
|
|
419
|
+
"on": {
|
|
420
|
+
"mouseenter": function mouseenter() {
|
|
421
|
+
return _this.setActiveFunc(item);
|
|
422
|
+
},
|
|
423
|
+
"click": function click() {
|
|
424
|
+
return _this.onSelect(item);
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
"key": item.name
|
|
428
|
+
}, [item.name]);
|
|
429
|
+
})]);
|
|
430
|
+
})])])])]), h("div", {
|
|
431
|
+
"class": "FormulaEditor-panel"
|
|
432
|
+
}, [h("div", {
|
|
433
|
+
"class": "FormulaEditor-panel-header"
|
|
434
|
+
}, [this.activeFunc && this.activeFunc.name || '']), h("div", {
|
|
435
|
+
"class": "FormulaEditor-panel-body"
|
|
436
|
+
}, [this.activeFunc ? h("div", {
|
|
437
|
+
"class": ["FormulaEditor-FuncList-doc"]
|
|
438
|
+
}, [h("pre", [h("code", [this.activeFunc.example])]), h("div", {
|
|
439
|
+
"class": "FormulaEditor-FuncList-doc-desc"
|
|
440
|
+
}, [this.activeFunc.description])]) : h("div")])])]);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
// EXTERNAL MODULE: external "element-ui/lib/tabs"
|
|
444
|
+
var tabs_ = __webpack_require__(5);
|
|
445
|
+
var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
|
|
446
|
+
|
|
447
|
+
// EXTERNAL MODULE: external "element-ui/lib/tab-pane"
|
|
448
|
+
var tab_pane_ = __webpack_require__(6);
|
|
449
|
+
var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
|
|
450
|
+
|
|
451
|
+
// EXTERNAL MODULE: external "element-ui/lib/tree"
|
|
452
|
+
var tree_ = __webpack_require__(58);
|
|
453
|
+
var tree_default = /*#__PURE__*/__webpack_require__.n(tree_);
|
|
454
|
+
|
|
455
|
+
// EXTERNAL MODULE: external "element-ui/lib/badge"
|
|
456
|
+
var badge_ = __webpack_require__(59);
|
|
457
|
+
var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
458
|
+
|
|
459
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/helper"
|
|
460
|
+
var helper_ = __webpack_require__(60);
|
|
461
|
+
|
|
462
|
+
// CONCATENATED MODULE: ./src/components/formula/src/variableList.js
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
/* harmony default export */ var variableList = ({
|
|
472
|
+
name: "VariableList",
|
|
473
|
+
componentName: "VariableList",
|
|
474
|
+
components: {
|
|
475
|
+
elInput: input_default.a,
|
|
476
|
+
elTabs: tabs_default.a,
|
|
477
|
+
elTabPane: tab_pane_default.a,
|
|
478
|
+
elTree: tree_default.a,
|
|
479
|
+
elBadge: badge_default.a
|
|
480
|
+
},
|
|
481
|
+
props: {
|
|
482
|
+
className: String,
|
|
483
|
+
itemClassName: String,
|
|
484
|
+
classPrefix: {
|
|
485
|
+
type: String,
|
|
486
|
+
default: "FormulaEditor-VariableList"
|
|
487
|
+
},
|
|
488
|
+
selectMode: String,
|
|
489
|
+
data: Array,
|
|
490
|
+
itemRender: Function,
|
|
491
|
+
selfVariableName: String
|
|
492
|
+
},
|
|
493
|
+
data: function data() {
|
|
494
|
+
return {
|
|
495
|
+
searchVal: null,
|
|
496
|
+
filterVars: []
|
|
497
|
+
};
|
|
498
|
+
},
|
|
499
|
+
created: function created() {
|
|
500
|
+
this.filterVars = this.data || [];
|
|
501
|
+
},
|
|
502
|
+
methods: {
|
|
503
|
+
handleSearch: function handleSearch(val) {
|
|
504
|
+
this.searchVal = val;
|
|
505
|
+
var filtered = Object(helper_["findTree"])(this.data, function (i) {
|
|
506
|
+
return ~i.label.indexOf(val);
|
|
507
|
+
});
|
|
508
|
+
this.filterVars = !val ? this.data : filtered ? [filtered] : [];
|
|
509
|
+
},
|
|
510
|
+
onSelect: function onSelect(item) {
|
|
511
|
+
this.$emit("select", item);
|
|
512
|
+
},
|
|
513
|
+
handleTree: function handleTree(data, node) {
|
|
514
|
+
this.onSelect(data);
|
|
515
|
+
},
|
|
516
|
+
renderSearchBox: function renderSearchBox(h) {
|
|
517
|
+
return h("div", {
|
|
518
|
+
"class": "FormulaEditor-VariableList-searchBox"
|
|
519
|
+
}, [h("el-input", {
|
|
520
|
+
"attrs": {
|
|
521
|
+
"value": this.searchVal,
|
|
522
|
+
"prefix-icon": "el-icon-search",
|
|
523
|
+
"clearable": true
|
|
524
|
+
},
|
|
525
|
+
"on": {
|
|
526
|
+
"input": this.handleSearch
|
|
527
|
+
}
|
|
528
|
+
})]);
|
|
529
|
+
},
|
|
530
|
+
renderItem: function renderItem(h, _ref) {
|
|
531
|
+
var node = _ref.node,
|
|
532
|
+
data = _ref.data,
|
|
533
|
+
store = _ref.store;
|
|
534
|
+
if (typeof this.itemRender === 'function') {
|
|
535
|
+
return this.itemRender.call(this, h, {
|
|
536
|
+
node: node,
|
|
537
|
+
data: data,
|
|
538
|
+
store: store
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
return h("span", {
|
|
542
|
+
"class": [this.classPrefix + "-item", this.itemClassName]
|
|
543
|
+
}, [data.label && this.selfVariableName && data.value === this.selfVariableName && h("el-badge", {
|
|
544
|
+
"attrs": {
|
|
545
|
+
"value": "self"
|
|
546
|
+
}
|
|
547
|
+
}, [h("label", [data.label])]), data.label && (!this.selfVariableName || data.value !== this.selfVariableName) && h("label", [data.label]), data.tag ? h("span", {
|
|
548
|
+
"class": this.classPrefix + "-item-tag"
|
|
549
|
+
}, [data.tag]) : null]);
|
|
550
|
+
},
|
|
551
|
+
renderTab: function renderTab(h) {
|
|
552
|
+
var _this = this;
|
|
553
|
+
return h("el-tabs", {
|
|
554
|
+
"class": [this.classPrefix + "-base " + this.classPrefix + "-tabs"]
|
|
555
|
+
}, [this.filterVars.map(function (item, index) {
|
|
556
|
+
return h("el-tab-pane", {
|
|
557
|
+
"class": _this.classPrefix + "-tab",
|
|
558
|
+
"key": index,
|
|
559
|
+
"attrs": {
|
|
560
|
+
"label": item.label
|
|
561
|
+
}
|
|
562
|
+
}, [h("VariableList", babel_helper_vue_jsx_merge_props_default()([{
|
|
563
|
+
"attrs": {
|
|
564
|
+
"classPrefix": _this.classPrefix + "-sub-",
|
|
565
|
+
"className": _this.classPrefix + "-sub",
|
|
566
|
+
"selectMode": item.selectMode,
|
|
567
|
+
"data": item.children,
|
|
568
|
+
"selfVariableName": _this.selfVariableName
|
|
569
|
+
}
|
|
570
|
+
}, {
|
|
571
|
+
"on": {
|
|
572
|
+
select: _this.onSelect
|
|
573
|
+
}
|
|
574
|
+
}]))]);
|
|
575
|
+
})]);
|
|
576
|
+
},
|
|
577
|
+
renderTree: function renderTree(h) {
|
|
578
|
+
return h("div", {
|
|
579
|
+
"class": "FormulaEditor-VariableList-body"
|
|
580
|
+
}, [this.renderSearchBox(h), h("el-tree", babel_helper_vue_jsx_merge_props_default()([{
|
|
581
|
+
"class": [this.classPrefix + "-base", "is-scrollable"],
|
|
582
|
+
"attrs": {
|
|
583
|
+
"expand-on-click-node": false,
|
|
584
|
+
"default-expand-all": true,
|
|
585
|
+
"data": this.filterVars,
|
|
586
|
+
"render-content": this.renderItem
|
|
587
|
+
}
|
|
588
|
+
}, {
|
|
589
|
+
"on": {
|
|
590
|
+
"node-click": this.handleTree
|
|
591
|
+
}
|
|
592
|
+
}]))]);
|
|
593
|
+
},
|
|
594
|
+
renderOption: function renderOption(h, _ref2) {
|
|
595
|
+
var _this2 = this;
|
|
596
|
+
var data = _ref2.data;
|
|
597
|
+
if (Array.isArray(data.children)) {
|
|
598
|
+
return h("div", {
|
|
599
|
+
"class": "GroupedSelection-group"
|
|
600
|
+
}, [h("div", {
|
|
601
|
+
"class": "GroupedSelection-itemLabel"
|
|
602
|
+
}, [this.renderItem(h, {
|
|
603
|
+
data: data
|
|
604
|
+
})]), h("div", {
|
|
605
|
+
"class": "GroupedSelection-items"
|
|
606
|
+
}, [data.children && data.children.map(function (child) {
|
|
607
|
+
return _this2.renderOption(h, {
|
|
608
|
+
data: child
|
|
609
|
+
});
|
|
610
|
+
})])]);
|
|
611
|
+
}
|
|
612
|
+
return h("div", {
|
|
613
|
+
"class": ["GroupedSelection-item"],
|
|
614
|
+
"on": {
|
|
615
|
+
"click": function click() {
|
|
616
|
+
return _this2.onSelect(data);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}, [h("div", {
|
|
620
|
+
"class": "GroupedSelection-itemLabel"
|
|
621
|
+
}, [this.renderItem(h, {
|
|
622
|
+
data: data
|
|
623
|
+
})])]);
|
|
624
|
+
},
|
|
625
|
+
renderContent: function renderContent(h) {
|
|
626
|
+
var _this3 = this;
|
|
627
|
+
if (this.selectMode === 'tree') {
|
|
628
|
+
return this.renderTree(h);
|
|
629
|
+
}
|
|
630
|
+
return h("div", {
|
|
631
|
+
"class": "FormulaEditor-VariableList-body"
|
|
632
|
+
}, [this.renderSearchBox(h), h("div", {
|
|
633
|
+
"class": ["GroupedSelection", this.classPrefix + "-base", 'is-scrollable']
|
|
634
|
+
}, [this.filterVars.map(function (item) {
|
|
635
|
+
return _this3.renderOption(h, {
|
|
636
|
+
data: item
|
|
637
|
+
});
|
|
638
|
+
})])]);
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
render: function render(h) {
|
|
642
|
+
return h("div", {
|
|
643
|
+
"class": ["FormulaEditor-VariableList", this.selectMode && "FormulaEditor-VariableList-" + this.selectMode, this.className]
|
|
644
|
+
}, [this.selectMode === 'tabs' ? this.renderTab(h) : this.renderContent(h)]);
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
648
|
+
/**
|
|
649
|
+
* @file 扩展 codemirror
|
|
650
|
+
*/
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* 遍历树
|
|
654
|
+
* @param tree
|
|
655
|
+
* @param iterator
|
|
656
|
+
*/
|
|
657
|
+
function eachTree(tree, iterator, level, paths) {
|
|
658
|
+
if (level === void 0) {
|
|
659
|
+
level = 1;
|
|
660
|
+
}
|
|
661
|
+
if (paths === void 0) {
|
|
662
|
+
paths = [];
|
|
663
|
+
}
|
|
664
|
+
tree.map(function (item, index) {
|
|
665
|
+
var currentPath = paths.concat(item);
|
|
666
|
+
iterator(item, index, level, currentPath);
|
|
667
|
+
if (item.children && item.children.splice) {
|
|
668
|
+
eachTree(item.children, iterator, level + 1, currentPath);
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
673
|
+
var from = str.slice(0, idx);
|
|
674
|
+
var left = str.slice(idx);
|
|
675
|
+
return from + left.replace(key, replaceKey);
|
|
676
|
+
}
|
|
677
|
+
function getRegExpByMode(evalMode, key) {
|
|
678
|
+
var reg = evalMode ? "\\b" + key + "\\b" : "\\$\\{[^\\{\\}]*\\b" + key + "\\b[^\\{\\}]*\\}";
|
|
679
|
+
return new RegExp(reg);
|
|
680
|
+
}
|
|
681
|
+
function plugin_editorFactory(dom, cm, props) {
|
|
682
|
+
registerLaunguageMode(cm);
|
|
683
|
+
return cm(dom, {
|
|
684
|
+
value: props && props.value || '',
|
|
685
|
+
autofocus: true,
|
|
686
|
+
mode: props && props.evalMode ? 'text/formula' : 'text/formula-template'
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
var FormulaPlugin = /*#__PURE__*/function () {
|
|
690
|
+
function FormulaPlugin(editor, cm, getProps) {
|
|
691
|
+
this.editor = editor;
|
|
692
|
+
this.cm = cm;
|
|
693
|
+
this.getProps = getProps;
|
|
694
|
+
// editor.on('change', this.autoMarkText);
|
|
695
|
+
this.autoMarkText();
|
|
696
|
+
}
|
|
697
|
+
var _proto = FormulaPlugin.prototype;
|
|
698
|
+
_proto.autoMarkText = function autoMarkText() {
|
|
699
|
+
var _this$getProps = this.getProps(),
|
|
700
|
+
functions = _this$getProps.functions,
|
|
701
|
+
variables = _this$getProps.variables,
|
|
702
|
+
value = _this$getProps.value;
|
|
703
|
+
if (value) {
|
|
704
|
+
// todo functions 也需要自动替换
|
|
705
|
+
this.autoMark(variables);
|
|
706
|
+
this.focus(value);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
// 计算 `${`、`}` 括号的位置,如 ${a}+${b}, 结果是 [ { from: 0, to: 3 }, { from: 5, to: 8 } ]
|
|
710
|
+
;
|
|
711
|
+
_proto.computedBracesPosition = function computedBracesPosition(exp) {
|
|
712
|
+
var braces = [];
|
|
713
|
+
exp === null || exp === void 0 ? void 0 : exp.replace(/\$\{/g, function (val, offset) {
|
|
714
|
+
if (val) {
|
|
715
|
+
var charArr = exp.slice(offset + val.length).split('');
|
|
716
|
+
var cache = ['${'];
|
|
717
|
+
for (var index = 0; index < charArr.length; index++) {
|
|
718
|
+
var char = charArr[index];
|
|
719
|
+
if (char === '$' && charArr[index + 1] === '{') {
|
|
720
|
+
cache.push('${');
|
|
721
|
+
} else if (char === '}') {
|
|
722
|
+
cache.pop();
|
|
723
|
+
}
|
|
724
|
+
if (cache.length === 0) {
|
|
725
|
+
braces.push({
|
|
726
|
+
begin: offset + 2,
|
|
727
|
+
end: index + offset + 2
|
|
728
|
+
});
|
|
729
|
+
break;
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
return '';
|
|
734
|
+
});
|
|
735
|
+
return braces;
|
|
736
|
+
}
|
|
737
|
+
// 判断字符串是否在 ${} 中
|
|
738
|
+
;
|
|
739
|
+
_proto.checkStrIsInBraces = function checkStrIsInBraces(_ref, braces) {
|
|
740
|
+
var from = _ref[0],
|
|
741
|
+
to = _ref[1];
|
|
742
|
+
var isIn = false;
|
|
743
|
+
if (braces.length) {
|
|
744
|
+
for (var index = 0; index < braces.length; index++) {
|
|
745
|
+
var brace = braces[index];
|
|
746
|
+
if (from >= brace.begin && to <= brace.end) {
|
|
747
|
+
isIn = true;
|
|
748
|
+
break;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
return isIn;
|
|
753
|
+
};
|
|
754
|
+
_proto.insertBraces = function insertBraces(originFrom, originTo) {
|
|
755
|
+
var str = this.editor.getValue();
|
|
756
|
+
var braces = this.computedBracesPosition(str);
|
|
757
|
+
if (!this.checkStrIsInBraces([originFrom.ch, originTo.ch], braces)) {
|
|
758
|
+
this.editor.setCursor({
|
|
759
|
+
line: originFrom.line,
|
|
760
|
+
ch: originFrom.ch
|
|
761
|
+
});
|
|
762
|
+
this.editor.replaceSelection('${');
|
|
763
|
+
this.editor.setCursor({
|
|
764
|
+
line: originTo.line,
|
|
765
|
+
ch: originTo.ch + 2
|
|
766
|
+
});
|
|
767
|
+
this.editor.replaceSelection('}');
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
_proto.insertContent = function insertContent(value, type) {
|
|
771
|
+
var from = this.editor.getCursor();
|
|
772
|
+
var _this$getProps2 = this.getProps(),
|
|
773
|
+
evalMode = _this$getProps2.evalMode;
|
|
774
|
+
if (type === 'variable') {
|
|
775
|
+
this.editor.replaceSelection(value.key);
|
|
776
|
+
var to = this.editor.getCursor();
|
|
777
|
+
this.markText(from, to, value.name, 'cm-field');
|
|
778
|
+
!evalMode && this.insertBraces(from, to);
|
|
779
|
+
} else if (type === 'func') {
|
|
780
|
+
this.editor.replaceSelection(value + "()");
|
|
781
|
+
var _to = this.editor.getCursor();
|
|
782
|
+
this.markText(from, {
|
|
783
|
+
line: _to.line,
|
|
784
|
+
ch: _to.ch - 2
|
|
785
|
+
}, value, 'cm-func');
|
|
786
|
+
this.editor.setCursor({
|
|
787
|
+
line: _to.line,
|
|
788
|
+
ch: _to.ch - 1
|
|
789
|
+
});
|
|
790
|
+
if (!evalMode) {
|
|
791
|
+
this.insertBraces(from, _to);
|
|
792
|
+
this.editor.setCursor({
|
|
793
|
+
line: _to.line,
|
|
794
|
+
ch: _to.ch + 1
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
} else if (typeof value === 'string') {
|
|
798
|
+
this.editor.replaceSelection(value);
|
|
799
|
+
}
|
|
800
|
+
this.editor.focus();
|
|
801
|
+
};
|
|
802
|
+
_proto.markText = function markText(from, to, label, className) {
|
|
803
|
+
if (className === void 0) {
|
|
804
|
+
className = 'cm-func';
|
|
805
|
+
}
|
|
806
|
+
var text = document.createElement('span');
|
|
807
|
+
text.className = className;
|
|
808
|
+
text.innerText = label;
|
|
809
|
+
this.editor.markText(from, to, {
|
|
810
|
+
atomic: true,
|
|
811
|
+
replacedWith: text
|
|
812
|
+
});
|
|
813
|
+
};
|
|
814
|
+
_proto.autoMark = function autoMark(variables) {
|
|
815
|
+
var _this = this;
|
|
816
|
+
if (!Array.isArray(variables) || !variables.length) {
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
var varMap = {};
|
|
820
|
+
eachTree(variables, function (item) {
|
|
821
|
+
if (item.value) {
|
|
822
|
+
varMap[item.value] = item.label;
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
var vars = Object.keys(varMap).sort(function (a, b) {
|
|
826
|
+
return b.length - a.length;
|
|
827
|
+
});
|
|
828
|
+
var editor = this.editor;
|
|
829
|
+
var lines = editor.lineCount();
|
|
830
|
+
var _this$getProps3 = this.getProps(),
|
|
831
|
+
_this$getProps3$evalM = _this$getProps3.evalMode,
|
|
832
|
+
evalMode = _this$getProps3$evalM === void 0 ? true : _this$getProps3$evalM;
|
|
833
|
+
var _loop = function _loop(line) {
|
|
834
|
+
var content = editor.getLine(line);
|
|
835
|
+
// 标记方法调用
|
|
836
|
+
content.replace(/([A-Z]+)\s*\(/g, function (_, func, pos) {
|
|
837
|
+
_this.markText({
|
|
838
|
+
line: line,
|
|
839
|
+
ch: pos
|
|
840
|
+
}, {
|
|
841
|
+
line: line,
|
|
842
|
+
ch: pos + func.length
|
|
843
|
+
}, func, 'cm-func');
|
|
844
|
+
return _;
|
|
845
|
+
});
|
|
846
|
+
var REPLACE_KEY = 'AMIS_FORMULA_REPLACE_KEY';
|
|
847
|
+
// 标记变量
|
|
848
|
+
vars.forEach(function (v) {
|
|
849
|
+
var from = 0;
|
|
850
|
+
var idx = -1;
|
|
851
|
+
while (~(idx = content.indexOf(v, from))) {
|
|
852
|
+
var encode = replaceStrByIndex(content, idx, v, REPLACE_KEY);
|
|
853
|
+
var reg = getRegExpByMode(evalMode, REPLACE_KEY);
|
|
854
|
+
if (reg.test(encode)) {
|
|
855
|
+
_this.markText({
|
|
856
|
+
line: line,
|
|
857
|
+
ch: idx
|
|
858
|
+
}, {
|
|
859
|
+
line: line,
|
|
860
|
+
ch: idx + v.length
|
|
861
|
+
}, varMap[v], 'cm-field');
|
|
862
|
+
}
|
|
863
|
+
from = idx + v.length;
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
};
|
|
867
|
+
for (var line = 0; line < lines; line++) {
|
|
868
|
+
_loop(line);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
// 焦点放在最后
|
|
872
|
+
;
|
|
873
|
+
_proto.focus = function focus(value) {
|
|
874
|
+
this.editor.setCursor({
|
|
875
|
+
line: 0,
|
|
876
|
+
ch: (value === null || value === void 0 ? void 0 : value.length) || 0
|
|
877
|
+
});
|
|
878
|
+
};
|
|
879
|
+
_proto.dispose = function dispose() {};
|
|
880
|
+
_proto.validate = function validate() {};
|
|
881
|
+
return FormulaPlugin;
|
|
882
|
+
}();
|
|
883
|
+
var modeRegisted = false;
|
|
884
|
+
function registerLaunguageMode(cm) {
|
|
885
|
+
if (modeRegisted) {
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
modeRegisted = true;
|
|
889
|
+
// 对应 evalMode
|
|
890
|
+
cm.defineMode('formula', function (config, parserConfig) {
|
|
891
|
+
var formula = cm.getMode(config, 'javascript');
|
|
892
|
+
if (!parserConfig || !parserConfig.base) return formula;
|
|
893
|
+
debugger;
|
|
894
|
+
return cm.multiplexingMode(cm.getMode(config, parserConfig.base), {
|
|
895
|
+
open: '${',
|
|
896
|
+
close: '}',
|
|
897
|
+
mode: formula
|
|
898
|
+
});
|
|
899
|
+
});
|
|
900
|
+
cm.defineMIME('text/formula', {
|
|
901
|
+
name: 'formula'
|
|
902
|
+
});
|
|
903
|
+
cm.defineMIME('text/formula-template', {
|
|
904
|
+
name: 'formula',
|
|
905
|
+
base: 'htmlmixed'
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
// CONCATENATED MODULE: ./src/utils/formula/doc.js
|
|
909
|
+
/**
|
|
910
|
+
* 公式文档 请运行 `npm run genDoc` 自动生成
|
|
911
|
+
*/
|
|
912
|
+
/* harmony default export */ var doc = ([{
|
|
913
|
+
name: "IF",
|
|
914
|
+
description: "示例:IF(A, B, C)\n\n如果满足条件A,则返回B,否则返回C,支持多层嵌套IF函数。\n\n也可以用表达式如:A ? B : C",
|
|
915
|
+
example: "IF(condition, consequent, alternate)",
|
|
916
|
+
params: [{
|
|
917
|
+
type: "expression",
|
|
918
|
+
name: "condition",
|
|
919
|
+
description: "条件表达式."
|
|
920
|
+
}, {
|
|
921
|
+
type: "any",
|
|
922
|
+
name: "consequent",
|
|
923
|
+
description: "条件判断通过的返回结果"
|
|
924
|
+
}, {
|
|
925
|
+
type: "any",
|
|
926
|
+
name: "alternate",
|
|
927
|
+
description: "条件判断不通过的返回结果"
|
|
928
|
+
}],
|
|
929
|
+
returns: {
|
|
930
|
+
type: "any",
|
|
931
|
+
description: "根据条件返回不同的结果"
|
|
932
|
+
},
|
|
933
|
+
namespace: "逻辑函数"
|
|
934
|
+
}, {
|
|
935
|
+
name: "AND",
|
|
936
|
+
description: "条件全部符合,返回 true,否则返回 false\n\n示例:AND(语文成绩>80, 数学成绩>80)\n\n语文成绩和数学成绩都大于 80,则返回 true,否则返回 false\n\n也可以直接用表达式如:语文成绩>80 && 数学成绩>80",
|
|
937
|
+
example: "AND(expression1, expression2, ...expressionN)",
|
|
938
|
+
params: [{
|
|
939
|
+
type: "...expression",
|
|
940
|
+
name: "conditions",
|
|
941
|
+
description: "条件表达式."
|
|
942
|
+
}],
|
|
943
|
+
returns: {
|
|
944
|
+
type: "boolean",
|
|
945
|
+
description: null
|
|
946
|
+
},
|
|
947
|
+
namespace: "逻辑函数"
|
|
948
|
+
}, {
|
|
949
|
+
name: "OR",
|
|
950
|
+
description: "条件任意一个满足条件,返回 true,否则返回 false\n\n示例:OR(语文成绩>80, 数学成绩>80)\n\n语文成绩和数学成绩任意一个大于 80,则返回 true,否则返回 false\n\n也可以直接用表达式如:语文成绩>80 || 数学成绩>80",
|
|
951
|
+
example: "OR(expression1, expression2, ...expressionN)",
|
|
952
|
+
params: [{
|
|
953
|
+
type: "...expression",
|
|
954
|
+
name: "conditions",
|
|
955
|
+
description: "条件表达式."
|
|
956
|
+
}],
|
|
957
|
+
returns: {
|
|
958
|
+
type: "boolean",
|
|
959
|
+
description: null
|
|
960
|
+
},
|
|
961
|
+
namespace: "逻辑函数"
|
|
962
|
+
}, {
|
|
963
|
+
name: "XOR",
|
|
964
|
+
description: "异或处理,多个表达式组中存在奇数个真时认为真。",
|
|
965
|
+
example: "XOR(condition1, condition2)",
|
|
966
|
+
params: [{
|
|
967
|
+
type: "expression",
|
|
968
|
+
name: "condition1",
|
|
969
|
+
description: "条件表达式1"
|
|
970
|
+
}, {
|
|
971
|
+
type: "expression",
|
|
972
|
+
name: "condition2",
|
|
973
|
+
description: "条件表达式2"
|
|
974
|
+
}],
|
|
975
|
+
returns: {
|
|
976
|
+
type: "boolean",
|
|
977
|
+
description: null
|
|
978
|
+
},
|
|
979
|
+
namespace: "逻辑函数"
|
|
980
|
+
}, {
|
|
981
|
+
name: "IFS",
|
|
982
|
+
description: "判断函数集合,相当于多个 else if 合并成一个。\n\n示例:IFS(语文成绩 > 80, \"优秀\", 语文成绩 > 60, \"良\", \"继续努力\")\n\n如果语文成绩大于 80,则返回优秀,否则判断大于 60 分,则返回良,否则返回继续努力。",
|
|
983
|
+
example: "IFS(condition1, result1, condition2, result2,...conditionN, resultN)",
|
|
984
|
+
params: [{
|
|
985
|
+
type: "...any",
|
|
986
|
+
name: "args",
|
|
987
|
+
description: "条件,返回值集合"
|
|
988
|
+
}],
|
|
989
|
+
returns: {
|
|
990
|
+
type: "any",
|
|
991
|
+
description: "第一个满足条件的结果,没有命中的返回 false。"
|
|
992
|
+
},
|
|
993
|
+
namespace: "逻辑函数"
|
|
994
|
+
}, {
|
|
995
|
+
name: "ABS",
|
|
996
|
+
description: "返回传入数字的绝对值",
|
|
997
|
+
example: "ABS(num)",
|
|
998
|
+
params: [{
|
|
999
|
+
type: "number",
|
|
1000
|
+
name: "num",
|
|
1001
|
+
description: "数值"
|
|
1002
|
+
}],
|
|
1003
|
+
returns: {
|
|
1004
|
+
type: "number",
|
|
1005
|
+
description: "传入数值的绝对值"
|
|
1006
|
+
},
|
|
1007
|
+
namespace: "数学函数"
|
|
1008
|
+
}, {
|
|
1009
|
+
name: "MAX",
|
|
1010
|
+
description: "获取最大值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1011
|
+
example: "MAX(num1, num2, ...numN)",
|
|
1012
|
+
params: [{
|
|
1013
|
+
type: "...number",
|
|
1014
|
+
name: "num",
|
|
1015
|
+
description: "数值"
|
|
1016
|
+
}],
|
|
1017
|
+
returns: {
|
|
1018
|
+
type: "number",
|
|
1019
|
+
description: "所有传入值中最大的那个"
|
|
1020
|
+
},
|
|
1021
|
+
namespace: "数学函数"
|
|
1022
|
+
}, {
|
|
1023
|
+
name: "MIN",
|
|
1024
|
+
description: "获取最小值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1025
|
+
example: "MIN(num1, num2, ...numN)",
|
|
1026
|
+
params: [{
|
|
1027
|
+
type: "...number",
|
|
1028
|
+
name: "num",
|
|
1029
|
+
description: "数值"
|
|
1030
|
+
}],
|
|
1031
|
+
returns: {
|
|
1032
|
+
type: "number",
|
|
1033
|
+
description: "所有传入值中最小的那个"
|
|
1034
|
+
},
|
|
1035
|
+
namespace: "数学函数"
|
|
1036
|
+
}, {
|
|
1037
|
+
name: "SUM",
|
|
1038
|
+
description: "求和,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1039
|
+
example: "SUM(num1, num2, ...numN)",
|
|
1040
|
+
params: [{
|
|
1041
|
+
type: "...number",
|
|
1042
|
+
name: "num",
|
|
1043
|
+
description: "数值"
|
|
1044
|
+
}],
|
|
1045
|
+
returns: {
|
|
1046
|
+
type: "number",
|
|
1047
|
+
description: "所有传入数值的总和"
|
|
1048
|
+
},
|
|
1049
|
+
namespace: "数学函数"
|
|
1050
|
+
}, {
|
|
1051
|
+
name: "INT",
|
|
1052
|
+
description: "将数值向下取整为最接近的整数",
|
|
1053
|
+
example: "INT(num)",
|
|
1054
|
+
params: [{
|
|
1055
|
+
type: "number",
|
|
1056
|
+
name: "num",
|
|
1057
|
+
description: "数值"
|
|
1058
|
+
}],
|
|
1059
|
+
returns: {
|
|
1060
|
+
type: "number",
|
|
1061
|
+
description: "数值对应的整形"
|
|
1062
|
+
},
|
|
1063
|
+
namespace: "数学函数"
|
|
1064
|
+
}, {
|
|
1065
|
+
name: "MOD",
|
|
1066
|
+
description: "返回两数相除的余数,参数 number 是被除数,divisor 是除数",
|
|
1067
|
+
example: "MOD(num, divisor)",
|
|
1068
|
+
params: [{
|
|
1069
|
+
type: "number",
|
|
1070
|
+
name: "num",
|
|
1071
|
+
description: "被除数"
|
|
1072
|
+
}, {
|
|
1073
|
+
type: "number",
|
|
1074
|
+
name: "divisor",
|
|
1075
|
+
description: "除数"
|
|
1076
|
+
}],
|
|
1077
|
+
returns: {
|
|
1078
|
+
type: "number",
|
|
1079
|
+
description: "两数相除的余数"
|
|
1080
|
+
},
|
|
1081
|
+
namespace: "数学函数"
|
|
1082
|
+
}, {
|
|
1083
|
+
name: "PI",
|
|
1084
|
+
description: "圆周率 3.1415...",
|
|
1085
|
+
example: "PI()",
|
|
1086
|
+
params: [],
|
|
1087
|
+
returns: {
|
|
1088
|
+
type: "number",
|
|
1089
|
+
description: "圆周率数值"
|
|
1090
|
+
},
|
|
1091
|
+
namespace: "数学函数"
|
|
1092
|
+
}, {
|
|
1093
|
+
name: "ROUND",
|
|
1094
|
+
description: "将数字四舍五入到指定的位数,可以设置小数位。",
|
|
1095
|
+
example: "ROUND(num[, numDigits = 2])",
|
|
1096
|
+
params: [{
|
|
1097
|
+
type: "number",
|
|
1098
|
+
name: "num",
|
|
1099
|
+
description: "要处理的数字"
|
|
1100
|
+
}, {
|
|
1101
|
+
type: "number",
|
|
1102
|
+
name: "numDigits",
|
|
1103
|
+
description: "小数位数"
|
|
1104
|
+
}],
|
|
1105
|
+
returns: {
|
|
1106
|
+
type: "number",
|
|
1107
|
+
description: "传入数值四舍五入后的结果"
|
|
1108
|
+
},
|
|
1109
|
+
namespace: "数学函数"
|
|
1110
|
+
}, {
|
|
1111
|
+
name: "FLOOR",
|
|
1112
|
+
description: "将数字向下取整到指定的位数,可以设置小数位。",
|
|
1113
|
+
example: "FLOOR(num[, numDigits=2])",
|
|
1114
|
+
params: [{
|
|
1115
|
+
type: "number",
|
|
1116
|
+
name: "num",
|
|
1117
|
+
description: "要处理的数字"
|
|
1118
|
+
}, {
|
|
1119
|
+
type: "number",
|
|
1120
|
+
name: "numDigits",
|
|
1121
|
+
description: "小数位数"
|
|
1122
|
+
}],
|
|
1123
|
+
returns: {
|
|
1124
|
+
type: "number",
|
|
1125
|
+
description: "传入数值向下取整后的结果"
|
|
1126
|
+
},
|
|
1127
|
+
namespace: "数学函数"
|
|
1128
|
+
}, {
|
|
1129
|
+
name: "CEIL",
|
|
1130
|
+
description: "将数字向上取整到指定的位数,可以设置小数位。",
|
|
1131
|
+
example: "CEIL(num[, numDigits=2])",
|
|
1132
|
+
params: [{
|
|
1133
|
+
type: "number",
|
|
1134
|
+
name: "num",
|
|
1135
|
+
description: "要处理的数字"
|
|
1136
|
+
}, {
|
|
1137
|
+
type: "number",
|
|
1138
|
+
name: "numDigits",
|
|
1139
|
+
description: "小数位数"
|
|
1140
|
+
}],
|
|
1141
|
+
returns: {
|
|
1142
|
+
type: "number",
|
|
1143
|
+
description: "传入数值向上取整后的结果"
|
|
1144
|
+
},
|
|
1145
|
+
namespace: "数学函数"
|
|
1146
|
+
}, {
|
|
1147
|
+
name: "SQRT",
|
|
1148
|
+
description: "开平方,参数 number 为非负数",
|
|
1149
|
+
example: "SQRT(num)",
|
|
1150
|
+
params: [{
|
|
1151
|
+
type: "number",
|
|
1152
|
+
name: "num",
|
|
1153
|
+
description: "要处理的数字"
|
|
1154
|
+
}],
|
|
1155
|
+
returns: {
|
|
1156
|
+
type: "number",
|
|
1157
|
+
description: "开平方的结果"
|
|
1158
|
+
},
|
|
1159
|
+
namespace: "数学函数"
|
|
1160
|
+
}, {
|
|
1161
|
+
name: "AVG",
|
|
1162
|
+
description: "返回所有参数的平均值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1163
|
+
example: "AVG(num1, num2, ...numN)",
|
|
1164
|
+
params: [{
|
|
1165
|
+
type: "...number",
|
|
1166
|
+
name: "num",
|
|
1167
|
+
description: "要处理的数字"
|
|
1168
|
+
}],
|
|
1169
|
+
returns: {
|
|
1170
|
+
type: "number",
|
|
1171
|
+
description: "所有数值的平均值"
|
|
1172
|
+
},
|
|
1173
|
+
namespace: "数学函数"
|
|
1174
|
+
}, {
|
|
1175
|
+
name: "DEVSQ",
|
|
1176
|
+
description: "返回数据点与数据均值点之差(数据偏差)的平方和,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1177
|
+
example: "DEVSQ(num1, num2, ...numN)",
|
|
1178
|
+
params: [{
|
|
1179
|
+
type: "...number",
|
|
1180
|
+
name: "num",
|
|
1181
|
+
description: "要处理的数字"
|
|
1182
|
+
}],
|
|
1183
|
+
returns: {
|
|
1184
|
+
type: "number",
|
|
1185
|
+
description: "所有数值的平均值"
|
|
1186
|
+
},
|
|
1187
|
+
namespace: "数学函数"
|
|
1188
|
+
}, {
|
|
1189
|
+
name: "AVEDEV",
|
|
1190
|
+
description: "数据点到其算术平均值的绝对偏差的平均值",
|
|
1191
|
+
example: "AVEDEV(num1, num2, ...numN)",
|
|
1192
|
+
params: [{
|
|
1193
|
+
type: "...number",
|
|
1194
|
+
name: "num",
|
|
1195
|
+
description: "要处理的数字"
|
|
1196
|
+
}],
|
|
1197
|
+
returns: {
|
|
1198
|
+
type: "number",
|
|
1199
|
+
description: "所有数值的平均值"
|
|
1200
|
+
},
|
|
1201
|
+
namespace: "数学函数"
|
|
1202
|
+
}, {
|
|
1203
|
+
name: "HARMEAN",
|
|
1204
|
+
description: "数据点的调和平均值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
1205
|
+
example: "HARMEAN(num1, num2, ...numN)",
|
|
1206
|
+
params: [{
|
|
1207
|
+
type: "...number",
|
|
1208
|
+
name: "num",
|
|
1209
|
+
description: "要处理的数字"
|
|
1210
|
+
}],
|
|
1211
|
+
returns: {
|
|
1212
|
+
type: "number",
|
|
1213
|
+
description: "所有数值的平均值"
|
|
1214
|
+
},
|
|
1215
|
+
namespace: "数学函数"
|
|
1216
|
+
}, {
|
|
1217
|
+
name: "LARGE",
|
|
1218
|
+
description: "数据集中第 k 个最大值",
|
|
1219
|
+
example: "LARGE(array, k)",
|
|
1220
|
+
params: [{
|
|
1221
|
+
type: "array",
|
|
1222
|
+
name: "nums",
|
|
1223
|
+
description: "要处理的数字"
|
|
1224
|
+
}, {
|
|
1225
|
+
type: "number",
|
|
1226
|
+
name: "k",
|
|
1227
|
+
description: "第几大"
|
|
1228
|
+
}],
|
|
1229
|
+
returns: {
|
|
1230
|
+
type: "number",
|
|
1231
|
+
description: "所有数值的平均值"
|
|
1232
|
+
},
|
|
1233
|
+
namespace: "数学函数"
|
|
1234
|
+
}, {
|
|
1235
|
+
name: "UPPERMONEY",
|
|
1236
|
+
description: "将数值转为中文大写金额",
|
|
1237
|
+
example: "UPPERMONEY(num)",
|
|
1238
|
+
params: [{
|
|
1239
|
+
type: "number",
|
|
1240
|
+
name: "num",
|
|
1241
|
+
description: "要处理的数字"
|
|
1242
|
+
}],
|
|
1243
|
+
returns: {
|
|
1244
|
+
type: "string",
|
|
1245
|
+
description: "数值中文大写字符"
|
|
1246
|
+
},
|
|
1247
|
+
namespace: "数学函数"
|
|
1248
|
+
}, {
|
|
1249
|
+
name: "RAND",
|
|
1250
|
+
description: "返回大于等于 0 且小于 1 的均匀分布随机实数。每一次触发计算都会变化。\n\n示例:`RAND()*100`\n\n返回 0-100 之间的随机数",
|
|
1251
|
+
example: "RAND()",
|
|
1252
|
+
params: [],
|
|
1253
|
+
returns: {
|
|
1254
|
+
type: "number",
|
|
1255
|
+
description: "随机数"
|
|
1256
|
+
},
|
|
1257
|
+
namespace: "数学函数"
|
|
1258
|
+
}, {
|
|
1259
|
+
name: "LAST",
|
|
1260
|
+
description: "取数据最后一个",
|
|
1261
|
+
example: "LAST(array)",
|
|
1262
|
+
params: [{
|
|
1263
|
+
type: "...number",
|
|
1264
|
+
name: "arr",
|
|
1265
|
+
description: "要处理的数组"
|
|
1266
|
+
}],
|
|
1267
|
+
returns: {
|
|
1268
|
+
type: "any",
|
|
1269
|
+
description: "最后一个值"
|
|
1270
|
+
},
|
|
1271
|
+
namespace: "数学函数"
|
|
1272
|
+
}, {
|
|
1273
|
+
name: "LEFT",
|
|
1274
|
+
description: "返回传入文本左侧的指定长度字符串。",
|
|
1275
|
+
example: "LEFT(text, len)",
|
|
1276
|
+
params: [{
|
|
1277
|
+
type: "string",
|
|
1278
|
+
name: "text",
|
|
1279
|
+
description: "要处理的文本"
|
|
1280
|
+
}, {
|
|
1281
|
+
type: "number",
|
|
1282
|
+
name: "len",
|
|
1283
|
+
description: "要处理的长度"
|
|
1284
|
+
}],
|
|
1285
|
+
returns: {
|
|
1286
|
+
type: "string",
|
|
1287
|
+
description: "对应字符串"
|
|
1288
|
+
},
|
|
1289
|
+
namespace: "文本函数"
|
|
1290
|
+
}, {
|
|
1291
|
+
name: "RIGHT",
|
|
1292
|
+
description: "返回传入文本右侧的指定长度字符串。",
|
|
1293
|
+
example: "RIGHT(text, len)",
|
|
1294
|
+
params: [{
|
|
1295
|
+
type: "string",
|
|
1296
|
+
name: "text",
|
|
1297
|
+
description: "要处理的文本"
|
|
1298
|
+
}, {
|
|
1299
|
+
type: "number",
|
|
1300
|
+
name: "len",
|
|
1301
|
+
description: "要处理的长度"
|
|
1302
|
+
}],
|
|
1303
|
+
returns: {
|
|
1304
|
+
type: "string",
|
|
1305
|
+
description: "对应字符串"
|
|
1306
|
+
},
|
|
1307
|
+
namespace: "文本函数"
|
|
1308
|
+
}, {
|
|
1309
|
+
name: "LEN",
|
|
1310
|
+
description: "计算文本的长度",
|
|
1311
|
+
example: "LEN(text)",
|
|
1312
|
+
params: [{
|
|
1313
|
+
type: "string",
|
|
1314
|
+
name: "text",
|
|
1315
|
+
description: "要处理的文本"
|
|
1316
|
+
}],
|
|
1317
|
+
returns: {
|
|
1318
|
+
type: "number",
|
|
1319
|
+
description: "长度"
|
|
1320
|
+
},
|
|
1321
|
+
namespace: "文本函数"
|
|
1322
|
+
}, {
|
|
1323
|
+
name: "LENGTH",
|
|
1324
|
+
description: "计算文本集合中所有文本的长度",
|
|
1325
|
+
example: "LENGTH(textArr)",
|
|
1326
|
+
params: [{
|
|
1327
|
+
type: "Array<string>",
|
|
1328
|
+
name: "textArr",
|
|
1329
|
+
description: "要处理的文本集合"
|
|
1330
|
+
}],
|
|
1331
|
+
returns: {
|
|
1332
|
+
type: "Array<number>",
|
|
1333
|
+
description: "长度集合"
|
|
1334
|
+
},
|
|
1335
|
+
namespace: "文本函数"
|
|
1336
|
+
}, {
|
|
1337
|
+
name: "ISEMPTY",
|
|
1338
|
+
description: "判断文本是否为空",
|
|
1339
|
+
example: "ISEMPTY(text)",
|
|
1340
|
+
params: [{
|
|
1341
|
+
type: "string",
|
|
1342
|
+
name: "text",
|
|
1343
|
+
description: "要处理的文本"
|
|
1344
|
+
}],
|
|
1345
|
+
returns: {
|
|
1346
|
+
type: "boolean",
|
|
1347
|
+
description: "判断结果"
|
|
1348
|
+
},
|
|
1349
|
+
namespace: "文本函数"
|
|
1350
|
+
}, {
|
|
1351
|
+
name: "CONCATENATE",
|
|
1352
|
+
description: "将多个传入值连接成文本",
|
|
1353
|
+
example: "CONCATENATE(text1, text2, ...textN)",
|
|
1354
|
+
params: [{
|
|
1355
|
+
type: "...string",
|
|
1356
|
+
name: "text",
|
|
1357
|
+
description: "文本集合"
|
|
1358
|
+
}],
|
|
1359
|
+
returns: {
|
|
1360
|
+
type: "string",
|
|
1361
|
+
description: "连接后的文本"
|
|
1362
|
+
},
|
|
1363
|
+
namespace: "文本函数"
|
|
1364
|
+
}, {
|
|
1365
|
+
name: "CHAR",
|
|
1366
|
+
description: "返回计算机字符集的数字代码所对应的字符。\n\n`CHAR(97)` 等价于 \"a\"",
|
|
1367
|
+
example: "CHAR(code)",
|
|
1368
|
+
params: [{
|
|
1369
|
+
type: "number",
|
|
1370
|
+
name: "code",
|
|
1371
|
+
description: "编码值"
|
|
1372
|
+
}],
|
|
1373
|
+
returns: {
|
|
1374
|
+
type: "string",
|
|
1375
|
+
description: "指定位置的字符"
|
|
1376
|
+
},
|
|
1377
|
+
namespace: "文本函数"
|
|
1378
|
+
}, {
|
|
1379
|
+
name: "LOWER",
|
|
1380
|
+
description: "将传入文本转成小写",
|
|
1381
|
+
example: "LOWER(text)",
|
|
1382
|
+
params: [{
|
|
1383
|
+
type: "string",
|
|
1384
|
+
name: "text",
|
|
1385
|
+
description: "文本"
|
|
1386
|
+
}],
|
|
1387
|
+
returns: {
|
|
1388
|
+
type: "string",
|
|
1389
|
+
description: "结果文本"
|
|
1390
|
+
},
|
|
1391
|
+
namespace: "文本函数"
|
|
1392
|
+
}, {
|
|
1393
|
+
name: "UPPER",
|
|
1394
|
+
description: "将传入文本转成大写",
|
|
1395
|
+
example: "UPPER(text)",
|
|
1396
|
+
params: [{
|
|
1397
|
+
type: "string",
|
|
1398
|
+
name: "text",
|
|
1399
|
+
description: "文本"
|
|
1400
|
+
}],
|
|
1401
|
+
returns: {
|
|
1402
|
+
type: "string",
|
|
1403
|
+
description: "结果文本"
|
|
1404
|
+
},
|
|
1405
|
+
namespace: "文本函数"
|
|
1406
|
+
}, {
|
|
1407
|
+
name: "UPPERFIRST",
|
|
1408
|
+
description: "将传入文本首字母转成大写",
|
|
1409
|
+
example: "UPPERFIRST(text)",
|
|
1410
|
+
params: [{
|
|
1411
|
+
type: "string",
|
|
1412
|
+
name: "text",
|
|
1413
|
+
description: "文本"
|
|
1414
|
+
}],
|
|
1415
|
+
returns: {
|
|
1416
|
+
type: "string",
|
|
1417
|
+
description: "结果文本"
|
|
1418
|
+
},
|
|
1419
|
+
namespace: "文本函数"
|
|
1420
|
+
}, {
|
|
1421
|
+
name: "PADSTART",
|
|
1422
|
+
description: "向前补齐文本长度\n\n示例 `PADSTART(\"6\", 2, \"0\")`\n\n返回 `06`",
|
|
1423
|
+
example: "PADSTART(text)",
|
|
1424
|
+
params: [{
|
|
1425
|
+
type: "string",
|
|
1426
|
+
name: "text",
|
|
1427
|
+
description: "文本"
|
|
1428
|
+
}, {
|
|
1429
|
+
type: "number",
|
|
1430
|
+
name: "num",
|
|
1431
|
+
description: "目标长度"
|
|
1432
|
+
}, {
|
|
1433
|
+
type: "string",
|
|
1434
|
+
name: "pad",
|
|
1435
|
+
description: "用于补齐的文本"
|
|
1436
|
+
}],
|
|
1437
|
+
returns: {
|
|
1438
|
+
type: "string",
|
|
1439
|
+
description: "结果文本"
|
|
1440
|
+
},
|
|
1441
|
+
namespace: "文本函数"
|
|
1442
|
+
}, {
|
|
1443
|
+
name: "CAPITALIZE",
|
|
1444
|
+
description: "将文本转成标题\n\n示例 `CAPITALIZE(\"star\")`\n\n返回 `Star`",
|
|
1445
|
+
example: "CAPITALIZE(text)",
|
|
1446
|
+
params: [{
|
|
1447
|
+
type: "string",
|
|
1448
|
+
name: "text",
|
|
1449
|
+
description: "文本"
|
|
1450
|
+
}],
|
|
1451
|
+
returns: {
|
|
1452
|
+
type: "string",
|
|
1453
|
+
description: "结果文本"
|
|
1454
|
+
},
|
|
1455
|
+
namespace: "文本函数"
|
|
1456
|
+
}, {
|
|
1457
|
+
name: "ESCAPE",
|
|
1458
|
+
description: "对文本进行 HTML 转义\n\n示例 `ESCAPE(\"<star>&\")`\n\n返回 `<start>&`",
|
|
1459
|
+
example: "ESCAPE(text)",
|
|
1460
|
+
params: [{
|
|
1461
|
+
type: "string",
|
|
1462
|
+
name: "text",
|
|
1463
|
+
description: "文本"
|
|
1464
|
+
}],
|
|
1465
|
+
returns: {
|
|
1466
|
+
type: "string",
|
|
1467
|
+
description: "结果文本"
|
|
1468
|
+
},
|
|
1469
|
+
namespace: "文本函数"
|
|
1470
|
+
}, {
|
|
1471
|
+
name: "TRUNCATE",
|
|
1472
|
+
description: "对文本长度进行截断\n\n示例 `TRUNCATE(\"amis.baidu.com\", 6)`\n\n返回 `amis...`",
|
|
1473
|
+
example: "TRUNCATE(text, 6)",
|
|
1474
|
+
params: [{
|
|
1475
|
+
type: "string",
|
|
1476
|
+
name: "text",
|
|
1477
|
+
description: "文本"
|
|
1478
|
+
}, {
|
|
1479
|
+
type: "number",
|
|
1480
|
+
name: "text",
|
|
1481
|
+
description: "最长长度"
|
|
1482
|
+
}],
|
|
1483
|
+
returns: {
|
|
1484
|
+
type: "string",
|
|
1485
|
+
description: "结果文本"
|
|
1486
|
+
},
|
|
1487
|
+
namespace: "文本函数"
|
|
1488
|
+
}, {
|
|
1489
|
+
name: "BEFORELAST",
|
|
1490
|
+
description: "取在某个分隔符之前的所有字符串",
|
|
1491
|
+
example: "BEFORELAST(text, '.')",
|
|
1492
|
+
params: [{
|
|
1493
|
+
type: "string",
|
|
1494
|
+
name: "text",
|
|
1495
|
+
description: "文本"
|
|
1496
|
+
}, {
|
|
1497
|
+
type: "string",
|
|
1498
|
+
name: "delimiter",
|
|
1499
|
+
description: "结束文本"
|
|
1500
|
+
}],
|
|
1501
|
+
returns: {
|
|
1502
|
+
type: "string",
|
|
1503
|
+
description: "判断结果"
|
|
1504
|
+
},
|
|
1505
|
+
namespace: "文本函数"
|
|
1506
|
+
}, {
|
|
1507
|
+
name: "SPLIT",
|
|
1508
|
+
description: "将文本根据指定片段分割成数组\n\n示例:`SPLIT(\"a,b,c\", \",\")`\n\n返回 `[\"a\", \"b\", \"c\"]`",
|
|
1509
|
+
example: "SPLIT(text, ',')",
|
|
1510
|
+
params: [{
|
|
1511
|
+
type: "string",
|
|
1512
|
+
name: "text",
|
|
1513
|
+
description: "文本"
|
|
1514
|
+
}, {
|
|
1515
|
+
type: "string",
|
|
1516
|
+
name: "delimiter",
|
|
1517
|
+
description: "文本片段"
|
|
1518
|
+
}],
|
|
1519
|
+
returns: {
|
|
1520
|
+
type: "Array<string>",
|
|
1521
|
+
description: "文本集"
|
|
1522
|
+
},
|
|
1523
|
+
namespace: "文本函数"
|
|
1524
|
+
}, {
|
|
1525
|
+
name: "TRIM",
|
|
1526
|
+
description: "将文本去除前后空格",
|
|
1527
|
+
example: "TRIM(text)",
|
|
1528
|
+
params: [{
|
|
1529
|
+
type: "string",
|
|
1530
|
+
name: "text",
|
|
1531
|
+
description: "文本"
|
|
1532
|
+
}],
|
|
1533
|
+
returns: {
|
|
1534
|
+
type: "string",
|
|
1535
|
+
description: "处理后的文本"
|
|
1536
|
+
},
|
|
1537
|
+
namespace: "文本函数"
|
|
1538
|
+
}, {
|
|
1539
|
+
name: "STRIPTAG",
|
|
1540
|
+
description: "去除文本中的 HTML 标签\n\n示例:`STRIPTAG(\"<b>amis</b>\")`\n\n返回:`amis`",
|
|
1541
|
+
example: "STRIPTAG(text)",
|
|
1542
|
+
params: [{
|
|
1543
|
+
type: "string",
|
|
1544
|
+
name: "text",
|
|
1545
|
+
description: "文本"
|
|
1546
|
+
}],
|
|
1547
|
+
returns: {
|
|
1548
|
+
type: "string",
|
|
1549
|
+
description: "处理后的文本"
|
|
1550
|
+
},
|
|
1551
|
+
namespace: "文本函数"
|
|
1552
|
+
}, {
|
|
1553
|
+
name: "LINEBREAK",
|
|
1554
|
+
description: "将字符串中的换行转成 HTML `<br>`,用于简单换行的场景\n\n示例:`LINEBREAK(\"\\n\")`\n\n返回:`<br/>`",
|
|
1555
|
+
example: "LINEBREAK(text)",
|
|
1556
|
+
params: [{
|
|
1557
|
+
type: "string",
|
|
1558
|
+
name: "text",
|
|
1559
|
+
description: "文本"
|
|
1560
|
+
}],
|
|
1561
|
+
returns: {
|
|
1562
|
+
type: "string",
|
|
1563
|
+
description: "处理后的文本"
|
|
1564
|
+
},
|
|
1565
|
+
namespace: "文本函数"
|
|
1566
|
+
}, {
|
|
1567
|
+
name: "STARTSWITH",
|
|
1568
|
+
description: "判断字符串(text)是否以特定字符串(startString)开始,是则返回 True,否则返回 False",
|
|
1569
|
+
example: "STARTSWITH(text, '片段')",
|
|
1570
|
+
params: [{
|
|
1571
|
+
type: "string",
|
|
1572
|
+
name: "text",
|
|
1573
|
+
description: "文本"
|
|
1574
|
+
}, {
|
|
1575
|
+
type: "string",
|
|
1576
|
+
name: "startString",
|
|
1577
|
+
description: "起始文本"
|
|
1578
|
+
}],
|
|
1579
|
+
returns: {
|
|
1580
|
+
type: "string",
|
|
1581
|
+
description: "判断结果"
|
|
1582
|
+
},
|
|
1583
|
+
namespace: "文本函数"
|
|
1584
|
+
}, {
|
|
1585
|
+
name: "ENDSWITH",
|
|
1586
|
+
description: "判断字符串(text)是否以特定字符串(endString)结束,是则返回 True,否则返回 False",
|
|
1587
|
+
example: "ENDSWITH(text, '片段')",
|
|
1588
|
+
params: [{
|
|
1589
|
+
type: "string",
|
|
1590
|
+
name: "text",
|
|
1591
|
+
description: "文本"
|
|
1592
|
+
}, {
|
|
1593
|
+
type: "string",
|
|
1594
|
+
name: "endString",
|
|
1595
|
+
description: "结束文本"
|
|
1596
|
+
}],
|
|
1597
|
+
returns: {
|
|
1598
|
+
type: "string",
|
|
1599
|
+
description: "判断结果"
|
|
1600
|
+
},
|
|
1601
|
+
namespace: "文本函数"
|
|
1602
|
+
}, {
|
|
1603
|
+
name: "CONTAINS",
|
|
1604
|
+
description: "判断参数 1 中的文本是否包含参数 2 中的文本。",
|
|
1605
|
+
example: "CONTAINS(text, searchText)",
|
|
1606
|
+
params: [{
|
|
1607
|
+
type: "string",
|
|
1608
|
+
name: "text",
|
|
1609
|
+
description: "文本"
|
|
1610
|
+
}, {
|
|
1611
|
+
type: "string",
|
|
1612
|
+
name: "searchText",
|
|
1613
|
+
description: "搜索文本"
|
|
1614
|
+
}],
|
|
1615
|
+
returns: {
|
|
1616
|
+
type: "string",
|
|
1617
|
+
description: "判断结果"
|
|
1618
|
+
},
|
|
1619
|
+
namespace: "文本函数"
|
|
1620
|
+
}, {
|
|
1621
|
+
name: "REPLACE",
|
|
1622
|
+
description: "对文本进行全量替换。",
|
|
1623
|
+
example: "REPLACE(text, search, replace)",
|
|
1624
|
+
params: [{
|
|
1625
|
+
type: "string",
|
|
1626
|
+
name: "text",
|
|
1627
|
+
description: "要处理的文本"
|
|
1628
|
+
}, {
|
|
1629
|
+
type: "string",
|
|
1630
|
+
name: "search",
|
|
1631
|
+
description: "要被替换的文本"
|
|
1632
|
+
}, {
|
|
1633
|
+
type: "string",
|
|
1634
|
+
name: "replace",
|
|
1635
|
+
description: "要替换的文本"
|
|
1636
|
+
}],
|
|
1637
|
+
returns: {
|
|
1638
|
+
type: "string",
|
|
1639
|
+
description: "处理结果"
|
|
1640
|
+
},
|
|
1641
|
+
namespace: "文本函数"
|
|
1642
|
+
}, {
|
|
1643
|
+
name: "SEARCH",
|
|
1644
|
+
description: "对文本进行搜索,返回命中的位置",
|
|
1645
|
+
example: "SEARCH(text, search, 0)",
|
|
1646
|
+
params: [{
|
|
1647
|
+
type: "string",
|
|
1648
|
+
name: "text",
|
|
1649
|
+
description: "要处理的文本"
|
|
1650
|
+
}, {
|
|
1651
|
+
type: "string",
|
|
1652
|
+
name: "search",
|
|
1653
|
+
description: "用来搜索的文本"
|
|
1654
|
+
}, {
|
|
1655
|
+
type: "number",
|
|
1656
|
+
name: "start",
|
|
1657
|
+
description: "起始位置"
|
|
1658
|
+
}],
|
|
1659
|
+
returns: {
|
|
1660
|
+
type: "number",
|
|
1661
|
+
description: "命中的位置"
|
|
1662
|
+
},
|
|
1663
|
+
namespace: "文本函数"
|
|
1664
|
+
}, {
|
|
1665
|
+
name: "MID",
|
|
1666
|
+
description: "返回文本字符串中从指定位置开始的特定数目的字符",
|
|
1667
|
+
example: "MID(text, from, len)",
|
|
1668
|
+
params: [{
|
|
1669
|
+
type: "string",
|
|
1670
|
+
name: "text",
|
|
1671
|
+
description: "要处理的文本"
|
|
1672
|
+
}, {
|
|
1673
|
+
type: "number",
|
|
1674
|
+
name: "from",
|
|
1675
|
+
description: "起始位置"
|
|
1676
|
+
}, {
|
|
1677
|
+
type: "number",
|
|
1678
|
+
name: "len",
|
|
1679
|
+
description: "处理长度"
|
|
1680
|
+
}],
|
|
1681
|
+
returns: {
|
|
1682
|
+
type: "number",
|
|
1683
|
+
description: "命中的位置"
|
|
1684
|
+
},
|
|
1685
|
+
namespace: "文本函数"
|
|
1686
|
+
}, {
|
|
1687
|
+
name: "BASENAME",
|
|
1688
|
+
description: "返回路径中的文件名\n\n示例:`/home/amis/a.json`\n\n返回:a.json`",
|
|
1689
|
+
example: "BASENAME(text)",
|
|
1690
|
+
params: [{
|
|
1691
|
+
type: "string",
|
|
1692
|
+
name: "text",
|
|
1693
|
+
description: "要处理的文本"
|
|
1694
|
+
}],
|
|
1695
|
+
returns: {
|
|
1696
|
+
type: "string",
|
|
1697
|
+
description: "文件名"
|
|
1698
|
+
},
|
|
1699
|
+
namespace: "文本函数"
|
|
1700
|
+
}, {
|
|
1701
|
+
name: "DATE",
|
|
1702
|
+
description: "创建日期对象,可以通过特定格式的字符串,或者数值。\n\n需要注意的是,其中月份的数值是从0开始的,也就是说,\n如果是12月份,你应该传入数值11。",
|
|
1703
|
+
example: "DATE('2021-12-06 08:20:00')",
|
|
1704
|
+
params: [],
|
|
1705
|
+
returns: {
|
|
1706
|
+
type: "Date",
|
|
1707
|
+
description: "日期对象"
|
|
1708
|
+
},
|
|
1709
|
+
namespace: "日期函数"
|
|
1710
|
+
}, {
|
|
1711
|
+
name: "TIMESTAMP",
|
|
1712
|
+
description: "返回时间的时间戳",
|
|
1713
|
+
example: "TIMESTAMP(date, 'x')",
|
|
1714
|
+
params: [{
|
|
1715
|
+
type: "date",
|
|
1716
|
+
name: "date",
|
|
1717
|
+
description: "日期对象"
|
|
1718
|
+
}, {
|
|
1719
|
+
type: "string",
|
|
1720
|
+
name: "format",
|
|
1721
|
+
description: "时间戳格式,带毫秒传入 'x'。默认为 'X' 不带毫秒的。"
|
|
1722
|
+
}],
|
|
1723
|
+
returns: {
|
|
1724
|
+
type: "number",
|
|
1725
|
+
description: "时间戳"
|
|
1726
|
+
},
|
|
1727
|
+
namespace: "日期函数"
|
|
1728
|
+
}, {
|
|
1729
|
+
name: "TODAY",
|
|
1730
|
+
description: "返回今天的日期",
|
|
1731
|
+
example: "TODAY()",
|
|
1732
|
+
params: [],
|
|
1733
|
+
returns: {
|
|
1734
|
+
type: "number",
|
|
1735
|
+
description: "日期"
|
|
1736
|
+
},
|
|
1737
|
+
namespace: "日期函数"
|
|
1738
|
+
}, {
|
|
1739
|
+
name: "NOW",
|
|
1740
|
+
description: "返回现在的日期",
|
|
1741
|
+
example: "NOW()",
|
|
1742
|
+
params: [],
|
|
1743
|
+
returns: {
|
|
1744
|
+
type: "number",
|
|
1745
|
+
description: "日期"
|
|
1746
|
+
},
|
|
1747
|
+
namespace: "日期函数"
|
|
1748
|
+
}, {
|
|
1749
|
+
name: "WEEKDAY",
|
|
1750
|
+
description: "获取日期的星期几,\n\n示例:\n\nWEEKDAY('2023-02-27') 得到 1",
|
|
1751
|
+
example: "WEEKDAY(date)",
|
|
1752
|
+
params: [{
|
|
1753
|
+
type: "any",
|
|
1754
|
+
name: "date",
|
|
1755
|
+
description: "日期"
|
|
1756
|
+
}, {
|
|
1757
|
+
type: "number",
|
|
1758
|
+
name: "type",
|
|
1759
|
+
description: "星期定义类型,默认为1,1表示0至6代表星期一到星期日,2表示1至7代表星期一到星期日"
|
|
1760
|
+
}],
|
|
1761
|
+
returns: {
|
|
1762
|
+
type: "number",
|
|
1763
|
+
description: "星期几的数字标识"
|
|
1764
|
+
},
|
|
1765
|
+
namespace: "日期函数"
|
|
1766
|
+
}, {
|
|
1767
|
+
name: "WEEK",
|
|
1768
|
+
description: "获取年份的星期,即第几周\n\n示例:\n\nWEEK('2023-03-05') 得到 10",
|
|
1769
|
+
example: "WEEK(date)",
|
|
1770
|
+
params: [{
|
|
1771
|
+
type: "any",
|
|
1772
|
+
name: "date",
|
|
1773
|
+
description: "日期"
|
|
1774
|
+
}, {
|
|
1775
|
+
type: "boolean",
|
|
1776
|
+
name: "isISO",
|
|
1777
|
+
description: "是否ISO星期"
|
|
1778
|
+
}],
|
|
1779
|
+
returns: {
|
|
1780
|
+
type: "number",
|
|
1781
|
+
description: "星期几的数字标识"
|
|
1782
|
+
},
|
|
1783
|
+
namespace: "日期函数"
|
|
1784
|
+
}, {
|
|
1785
|
+
name: "DATETOSTR",
|
|
1786
|
+
description: "对日期、日期字符串、时间戳进行格式化\n\n示例:\n\nDATETOSTR('12/25/2022', 'YYYY-MM-DD') 得到 '2022.12.25'\nDATETOSTR(1676563200, 'YYYY.MM.DD') 得到 '2023.02.17'\nDATETOSTR(1676563200000, 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATETOSTR(DATE('2021-12-21'), 'YYYY.MM.DD hh:mm:ss') 得到 '2021.12.21 08:00:00'",
|
|
1787
|
+
example: "DATETOSTR(date, 'YYYY-MM-DD')",
|
|
1788
|
+
params: [{
|
|
1789
|
+
type: "any",
|
|
1790
|
+
name: "date",
|
|
1791
|
+
description: "日期对象、日期字符串、时间戳"
|
|
1792
|
+
}, {
|
|
1793
|
+
type: "string",
|
|
1794
|
+
name: "format",
|
|
1795
|
+
description: "日期格式,默认为 \"YYYY-MM-DD HH:mm:ss\""
|
|
1796
|
+
}],
|
|
1797
|
+
returns: {
|
|
1798
|
+
type: "string",
|
|
1799
|
+
description: "日期字符串"
|
|
1800
|
+
},
|
|
1801
|
+
namespace: "日期函数"
|
|
1802
|
+
}, {
|
|
1803
|
+
name: "DATERANGESPLIT",
|
|
1804
|
+
description: "获取日期范围字符串中的开始时间、结束时间\n\n示例:\n\nDATERANGESPLIT('1676563200, 1676735999') 得到 [1676563200, 1676735999]\nDATERANGESPLIT('1676563200, 1676735999', undefined , 'YYYY.MM.DD hh:mm:ss') 得到 [2023.02.17 12:00:00, 2023.02.18 11:59:59]\nDATERANGESPLIT('1676563200, 1676735999', 0 , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATERANGESPLIT('1676563200, 1676735999', 'start' , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATERANGESPLIT('1676563200, 1676735999', 1 , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.18 11:59:59'\nDATERANGESPLIT('1676563200, 1676735999', 'end' , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.18 11:59:59'",
|
|
1805
|
+
example: "DATERANGESPLIT(date, 'YYYY-MM-DD')",
|
|
1806
|
+
params: [{
|
|
1807
|
+
type: "string",
|
|
1808
|
+
name: "date",
|
|
1809
|
+
description: "日期范围字符串"
|
|
1810
|
+
}, {
|
|
1811
|
+
type: "string",
|
|
1812
|
+
name: "key",
|
|
1813
|
+
description: "取值标识,0或'start'表示获取开始时间,1或'end'表示获取结束时间"
|
|
1814
|
+
}, {
|
|
1815
|
+
type: "string",
|
|
1816
|
+
name: "format",
|
|
1817
|
+
description: "日期格式,可选"
|
|
1818
|
+
}, {
|
|
1819
|
+
type: "string",
|
|
1820
|
+
name: "delimiter",
|
|
1821
|
+
description: "分隔符,可选,默认为','"
|
|
1822
|
+
}],
|
|
1823
|
+
returns: {
|
|
1824
|
+
type: "string",
|
|
1825
|
+
description: "日期字符串"
|
|
1826
|
+
},
|
|
1827
|
+
namespace: "日期函数"
|
|
1828
|
+
}, {
|
|
1829
|
+
name: "STARTOF",
|
|
1830
|
+
description: "返回日期的指定范围的开端",
|
|
1831
|
+
example: "STARTOF(date[unit = \"day\"])",
|
|
1832
|
+
params: [{
|
|
1833
|
+
type: "date",
|
|
1834
|
+
name: "date",
|
|
1835
|
+
description: "日期对象"
|
|
1836
|
+
}, {
|
|
1837
|
+
type: "string",
|
|
1838
|
+
name: "unit",
|
|
1839
|
+
description: "比如可以传入 'day'、'month'、'year' 或者 `week` 等等"
|
|
1840
|
+
}, {
|
|
1841
|
+
type: "string",
|
|
1842
|
+
name: "format",
|
|
1843
|
+
description: "日期格式,可选"
|
|
1844
|
+
}],
|
|
1845
|
+
returns: {
|
|
1846
|
+
type: "date",
|
|
1847
|
+
description: "新的日期对象"
|
|
1848
|
+
},
|
|
1849
|
+
namespace: "日期函数"
|
|
1850
|
+
}, {
|
|
1851
|
+
name: "ENDOF",
|
|
1852
|
+
description: "返回日期的指定范围的末尾",
|
|
1853
|
+
example: "ENDOF(date[unit = \"day\"])",
|
|
1854
|
+
params: [{
|
|
1855
|
+
type: "date",
|
|
1856
|
+
name: "date",
|
|
1857
|
+
description: "日期对象"
|
|
1858
|
+
}, {
|
|
1859
|
+
type: "string",
|
|
1860
|
+
name: "unit",
|
|
1861
|
+
description: "比如可以传入 'day'、'month'、'year' 或者 `week` 等等"
|
|
1862
|
+
}, {
|
|
1863
|
+
type: "string",
|
|
1864
|
+
name: "format",
|
|
1865
|
+
description: "日期格式,可选"
|
|
1866
|
+
}],
|
|
1867
|
+
returns: {
|
|
1868
|
+
type: "date",
|
|
1869
|
+
description: "新的日期对象"
|
|
1870
|
+
},
|
|
1871
|
+
namespace: "日期函数"
|
|
1872
|
+
}, {
|
|
1873
|
+
name: "YEAR",
|
|
1874
|
+
description: "返回日期的年份",
|
|
1875
|
+
example: "YEAR(date)",
|
|
1876
|
+
params: [{
|
|
1877
|
+
type: "date",
|
|
1878
|
+
name: "date",
|
|
1879
|
+
description: "日期对象"
|
|
1880
|
+
}],
|
|
1881
|
+
returns: {
|
|
1882
|
+
type: "number",
|
|
1883
|
+
description: "数值"
|
|
1884
|
+
},
|
|
1885
|
+
namespace: "日期函数"
|
|
1886
|
+
}, {
|
|
1887
|
+
name: "MONTH",
|
|
1888
|
+
description: "返回日期的月份,这里就是自然月份。",
|
|
1889
|
+
example: "MONTH(date)",
|
|
1890
|
+
params: [{
|
|
1891
|
+
type: "date",
|
|
1892
|
+
name: "date",
|
|
1893
|
+
description: "日期对象"
|
|
1894
|
+
}],
|
|
1895
|
+
returns: {
|
|
1896
|
+
type: "number",
|
|
1897
|
+
description: "数值"
|
|
1898
|
+
},
|
|
1899
|
+
namespace: "日期函数"
|
|
1900
|
+
}, {
|
|
1901
|
+
name: "DAY",
|
|
1902
|
+
description: "返回日期的天",
|
|
1903
|
+
example: "DAY(date)",
|
|
1904
|
+
params: [{
|
|
1905
|
+
type: "date",
|
|
1906
|
+
name: "date",
|
|
1907
|
+
description: "日期对象"
|
|
1908
|
+
}],
|
|
1909
|
+
returns: {
|
|
1910
|
+
type: "number",
|
|
1911
|
+
description: "数值"
|
|
1912
|
+
},
|
|
1913
|
+
namespace: "日期函数"
|
|
1914
|
+
}, {
|
|
1915
|
+
name: "HOUR",
|
|
1916
|
+
description: "返回日期的小时",
|
|
1917
|
+
example: "HOUR(date)",
|
|
1918
|
+
params: [{
|
|
1919
|
+
type: "date",
|
|
1920
|
+
name: "date",
|
|
1921
|
+
description: "日期对象"
|
|
1922
|
+
}],
|
|
1923
|
+
returns: {
|
|
1924
|
+
type: "number",
|
|
1925
|
+
description: "数值"
|
|
1926
|
+
},
|
|
1927
|
+
namespace: "日期函数"
|
|
1928
|
+
}, {
|
|
1929
|
+
name: "MINUTE",
|
|
1930
|
+
description: "返回日期的分",
|
|
1931
|
+
example: "MINUTE(date)",
|
|
1932
|
+
params: [{
|
|
1933
|
+
type: "date",
|
|
1934
|
+
name: "date",
|
|
1935
|
+
description: "日期对象"
|
|
1936
|
+
}],
|
|
1937
|
+
returns: {
|
|
1938
|
+
type: "number",
|
|
1939
|
+
description: "数值"
|
|
1940
|
+
},
|
|
1941
|
+
namespace: "日期函数"
|
|
1942
|
+
}, {
|
|
1943
|
+
name: "SECOND",
|
|
1944
|
+
description: "返回日期的秒",
|
|
1945
|
+
example: "SECOND(date)",
|
|
1946
|
+
params: [{
|
|
1947
|
+
type: "date",
|
|
1948
|
+
name: "date",
|
|
1949
|
+
description: "日期对象"
|
|
1950
|
+
}],
|
|
1951
|
+
returns: {
|
|
1952
|
+
type: "number",
|
|
1953
|
+
description: "数值"
|
|
1954
|
+
},
|
|
1955
|
+
namespace: "日期函数"
|
|
1956
|
+
}, {
|
|
1957
|
+
name: "YEARS",
|
|
1958
|
+
description: "返回两个日期相差多少年",
|
|
1959
|
+
example: "YEARS(endDate, startDate)",
|
|
1960
|
+
params: [{
|
|
1961
|
+
type: "date",
|
|
1962
|
+
name: "endDate",
|
|
1963
|
+
description: "日期对象"
|
|
1964
|
+
}, {
|
|
1965
|
+
type: "date",
|
|
1966
|
+
name: "startDate",
|
|
1967
|
+
description: "日期对象"
|
|
1968
|
+
}],
|
|
1969
|
+
returns: {
|
|
1970
|
+
type: "number",
|
|
1971
|
+
description: "数值"
|
|
1972
|
+
},
|
|
1973
|
+
namespace: "日期函数"
|
|
1974
|
+
}, {
|
|
1975
|
+
name: "MINUTES",
|
|
1976
|
+
description: "返回两个日期相差多少分钟",
|
|
1977
|
+
example: "MINUTES(endDate, startDate)",
|
|
1978
|
+
params: [{
|
|
1979
|
+
type: "date",
|
|
1980
|
+
name: "endDate",
|
|
1981
|
+
description: "日期对象"
|
|
1982
|
+
}, {
|
|
1983
|
+
type: "date",
|
|
1984
|
+
name: "startDate",
|
|
1985
|
+
description: "日期对象"
|
|
1986
|
+
}],
|
|
1987
|
+
returns: {
|
|
1988
|
+
type: "number",
|
|
1989
|
+
description: "数值"
|
|
1990
|
+
},
|
|
1991
|
+
namespace: "日期函数"
|
|
1992
|
+
}, {
|
|
1993
|
+
name: "DAYS",
|
|
1994
|
+
description: "返回两个日期相差多少天",
|
|
1995
|
+
example: "DAYS(endDate, startDate)",
|
|
1996
|
+
params: [{
|
|
1997
|
+
type: "date",
|
|
1998
|
+
name: "endDate",
|
|
1999
|
+
description: "日期对象"
|
|
2000
|
+
}, {
|
|
2001
|
+
type: "date",
|
|
2002
|
+
name: "startDate",
|
|
2003
|
+
description: "日期对象"
|
|
2004
|
+
}],
|
|
2005
|
+
returns: {
|
|
2006
|
+
type: "number",
|
|
2007
|
+
description: "数值"
|
|
2008
|
+
},
|
|
2009
|
+
namespace: "日期函数"
|
|
2010
|
+
}, {
|
|
2011
|
+
name: "HOURS",
|
|
2012
|
+
description: "返回两个日期相差多少小时",
|
|
2013
|
+
example: "HOURS(endDate, startDate)",
|
|
2014
|
+
params: [{
|
|
2015
|
+
type: "date",
|
|
2016
|
+
name: "endDate",
|
|
2017
|
+
description: "日期对象"
|
|
2018
|
+
}, {
|
|
2019
|
+
type: "date",
|
|
2020
|
+
name: "startDate",
|
|
2021
|
+
description: "日期对象"
|
|
2022
|
+
}],
|
|
2023
|
+
returns: {
|
|
2024
|
+
type: "number",
|
|
2025
|
+
description: "数值"
|
|
2026
|
+
},
|
|
2027
|
+
namespace: "日期函数"
|
|
2028
|
+
}, {
|
|
2029
|
+
name: "DATEMODIFY",
|
|
2030
|
+
description: "修改日期,对日期进行加减天、月份、年等操作\n\n示例:\n\nDATEMODIFY(A, -2, 'month')\n\n对日期 A 进行往前减2月的操作。",
|
|
2031
|
+
example: "DATEMODIFY(date, 2, 'days')",
|
|
2032
|
+
params: [{
|
|
2033
|
+
type: "date",
|
|
2034
|
+
name: "date",
|
|
2035
|
+
description: "日期对象"
|
|
2036
|
+
}, {
|
|
2037
|
+
type: "number",
|
|
2038
|
+
name: "num",
|
|
2039
|
+
description: "数值"
|
|
2040
|
+
}, {
|
|
2041
|
+
type: "string",
|
|
2042
|
+
name: "unit",
|
|
2043
|
+
description: "单位:支持年、月、天等等"
|
|
2044
|
+
}],
|
|
2045
|
+
returns: {
|
|
2046
|
+
type: "date",
|
|
2047
|
+
description: "日期对象"
|
|
2048
|
+
},
|
|
2049
|
+
namespace: "日期函数"
|
|
2050
|
+
}, {
|
|
2051
|
+
name: "STRTODATE",
|
|
2052
|
+
description: "将字符日期转成日期对象,可以指定日期格式。\n\n示例:STRTODATE('2021/12/6', 'YYYY/MM/DD')",
|
|
2053
|
+
example: "STRTODATE(value[, format=\"\"])",
|
|
2054
|
+
params: [{
|
|
2055
|
+
type: "string",
|
|
2056
|
+
name: "value",
|
|
2057
|
+
description: "日期字符"
|
|
2058
|
+
}, {
|
|
2059
|
+
type: "string",
|
|
2060
|
+
name: "format",
|
|
2061
|
+
description: "日期格式"
|
|
2062
|
+
}],
|
|
2063
|
+
returns: {
|
|
2064
|
+
type: "date",
|
|
2065
|
+
description: "日期对象"
|
|
2066
|
+
},
|
|
2067
|
+
namespace: "日期函数"
|
|
2068
|
+
}, {
|
|
2069
|
+
name: "ISBEFORE",
|
|
2070
|
+
description: "判断两个日期,是否第一个日期在第二个日期的前面",
|
|
2071
|
+
example: "ISBEFORE(a, b)",
|
|
2072
|
+
params: [{
|
|
2073
|
+
type: "date",
|
|
2074
|
+
name: "a",
|
|
2075
|
+
description: "第一个日期"
|
|
2076
|
+
}, {
|
|
2077
|
+
type: "date",
|
|
2078
|
+
name: "b",
|
|
2079
|
+
description: "第二个日期"
|
|
2080
|
+
}, {
|
|
2081
|
+
type: "string",
|
|
2082
|
+
name: "unit",
|
|
2083
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
2084
|
+
}],
|
|
2085
|
+
returns: {
|
|
2086
|
+
type: "boolean",
|
|
2087
|
+
description: "判断结果"
|
|
2088
|
+
},
|
|
2089
|
+
namespace: "日期函数"
|
|
2090
|
+
}, {
|
|
2091
|
+
name: "ISAFTER",
|
|
2092
|
+
description: "判断两个日期,是否第一个日期在第二个日期的后面",
|
|
2093
|
+
example: "ISAFTER(a, b)",
|
|
2094
|
+
params: [{
|
|
2095
|
+
type: "date",
|
|
2096
|
+
name: "a",
|
|
2097
|
+
description: "第一个日期"
|
|
2098
|
+
}, {
|
|
2099
|
+
type: "date",
|
|
2100
|
+
name: "b",
|
|
2101
|
+
description: "第二个日期"
|
|
2102
|
+
}, {
|
|
2103
|
+
type: "string",
|
|
2104
|
+
name: "unit",
|
|
2105
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
2106
|
+
}],
|
|
2107
|
+
returns: {
|
|
2108
|
+
type: "boolean",
|
|
2109
|
+
description: "判断结果"
|
|
2110
|
+
},
|
|
2111
|
+
namespace: "日期函数"
|
|
2112
|
+
}, {
|
|
2113
|
+
name: "BETWEENRANGE",
|
|
2114
|
+
description: "判断日期是否在指定范围内\n\n示例:BETWEENRANGE('2021/12/6', ['2021/12/5','2021/12/7'])",
|
|
2115
|
+
example: "BETWEENRANGE(date, [start, end])",
|
|
2116
|
+
params: [{
|
|
2117
|
+
type: "any",
|
|
2118
|
+
name: "date",
|
|
2119
|
+
description: "第一个日期"
|
|
2120
|
+
}, {
|
|
2121
|
+
type: "Array<any>",
|
|
2122
|
+
name: "daterange",
|
|
2123
|
+
description: "日期范围"
|
|
2124
|
+
}, {
|
|
2125
|
+
type: "string",
|
|
2126
|
+
name: "unit",
|
|
2127
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
2128
|
+
}, {
|
|
2129
|
+
type: "string",
|
|
2130
|
+
name: "inclusivity",
|
|
2131
|
+
description: "包容性规则,默认为'[]'。[ 表示包含、( 表示排除,如果使用包容性参数,则必须传入两个指示符,如'()'表示左右范围都排除"
|
|
2132
|
+
}],
|
|
2133
|
+
returns: {
|
|
2134
|
+
type: "boolean",
|
|
2135
|
+
description: "判断结果"
|
|
2136
|
+
},
|
|
2137
|
+
namespace: "日期函数"
|
|
2138
|
+
}, {
|
|
2139
|
+
name: "ISSAMEORBEFORE",
|
|
2140
|
+
description: "判断两个日期,是否第一个日期在第二个日期的前面或者相等",
|
|
2141
|
+
example: "ISSAMEORBEFORE(a, b)",
|
|
2142
|
+
params: [{
|
|
2143
|
+
type: "date",
|
|
2144
|
+
name: "a",
|
|
2145
|
+
description: "第一个日期"
|
|
2146
|
+
}, {
|
|
2147
|
+
type: "date",
|
|
2148
|
+
name: "b",
|
|
2149
|
+
description: "第二个日期"
|
|
2150
|
+
}, {
|
|
2151
|
+
type: "string",
|
|
2152
|
+
name: "unit",
|
|
2153
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
2154
|
+
}],
|
|
2155
|
+
returns: {
|
|
2156
|
+
type: "boolean",
|
|
2157
|
+
description: "判断结果"
|
|
2158
|
+
},
|
|
2159
|
+
namespace: "日期函数"
|
|
2160
|
+
}, {
|
|
2161
|
+
name: "ISSAMEORAFTER",
|
|
2162
|
+
description: "判断两个日期,是否第一个日期在第二个日期的后面或者相等",
|
|
2163
|
+
example: "ISSAMEORAFTER(a, b)",
|
|
2164
|
+
params: [{
|
|
2165
|
+
type: "date",
|
|
2166
|
+
name: "a",
|
|
2167
|
+
description: "第一个日期"
|
|
2168
|
+
}, {
|
|
2169
|
+
type: "date",
|
|
2170
|
+
name: "b",
|
|
2171
|
+
description: "第二个日期"
|
|
2172
|
+
}, {
|
|
2173
|
+
type: "string",
|
|
2174
|
+
name: "unit",
|
|
2175
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
2176
|
+
}],
|
|
2177
|
+
returns: {
|
|
2178
|
+
type: "boolean",
|
|
2179
|
+
description: "判断结果"
|
|
2180
|
+
},
|
|
2181
|
+
namespace: "日期函数"
|
|
2182
|
+
}, {
|
|
2183
|
+
name: "COUNT",
|
|
2184
|
+
description: "返回数组的长度",
|
|
2185
|
+
example: "COUNT(arr)",
|
|
2186
|
+
params: [{
|
|
2187
|
+
type: "Array<any>",
|
|
2188
|
+
name: "arr",
|
|
2189
|
+
description: "数组"
|
|
2190
|
+
}],
|
|
2191
|
+
returns: {
|
|
2192
|
+
type: "boolean",
|
|
2193
|
+
description: "结果"
|
|
2194
|
+
},
|
|
2195
|
+
namespace: "数组"
|
|
2196
|
+
}, {
|
|
2197
|
+
name: "ARRAYMAP",
|
|
2198
|
+
description: "数组做数据转换,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。",
|
|
2199
|
+
example: "ARRAYMAP(arr, item => item)",
|
|
2200
|
+
params: [{
|
|
2201
|
+
type: "Array<any>",
|
|
2202
|
+
name: "arr",
|
|
2203
|
+
description: "数组"
|
|
2204
|
+
}, {
|
|
2205
|
+
type: "Array<any>",
|
|
2206
|
+
name: "iterator",
|
|
2207
|
+
description: "箭头函数"
|
|
2208
|
+
}],
|
|
2209
|
+
returns: {
|
|
2210
|
+
type: "boolean",
|
|
2211
|
+
description: "结果"
|
|
2212
|
+
},
|
|
2213
|
+
namespace: "数组"
|
|
2214
|
+
}, {
|
|
2215
|
+
name: "ARRAYFILTER",
|
|
2216
|
+
description: "数据做数据过滤,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n将第二个箭头函数返回为 false 的成员过滤掉。",
|
|
2217
|
+
example: "ARRAYFILTER(arr, item => item)",
|
|
2218
|
+
params: [{
|
|
2219
|
+
type: "Array<any>",
|
|
2220
|
+
name: "arr",
|
|
2221
|
+
description: "数组"
|
|
2222
|
+
}, {
|
|
2223
|
+
type: "Array<any>",
|
|
2224
|
+
name: "iterator",
|
|
2225
|
+
description: "箭头函数"
|
|
2226
|
+
}],
|
|
2227
|
+
returns: {
|
|
2228
|
+
type: "boolean",
|
|
2229
|
+
description: "结果"
|
|
2230
|
+
},
|
|
2231
|
+
namespace: "数组"
|
|
2232
|
+
}, {
|
|
2233
|
+
name: "ARRAYFINDINDEX",
|
|
2234
|
+
description: "数据做数据查找,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n找出第二个箭头函数返回为 true 的成员的索引。\n\n示例:\n\nARRAYFINDINDEX([0, 2, false], item => item === 2) 得到 1",
|
|
2235
|
+
example: "ARRAYFINDINDEX(arr, item => item === 2)",
|
|
2236
|
+
params: [{
|
|
2237
|
+
type: "Array<any>",
|
|
2238
|
+
name: "arr",
|
|
2239
|
+
description: "数组"
|
|
2240
|
+
}, {
|
|
2241
|
+
type: "Array<any>",
|
|
2242
|
+
name: "iterator",
|
|
2243
|
+
description: "箭头函数"
|
|
2244
|
+
}],
|
|
2245
|
+
returns: {
|
|
2246
|
+
type: "number",
|
|
2247
|
+
description: "结果"
|
|
2248
|
+
},
|
|
2249
|
+
namespace: "数组"
|
|
2250
|
+
}, {
|
|
2251
|
+
name: "ARRAYFIND",
|
|
2252
|
+
description: "数据做数据查找,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n找出第二个箭头函数返回为 true 的成员。\n\n示例:\n\nARRAYFIND([0, 2, false], item => item === 2) 得到 2",
|
|
2253
|
+
example: "ARRAYFIND(arr, item => item === 2)",
|
|
2254
|
+
params: [{
|
|
2255
|
+
type: "Array<any>",
|
|
2256
|
+
name: "arr",
|
|
2257
|
+
description: "数组"
|
|
2258
|
+
}, {
|
|
2259
|
+
type: "Array<any>",
|
|
2260
|
+
name: "iterator",
|
|
2261
|
+
description: "箭头函数"
|
|
2262
|
+
}],
|
|
2263
|
+
returns: {
|
|
2264
|
+
type: "any",
|
|
2265
|
+
description: "结果"
|
|
2266
|
+
},
|
|
2267
|
+
namespace: "数组"
|
|
2268
|
+
}, {
|
|
2269
|
+
name: "ARRAYSOME",
|
|
2270
|
+
description: "数据做数据遍历判断,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n判断第二个箭头函数是否存在返回为 true 的成员。\n\n示例:\n\nARRAYSOME([0, 2, false], item => item === 2) 得到 true",
|
|
2271
|
+
example: "ARRAYSOME(arr, item => item === 2)",
|
|
2272
|
+
params: [{
|
|
2273
|
+
type: "Array<any>",
|
|
2274
|
+
name: "arr",
|
|
2275
|
+
description: "数组"
|
|
2276
|
+
}, {
|
|
2277
|
+
type: "Array<any>",
|
|
2278
|
+
name: "iterator",
|
|
2279
|
+
description: "箭头函数"
|
|
2280
|
+
}],
|
|
2281
|
+
returns: {
|
|
2282
|
+
type: "boolean",
|
|
2283
|
+
description: "结果"
|
|
2284
|
+
},
|
|
2285
|
+
namespace: "数组"
|
|
2286
|
+
}, {
|
|
2287
|
+
name: "ARRAYEVERY",
|
|
2288
|
+
description: "数据做数据遍历判断,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n判断第二个箭头函数返回是否都为 true。\n\n示例:\n\nARRAYEVERY([0, 2, false], item => item === 2) 得到 false",
|
|
2289
|
+
example: "ARRAYEVERY(arr, item => item === 2)",
|
|
2290
|
+
params: [{
|
|
2291
|
+
type: "Array<any>",
|
|
2292
|
+
name: "arr",
|
|
2293
|
+
description: "数组"
|
|
2294
|
+
}, {
|
|
2295
|
+
type: "Array<any>",
|
|
2296
|
+
name: "iterator",
|
|
2297
|
+
description: "箭头函数"
|
|
2298
|
+
}],
|
|
2299
|
+
returns: {
|
|
2300
|
+
type: "boolean",
|
|
2301
|
+
description: "结果"
|
|
2302
|
+
},
|
|
2303
|
+
namespace: "数组"
|
|
2304
|
+
}, {
|
|
2305
|
+
name: "ARRAYINCLUDES",
|
|
2306
|
+
description: "判断数据中是否存在指定元素\n\n示例:\n\nARRAYINCLUDES([0, 2, false], 2) 得到 true",
|
|
2307
|
+
example: "ARRAYINCLUDES(arr, 2)",
|
|
2308
|
+
params: [{
|
|
2309
|
+
type: "Array<any>",
|
|
2310
|
+
name: "arr",
|
|
2311
|
+
description: "数组"
|
|
2312
|
+
}, {
|
|
2313
|
+
type: "any",
|
|
2314
|
+
name: "item",
|
|
2315
|
+
description: "元素"
|
|
2316
|
+
}],
|
|
2317
|
+
returns: {
|
|
2318
|
+
type: "any",
|
|
2319
|
+
description: "结果"
|
|
2320
|
+
},
|
|
2321
|
+
namespace: "数组"
|
|
2322
|
+
}, {
|
|
2323
|
+
name: "COMPACT",
|
|
2324
|
+
description: "数组过滤掉 false、null、0 和 \"\"\n\n示例:\n\nCOMPACT([0, 1, false, 2, '', 3]) 得到 [1, 2, 3]",
|
|
2325
|
+
example: "COMPACT(arr)",
|
|
2326
|
+
params: [{
|
|
2327
|
+
type: "Array<any>",
|
|
2328
|
+
name: "arr",
|
|
2329
|
+
description: "数组"
|
|
2330
|
+
}],
|
|
2331
|
+
returns: {
|
|
2332
|
+
type: "Array<any>",
|
|
2333
|
+
description: "结果"
|
|
2334
|
+
},
|
|
2335
|
+
namespace: "数组"
|
|
2336
|
+
}, {
|
|
2337
|
+
name: "JOIN",
|
|
2338
|
+
description: "数组转成字符串\n\n示例:\n\nJOIN(['a', 'b', 'c'], '=') 得到 'a=b=c'",
|
|
2339
|
+
example: "JOIN(arr, string)",
|
|
2340
|
+
params: [{
|
|
2341
|
+
type: "Array<any>",
|
|
2342
|
+
name: "arr",
|
|
2343
|
+
description: "数组"
|
|
2344
|
+
}, {
|
|
2345
|
+
type: "String",
|
|
2346
|
+
name: "separator",
|
|
2347
|
+
description: "分隔符"
|
|
2348
|
+
}],
|
|
2349
|
+
returns: {
|
|
2350
|
+
type: "String",
|
|
2351
|
+
description: "结果"
|
|
2352
|
+
},
|
|
2353
|
+
namespace: "数组"
|
|
2354
|
+
}, {
|
|
2355
|
+
name: "CONCAT",
|
|
2356
|
+
description: "数组合并\n\n示例:\n\nCONCAT(['a', 'b', 'c'], ['1'], ['3']) 得到 ['a', 'b', 'c', '1', '3']",
|
|
2357
|
+
example: "CONCAT(['a', 'b', 'c'], ['1'], ['3'])",
|
|
2358
|
+
params: [{
|
|
2359
|
+
type: "Array<any>",
|
|
2360
|
+
name: "arr",
|
|
2361
|
+
description: "数组"
|
|
2362
|
+
}],
|
|
2363
|
+
returns: {
|
|
2364
|
+
type: "Array<any>",
|
|
2365
|
+
description: "结果"
|
|
2366
|
+
},
|
|
2367
|
+
namespace: "数组"
|
|
2368
|
+
}, {
|
|
2369
|
+
name: "UNIQ",
|
|
2370
|
+
description: "数组去重,第二个参数「field」,可指定根据该字段去重\n\n示例:\n\nUNIQ([{a: '1'}, {b: '2'}, {a: '1'}], 'id')",
|
|
2371
|
+
example: "UNIQ([{a: '1'}, {b: '2'}, {a: '1'}], 'x')",
|
|
2372
|
+
params: [{
|
|
2373
|
+
type: "Array<any>",
|
|
2374
|
+
name: "arr",
|
|
2375
|
+
description: "数组"
|
|
2376
|
+
}, {
|
|
2377
|
+
type: "string",
|
|
2378
|
+
name: "field",
|
|
2379
|
+
description: "字段"
|
|
2380
|
+
}],
|
|
2381
|
+
returns: {
|
|
2382
|
+
type: "Array<any>",
|
|
2383
|
+
description: "结果"
|
|
2384
|
+
},
|
|
2385
|
+
namespace: "数组"
|
|
2386
|
+
}, {
|
|
2387
|
+
name: "ENCODEJSON",
|
|
2388
|
+
description: "将JS对象转换成JSON字符串\n\n示例:\n\nENCODEJSON({name: 'amis'}) 得到 '{\"name\":\"amis\"}'",
|
|
2389
|
+
example: "ENCODEJSON({name: 'amis'})",
|
|
2390
|
+
params: [{
|
|
2391
|
+
type: "object",
|
|
2392
|
+
name: "obj",
|
|
2393
|
+
description: "JS对象"
|
|
2394
|
+
}],
|
|
2395
|
+
returns: {
|
|
2396
|
+
type: "string",
|
|
2397
|
+
description: "结果"
|
|
2398
|
+
},
|
|
2399
|
+
namespace: "编码"
|
|
2400
|
+
}, {
|
|
2401
|
+
name: "DECODEJSON",
|
|
2402
|
+
description: "解析JSON编码数据,返回JS对象\n\n示例:\n\nDECODEJSON('{\\\"name\\\": \"amis\"}') 得到 {name: 'amis'}",
|
|
2403
|
+
example: "DECODEJSON('{\\\"name\\\": \"amis\"}')",
|
|
2404
|
+
params: [{
|
|
2405
|
+
type: "string",
|
|
2406
|
+
name: "str",
|
|
2407
|
+
description: "字符串"
|
|
2408
|
+
}],
|
|
2409
|
+
returns: {
|
|
2410
|
+
type: "object",
|
|
2411
|
+
description: "结果"
|
|
2412
|
+
},
|
|
2413
|
+
namespace: "编码"
|
|
2414
|
+
}, {
|
|
2415
|
+
name: "GET",
|
|
2416
|
+
description: "根据对象或者数组的path路径获取值。 如果解析 value 是 undefined 会以 defaultValue 取代\n\n示例:\n\nGET([0, 2, {name: 'amis', age: 18}], 1) 得到 2\nGET([0, 2, {name: 'amis', age: 18}], '2.name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr[0].name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr.0.name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr.1.name', 'not-found') 得到 'not-found'",
|
|
2417
|
+
example: "GET(arr, 2)",
|
|
2418
|
+
params: [{
|
|
2419
|
+
type: "any",
|
|
2420
|
+
name: "obj",
|
|
2421
|
+
description: "对象或数组"
|
|
2422
|
+
}, {
|
|
2423
|
+
type: "string",
|
|
2424
|
+
name: "path",
|
|
2425
|
+
description: "路径"
|
|
2426
|
+
}, {
|
|
2427
|
+
type: "any",
|
|
2428
|
+
name: "defaultValue",
|
|
2429
|
+
description: "如果解析不到则返回该值"
|
|
2430
|
+
}],
|
|
2431
|
+
returns: {
|
|
2432
|
+
type: "any",
|
|
2433
|
+
description: "结果"
|
|
2434
|
+
},
|
|
2435
|
+
namespace: "其他"
|
|
2436
|
+
}, {
|
|
2437
|
+
name: "ISTYPE",
|
|
2438
|
+
description: "判断是否为类型支持:string, number, array, date, plain-object。",
|
|
2439
|
+
example: "ISTYPE([{a: '1'}, {b: '2'}, {a: '1'}], 'array')",
|
|
2440
|
+
params: [{
|
|
2441
|
+
type: "string",
|
|
2442
|
+
name: "判断对象",
|
|
2443
|
+
description: null
|
|
2444
|
+
}],
|
|
2445
|
+
returns: {
|
|
2446
|
+
type: "boolean",
|
|
2447
|
+
description: "结果"
|
|
2448
|
+
},
|
|
2449
|
+
namespace: "其他"
|
|
2450
|
+
}]);
|
|
2451
|
+
// EXTERNAL MODULE: external "element-ui/lib/message"
|
|
2452
|
+
var message_ = __webpack_require__(61);
|
|
2453
|
+
var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
2454
|
+
|
|
2455
|
+
// CONCATENATED MODULE: ./src/components/formula/src/index.js
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
/* harmony default export */ var src = ({
|
|
2466
|
+
name: "Formula",
|
|
2467
|
+
componentName: "Formula",
|
|
2468
|
+
components: {
|
|
2469
|
+
CodeMirrorEditor: codeMirror,
|
|
2470
|
+
FuncList: funcList,
|
|
2471
|
+
VariableList: variableList
|
|
2472
|
+
},
|
|
2473
|
+
props: {
|
|
2474
|
+
value: String,
|
|
2475
|
+
evalMode: {
|
|
2476
|
+
type: Boolean,
|
|
2477
|
+
default: function _default() {
|
|
2478
|
+
return true;
|
|
2479
|
+
}
|
|
2480
|
+
},
|
|
2481
|
+
/**
|
|
2482
|
+
* 变量展现模式,可选值:'tabs' | 'tree'
|
|
2483
|
+
*/
|
|
2484
|
+
variableMode: {
|
|
2485
|
+
type: String,
|
|
2486
|
+
default: "tabs"
|
|
2487
|
+
},
|
|
2488
|
+
functions: Array,
|
|
2489
|
+
variables: Array,
|
|
2490
|
+
functionClassName: String,
|
|
2491
|
+
variableClassName: String,
|
|
2492
|
+
/**
|
|
2493
|
+
* 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
|
|
2494
|
+
*/
|
|
2495
|
+
selfVariableName: String
|
|
2496
|
+
},
|
|
2497
|
+
data: function data() {
|
|
2498
|
+
return {
|
|
2499
|
+
focused: false,
|
|
2500
|
+
editorPlugin: null
|
|
2501
|
+
};
|
|
2502
|
+
},
|
|
2503
|
+
computed: {
|
|
2504
|
+
functionList: function functionList() {
|
|
2505
|
+
var funcs = [];
|
|
2506
|
+
doc.forEach(function (item) {
|
|
2507
|
+
var namespace = item.namespace || 'Others';
|
|
2508
|
+
var exists = funcs.find(function (item) {
|
|
2509
|
+
return item.groupName === namespace;
|
|
2510
|
+
});
|
|
2511
|
+
if (!exists) {
|
|
2512
|
+
exists = {
|
|
2513
|
+
groupName: namespace,
|
|
2514
|
+
items: []
|
|
2515
|
+
};
|
|
2516
|
+
funcs.push(exists);
|
|
2517
|
+
}
|
|
2518
|
+
exists.items.push(item);
|
|
2519
|
+
});
|
|
2520
|
+
var customFunctions = Array.isArray(this.functions) ? this.functions : [];
|
|
2521
|
+
return [].concat(funcs, customFunctions);
|
|
2522
|
+
}
|
|
2523
|
+
},
|
|
2524
|
+
methods: {
|
|
2525
|
+
editorFactory: function editorFactory(dom, cm) {
|
|
2526
|
+
return plugin_editorFactory(dom, cm, this.$props);
|
|
2527
|
+
},
|
|
2528
|
+
handleEditorMounted: function handleEditorMounted(cm, editor) {
|
|
2529
|
+
var _this = this;
|
|
2530
|
+
this.editorPlugin = new FormulaPlugin(editor, cm, function () {
|
|
2531
|
+
return _this.$props;
|
|
2532
|
+
});
|
|
2533
|
+
},
|
|
2534
|
+
// type:'variable' | 'func'
|
|
2535
|
+
insertValue: function insertValue(value, type) {
|
|
2536
|
+
if (!this.editorPlugin) {
|
|
2537
|
+
return;
|
|
2538
|
+
}
|
|
2539
|
+
this.editorPlugin.insertContent(value, type);
|
|
2540
|
+
},
|
|
2541
|
+
handleFunctionSelect: function handleFunctionSelect(item) {
|
|
2542
|
+
if (!this.editorPlugin) {
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2545
|
+
this.editorPlugin.insertContent("" + item.name, 'func');
|
|
2546
|
+
},
|
|
2547
|
+
handleVariableSelect: function handleVariableSelect(item) {
|
|
2548
|
+
var _this$$props = this.$props,
|
|
2549
|
+
evalMode = _this$$props.evalMode,
|
|
2550
|
+
selfVariableName = _this$$props.selfVariableName;
|
|
2551
|
+
if (!(item.value && this.editorPlugin)) {
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
if (selfVariableName && selfVariableName === item.value) {
|
|
2555
|
+
message_default.a.warning("\u4E0D\u80FD\u4F7F\u7528\u5F53\u524D\u53D8\u91CF[" + selfVariableName + "]\uFF0C\u907F\u514D\u5FAA\u73AF\u5F15\u7528\u3002");
|
|
2556
|
+
return;
|
|
2557
|
+
}
|
|
2558
|
+
this.editorPlugin.insertContent({
|
|
2559
|
+
key: item.value,
|
|
2560
|
+
name: item.label
|
|
2561
|
+
}, 'variable');
|
|
2562
|
+
},
|
|
2563
|
+
handleChange: function handleChange(value) {
|
|
2564
|
+
this.$emit("change", value);
|
|
2565
|
+
},
|
|
2566
|
+
handleFocus: function handleFocus() {
|
|
2567
|
+
this.focused = true;
|
|
2568
|
+
},
|
|
2569
|
+
handleBlur: function handleBlur() {
|
|
2570
|
+
this.focused = false;
|
|
2571
|
+
},
|
|
2572
|
+
handleValClick: function handleValClick() {
|
|
2573
|
+
this.handleVariableSelect({
|
|
2574
|
+
value: "name",
|
|
2575
|
+
label: "名称"
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
},
|
|
2579
|
+
beforeDestroy: function beforeDestroy() {
|
|
2580
|
+
this.editorPlugin && this.editorPlugin.dispose();
|
|
2581
|
+
},
|
|
2582
|
+
render: function render(h) {
|
|
2583
|
+
var mirrorParam = {
|
|
2584
|
+
attrs: Object.assign({
|
|
2585
|
+
className: "FormulaEditor-editor",
|
|
2586
|
+
value: this.value,
|
|
2587
|
+
editorFactory: this.editorFactory,
|
|
2588
|
+
editorDidMount: this.handleEditorMounted
|
|
2589
|
+
}, this.$attrs),
|
|
2590
|
+
on: Object.assign({
|
|
2591
|
+
change: this.handleChange,
|
|
2592
|
+
focus: this.handleFocus,
|
|
2593
|
+
blur: this.handleBlur
|
|
2594
|
+
}, this.$listeners),
|
|
2595
|
+
slots: this.$slots,
|
|
2596
|
+
scopedSlots: this.$scopedSlots
|
|
2597
|
+
};
|
|
2598
|
+
return h("div", {
|
|
2599
|
+
"class": ["FormulaEditor", {
|
|
2600
|
+
"is-focused": this.focused
|
|
2601
|
+
}]
|
|
2602
|
+
}, [h("section", {
|
|
2603
|
+
"class": ["FormulaEditor-content"]
|
|
2604
|
+
}, [h("header", {
|
|
2605
|
+
"class": "FormulaEditor-header"
|
|
2606
|
+
}, ["\u8868\u8FBE\u5F0F"]), h(codeMirror, babel_helper_vue_jsx_merge_props_default()([{}, mirrorParam]))]), h("section", {
|
|
2607
|
+
"class": "FormulaEditor-settings"
|
|
2608
|
+
}, [h("div", {
|
|
2609
|
+
"class": "FormulaEditor-panel"
|
|
2610
|
+
}, [this.variableMode !== 'tabs' ? h("div", {
|
|
2611
|
+
"class": "FormulaEditor-panel-header"
|
|
2612
|
+
}, ["\u53D8\u91CF"]) : null, h("div", {
|
|
2613
|
+
"class": ["FormulaEditor-panel-body", this.variableMode && "FormulaEditor-panel-body--" + this.variableMode]
|
|
2614
|
+
}, [h(variableList, babel_helper_vue_jsx_merge_props_default()([{
|
|
2615
|
+
"class": ["FormulaEditor-VariableList", "FormulaEditor-VariableList-root", this.variableClassName],
|
|
2616
|
+
"attrs": {
|
|
2617
|
+
"classPrefix": this.classPrefix,
|
|
2618
|
+
"selectMode": this.variableMode,
|
|
2619
|
+
"selfVariableName": this.selfVariableName,
|
|
2620
|
+
"data": this.variables
|
|
2621
|
+
}
|
|
2622
|
+
}, {
|
|
2623
|
+
"on": {
|
|
2624
|
+
select: this.handleVariableSelect
|
|
2625
|
+
}
|
|
2626
|
+
}]))])]), h(funcList, babel_helper_vue_jsx_merge_props_default()([{
|
|
2627
|
+
"attrs": {
|
|
2628
|
+
"className": this.functionClassName,
|
|
2629
|
+
"data": this.functionList
|
|
2630
|
+
}
|
|
2631
|
+
}, {
|
|
2632
|
+
"on": {
|
|
2633
|
+
select: this.handleFunctionSelect
|
|
2634
|
+
}
|
|
2635
|
+
}]))])]);
|
|
2636
|
+
}
|
|
2637
|
+
});
|
|
2638
|
+
// CONCATENATED MODULE: ./src/components/formula/index.js
|
|
2639
|
+
|
|
2640
|
+
/* istanbul ignore next */
|
|
2641
|
+
src.install = function (Vue) {
|
|
2642
|
+
Vue.component(src.name, src);
|
|
2643
|
+
};
|
|
2644
|
+
/* harmony default export */ var formula = __webpack_exports__["default"] = (src);
|
|
2645
|
+
|
|
2646
|
+
/***/ }),
|
|
2647
|
+
|
|
2648
|
+
/***/ 8:
|
|
2649
|
+
/***/ (function(module, exports) {
|
|
2650
|
+
|
|
2651
|
+
module.exports = require("element-ui/lib/collapse-item");
|
|
2652
|
+
|
|
2653
|
+
/***/ })
|
|
2654
|
+
|
|
2655
|
+
/******/ });
|