@zscreate/form-component 1.1.221-test.47 → 1.1.221-test.49

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.
@@ -572,7 +572,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
572
572
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
573
573
 
574
574
  "use strict";
575
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.reduce.js\");\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace-all.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.string.replace-all.js\");\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.json.stringify.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.json.stringify.js\");\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ \"./node_modules/_lodash@4.17.21@lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @zscreate/formula */ \"./node_modules/_@zscreate_formula@1.0.1@@zscreate/formula/dist/formula.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_zscreate_formula__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ \"./node_modules/_codemirror@5.65.16@codemirror/lib/codemirror.css\");\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! codemirror/addon/hint/show-hint.css */ \"./node_modules/_codemirror@5.65.16@codemirror/addon/hint/show-hint.css\");\n/* harmony import */ var codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! codemirror/theme/eclipse.css */ \"./node_modules/_codemirror@5.65.16@codemirror/theme/eclipse.css\");\n/* harmony import */ var codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _list_2__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./list_2 */ \"./src/form/formula/list_2.js\");\n/* harmony import */ var _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/form/formula/utils */ \"./src/form/formula/utils/index.js\");\n\n\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nconsole.log(_zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.Formula);\nwindow.Formula = _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.Formula;\n\n\n\n\nconst CodeMirror = window.CodeMirror = __webpack_require__(/*! codemirror/lib/codemirror */ \"./node_modules/_codemirror@5.65.16@codemirror/lib/codemirror.js\");\n__webpack_require__(/*! codemirror/addon/hint/show-hint */ \"./node_modules/_codemirror@5.65.16@codemirror/addon/hint/show-hint.js\");\n__webpack_require__(/*! ./codemirror/addon/hint/formula-hint */ \"./src/form/formula/codemirror/addon/hint/formula-hint.js\");\n__webpack_require__(/*! ./codemirror/mode/formula/formula-mode */ \"./src/form/formula/codemirror/mode/formula/formula-mode.js\");\n\nconst keywords = [];\nconst keywordsMap = {};\n_list_2__WEBPACK_IMPORTED_MODULE_9__[\"default\"].forEach(item => {\n item.contains.forEach(contain => {\n keywords.push(contain.name);\n keywordsMap[contain.name] = contain.subName;\n });\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n props: {\n visible: {\n type: Boolean,\n default: false\n },\n data: {\n type: [Object]\n },\n boData: {\n type: Array\n },\n title: {\n type: String,\n default: '公式编辑'\n },\n widgetName: {\n type: String,\n default: ''\n },\n label: {\n type: String,\n default: '公式'\n }\n },\n data() {\n return {\n TypesName: _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__.TypesName,\n componentTypes: _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__.componentTypes,\n dialogVisible: false,\n err_current: '',\n err_msg: '',\n remark: '',\n editor: null,\n form: {\n message: '',\n formula: '',\n remark: ''\n },\n replaceObject: {\n currReplaceParams: [],\n curr: '',\n replace: ''\n },\n search_variable: '',\n search_methods: '',\n filter_treeData: [],\n hasInVaild: false,\n hasTip: false,\n formulaIntro: '',\n expandIndex: [],\n TABLE_SEPARATOR: '.',\n replaceForm: null,\n replaceVisible: false\n };\n },\n computed: {\n filter_boData() {\n return this.boData.filter(item => {\n if (!this.search_variable) return true;\n return String(item.name).includes(this.search_variable);\n });\n },\n // boTreeData() {\n // return TreeUtils.transformToTreeFormat(this.boData, {\n // idKey: 'id',\n // pIdKey: 'parentId'\n // })\n // },\n currReplaceTotal() {\n const {\n curr,\n currReplaceParams\n } = this.replaceObject;\n if (curr) {\n var _currReplaceParams$fi;\n return ((_currReplaceParams$fi = currReplaceParams.find(item => item.value === curr)) === null || _currReplaceParams$fi === void 0 ? void 0 : _currReplaceParams$fi.count) || 0;\n }\n return 0;\n },\n treeData() {\n return _list_2__WEBPACK_IMPORTED_MODULE_9__[\"default\"].map(item => {\n return {\n title: item.category,\n key: item.value,\n level: 0,\n children: item.contains.map(contain => {\n return {\n title: contain.name,\n key: contain.name,\n level: 1,\n ...contain,\n on: {\n click: () => {\n console.log('mouseEnter');\n }\n }\n };\n })\n };\n });\n },\n f_dataObj() {\n return this.boData.reduce((prev, curr) => {\n prev[`$${curr.key}#`] = curr.name;\n return prev;\n }, {});\n },\n dataTypes() {\n return this.boData.reduce((prev, curr) => {\n prev[`${curr.key}`] = curr.type;\n return prev;\n }, {});\n }\n },\n watch: {\n search_methods: {\n handler() {\n this.expandIndex = [];\n this.formulaIntro = '';\n this.filter_treeData = this.handleMethodSearch(this.search_methods, true);\n },\n immediate: true\n },\n visible: {\n handler: function (val, oldVal) {\n this.replaceVisible = false;\n this.search_methods = this.search_variable = '';\n this.dialogVisible = this.visible;\n if (this.dialogVisible) {\n this.$nextTick(() => {\n this.initCodeMirror();\n });\n }\n },\n immediate: true\n },\n replaceVisible(val) {\n if (val) {\n this.replaceForm = this.$form.createForm(this, {\n mapPropsToFields: () => {\n return {\n curr: '',\n replace: ''\n };\n },\n onValuesChange: (_, values) => {\n console.log(values);\n this.replaceObject = {\n ...this.replaceObject,\n ...values\n };\n // Synchronize to vuex store in real time\n // this.$store.commit('update', values)\n }\n });\n }\n }\n },\n\n methods: {\n handleMethodSearch(val, fuzzy) {\n this.formulaIntro = '';\n const treeData = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(this.treeData);\n return treeData.filter((item, idx) => {\n if (!val) return true;\n item.children = item.children.filter(item => {\n if (!fuzzy) return item.title === val;\n return String(item.title).includes(String(val).toUpperCase()) || String(item.subName).includes(val);\n });\n if (item.children.length > 0) {\n this.$set(this.expandIndex, this.expandIndex.length, true);\n if (!this.formulaIntro) this.formulaIntro = item.children[0];\n }\n return item.children.length;\n });\n },\n replaceFilterOption(inputValue, option) {\n return option.componentOptions.propsData.title.includes(inputValue);\n },\n replaceConfirm(e) {\n console.log(e);\n this.replaceForm.validateFields((err, values) => {\n if (!err) {\n const {\n curr,\n replace\n } = this.replaceObject;\n console.log(curr, replace);\n const res = this.form.formula.replaceAll(curr, replace);\n console.log('replace result:', res);\n this.setValue(res);\n this.$message.success('变量替换成功');\n this.replaceVisible = false;\n }\n });\n },\n handleClick(key) {\n switch (key) {\n case 'copy':\n this.editor.execCommand(\"selectAll\");\n this.D(this.editor);\n this.$message.success('公式复制成功');\n break;\n case 'remark':\n this.remark = this.form.remark;\n break;\n case 'replace':\n const e = this.M(this.editor).formulaWords;\n console.log(e);\n var t = [],\n n = {};\n e.forEach(e => {\n this.f_dataObj[e] && (n[e] ? n[e]++ : (n[e] = 1, t.push(e)));\n });\n this.replaceObject.currReplaceParams = t.map(e => {\n if (this.f_dataObj && this.f_dataObj[e]) return {\n value: e,\n text: this.f_dataObj[e],\n count: n[e]\n };\n });\n this.replaceObject.curr = this.replaceObject.replace = '';\n setTimeout(() => {\n this.replaceVisible = true;\n }, 100);\n // Ye(r)\n break;\n case 'debug':\n const {\n relyWidgets,\n formula\n } = this._getValue();\n this.$emit('debug', {\n relyWidgets,\n formula\n });\n break;\n }\n },\n R(e, t) {\n return t.line !== e.line ? t.line > e.line ? 1 : -1 : t.ch === e.ch ? 0 : t.ch > e.ch ? 1 : -1;\n },\n D(e) {\n for (var t, n, r = [], a = e.getDoc(), o = a.sel.ranges[0], i = [], c = function (e) {\n var o = a.getLineHandle(e),\n c = {\n from: {\n line: e,\n ch: e === n.from.line ? n.from.ch : 0\n },\n to: {\n line: e,\n ch: e === n.to.line ? n.to.ch : null == (t = o.text) ? void 0 : t.length\n }\n };\n i.push(o.text.slice(c.from.ch, c.to.ch));\n var u = a.findMarks(c.from, c.to);\n o.markedSpans && o.markedSpans.forEach(function (t) {\n u.forEach(function (a) {\n var _t$marker$attributes, _t$marker$attributes2;\n t.marker === a && r.push({\n from: {\n line: e - n.from.line,\n ch: t.from - c.from.ch\n },\n to: {\n line: e - n.from.line,\n ch: t.to - c.from.ch\n },\n field: (_t$marker$attributes = t.marker[\"attributes\"]) === null || _t$marker$attributes === void 0 ? void 0 : _t$marker$attributes[\"data-field\"],\n entry: (_t$marker$attributes2 = t.marker[\"attributes\"]) === null || _t$marker$attributes2 === void 0 ? void 0 : _t$marker$attributes2[\"entry\"]\n });\n });\n });\n }, u = (n = this.R(o.head, o.anchor) > 0 ? {\n from: o.head,\n to: o.anchor\n } : {\n from: o.anchor,\n to: o.head\n }).from.line; u <= n.to.line; u += 1) c(u);\n var s = {\n text: i.join(\"\\n\"),\n marks: r,\n cmf: !0\n };\n this.copyToClipboard(JSON.stringify(s));\n },\n copyToClipboard(e, t) {\n var n,\n r = document.createElement(\"textarea\");\n r.style.background = \"transparent\", r.style.color = \"transparent\", r.value = e, document.body.appendChild(r), r.select(), r.setSelectionRange(0, e.length), r.focus();\n try {\n n = document.execCommand(\"copy\");\n } catch (a) {\n n = !1;\n }\n document.body.removeChild(r), n && t && t();\n },\n handleActionEvent({\n key\n }) {\n switch (key) {\n case 'confirm':\n this.handleConfirm();\n break;\n case 'cancel':\n this.closeDialog();\n break;\n default:\n break;\n }\n },\n handleConfirm() {\n const {\n relyWidgets,\n formula\n } = this._getValue();\n if (this.hasInVaild) {\n return this.$message.warning('存在无效字段,请删除');\n }\n this.$emit('callback', Object.assign({\n relyWidgets\n }, this.form));\n // this.closeDialog()\n },\n\n check: (0,lodash__WEBPACK_IMPORTED_MODULE_4__.debounce)(function () {\n const {\n formula = ''\n } = this._getValue();\n this.form.formula = formula;\n if (!formula) return this.err_msg = '';\n try {\n const checkRes = new _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.FormulaCheck().run(formula, this.dataTypes, false);\n console.log(`check:`, checkRes);\n this.err_msg = '';\n } catch (n) {\n try {\n var r = JSON.parse(n.message),\n a = r.type,\n o = r.errorType,\n i = r.name,\n u = r.paramIndex,\n s = \"\";\n switch (a) {\n case \"lexer\":\n case \"parser\":\n s = '语法错误,缺少标示符', this.err_current = \"parser\";\n break;\n case \"function\":\n var d = \"paramCount\" === o || \"minParamCount\" === o || \"maxParamCount\" === o;\n this.err_current = d ? \"param_count\" : \"param_type\";\n s = d ? `${i}:表达式参数的个数不符合要求` : `${i}:表达式的第${u}个参数不符合类型要求`;\n break;\n case \"resultType\":\n s = '公式计算值和当前字段类型不匹配', this.err_current = \"result_type\";\n break;\n case \"mathOperator\":\n s = 1 === u ? `${i}:运算符左侧有参数不符合类型要求` : `${i}:运算符右侧有参数不符合类型要求`, this.err_current = \"math\";\n }\n this.err_msg = s;\n console.log('err_msg: ', s);\n } catch (f) {\n this.err_msg = '';\n this.err_current = void 0;\n }\n }\n }, 500),\n // 关闭当前窗口\n closeDialog() {\n this.$emit('close', false);\n },\n clickBoNode(data) {\n this.insertField(data, false);\n },\n handleMouseLeave() {\n if (this.lastVisitMethodInfo) {\n this.formulaIntro = this.lastVisitMethodInfo;\n }\n },\n handleFunctionHover(data) {\n this.formulaIntro = data;\n },\n clickFunctionNode(data) {\n this._markKeyWord(data.name);\n },\n onCustomPaste: function (e) {\n var t = e.marks,\n n = [];\n const labelMap = {};\n this.boData.forEach(item => {\n labelMap[`$${item.key}#`] = item.name;\n });\n this.pasteValue(e, labelMap);\n },\n pasteValue(e, t) {\n var n = this.editor,\n e;\n n.replaceSelection(\"\");\n var a = n.getCursor();\n n.replaceSelection(e.text), e.marks.forEach(e => {\n var o = \"$\" + e.field + \"#\" + (e.entry || '') || 0,\n i = {\n invalid: !t[o],\n label: t[o] || '失效变量'\n },\n c = i.label,\n u = 0 === e.from.line ? a.ch : 0,\n s = {\n line: a.line + e.from.line,\n ch: u + e.from.ch\n },\n d = {\n line: a.line + e.to.line,\n ch: u + e.to.ch\n };\n this.T({\n from: s,\n to: d,\n field: e.field,\n entry: e.entry || \"\",\n invalid: i.invalid,\n label: c\n }, n);\n });\n },\n T(e, t, n) {\n var r = \"\",\n a = {\n \"data-field\": e.field\n };\n e.invalid ? r = 'cm-field-invalid' : e.entry ? (r = 'cm-field-name', a[\"data-entry\"] = e.entry) : r = 'cm-field-value';\n var o,\n i,\n c = (o = '<span class=\"cm-field '.concat(r, '\">').concat(e.label, \"</span>\"), (i = document.createElement(\"div\")).innerHTML = o, i.childNodes[0]);\n c.setAttribute(\"data-field\", e.field), e.entry && c.setAttribute(\"data-entry\", e.entry), n && n(e, c), t.markText(e.from, e.to, {\n handleMouseEvents: !0,\n atomic: !0,\n attributes: {\n 'data-field': e.field,\n 'data-entry': e.entry\n },\n replacedWith: c\n });\n },\n initCodeMirror() {\n CodeMirror.keywords = keywords;\n CodeMirror.keywordsMap = keywordsMap;\n CodeMirror.feildKeywords = this.boData;\n this.editor = CodeMirror.fromTextArea(this.$refs.formula, {\n line: true,\n autoCloseTags: true,\n autofocus: false,\n lineWrapping: true,\n matchBrackets: {\n maxHighlightLineLength: 2000,\n maxScanLines: 2000\n },\n mode: 'formula',\n // 选择对应代码编辑器的语言\n // eslint-disable-next-line no-control-regex\n specialChars: /[\\u0000-\\u001f\\u007f\\u00ad\\u200c-\\u200f\\u2028\\u2029\\ufeff]/,\n theme: 'eclipse',\n onFieldSelect: feild => {\n this.insertField(feild, false);\n console.log('onFieldSelect', feild);\n // console.log()\n },\n\n extraKeys: {\n Backspace: function (cm) {\n const token = cm.getTokenAt(cm.getCursor());\n if (token.type === 'field') {\n // 删除字段 || \"keyword\" == token.type\n const line = cm.getCursor().line;\n cm.setSelection(new CodeMirror.Pos(line, token.start), new CodeMirror.Pos(line, token.end));\n cm.replaceSelection('', null, '+delete');\n } else {\n cm.execCommand('delCharBefore');\n }\n }\n }\n });\n console.log('this.editor: ', this.editor);\n this.editor.getWrapperElement().addEventListener('click', e => {\n if (e.target.classList.contains('cm-keyword')) {\n this.setLastVisitMethodInfo(e.target.innerText);\n }\n });\n this.editor.setSize('100%', '180px');\n this.editor.on('cursorActivity', function (editor, b) {\n CodeMirror.showHint(editor, CodeMirror.formulaHint, {\n completeSingle: false\n });\n });\n this.editor.on('change', (cm, res) => {\n console.log('res:', res);\n this.check();\n });\n this.editor.on('changes', (cm, res) => {\n console.log('updates', res);\n res = res[0];\n if (res.origin === 'complete') {\n const text = res.text[0];\n if (text.includes('()')) {\n this.setLastVisitMethodInfo(text.replace(\"()\", ''));\n }\n }\n });\n this.editor.on('paste', (e, t) => {\n var n = t.clipboardData.getData(\"text/plain\"),\n r = null;\n try {\n r = JSON.parse(n);\n } catch (a) {\n r = null;\n }\n r && r.cmf && r.marks && (t.preventDefault(), this.onCustomPaste(r));\n });\n this.editor.on('copy', (e, t) => {\n t.preventDefault(), this.D(e), e.focus();\n });\n this.editor.on('cut', (e, t) => {\n t.preventDefault(), this.D(e), e.deleteH(), e.focus();\n });\n this.form.message = '';\n this.setValue(this.data.formula);\n const lastKeyWord = this.editor.getLineTokens(9999).filter(item => item.type == 'keyword').slice(-1);\n if (lastKeyWord.length) {\n this.setLastVisitMethodInfo(lastKeyWord[0].string);\n }\n },\n insertField: function (obj, b) {\n const start = this.editor.getCursor();\n this.editor.replaceSelection('​' + obj.name + '​');\n const end = this.editor.getCursor();\n b ? this._markFieldName(start, end, obj.key, obj.id) : this._markFieldValue(start, end, obj.key);\n this.editor.focus();\n },\n _markFieldValue(start, end, key) {\n const item = this.boData.find(item => item.key === key) || {\n invalid: true\n };\n let outDiv = document.createElement(\"div\");\n outDiv.innerHTML = `<span class=\"cm-field ${item.invalid ? 'cm-field-invalid' : 'cm-field-value'}\">${item.invalid ? '失效变量' : item.name}</span>`;\n const node = outDiv.childNodes[0];\n node.setAttribute('data-field', key);\n this.editor.markText(start, end, {\n handleMouseEvents: !0,\n atomic: !0,\n attributes: {\n 'data-field': key\n },\n replacedWith: node\n });\n },\n _markFieldName(start, end, key, id) {\n this.editor.markText(start, end, {\n className: 'cm-field-name',\n attributes: {\n 'data-field': key,\n 'data-entry': id\n }\n });\n },\n _markKeyWord(key) {\n this.editor.focus();\n const cursor = this.editor.getCursor();\n this.editor.replaceSelection(key + '()');\n this.editor.setCursor({\n line: cursor.line,\n ch: cursor.ch + key.length + 1\n });\n this.setLastVisitMethodInfo(key);\n },\n setLastVisitMethodInfo: (0,lodash__WEBPACK_IMPORTED_MODULE_4__.debounce)(function (methodName) {\n this.handleMethodSearch(methodName);\n this.lastVisitMethodInfo = this.formulaIntro;\n }, 500),\n setValue(val) {\n if (!val) {\n return;\n }\n const _this = this;\n const c = [];\n const d = [];\n const valAry = val.split('\\n');\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(valAry, (b, a) => {\n let e = '';\n // eslint-disable-next-line no-useless-escape\n const f = b.split(/(\\$[0-9a-zA-Z\\._]+#[0-9A-Fa-f]*)/g);\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(f, c => {\n if (/^\\$(_widget_|_formula_|ext)/.test(c)) {\n const label = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.startsWith)(c, '$ext') ? '扩展字段' : _this.getBoLabel(c);\n const g = c.replace('$', '').split('#');\n const field = g[0];\n const entry = g[1];\n const from = CodeMirror.Pos(a, e.length);\n e += '​' + label + '​';\n const to = CodeMirror.Pos(a, e.length);\n d.push({\n from: from,\n to: to,\n field: field,\n entry: entry\n });\n } else {\n e += c;\n }\n });\n c.push(e);\n });\n this.editor.setValue(c.join('\\n'));\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(d, c => {\n c.entry ? _this._markFieldName(c.from, c.to, c.field, c.entry) : _this._markFieldValue(c.from, c.to, c.field);\n });\n },\n getValue: function () {\n function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }\n const formula = [];\n const show = [];\n const lineContent = this.editor.display.lineDiv.getElementsByClassName('CodeMirror-line');\n for (let i = 0; i < lineContent.length; i++) {\n const f = [];\n const l = [];\n const content = lineContent[i];\n const children = content.children[0].children;\n for (let j = 0; j < children.length; j++) {\n let span = children[j];\n if (span.querySelector('[data-field]')) span = span.querySelector('[data-field]');\n const field = span.getAttribute('data-field');\n const entry = span.getAttribute('data-entry');\n if (hasClass(span, 'cm-field-name')) {\n f.push('$' + field + '#' + entry);\n } else if (hasClass(span, 'cm-field-value')) {\n f.push('$' + field + '#');\n } else {\n if (hasClass(span, 'cm-deprecate')) {\n continue;\n }\n f.push(span.textContent || span.innerText);\n }\n l.push(span.textContent || span.innerText);\n }\n const g = f.join('').replace(/\\u200b/g, '').replace(/\\u00a0/g, ' ');\n formula.push(g);\n const t = l.join('').replace(/\\u200b/g, '').replace(/\\u00a0/g, ' ');\n show.push(t);\n }\n return {\n formula: formula.join('\\n'),\n show: show.join('\\n')\n };\n },\n M(e) {\n var t = [],\n n = [],\n r = [],\n a = e.display.lineDiv.children || [];\n this.hasInVaild = false;\n return Array.from(a).forEach(e => {\n var a = [],\n o = e.children[0].childNodes;\n o.forEach(e => {\n var _e$firstChild;\n var t = e.children;\n if (t && t[0]) {\n var r = t[0],\n o = r.getAttribute(\"data-field\"),\n i = r.getAttribute(\"data-entry\");\n r.classList.contains('cm-field-name') ? a.push(\"$\" + o + \"#\" + i) : r.classList.contains('cm-field-value') && (a.push(\"$\" + o + \"#\"), n.includes(o) || n.push(o));\n if (r.classList.contains('cm-field-invalid')) {\n this.hasInVaild = true;\n }\n } else if (\"#text\" === (e === null || e === void 0 ? void 0 : (_e$firstChild = e.firstChild) === null || _e$firstChild === void 0 ? void 0 : _e$firstChild.nodeName)) {\n var _e$firstChild2;\n if (e.classList.contains('cm-deprecate') || e.classList.contains('cm-field-invalid') || e.classList.contains('cm-negative')) return;\n a.push(e === null || e === void 0 ? void 0 : (_e$firstChild2 = e.firstChild) === null || _e$firstChild2 === void 0 ? void 0 : _e$firstChild2.nodeValue);\n } else \"#text\" === e.nodeName && a.push(e.nodeValue);\n }), r = r.concat(a);\n var i = a.join(\"\").replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \");\n t.push(i);\n }), {\n formula: t.join(\"\\n\"),\n formulaWords: r,\n relyWidgets: n\n };\n },\n _getValue: function () {\n return e = function (e, t) {\n e = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(t);\n return e;\n }({}, this.M(this.editor)), Object.defineProperties(e, Object.getOwnPropertyDescriptors({\n remark: this.form.remark\n }));\n var e;\n },\n getBoLabel(key) {\n for (let i = 0; i < this.boData.length; i++) {\n const bo = this.boData[i];\n if ('$_widget_' + bo.key + '#' === key) {\n return bo.name;\n }\n }\n return '';\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/formula/formula-edit.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
575
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.reduce.js\");\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace-all.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.string.replace-all.js\");\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.json.stringify.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.json.stringify.js\");\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash */ \"./node_modules/_lodash@4.17.21@lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @zscreate/formula */ \"./node_modules/_@zscreate_formula@1.0.1@@zscreate/formula/dist/formula.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_zscreate_formula__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! codemirror/lib/codemirror.css */ \"./node_modules/_codemirror@5.65.16@codemirror/lib/codemirror.css\");\n/* harmony import */ var codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(codemirror_lib_codemirror_css__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! codemirror/addon/hint/show-hint.css */ \"./node_modules/_codemirror@5.65.16@codemirror/addon/hint/show-hint.css\");\n/* harmony import */ var codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! codemirror/theme/eclipse.css */ \"./node_modules/_codemirror@5.65.16@codemirror/theme/eclipse.css\");\n/* harmony import */ var codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(codemirror_theme_eclipse_css__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _list_2__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./list_2 */ \"./src/form/formula/list_2.js\");\n/* harmony import */ var _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/form/formula/utils */ \"./src/form/formula/utils/index.js\");\n\n\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\nconsole.log(_zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.Formula);\nwindow.Formula = _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.Formula;\n\n\n\n\nconst CodeMirror = window.CodeMirror = __webpack_require__(/*! codemirror/lib/codemirror */ \"./node_modules/_codemirror@5.65.16@codemirror/lib/codemirror.js\");\n__webpack_require__(/*! codemirror/addon/hint/show-hint */ \"./node_modules/_codemirror@5.65.16@codemirror/addon/hint/show-hint.js\");\n__webpack_require__(/*! ./codemirror/addon/hint/formula-hint */ \"./src/form/formula/codemirror/addon/hint/formula-hint.js\");\n__webpack_require__(/*! ./codemirror/mode/formula/formula-mode */ \"./src/form/formula/codemirror/mode/formula/formula-mode.js\");\n\nconst keywords = [];\nconst keywordsMap = {};\n_list_2__WEBPACK_IMPORTED_MODULE_9__[\"default\"].forEach(item => {\n item.contains.forEach(contain => {\n keywords.push(contain.name);\n keywordsMap[contain.name] = contain.subName;\n });\n});\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n props: {\n visible: {\n type: Boolean,\n default: false\n },\n data: {\n type: [Object]\n },\n boData: {\n type: Array\n },\n title: {\n type: String,\n default: '公式编辑'\n },\n widgetName: {\n type: String,\n default: ''\n },\n label: {\n type: String,\n default: '公式'\n }\n },\n data() {\n return {\n TypesName: _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__.TypesName,\n componentTypes: _form_formula_utils__WEBPACK_IMPORTED_MODULE_10__.componentTypes,\n dialogVisible: false,\n err_current: '',\n err_msg: '',\n remark: '',\n editor: null,\n form: {\n message: '',\n formula: '',\n remark: ''\n },\n initFormula: '',\n replaceObject: {\n currReplaceParams: [],\n curr: '',\n replace: ''\n },\n search_variable: '',\n search_methods: '',\n filter_treeData: [],\n hasInVaild: false,\n hasTip: false,\n formulaIntro: '',\n expandIndex: [],\n TABLE_SEPARATOR: '.',\n replaceForm: null,\n replaceVisible: false\n };\n },\n computed: {\n filter_boData() {\n return this.boData.filter(item => {\n if (!this.search_variable) return true;\n return String(item.name).includes(this.search_variable);\n });\n },\n // boTreeData() {\n // return TreeUtils.transformToTreeFormat(this.boData, {\n // idKey: 'id',\n // pIdKey: 'parentId'\n // })\n // },\n currReplaceTotal() {\n const {\n curr,\n currReplaceParams\n } = this.replaceObject;\n if (curr) {\n var _currReplaceParams$fi;\n return ((_currReplaceParams$fi = currReplaceParams.find(item => item.value === curr)) === null || _currReplaceParams$fi === void 0 ? void 0 : _currReplaceParams$fi.count) || 0;\n }\n return 0;\n },\n treeData() {\n return _list_2__WEBPACK_IMPORTED_MODULE_9__[\"default\"].map(item => {\n return {\n title: item.category,\n key: item.value,\n level: 0,\n children: item.contains.map(contain => {\n return {\n title: contain.name,\n key: contain.name,\n level: 1,\n ...contain,\n on: {\n click: () => {\n console.log('mouseEnter');\n }\n }\n };\n })\n };\n });\n },\n f_dataObj() {\n return this.boData.reduce((prev, curr) => {\n prev[`$${curr.key}#`] = curr.name;\n return prev;\n }, {});\n },\n dataTypes() {\n return this.boData.reduce((prev, curr) => {\n prev[`${curr.key}`] = curr.type;\n return prev;\n }, {});\n }\n },\n watch: {\n search_methods: {\n handler() {\n this.expandIndex = [];\n this.formulaIntro = '';\n this.filter_treeData = this.handleMethodSearch(this.search_methods, true);\n },\n immediate: true\n },\n visible: {\n handler: function (val, oldVal) {\n this.replaceVisible = false;\n this.search_methods = this.search_variable = '';\n this.dialogVisible = this.visible;\n if (this.dialogVisible) {\n this.$nextTick(() => {\n this.initCodeMirror();\n });\n }\n },\n immediate: true\n },\n replaceVisible(val) {\n if (val) {\n this.replaceForm = this.$form.createForm(this, {\n mapPropsToFields: () => {\n return {\n curr: '',\n replace: ''\n };\n },\n onValuesChange: (_, values) => {\n console.log(values);\n this.replaceObject = {\n ...this.replaceObject,\n ...values\n };\n // Synchronize to vuex store in real time\n // this.$store.commit('update', values)\n }\n });\n }\n }\n },\n\n methods: {\n handleMethodSearch(val, fuzzy) {\n this.formulaIntro = '';\n const treeData = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(this.treeData);\n return treeData.filter((item, idx) => {\n if (!val) return true;\n item.children = item.children.filter(item => {\n if (!fuzzy) return item.title === val;\n return String(item.title).includes(String(val).toUpperCase()) || String(item.subName).includes(val);\n });\n if (item.children.length > 0) {\n this.$set(this.expandIndex, this.expandIndex.length, true);\n if (!this.formulaIntro) this.formulaIntro = item.children[0];\n }\n return item.children.length;\n });\n },\n replaceFilterOption(inputValue, option) {\n return option.componentOptions.propsData.title.includes(inputValue);\n },\n replaceConfirm(e) {\n console.log(e);\n this.replaceForm.validateFields((err, values) => {\n if (!err) {\n const {\n curr,\n replace\n } = this.replaceObject;\n console.log(curr, replace);\n const res = this.form.formula.replaceAll(curr, replace);\n console.log('replace result:', res);\n this.setValue(res);\n this.$message.success('变量替换成功');\n this.replaceVisible = false;\n }\n });\n },\n handleClick(key) {\n switch (key) {\n case 'copy':\n this.editor.execCommand(\"selectAll\");\n this.D(this.editor);\n this.$message.success('公式复制成功');\n break;\n case 'remark':\n this.remark = this.form.remark;\n break;\n case 'replace':\n const e = this.M(this.editor).formulaWords;\n console.log(e);\n var t = [],\n n = {};\n e.forEach(e => {\n this.f_dataObj[e] && (n[e] ? n[e]++ : (n[e] = 1, t.push(e)));\n });\n this.replaceObject.currReplaceParams = t.map(e => {\n if (this.f_dataObj && this.f_dataObj[e]) return {\n value: e,\n text: this.f_dataObj[e],\n count: n[e]\n };\n });\n this.replaceObject.curr = this.replaceObject.replace = '';\n setTimeout(() => {\n this.replaceVisible = true;\n }, 100);\n // Ye(r)\n break;\n case 'debug':\n const {\n relyWidgets,\n formula\n } = this._getValue();\n this.$emit('debug', {\n relyWidgets,\n formula\n });\n break;\n }\n },\n R(e, t) {\n return t.line !== e.line ? t.line > e.line ? 1 : -1 : t.ch === e.ch ? 0 : t.ch > e.ch ? 1 : -1;\n },\n D(e) {\n for (var t, n, r = [], a = e.getDoc(), o = a.sel.ranges[0], i = [], c = function (e) {\n var o = a.getLineHandle(e),\n c = {\n from: {\n line: e,\n ch: e === n.from.line ? n.from.ch : 0\n },\n to: {\n line: e,\n ch: e === n.to.line ? n.to.ch : null == (t = o.text) ? void 0 : t.length\n }\n };\n i.push(o.text.slice(c.from.ch, c.to.ch));\n var u = a.findMarks(c.from, c.to);\n o.markedSpans && o.markedSpans.forEach(function (t) {\n u.forEach(function (a) {\n var _t$marker$attributes, _t$marker$attributes2;\n t.marker === a && r.push({\n from: {\n line: e - n.from.line,\n ch: t.from - c.from.ch\n },\n to: {\n line: e - n.from.line,\n ch: t.to - c.from.ch\n },\n field: (_t$marker$attributes = t.marker[\"attributes\"]) === null || _t$marker$attributes === void 0 ? void 0 : _t$marker$attributes[\"data-field\"],\n entry: (_t$marker$attributes2 = t.marker[\"attributes\"]) === null || _t$marker$attributes2 === void 0 ? void 0 : _t$marker$attributes2[\"entry\"]\n });\n });\n });\n }, u = (n = this.R(o.head, o.anchor) > 0 ? {\n from: o.head,\n to: o.anchor\n } : {\n from: o.anchor,\n to: o.head\n }).from.line; u <= n.to.line; u += 1) c(u);\n var s = {\n text: i.join(\"\\n\"),\n marks: r,\n cmf: !0\n };\n this.copyToClipboard(JSON.stringify(s));\n },\n copyToClipboard(e, t) {\n var n,\n r = document.createElement(\"textarea\");\n r.style.background = \"transparent\", r.style.color = \"transparent\", r.value = e, document.body.appendChild(r), r.select(), r.setSelectionRange(0, e.length), r.focus();\n try {\n n = document.execCommand(\"copy\");\n } catch (a) {\n n = !1;\n }\n document.body.removeChild(r), n && t && t();\n },\n handleActionEvent({\n key\n }) {\n switch (key) {\n case 'confirm':\n this.handleConfirm();\n break;\n case 'cancel':\n this.closeDialog();\n break;\n default:\n break;\n }\n },\n handleConfirm() {\n const {\n relyWidgets,\n formula\n } = this._getValue();\n if (this.hasInVaild) {\n return this.$message.warning('存在无效字段,请删除');\n }\n this.$emit('callback', Object.assign({\n relyWidgets\n }, this.form));\n // this.closeDialog()\n },\n\n check: (0,lodash__WEBPACK_IMPORTED_MODULE_4__.debounce)(function () {\n const {\n formula = ''\n } = this._getValue();\n this.form.formula = formula;\n if (!formula) return this.err_msg = '';\n try {\n const checkRes = new _zscreate_formula__WEBPACK_IMPORTED_MODULE_5__.FormulaCheck().run(formula, this.dataTypes, false);\n console.log(`check:`, checkRes);\n this.err_msg = '';\n } catch (n) {\n try {\n var r = JSON.parse(n.message),\n a = r.type,\n o = r.errorType,\n i = r.name,\n u = r.paramIndex,\n s = \"\";\n switch (a) {\n case \"lexer\":\n case \"parser\":\n s = '语法错误,缺少标示符', this.err_current = \"parser\";\n break;\n case \"function\":\n var d = \"paramCount\" === o || \"minParamCount\" === o || \"maxParamCount\" === o;\n this.err_current = d ? \"param_count\" : \"param_type\";\n s = d ? `${i}:表达式参数的个数不符合要求` : `${i}:表达式的第${u}个参数不符合类型要求`;\n break;\n case \"resultType\":\n s = '公式计算值和当前字段类型不匹配', this.err_current = \"result_type\";\n break;\n case \"mathOperator\":\n s = 1 === u ? `${i}:运算符左侧有参数不符合类型要求` : `${i}:运算符右侧有参数不符合类型要求`, this.err_current = \"math\";\n }\n this.err_msg = s;\n console.log('err_msg: ', s);\n } catch (f) {\n this.err_msg = '';\n this.err_current = void 0;\n }\n }\n }, 500),\n // 关闭当前窗口\n closeDialog() {\n this.$emit('update:data', Object.assign({}, this.data, {\n formula: this.initFormula\n }));\n this.$emit('close', false);\n },\n clickBoNode(data) {\n this.insertField(data, false);\n },\n handleMouseLeave() {\n if (this.lastVisitMethodInfo) {\n this.formulaIntro = this.lastVisitMethodInfo;\n }\n },\n handleFunctionHover(data) {\n this.formulaIntro = data;\n },\n clickFunctionNode(data) {\n this._markKeyWord(data.name);\n },\n onCustomPaste: function (e) {\n var t = e.marks,\n n = [];\n const labelMap = {};\n this.boData.forEach(item => {\n labelMap[`$${item.key}#`] = item.name;\n });\n this.pasteValue(e, labelMap);\n },\n pasteValue(e, t) {\n var n = this.editor,\n e;\n n.replaceSelection(\"\");\n var a = n.getCursor();\n n.replaceSelection(e.text), e.marks.forEach(e => {\n var o = \"$\" + e.field + \"#\" + (e.entry || '') || 0,\n i = {\n invalid: !t[o],\n label: t[o] || '失效变量'\n },\n c = i.label,\n u = 0 === e.from.line ? a.ch : 0,\n s = {\n line: a.line + e.from.line,\n ch: u + e.from.ch\n },\n d = {\n line: a.line + e.to.line,\n ch: u + e.to.ch\n };\n this.T({\n from: s,\n to: d,\n field: e.field,\n entry: e.entry || \"\",\n invalid: i.invalid,\n label: c\n }, n);\n });\n },\n T(e, t, n) {\n var r = \"\",\n a = {\n \"data-field\": e.field\n };\n e.invalid ? r = 'cm-field-invalid' : e.entry ? (r = 'cm-field-name', a[\"data-entry\"] = e.entry) : r = 'cm-field-value';\n var o,\n i,\n c = (o = '<span class=\"cm-field '.concat(r, '\">').concat(e.label, \"</span>\"), (i = document.createElement(\"div\")).innerHTML = o, i.childNodes[0]);\n c.setAttribute(\"data-field\", e.field), e.entry && c.setAttribute(\"data-entry\", e.entry), n && n(e, c), t.markText(e.from, e.to, {\n handleMouseEvents: !0,\n atomic: !0,\n attributes: {\n 'data-field': e.field,\n 'data-entry': e.entry\n },\n replacedWith: c\n });\n },\n initCodeMirror() {\n this.initFormula = this.data.formula;\n this.form.formula = this.initFormula;\n CodeMirror.keywords = keywords;\n CodeMirror.keywordsMap = keywordsMap;\n CodeMirror.feildKeywords = this.boData;\n this.editor = CodeMirror.fromTextArea(this.$refs.formula, {\n line: true,\n autoCloseTags: true,\n autofocus: false,\n lineWrapping: true,\n matchBrackets: {\n maxHighlightLineLength: 2000,\n maxScanLines: 2000\n },\n mode: 'formula',\n // 选择对应代码编辑器的语言\n // eslint-disable-next-line no-control-regex\n specialChars: /[\\u0000-\\u001f\\u007f\\u00ad\\u200c-\\u200f\\u2028\\u2029\\ufeff]/,\n theme: 'eclipse',\n onFieldSelect: feild => {\n this.insertField(feild, false);\n console.log('onFieldSelect', feild);\n // console.log()\n },\n\n extraKeys: {\n Backspace: function (cm) {\n const token = cm.getTokenAt(cm.getCursor());\n if (token.type === 'field') {\n // 删除字段 || \"keyword\" == token.type\n const line = cm.getCursor().line;\n cm.setSelection(new CodeMirror.Pos(line, token.start), new CodeMirror.Pos(line, token.end));\n cm.replaceSelection('', null, '+delete');\n } else {\n cm.execCommand('delCharBefore');\n }\n }\n }\n });\n console.log('this.editor: ', this.editor);\n this.editor.getWrapperElement().addEventListener('click', e => {\n if (e.target.classList.contains('cm-keyword')) {\n this.setLastVisitMethodInfo(e.target.innerText);\n }\n });\n this.editor.setSize('100%', '180px');\n this.editor.on('cursorActivity', function (editor, b) {\n CodeMirror.showHint(editor, CodeMirror.formulaHint, {\n completeSingle: false\n });\n });\n this.editor.on('change', (cm, res) => {\n console.log('res:', res);\n this.check();\n });\n this.editor.on('changes', (cm, res) => {\n console.log('updates', res);\n res = res[0];\n if (res.origin === 'complete') {\n const text = res.text[0];\n if (text.includes('()')) {\n this.setLastVisitMethodInfo(text.replace(\"()\", ''));\n }\n }\n });\n this.editor.on('paste', (e, t) => {\n var n = t.clipboardData.getData(\"text/plain\"),\n r = null;\n try {\n r = JSON.parse(n);\n } catch (a) {\n r = null;\n }\n r && r.cmf && r.marks && (t.preventDefault(), this.onCustomPaste(r));\n });\n this.editor.on('copy', (e, t) => {\n t.preventDefault(), this.D(e), e.focus();\n });\n this.editor.on('cut', (e, t) => {\n t.preventDefault(), this.D(e), e.deleteH(), e.focus();\n });\n this.form.message = '';\n this.setValue(this.data.formula);\n const lastKeyWord = this.editor.getLineTokens(9999).filter(item => item.type == 'keyword').slice(-1);\n if (lastKeyWord.length) {\n this.setLastVisitMethodInfo(lastKeyWord[0].string);\n }\n },\n insertField: function (obj, b) {\n const start = this.editor.getCursor();\n this.editor.replaceSelection('​' + obj.name + '​');\n const end = this.editor.getCursor();\n b ? this._markFieldName(start, end, obj.key, obj.id) : this._markFieldValue(start, end, obj.key);\n this.editor.focus();\n },\n _markFieldValue(start, end, key) {\n const item = this.boData.find(item => item.key === key) || {\n invalid: true\n };\n let outDiv = document.createElement(\"div\");\n outDiv.innerHTML = `<span class=\"cm-field ${item.invalid ? 'cm-field-invalid' : 'cm-field-value'}\">${item.invalid ? '失效变量' : item.name}</span>`;\n const node = outDiv.childNodes[0];\n node.setAttribute('data-field', key);\n this.editor.markText(start, end, {\n handleMouseEvents: !0,\n atomic: !0,\n attributes: {\n 'data-field': key\n },\n replacedWith: node\n });\n },\n _markFieldName(start, end, key, id) {\n this.editor.markText(start, end, {\n className: 'cm-field-name',\n attributes: {\n 'data-field': key,\n 'data-entry': id\n }\n });\n },\n _markKeyWord(key) {\n this.editor.focus();\n const cursor = this.editor.getCursor();\n this.editor.replaceSelection(key + '()');\n this.editor.setCursor({\n line: cursor.line,\n ch: cursor.ch + key.length + 1\n });\n this.setLastVisitMethodInfo(key);\n },\n setLastVisitMethodInfo: (0,lodash__WEBPACK_IMPORTED_MODULE_4__.debounce)(function (methodName) {\n this.handleMethodSearch(methodName);\n this.lastVisitMethodInfo = this.formulaIntro;\n }, 500),\n setValue(val) {\n if (!val) {\n return;\n }\n const _this = this;\n const c = [];\n const d = [];\n const valAry = val.split('\\n');\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(valAry, (b, a) => {\n let e = '';\n // eslint-disable-next-line no-useless-escape\n const f = b.split(/(\\$[0-9a-zA-Z\\._]+#[0-9A-Fa-f]*)/g);\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(f, c => {\n if (/^\\$(_widget_|_formula_|ext)/.test(c)) {\n const label = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.startsWith)(c, '$ext') ? '扩展字段' : _this.getBoLabel(c);\n const g = c.replace('$', '').split('#');\n const field = g[0];\n const entry = g[1];\n const from = CodeMirror.Pos(a, e.length);\n e += '​' + label + '​';\n const to = CodeMirror.Pos(a, e.length);\n d.push({\n from: from,\n to: to,\n field: field,\n entry: entry\n });\n } else {\n e += c;\n }\n });\n c.push(e);\n });\n this.editor.setValue(c.join('\\n'));\n (0,lodash__WEBPACK_IMPORTED_MODULE_4__.forEach)(d, c => {\n c.entry ? _this._markFieldName(c.from, c.to, c.field, c.entry) : _this._markFieldValue(c.from, c.to, c.field);\n });\n },\n getValue: function () {\n function hasClass(element, cls) {\n return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;\n }\n const formula = [];\n const show = [];\n const lineContent = this.editor.display.lineDiv.getElementsByClassName('CodeMirror-line');\n for (let i = 0; i < lineContent.length; i++) {\n const f = [];\n const l = [];\n const content = lineContent[i];\n const children = content.children[0].children;\n for (let j = 0; j < children.length; j++) {\n let span = children[j];\n if (span.querySelector('[data-field]')) span = span.querySelector('[data-field]');\n const field = span.getAttribute('data-field');\n const entry = span.getAttribute('data-entry');\n if (hasClass(span, 'cm-field-name')) {\n f.push('$' + field + '#' + entry);\n } else if (hasClass(span, 'cm-field-value')) {\n f.push('$' + field + '#');\n } else {\n if (hasClass(span, 'cm-deprecate')) {\n continue;\n }\n f.push(span.textContent || span.innerText);\n }\n l.push(span.textContent || span.innerText);\n }\n const g = f.join('').replace(/\\u200b/g, '').replace(/\\u00a0/g, ' ');\n formula.push(g);\n const t = l.join('').replace(/\\u200b/g, '').replace(/\\u00a0/g, ' ');\n show.push(t);\n }\n return {\n formula: formula.join('\\n'),\n show: show.join('\\n')\n };\n },\n M(e) {\n var t = [],\n n = [],\n r = [],\n a = e.display.lineDiv.children || [];\n this.hasInVaild = false;\n return Array.from(a).forEach(e => {\n var a = [],\n o = e.children[0].childNodes;\n o.forEach(e => {\n var _e$firstChild;\n var t = e.children;\n if (t && t[0]) {\n var r = t[0],\n o = r.getAttribute(\"data-field\"),\n i = r.getAttribute(\"data-entry\");\n r.classList.contains('cm-field-name') ? a.push(\"$\" + o + \"#\" + i) : r.classList.contains('cm-field-value') && (a.push(\"$\" + o + \"#\"), n.includes(o) || n.push(o));\n if (r.classList.contains('cm-field-invalid')) {\n this.hasInVaild = true;\n }\n } else if (\"#text\" === (e === null || e === void 0 ? void 0 : (_e$firstChild = e.firstChild) === null || _e$firstChild === void 0 ? void 0 : _e$firstChild.nodeName)) {\n var _e$firstChild2;\n if (e.classList.contains('cm-deprecate') || e.classList.contains('cm-field-invalid') || e.classList.contains('cm-negative')) return;\n a.push(e === null || e === void 0 ? void 0 : (_e$firstChild2 = e.firstChild) === null || _e$firstChild2 === void 0 ? void 0 : _e$firstChild2.nodeValue);\n } else \"#text\" === e.nodeName && a.push(e.nodeValue);\n }), r = r.concat(a);\n var i = a.join(\"\").replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \");\n t.push(i);\n }), {\n formula: t.join(\"\\n\"),\n formulaWords: r,\n relyWidgets: n\n };\n },\n _getValue: function () {\n return e = function (e, t) {\n e = (0,lodash__WEBPACK_IMPORTED_MODULE_4__.cloneDeep)(t);\n return e;\n }({}, this.M(this.editor)), Object.defineProperties(e, Object.getOwnPropertyDescriptors({\n remark: this.form.remark\n }));\n var e;\n },\n getBoLabel(key) {\n for (let i = 0; i < this.boData.length; i++) {\n const bo = this.boData[i];\n if ('$_widget_' + bo.key + '#' === key) {\n return bo.name;\n }\n }\n return '';\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/formula/formula-edit.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
576
576
 
577
577
  /***/ }),
578
578
 
@@ -583,7 +583,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
583
583
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
584
584
 
585
585
  "use strict";
586
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _form_formula_formula_edit_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/form/formula/formula-edit.vue */ \"./src/form/formula/formula-edit.vue\");\n/* harmony import */ var _form_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/form/util */ \"./src/form/util/index.js\");\n/* harmony import */ var _form_formula_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/form/formula/utils */ \"./src/form/formula/utils/index.js\");\n/* harmony import */ var _form_util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/form/util/util */ \"./src/form/util/util.js\");\n\n\n\n\n// import layoutForPaper from \"@/form/modules/layout/layoutForPaper.vue\";\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: \"warpFormulaEdit\",\n inject: {\n getWidgetForm: {\n from: 'getWidgetForm',\n default: () => ({\n list: []\n })\n }\n },\n props: {\n widget: {\n type: Object,\n default: () => {}\n },\n datalist: {\n type: Array,\n default: () => []\n }\n },\n components: {\n layoutForPaper: () => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! @/form/modules/layout/layoutForPaper.vue */ \"./src/form/modules/layout/layoutForPaper.vue\")),\n FormulaEdit: _form_formula_formula_edit_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n data() {\n return {\n visible: false,\n debugVisible: false,\n widgetForm: {},\n formula: {\n formula: ''\n },\n debug_formula: '',\n debug_relyWidgets: [],\n datalist: []\n };\n },\n watch: {\n 'widget.model': {\n handler() {},\n immediate: true\n }\n },\n computed: {\n hasInValid() {\n var _this$widget$options;\n const {\n relyWidgets = []\n } = ((_this$widget$options = this.widget.options) === null || _this$widget$options === void 0 ? void 0 : _this$widget$options.formula) || {};\n if (!relyWidgets.length) return false;\n return !relyWidgets.every(item => {\n return this.widgetModels.includes(item);\n });\n },\n widgetModels() {\n return this.widgetList.map(item => {\n return '_widget_' + item.model;\n });\n },\n widgetList() {\n return (0,_form_util__WEBPACK_IMPORTED_MODULE_1__.getRecursionWidget)(this.widgetForm.list).filter(item => item.parentType !== 'table');\n },\n warpDebugForm() {\n const widgetForm = (0,_form_util_util__WEBPACK_IMPORTED_MODULE_3__.cloneObj)(this.widgetForm);\n const item = (0,_form_util__WEBPACK_IMPORTED_MODULE_1__.getRecursionWidget)(widgetForm.list).find(item => item.model === this.widget.model);\n item.options.formula = {\n ...(item.options.formula || {}),\n formula: this.debug_formula,\n relyWidgets: this.debug_relyWidgets\n };\n return widgetForm;\n },\n widgetsData() {\n const formulaComponents = this.widgetList.filter(item => {\n if (item.model === this.widget.model) return false;\n return ['input', 'textarea', 'number', 'date'].includes(item.type);\n });\n return formulaComponents.map(item => {\n return {\n name: item.name,\n key: '_widget_' + item.model,\n type: _form_formula_utils__WEBPACK_IMPORTED_MODULE_2__.componentTypes[item.type]\n };\n });\n }\n },\n mounted() {\n this.widgetForm = this.getWidgetForm();\n },\n methods: {\n init(widget) {\n this.visible = true;\n const {\n options\n } = widget;\n this.formula = options.formula || {\n value: ''\n };\n },\n handleDebug({\n relyWidgets,\n formula\n }) {\n this.debug_formula = formula;\n this.debug_relyWidgets = relyWidgets;\n setTimeout(() => {\n this.debugVisible = true;\n }, 100);\n },\n setFormulaValue(val) {\n this.formula = val;\n this.widget.options.formula = this.formula;\n this.visible = false;\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/formula/warpFormulaEdit.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
586
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _form_formula_formula_edit_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/form/formula/formula-edit.vue */ \"./src/form/formula/formula-edit.vue\");\n/* harmony import */ var _form_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/form/util */ \"./src/form/util/index.js\");\n/* harmony import */ var _form_formula_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/form/formula/utils */ \"./src/form/formula/utils/index.js\");\n/* harmony import */ var _form_util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/form/util/util */ \"./src/form/util/util.js\");\n\n\n\n\n// import layoutForPaper from \"@/form/modules/layout/layoutForPaper.vue\";\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n name: \"warpFormulaEdit\",\n inject: {\n getWidgetForm: {\n from: 'getWidgetForm',\n default: () => ({\n list: []\n })\n }\n },\n props: {\n widget: {\n type: Object,\n default: () => {}\n },\n datalist: {\n type: Array,\n default: () => []\n }\n },\n components: {\n layoutForPaper: () => Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! @/form/modules/layout/layoutForPaper.vue */ \"./src/form/modules/layout/layoutForPaper.vue\")),\n FormulaEdit: _form_formula_formula_edit_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n data() {\n return {\n visible: false,\n debugVisible: false,\n widgetForm: {},\n formula: {\n formula: ''\n },\n debug_formula: '',\n debug_relyWidgets: [],\n datalist: []\n };\n },\n watch: {\n 'widget.model': {\n handler() {},\n immediate: true\n }\n },\n computed: {\n hasInValid() {\n var _this$widget$options;\n const {\n relyWidgets = []\n } = ((_this$widget$options = this.widget.options) === null || _this$widget$options === void 0 ? void 0 : _this$widget$options.formula) || {};\n if (!relyWidgets.length) return false;\n return !relyWidgets.every(item => {\n return this.widgetModels.includes(item);\n });\n },\n widgetModels() {\n return this.widgetList.map(item => {\n return `_widget_${item.parentType === 'table' ? `${item.parentModel}.` : ''}` + item.model;\n });\n },\n widgetList() {\n return (0,_form_util__WEBPACK_IMPORTED_MODULE_1__.getRecursionWidget)(this.widgetForm.list);\n },\n warpDebugForm() {\n const widgetForm = (0,_form_util_util__WEBPACK_IMPORTED_MODULE_3__.cloneObj)(this.widgetForm);\n const item = (0,_form_util__WEBPACK_IMPORTED_MODULE_1__.getRecursionWidget)(widgetForm.list).find(item => item.model === this.widget.model);\n item.options.formula = {\n ...(item.options.formula || {}),\n formula: this.debug_formula,\n relyWidgets: this.debug_relyWidgets\n };\n return widgetForm;\n },\n widgetsData() {\n const tableArr = [];\n const formulaComponents = this.widgetList.filter(item => {\n if (item.model === this.widget.model) return false;\n return ['input', 'textarea', 'number', 'date'].includes(item.type);\n });\n return formulaComponents.map(item => {\n return {\n name: (item.parentType === 'table' ? '子表单.' : '') + item.name,\n key: `_widget_${item.parentType === 'table' ? `${item.parentModel}.` : ''}` + item.model,\n type: _form_formula_utils__WEBPACK_IMPORTED_MODULE_2__.componentTypes[item.parentType === 'table' ? 'array' : item.type]\n };\n });\n }\n },\n mounted() {\n this.widgetForm = this.getWidgetForm();\n },\n methods: {\n init(widget) {\n this.visible = true;\n const {\n options\n } = widget;\n this.formula = options.formula || {\n value: ''\n };\n },\n handleDebug({\n relyWidgets,\n formula\n }) {\n this.debug_formula = formula;\n this.debug_relyWidgets = relyWidgets;\n setTimeout(() => {\n this.debugVisible = true;\n }, 100);\n },\n setFormulaValue(val) {\n this.formula = val;\n this.widget.options.formula = this.formula;\n this.visible = false;\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/formula/warpFormulaEdit.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
587
587
 
588
588
  /***/ }),
589
589
 
@@ -781,7 +781,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
781
781
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
782
782
 
783
783
  "use strict";
784
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.unshift.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.unshift.js\");\n/* harmony import */ var core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _api_manage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/api/manage */ \"./src/api/manage.js\");\n/* harmony import */ var _querySelectDict__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./querySelectDict */ \"./src/form/modules/common/querySelectDict.vue\");\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n data() {\n return {\n visible: false,\n dataSource: [],\n initdataSource: [],\n ipagination: {\n current: 1,\n pageSize: 10,\n pageSizeOptions: [\"10\", \"20\", \"30\"],\n showTotal: (total, range) => {\n return range[0] + \"-\" + range[1] + \" 共\" + total + \"条\";\n },\n showQuickJumper: true,\n showSizeChanger: true,\n total: 0\n },\n selectedTableRowKeys: [],\n selectedTableRowValues: [],\n queryParam: {\n id: '',\n requestParams: {}\n },\n loading: false,\n columns: [],\n isApi: false\n };\n },\n components: {\n QuerySelectDict: _querySelectDict__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n defaultId: {\n type: [String, Number],\n default: ''\n },\n rowKey: {\n type: [String, Number],\n default: 'id'\n }\n },\n methods: {\n init(keys, values) {\n console.log(keys, keys);\n debugger;\n this.selectedTableRowKeys = keys ? keys : [];\n this.selectedTableRowValues = values ? values : [];\n this.visible = true;\n this.getColumsList();\n },\n // 获取表头\n getColumsList() {\n (0,_api_manage__WEBPACK_IMPORTED_MODULE_2__.getAction)('/dataset/getDatasetColumns', {\n id: this.defaultId\n }).then(res => {\n if (res.success) {\n console.log(res.result);\n let result = res.result ? res.result : [];\n this.columns = this.getColumn(result);\n this.getDataSource();\n }\n }).finally(() => {});\n },\n getDataSource() {\n this.loading = true;\n this.queryParam.id = this.defaultId;\n (0,_api_manage__WEBPACK_IMPORTED_MODULE_2__.postAction)('/dataset/getFormDefaultData', this.queryParam).then(res => {\n if (res.success) {\n this.dataSource = res.result ? res.result : [];\n if (this.initdataSource.length == 0) this.initdataSource = res.result ? res.result : [];\n this.ipagination.total = res.result.length;\n this.isApi = res.message == '2';\n if (this.isApi) {\n this.columns.forEach(item => {\n if (item.sorter) item.sorter = false;\n if (item.scopedSlots) delete item.scopedSlots;\n });\n }\n }\n }).finally(() => {\n this.loading = false;\n });\n },\n handleTableChange(pagination, filters, sorter) {\n if (Object.keys(sorter).length > 0) {\n this.queryParam.requestParams.column = sorter.field;\n if (!sorter.order) {\n this.queryParam.requestParams.column = undefined;\n this.queryParam.requestParams.order = undefined;\n } else {\n this.queryParam.requestParams.order = \"ascend\" == sorter.order ? \"asc\" : \"desc\";\n }\n }\n this.getDataSource();\n },\n getColumn(columnList) {\n if (!Array.isArray(columnList) || columnList.length == 0 || columnList == null) {\n return [];\n } else {\n let arr = [];\n arr = columnList = columnList.filter(item => {\n return item.columnWidth != '0';\n }).map(item => {\n let obj = {\n title: item.columnName,\n dataIndex: item.columnCode,\n width: '100px',\n ellipsis: true,\n sorter: true,\n align: \"center\",\n ...item,\n scopedSlots: {\n customRender: \"customRender\",\n filterDropdown: \"filterDropdown\",\n filterIcon: \"filterIcon\"\n }\n };\n return obj;\n });\n arr.unshift({\n title: \"序号\",\n dataIndex: \"index\",\n align: 'center',\n customRender: (text, record, index) => `${index + 1}`,\n width: \"1px\",\n ellipsis: true\n });\n return arr;\n }\n },\n handleOk() {\n this.$emit('ok', this.selectedTableRowKeys, this.selectedTableRowValues, this.columns);\n this.handleCancel();\n },\n handleCancel() {\n this.visible = false;\n },\n onSelectAll(selected, selectedRows, changeRows) {\n debugger;\n if (selected) {\n this.selectedTableRowKeys = this.initdataSource.map(item => item[this.rowKey]);\n this.selectedTableRowValues = this.initdataSource;\n } else {\n this.selectedTableRowKeys = [];\n this.selectedTableRowValues = [];\n }\n },\n onSelectTableChange(key, val) {\n this.selectedTableRowKeys = key;\n this.selectedTableRowValues = val;\n },\n handleSearch(selectedKeys, confirm, dataIndex, v) {\n if (v !== undefined) {\n selectedKeys.length = 0;\n selectedKeys.push(v);\n }\n confirm();\n this.ipagination.current = 1;\n this.queryParam.requestParams[dataIndex] = selectedKeys[0];\n this.getDataSource();\n },\n handleReset(clearFilters, dataIndex) {\n clearFilters();\n this.ipagination.current = 1;\n this.queryParam.requestParams[dataIndex] = \"\";\n this.getDataSource();\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/modules/common/addDataSetTable.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
784
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.unshift.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.unshift.js\");\n/* harmony import */ var core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_unshift_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _api_manage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/api/manage */ \"./src/api/manage.js\");\n/* harmony import */ var _querySelectDict__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./querySelectDict */ \"./src/form/modules/common/querySelectDict.vue\");\n\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n data() {\n return {\n visible: false,\n dataSource: [],\n initdataSource: [],\n ipagination: {\n current: 1,\n pageSize: 10,\n pageSizeOptions: [\"10\", \"20\", \"30\"],\n showTotal: (total, range) => {\n return range[0] + \"-\" + range[1] + \" 共\" + total + \"条\";\n },\n showQuickJumper: true,\n showSizeChanger: true,\n total: 0\n },\n selectedTableRowKeys: [],\n selectedTableRowValues: [],\n queryParam: {\n id: '',\n requestParams: {}\n },\n loading: false,\n columns: [],\n isApi: false\n };\n },\n components: {\n QuerySelectDict: _querySelectDict__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n props: {\n defaultId: {\n type: [String, Number],\n default: ''\n },\n rowKey: {\n type: [String, Number],\n default: 'id'\n }\n },\n methods: {\n init(keys, values) {\n console.log(keys, keys);\n debugger;\n this.selectedTableRowKeys = keys ? keys : [];\n this.selectedTableRowValues = values ? values : [];\n this.visible = true;\n this.getColumsList();\n },\n // 获取表头\n getColumsList() {\n (0,_api_manage__WEBPACK_IMPORTED_MODULE_2__.getAction)('/dataset/getDatasetColumns', {\n id: this.defaultId\n }).then(res => {\n if (res.success) {\n console.log(res.result);\n let result = res.result ? res.result : [];\n this.columns = this.getColumn(result);\n this.getDataSource();\n }\n }).finally(() => {});\n },\n getDataSource() {\n this.loading = true;\n this.queryParam.id = this.defaultId;\n (0,_api_manage__WEBPACK_IMPORTED_MODULE_2__.postAction)('/dataset/getFormDefaultData', this.queryParam).then(res => {\n if (res.success) {\n this.dataSource = res.result ? res.result : [];\n if (this.initdataSource.length == 0) this.initdataSource = res.result ? res.result : [];\n this.ipagination.total = res.result.length;\n this.isApi = res.message == '2';\n if (this.isApi) {\n this.columns.forEach(item => {\n if (item.sorter) item.sorter = false;\n if (item.scopedSlots) delete item.scopedSlots;\n });\n }\n }\n }).finally(() => {\n this.loading = false;\n });\n },\n handleTableChange(pagination, filters, sorter) {\n if (Object.keys(sorter).length > 0) {\n this.queryParam.requestParams.column = sorter.field;\n if (!sorter.order) {\n this.queryParam.requestParams.column = undefined;\n this.queryParam.requestParams.order = undefined;\n } else {\n this.queryParam.requestParams.order = \"ascend\" == sorter.order ? \"asc\" : \"desc\";\n }\n }\n this.ipagination = pagination;\n this.getDataSource();\n },\n getColumn(columnList) {\n if (!Array.isArray(columnList) || columnList.length == 0 || columnList == null) {\n return [];\n } else {\n let arr = [];\n arr = columnList = columnList.filter(item => {\n return item.columnWidth != '0';\n }).map(item => {\n let obj = {\n title: item.columnName,\n dataIndex: item.columnCode,\n width: '100px',\n ellipsis: true,\n sorter: true,\n align: \"center\",\n ...item,\n scopedSlots: {\n customRender: \"customRender\",\n filterDropdown: \"filterDropdown\",\n filterIcon: \"filterIcon\"\n }\n };\n return obj;\n });\n arr.unshift({\n title: \"序号\",\n dataIndex: \"index\",\n align: 'center',\n customRender: (text, record, index) => `${index + 1}`,\n width: \"1px\",\n ellipsis: true\n });\n return arr;\n }\n },\n handleOk() {\n this.$emit('ok', this.selectedTableRowKeys, this.selectedTableRowValues, this.columns);\n this.handleCancel();\n },\n handleCancel() {\n this.visible = false;\n },\n onSelectAll(selected, selectedRows, changeRows) {\n debugger;\n if (selected) {\n this.selectedTableRowKeys = this.initdataSource.map(item => item[this.rowKey]);\n this.selectedTableRowValues = this.initdataSource;\n } else {\n this.selectedTableRowKeys = [];\n this.selectedTableRowValues = [];\n }\n },\n onSelectTableChange(key, val) {\n this.selectedTableRowKeys = key;\n this.selectedTableRowValues = val;\n },\n handleSearch(selectedKeys, confirm, dataIndex, v) {\n if (v !== undefined) {\n selectedKeys.length = 0;\n selectedKeys.push(v);\n }\n confirm();\n this.ipagination.current = 1;\n this.queryParam.requestParams[dataIndex] = selectedKeys[0];\n this.getDataSource();\n },\n handleReset(clearFilters, dataIndex) {\n clearFilters();\n this.ipagination.current = 1;\n this.queryParam.requestParams[dataIndex] = \"\";\n this.getDataSource();\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/modules/common/addDataSetTable.vue?./node_modules/_babel-loader@8.3.0@babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
785
785
 
786
786
  /***/ }),
787
787
 
@@ -2397,7 +2397,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
2397
2397
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2398
2398
 
2399
2399
  "use strict";
2400
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TypesName\": () => (/* binding */ TypesName),\n/* harmony export */ \"componentTypes\": () => (/* binding */ componentTypes)\n/* harmony export */ });\nconst componentTypes = {\n 'input': 'string',\n 'textarea': 'string',\n 'number': 'number',\n 'date': 'datetime'\n};\nconst TypesName = {\n 'string': '文本',\n 'number': '数字',\n 'datetime': '日期'\n};\n\n//# sourceURL=webpack://form-component/./src/form/formula/utils/index.js?");
2400
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TypesName\": () => (/* binding */ TypesName),\n/* harmony export */ \"componentTypes\": () => (/* binding */ componentTypes)\n/* harmony export */ });\nconst componentTypes = {\n 'input': 'string',\n 'textarea': 'string',\n 'number': 'number',\n 'date': 'datetime',\n 'array': 'array'\n};\nconst TypesName = {\n 'string': '文本',\n 'number': '数字',\n 'datetime': '日期',\n 'array': '数组'\n};\n\n//# sourceURL=webpack://form-component/./src/form/formula/utils/index.js?");
2401
2401
 
2402
2402
  /***/ }),
2403
2403
 
@@ -2441,7 +2441,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
2441
2441
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2442
2442
 
2443
2443
  "use strict";
2444
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.replace-all.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.string.replace-all.js\");\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.reduce.js\");\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.error.cause.js\");\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! pubsub-js */ \"./node_modules/_pubsub-js@1.9.4@pubsub-js/src/pubsub.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(pubsub_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _api_manage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/api/manage */ \"./src/api/manage.js\");\n/* harmony import */ var _validateByApiMinxins__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./validateByApiMinxins */ \"./src/form/mixins/validateByApiMinxins.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @zscreate/formula */ \"./node_modules/_@zscreate_formula@1.0.1@@zscreate/formula/dist/formula.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_zscreate_formula__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ \"./node_modules/_moment@2.29.4@moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);\n\n\n\n\n/****\r\n *widgetMixins\r\n */\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n inject: {\n getWidgetList: {\n from: 'getWidgetList',\n default: () => () => [[]]\n },\n getFormData: {\n from: 'getFormData',\n default: () => () => ({})\n },\n isAllLayout: {\n from: 'isAllLayout',\n default: false\n },\n config: {\n from: 'config',\n default: undefined\n },\n formId: {\n from: 'formId',\n default: undefined\n },\n formDataId: {\n from: 'formDataId',\n default: undefined\n },\n isDraft: {\n from: 'isDraft',\n default: false\n }\n },\n mixins: [_validateByApiMinxins__WEBPACK_IMPORTED_MODULE_6__[\"default\"]],\n data() {\n return {\n pubsubSign: null,\n show: false,\n tableData: {}\n };\n },\n props: {\n showLabel: {\n type: Boolean\n },\n rules: {\n type: Object\n },\n tableKey: {\n type: String,\n default: \"\"\n },\n tableIndex: {\n type: [String, Number],\n default: \"\"\n },\n widget: {\n type: Object,\n default: () => {\n return {};\n }\n },\n value: {\n type: [String, Number, Array, Object]\n },\n isdisabled: {\n type: String,\n default: ''\n },\n models: {\n type: Object,\n default: () => {\n return {};\n }\n }\n },\n beforeMount() {\n let widget = this.widget;\n let model = this.widget.model;\n if (widget.options.onlyvalue && widget.options.onlyvalue === true) {\n let rule = {\n validator: this.validateonly,\n trigger: ['date', 'time'].includes(widget.type) ? 'change' : \"blur\"\n };\n let tableKey = this.tableKey;\n if (tableKey) {\n //防止重复添加 (可优化)\n if (this.rules[tableKey][model].isonlyvalue) return false;\n this.rules[tableKey][model].push(rule);\n this.rules[tableKey][model].isonlyvalue = true;\n } else {\n if (this.rules[model].isonlyvalue) return false;\n this.rules[model].push(rule);\n this.rules[model].isonlyvalue = true;\n }\n }\n // 时间比较增加校验规则\n if (widget.options.condition && widget.options.conditionValue) {\n if (this.tableKey) {\n if (this.rules[this.tableKey][this.widget.model].isvalidator) return false;\n this.rules[this.tableKey][this.widget.model].push({\n validator: this.validateTime,\n trigger: ['date', 'time'].includes(this.widget.type) ? 'change' : \"blur\"\n });\n this.rules[this.tableKey][this.widget.model].isvalidator = true;\n } else {\n if (this.rules[this.widget.model].isvalidator) return false;\n this.rules[this.widget.model].push({\n validator: this.validateTime,\n trigger: ['date', 'time'].includes(this.widget.type) ? 'change' : \"blur\"\n });\n this.rules[this.widget.model].isvalidator = true;\n }\n }\n },\n created() {\n this.minxsInit(); //混入初始化\n },\n\n computed: {\n currRules() {\n if (!this.rules) return [];\n return this.tableKey ? this.rules[this.tableKey][this.widget.model] : this.rules[this.widget.model];\n },\n getbgc: function () {\n //计算颜色\n return this.config.bgc;\n },\n getcolor: function () {\n //计算字体颜色\n return this.config.color;\n },\n labelWidth() {\n let width = this.widget.options.labelWidth;\n if (['', undefined, null].includes(width)) {\n width = 100;\n if (['editorAirt'].includes(this.widget.type)) width = 0;\n }\n // 如果是子表单元素 label 宽度为0 border为0\n return this.tableKey && !this.showLabel ? 0 : width;\n },\n labelCol() {\n let labelWidth = this.labelWidth + \"px\";\n return {\n style: {\n width: labelWidth,\n background: this.config.bgc,\n color: this.config.color,\n borderColor: this.config.borderColor,\n border: this.labelWidth == 0 ? 0 : undefined\n // borderBottomWidth: \"1px\",\n }\n };\n },\n\n //label样式\n wrapperCol() {\n return {\n style: {\n width: \"calc(100% - \" + this.labelWidth + \"px)\",\n borderColor: this.config.borderColor\n }\n };\n } //item 样式\n },\n\n watch: {\n models: {\n deep: true,\n handler(val) {\n this.updateModelByModelsChange();\n let tableKey = this.tableKey;\n if (tableKey) {\n //处理子表单删除行的时候 值未更新\n if (this.tableData[tableKey] == undefined) {\n this.$set(this.tableData, tableKey, {});\n this.tableData[tableKey].length = this.models[tableKey].length;\n }\n if (this.models[tableKey].length < this.tableData[tableKey].length) {\n this.dataModel = this.models[tableKey][this.tableIndex][this.widget.model];\n }\n this.tableData[tableKey].length = this.models[tableKey].length;\n }\n }\n },\n // \"widget.options.labelWidth\"(val) {\n // //监听labelWidth\n // this.updatelabelWidth(this.tableKey && !this.showLabel ? 0 : val);\n // },\n config(val) {}\n },\n methods: {\n publish: (pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().publish),\n // 发布方法\n parseInt: parseInt,\n // 取整\n getRecursionWidget() {\n const res_list = [];\n let func = (res_list, val) => {\n if (val instanceof Array && val.length > 0) {\n val.forEach(item => {\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\"].includes(item.type)) {\n // columns.list\n item.columns.forEach(columnsItem => {\n func(res_list, columnsItem.list);\n });\n } else if ([\"table\"].includes(item.type)) {\n // columns\n func(res_list, item.columns);\n } else {\n res_list.push(item);\n }\n });\n }\n };\n const [widgetList] = this.getWidgetList();\n func(res_list, widgetList);\n func = null;\n return res_list;\n },\n async updateValidateNotify() {\n await this.$nextTick();\n const rules = this.currRules;\n rules.forEach(item => {\n item.trigger && this.$refs[this.widget.model].validate(item.trigger);\n });\n },\n toFixed(num, length = 2, type = 1) {\n // 保留几位小数 默认number类型,为了部分校验\n var num = Number(num).toFixed(length);\n return type ? Number(num) : num;\n },\n getRules() {\n try {\n if (this.widget.options.canView == false) {\n this.rules[this.widget.model].forEach(item => {\n if (item.required && item.required == true) {\n item.required = false;\n }\n });\n }\n } catch (error) {}\n // console.log(this.rules)\n },\n\n updateModelByModelsChange() {\n try {\n //防止设计表单缺少models报错\n\n let dataModel = this.tableKey ? this.models[this.tableKey][this.tableIndex][this.widget.model] : this.models[this.widget.model];\n // 兼容移动端bug, select 下拉选择框,单选的时候, 可能返回的数组的值, 所以这里需要单独处理下\n if (this.widget.type === 'select' && !this.widget.options.multiple && Array.isArray(dataModel) && dataModel.length > 0) {\n this.dataModel = dataModel[0];\n return;\n }\n if (this.widget.type === 'codeControl' && !dataModel) {\n const {\n enableCustomRules,\n customRules\n } = this.widget.options;\n if (enableCustomRules) {\n eval(`this.widget.key = dataModel = (${customRules})(this.widget, this.models, this)`);\n } else {\n const randomNum = String(Math.random());\n const dateStr = String(new Date().getFullYear()).slice(2) + (new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)) + (new Date().getDate() > 9 ? new Date().getDate() : '0' + new Date().getDate()) + randomNum.slice(-4);\n this.widget.key = dateStr + '';\n dataModel = this.widget.key;\n }\n }\n this.dataModel = dataModel;\n // if (this.verifyNode && this.widget.options.disabled) { // 审核状态下 不提示placeholder\n // this.widget.options.placeholder = \"\"\n // }\n } catch (error) {\n console.log(error);\n }\n },\n //时间比较\n onDateChange(val) {\n if (this.tableKey) {\n this.models[this.tableKey][this.tableIndex][this.widget.model] = val;\n } else {\n this.models[this.widget.model] = val;\n }\n },\n resetDataModel() {\n this.dataModel = \"\"; //部分组件重置dataModel 需要重写\n },\n\n //混入初始化\n minxsInit() {\n this.updateModelByModelsChange();\n //如果是子表单元素 label 宽度为0 border为0\n // this.updatelabelWidth((this.tableKey && !this.showLabel) ? 0 : this.widget.options.labelWidth);\n this.pubsubScribe(); //订阅消息\n },\n\n m_subscribe(key, val) {\n if (!(pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().calc_record)) (pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().calc_record) = {};\n },\n calc_run(isFirstRun) {\n let invalids = false;\n let {\n formula,\n relyWidgets = []\n } = this.widget.options.formula;\n relyWidgets.forEach(item => {\n formula = formula.replaceAll(`\\$${item}\\#`, item);\n });\n const models = this.models;\n const keys = Object.keys(models);\n const formulaModels = keys.reduce((prev, curr) => {\n const key = `_widget_${curr}`;\n prev[key] = models[curr];\n if (relyWidgets.includes(key) && isFirstRun && models[curr] === '') {\n invalids = true;\n }\n return prev;\n }, {});\n if (invalids) return;\n let result = _zscreate_formula__WEBPACK_IMPORTED_MODULE_8__.FormulaInstance.RUN(formula, formulaModels);\n if ([NaN].includes(result)) {\n result = '';\n }\n if (Object.prototype.toString.call(result).includes('Date')) {\n result = moment__WEBPACK_IMPORTED_MODULE_7___default()(result).format(this.widget.options.format || 'YYYY-MM-DD');\n }\n console.log('result: ', result);\n this.dataModel = result;\n },\n /**\r\n * @description 订阅消息\r\n * @return void\r\n */\n pubsubScribe() {\n var _this$widget$options$;\n let subscribeKey = this.widget.options.subscribeOptions ? this.widget.options.subscribeOptions.subscribeKey : \"\";\n if ((_this$widget$options$ = this.widget.options.formula) !== null && _this$widget$options$ !== void 0 && _this$widget$options$.formula) {\n let {\n formula,\n relyWidgets = []\n } = this.widget.options.formula;\n setTimeout(() => {\n if (!this.dataModel) this.calc_run(true);\n }, 100);\n relyWidgets.forEach(item => {\n pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().subscribe('calc_' + item.replace('_widget_', ''), data => {\n setTimeout(() => {\n this.calc_run();\n console.log(this, data);\n }, 100);\n });\n });\n }\n if (subscribeKey) {\n let tableIndex = this.tableIndex; //子表单联动\n subscribeKey = this.tableKey ? tableIndex + '_' + subscribeKey : subscribeKey;\n let timecount = 0;\n if (subscribeKey == 'time') {\n console.log('timecount', ++timecount);\n }\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\", 'table'].includes(this.widget.type)) return;\n this.pubsubSign = pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().subscribe(subscribeKey, (msg, data) => {\n console.log('isClickByUser', data.isClickByUser);\n if (data.hasOwnProperty('updateModel') && data.updateModel) {\n // 用于脚本里面精准更新model 避免通过监听models值来更新 model\n this.updateModelByPulish(data.value);\n return false;\n }\n\n // 订阅者接受指定 当data对象具有method属性时候 通过策略模式处理相关方法\n if (data.hasOwnProperty(\"method\")) {\n console.log(\"method==\");\n try {\n this[data.method](data.args);\n } catch (error) {}\n return false;\n }\n this.updateModelByScript(data, data.msg);\n });\n }\n },\n /***\r\n * @description 更新联动方法\r\n * @params { data } 联动规则\r\n * @params { list } Array String Number 是否是用户手动触发\r\n */\n updateModelByScript(data, list) {\n var that = this;\n that.isClickByUser = data.isClickByUser; //是否是用户点击\n that.isDraft = data.isDraft; //是否是草稿\n try {\n eval(data.operateValue);\n } catch (error) {\n console.log(error);\n }\n },\n /**\r\n * @description 发布消息\r\n * @params { string/number/object } val 发布的内容\r\n * @params { bollean } isClickByUser 是否是用户手动触发\r\n * @return void\r\n */\n pulishMsg(val, isClickByUser = false) {\n setTimeout(() => {\n let relateOptions = this.widget.options.relateOptions;\n pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().publish('calc_' + (this.tableKey ? this.tableKey + '.' + this.widget.model : this.widget.model), {\n msg: val\n });\n if (relateOptions && relateOptions.length > 0) {\n relateOptions.forEach((item, index) => {\n let publishKey = this.tableKey ? this.tableIndex + '_' + item.publishKey : item.publishKey; //子表单联动\n if (item.isTableChild === false) publishKey = item.publishKey; // 非子表单; false 兼容之前的逻辑; 之前为 \"\"\n console.log(\"pul--form\" + index);\n pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().publish(publishKey, {\n ...item,\n msg: val,\n isClickByUser,\n isDraft: this.isDraft\n });\n });\n }\n }, 0);\n },\n updateStatusByScribe(data, status, flag) {\n if ([\"string\", \"number\"].includes(typeof data.msg)) {\n if (data.operateValue.split(\",\").includes(data.msg)) {\n this.widget.options[status] = flag;\n this.resetByflag(flag);\n } else {\n this.widget.options[status] = !flag;\n this.resetByflag(!flag);\n }\n } else {\n //暂时实现等于条件;其他 >= != <= 未实现|只包括单选 (2021.2.03/czj)\n let _string = data.operateValue.split(\"==\");\n let _sub = _string[0];\n let _arr = _string[1].split(\",\");\n if (_sub) {\n if (_arr.includes(data.msg[0] ? data.msg[0][_sub] : \"\")) {\n //清空 状态还原 data.msg 为 []\n this.widget.options[status] = flag;\n this.resetByflag(flag);\n //禁用和隐藏 重置 组件的dataModel;\n } else {\n this.widget.options[status] = !flag;\n this.resetByflag(!flag);\n }\n }\n }\n },\n updateModelByScribe(data) {\n let values = data.msg;\n let labelArr = data.operateValue.split(\",\");\n if (Array.isArray(values)) {\n if (values.length == 0) {\n this.dataModel = \"\";\n return false;\n }\n let labelsStr = \"\";\n let splitSign = labelArr.length > 0 ? \"/\" : \"\";\n values.forEach(item => {\n let _labelStr = \"\";\n labelArr.forEach(i => {\n if (item[i] != undefined || item[i] != null) {\n _labelStr += splitSign + item[i];\n }\n });\n if (splitSign) {\n _labelStr = _labelStr.substring(1);\n }\n labelsStr += \",\" + _labelStr;\n });\n this.dataModel = labelsStr.substring(1);\n }\n },\n //更新labelWidth\n // updatelabelWidth(val) {\n // if (!val && val !== 0) return false;\n // this.labelCol.style.width = val + \"px\";\n // this.wrapperCol.style.width = \"calc(100% - \" + val + \"px)\";\n // if (val == 0) {\n // this.labelCol.style.border = 0\n // }\n // },\n //唯一值校验\n validateonly(rule, value, callback) {\n const {\n disabled,\n canView,\n canEdit,\n onlyurl_type = 'GET'\n } = this.widget.options;\n if (disabled || canView == false || canEdit == false) return callback();\n if (value) {\n let params = {\n formId: this.formId,\n model: this.widget.model,\n kssjKey: this.widget.options.kssjKey,\n jssjKey: this.widget.options.jssjKey,\n failMessage: this.widget.options.failMessage,\n checkFieIdKey: this.widget.options.checkFieIdKey,\n value: Object.assign({}, this.getFormData(), this.models)\n };\n if (typeof this.formDataId == 'object' && this.formDataId.id) {\n params.formDataId = this.formDataId.id;\n } else if (typeof this.formDataId == 'string') {\n params.formDataId = this.formDataId;\n } else {\n params.formDataId = '';\n }\n let currHttpAction = _api_manage__WEBPACK_IMPORTED_MODULE_5__.getAction;\n if (onlyurl_type === 'POST') currHttpAction = _api_manage__WEBPACK_IMPORTED_MODULE_5__.postAction;\n currHttpAction(this.widget.options.onlyurl, params).then(res => {\n if (res.result && !this.widget.options.disabled) {\n callback(new Error(res.message));\n } else {\n callback();\n }\n });\n } else {\n callback();\n }\n },\n // 通过消息发布 改变dataModel\n updateModelByPulish(value) {\n if (value == undefined || value == null) {\n return false;\n }\n this.dataModel = value;\n },\n resetByflag(flag) {\n if (flag) {\n this.resetDataModel();\n }\n },\n updateStringModel(key, data, tag = 'add') {\n const modelData = String(this.models[key] || '').split(',');\n if (modelData[0] === '') modelData.shift();\n if (tag === 'add' && !modelData.includes(data)) {\n modelData.push(data);\n } else if (tag === 'del' && modelData.includes(data)) {\n modelData.splice(modelData.indexOf(data), 1);\n }\n // 需要异步调用, 不然会影响 updateModels\n setTimeout(() => {\n this.models[key] = modelData.join(',');\n }, 0);\n }\n },\n beforeDestroy() {\n // 子表单某一行销毁后需要重新更新脚本\n if (this.tableKey) this.pulishMsg(\"\");\n },\n destroyed() {\n if (this.pubsubSign) {\n pubsub_js__WEBPACK_IMPORTED_MODULE_4___default().unsubscribe(this.pubsubSign);\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/mixins/widgetMixins.js?");
2444
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.replace-all.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.string.replace-all.js\");\n/* harmony import */ var core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.reduce.js\");\n/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.json.stringify.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.json.stringify.js\");\n/* harmony import */ var core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.error.cause.js\");\n/* harmony import */ var core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_error_cause_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! pubsub-js */ \"./node_modules/_pubsub-js@1.9.4@pubsub-js/src/pubsub.js\");\n/* harmony import */ var pubsub_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(pubsub_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _api_manage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/api/manage */ \"./src/api/manage.js\");\n/* harmony import */ var _validateByApiMinxins__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./validateByApiMinxins */ \"./src/form/mixins/validateByApiMinxins.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @zscreate/formula */ \"./node_modules/_@zscreate_formula@1.0.1@@zscreate/formula/dist/formula.js\");\n/* harmony import */ var _zscreate_formula__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_zscreate_formula__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment */ \"./node_modules/_moment@2.29.4@moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_8__);\n\n\n\n\n\n/****\r\n *widgetMixins\r\n */\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n inject: {\n getWidgetList: {\n from: 'getWidgetList',\n default: () => () => [[]]\n },\n getFormData: {\n from: 'getFormData',\n default: () => () => ({})\n },\n isAllLayout: {\n from: 'isAllLayout',\n default: false\n },\n config: {\n from: 'config',\n default: undefined\n },\n formId: {\n from: 'formId',\n default: undefined\n },\n formDataId: {\n from: 'formDataId',\n default: undefined\n },\n isDraft: {\n from: 'isDraft',\n default: false\n }\n },\n mixins: [_validateByApiMinxins__WEBPACK_IMPORTED_MODULE_7__[\"default\"]],\n data() {\n return {\n pubsubSign: null,\n show: false,\n tableData: {}\n };\n },\n props: {\n showLabel: {\n type: Boolean\n },\n rules: {\n type: Object\n },\n tableKey: {\n type: String,\n default: \"\"\n },\n tableIndex: {\n type: [String, Number],\n default: \"\"\n },\n widget: {\n type: Object,\n default: () => {\n return {};\n }\n },\n value: {\n type: [String, Number, Array, Object]\n },\n isdisabled: {\n type: String,\n default: ''\n },\n models: {\n type: Object,\n default: () => {\n return {};\n }\n }\n },\n beforeMount() {\n let widget = this.widget;\n let model = this.widget.model;\n if (widget.options.onlyvalue && widget.options.onlyvalue === true) {\n let rule = {\n validator: this.validateonly,\n trigger: ['date', 'time'].includes(widget.type) ? 'change' : \"blur\"\n };\n let tableKey = this.tableKey;\n if (tableKey) {\n //防止重复添加 (可优化)\n if (this.rules[tableKey][model].isonlyvalue) return false;\n this.rules[tableKey][model].push(rule);\n this.rules[tableKey][model].isonlyvalue = true;\n } else {\n if (this.rules[model].isonlyvalue) return false;\n this.rules[model].push(rule);\n this.rules[model].isonlyvalue = true;\n }\n }\n // 时间比较增加校验规则\n if (widget.options.condition && widget.options.conditionValue) {\n if (this.tableKey) {\n if (this.rules[this.tableKey][this.widget.model].isvalidator) return false;\n this.rules[this.tableKey][this.widget.model].push({\n validator: this.validateTime,\n trigger: ['date', 'time'].includes(this.widget.type) ? 'change' : \"blur\"\n });\n this.rules[this.tableKey][this.widget.model].isvalidator = true;\n } else {\n if (this.rules[this.widget.model].isvalidator) return false;\n this.rules[this.widget.model].push({\n validator: this.validateTime,\n trigger: ['date', 'time'].includes(this.widget.type) ? 'change' : \"blur\"\n });\n this.rules[this.widget.model].isvalidator = true;\n }\n }\n },\n created() {\n this.minxsInit(); //混入初始化\n },\n\n computed: {\n currRules() {\n if (!this.rules) return [];\n return this.tableKey ? this.rules[this.tableKey][this.widget.model] : this.rules[this.widget.model];\n },\n getbgc: function () {\n //计算颜色\n return this.config.bgc;\n },\n getcolor: function () {\n //计算字体颜色\n return this.config.color;\n },\n labelWidth() {\n let width = this.widget.options.labelWidth;\n if (['', undefined, null].includes(width)) {\n width = 100;\n if (['editorAirt'].includes(this.widget.type)) width = 0;\n }\n // 如果是子表单元素 label 宽度为0 border为0\n return this.tableKey && !this.showLabel ? 0 : width;\n },\n labelCol() {\n let labelWidth = this.labelWidth + \"px\";\n return {\n style: {\n width: labelWidth,\n background: this.config.bgc,\n color: this.config.color,\n borderColor: this.config.borderColor,\n border: this.labelWidth == 0 ? 0 : undefined\n // borderBottomWidth: \"1px\",\n }\n };\n },\n\n //label样式\n wrapperCol() {\n return {\n style: {\n width: \"calc(100% - \" + this.labelWidth + \"px)\",\n borderColor: this.config.borderColor\n }\n };\n } //item 样式\n },\n\n watch: {\n models: {\n deep: true,\n handler(val) {\n this.updateModelByModelsChange();\n let tableKey = this.tableKey;\n if (tableKey) {\n //处理子表单删除行的时候 值未更新\n if (this.tableData[tableKey] == undefined) {\n this.$set(this.tableData, tableKey, {});\n this.tableData[tableKey].length = this.models[tableKey].length;\n }\n if (this.models[tableKey].length < this.tableData[tableKey].length) {\n this.dataModel = this.models[tableKey][this.tableIndex][this.widget.model];\n }\n this.tableData[tableKey].length = this.models[tableKey].length;\n }\n }\n },\n // \"widget.options.labelWidth\"(val) {\n // //监听labelWidth\n // this.updatelabelWidth(this.tableKey && !this.showLabel ? 0 : val);\n // },\n config(val) {}\n },\n methods: {\n publish: (pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().publish),\n // 发布方法\n parseInt: parseInt,\n // 取整\n getRecursionWidget() {\n const res_list = [];\n let func = (res_list, val) => {\n if (val instanceof Array && val.length > 0) {\n val.forEach(item => {\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\"].includes(item.type)) {\n // columns.list\n item.columns.forEach(columnsItem => {\n func(res_list, columnsItem.list);\n });\n } else if ([\"table\"].includes(item.type)) {\n // columns\n func(res_list, item.columns);\n } else {\n res_list.push(item);\n }\n });\n }\n };\n const [widgetList] = this.getWidgetList();\n func(res_list, widgetList);\n func = null;\n return res_list;\n },\n async updateValidateNotify() {\n await this.$nextTick();\n const rules = this.currRules;\n rules.forEach(item => {\n item.trigger && this.$refs[this.widget.model].validate(item.trigger);\n });\n },\n toFixed(num, length = 2, type = 1) {\n // 保留几位小数 默认number类型,为了部分校验\n var num = Number(num).toFixed(length);\n return type ? Number(num) : num;\n },\n getRules() {\n try {\n if (this.widget.options.canView == false) {\n this.rules[this.widget.model].forEach(item => {\n if (item.required && item.required == true) {\n item.required = false;\n }\n });\n }\n } catch (error) {}\n // console.log(this.rules)\n },\n\n updateModelByModelsChange() {\n try {\n //防止设计表单缺少models报错\n\n let dataModel = this.tableKey ? this.models[this.tableKey][this.tableIndex][this.widget.model] : this.models[this.widget.model];\n // 兼容移动端bug, select 下拉选择框,单选的时候, 可能返回的数组的值, 所以这里需要单独处理下\n if (this.widget.type === 'select' && !this.widget.options.multiple && Array.isArray(dataModel) && dataModel.length > 0) {\n this.dataModel = dataModel[0];\n return;\n }\n if (this.widget.type === 'codeControl' && !dataModel) {\n const {\n enableCustomRules,\n customRules\n } = this.widget.options;\n if (enableCustomRules) {\n eval(`this.widget.key = dataModel = (${customRules})(this.widget, this.models, this)`);\n } else {\n const randomNum = String(Math.random());\n const dateStr = String(new Date().getFullYear()).slice(2) + (new Date().getMonth() + 1 > 9 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)) + (new Date().getDate() > 9 ? new Date().getDate() : '0' + new Date().getDate()) + randomNum.slice(-4);\n this.widget.key = dateStr + '';\n dataModel = this.widget.key;\n }\n }\n this.dataModel = dataModel;\n // if (this.verifyNode && this.widget.options.disabled) { // 审核状态下 不提示placeholder\n // this.widget.options.placeholder = \"\"\n // }\n } catch (error) {\n console.log(error);\n }\n },\n //时间比较\n onDateChange(val) {\n if (this.tableKey) {\n this.models[this.tableKey][this.tableIndex][this.widget.model] = val;\n } else {\n this.models[this.widget.model] = val;\n }\n },\n resetDataModel() {\n this.dataModel = \"\"; //部分组件重置dataModel 需要重写\n },\n\n //混入初始化\n minxsInit() {\n this.updateModelByModelsChange();\n //如果是子表单元素 label 宽度为0 border为0\n // this.updatelabelWidth((this.tableKey && !this.showLabel) ? 0 : this.widget.options.labelWidth);\n this.pubsubScribe(); //订阅消息\n },\n\n m_subscribe(key, val) {\n if (!(pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().calc_record)) (pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().calc_record) = {};\n },\n calc_run(isFirstRun) {\n let invalids = false;\n let {\n formula,\n relyWidgets = []\n } = this.widget.options.formula;\n relyWidgets.forEach(item => {\n formula = formula.replaceAll(`\\$${item}\\#`, item);\n });\n const tableArr = relyWidgets.filter(item => item.includes(\".\")).map(item => item.split(\".\"));\n const models = this.models;\n const keys = Object.keys(models);\n const formulaModels = keys.reduce((prev, curr) => {\n const key = `_widget_${curr}`;\n prev[key] = models[curr];\n const tableData = tableArr.find(item => item[0] === key);\n if (tableData && Array.isArray(models[curr])) {\n prev[key] = JSON.parse(JSON.stringify(models[curr]));\n prev[key][tableData[1]] = prev[key].map(item => item[tableData[1]]);\n }\n if (relyWidgets.includes(key) && isFirstRun && models[curr] === '') {\n invalids = true;\n }\n return prev;\n }, {});\n if (invalids) return;\n let result = _zscreate_formula__WEBPACK_IMPORTED_MODULE_9__.FormulaInstance.RUN(formula, formulaModels);\n if ([NaN].includes(result)) {\n result = '';\n }\n if (Object.prototype.toString.call(result).includes('Date')) {\n result = moment__WEBPACK_IMPORTED_MODULE_8___default()(result).format(this.widget.options.format || 'YYYY-MM-DD');\n }\n console.log('result: ', result);\n this.dataModel = result;\n },\n /**\r\n * @description 订阅消息\r\n * @return void\r\n */\n pubsubScribe() {\n var _this$widget$options$;\n let subscribeKey = this.widget.options.subscribeOptions ? this.widget.options.subscribeOptions.subscribeKey : \"\";\n if ((_this$widget$options$ = this.widget.options.formula) !== null && _this$widget$options$ !== void 0 && _this$widget$options$.formula) {\n let {\n formula,\n relyWidgets = []\n } = this.widget.options.formula;\n setTimeout(() => {\n if (!this.dataModel) this.calc_run(true);\n }, 100);\n relyWidgets.forEach(item => {\n if (item.includes('.')) item = item.split('.').slice(-1)[0];\n pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().subscribe('calc_' + item.replace('_widget_', ''), (key, data) => {\n setTimeout(() => {\n this.calc_run();\n console.log(this, key, data);\n }, 100);\n });\n });\n }\n if (subscribeKey) {\n let tableIndex = this.tableIndex; //子表单联动\n subscribeKey = this.tableKey ? tableIndex + '_' + subscribeKey : subscribeKey;\n let timecount = 0;\n if (subscribeKey == 'time') {\n console.log('timecount', ++timecount);\n }\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\", 'table'].includes(this.widget.type)) return;\n this.pubsubSign = pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().subscribe(subscribeKey, (msg, data) => {\n console.log('isClickByUser', data.isClickByUser);\n if (data.hasOwnProperty('updateModel') && data.updateModel) {\n // 用于脚本里面精准更新model 避免通过监听models值来更新 model\n this.updateModelByPulish(data.value);\n return false;\n }\n\n // 订阅者接受指定 当data对象具有method属性时候 通过策略模式处理相关方法\n if (data.hasOwnProperty(\"method\")) {\n console.log(\"method==\");\n try {\n this[data.method](data.args);\n } catch (error) {}\n return false;\n }\n this.updateModelByScript(data, data.msg);\n });\n }\n },\n /***\r\n * @description 更新联动方法\r\n * @params { data } 联动规则\r\n * @params { list } Array String Number 是否是用户手动触发\r\n */\n updateModelByScript(data, list) {\n var that = this;\n that.isClickByUser = data.isClickByUser; //是否是用户点击\n that.isDraft = data.isDraft; //是否是草稿\n try {\n eval(data.operateValue);\n } catch (error) {\n console.log(error);\n }\n },\n /**\r\n * @description 发布消息\r\n * @params { string/number/object } val 发布的内容\r\n * @params { bollean } isClickByUser 是否是用户手动触发\r\n * @return void\r\n */\n pulishMsg(val, isClickByUser = false) {\n setTimeout(() => {\n let relateOptions = this.widget.options.relateOptions;\n pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().publish('calc_' + this.widget.model, {\n msg: {\n val\n },\n model: this.widget.model,\n tableKey: this.tableKey,\n tableIndex: this.tableIndex\n });\n if (relateOptions && relateOptions.length > 0) {\n relateOptions.forEach((item, index) => {\n let publishKey = this.tableKey ? this.tableIndex + '_' + item.publishKey : item.publishKey; //子表单联动\n if (item.isTableChild === false) publishKey = item.publishKey; // 非子表单; false 兼容之前的逻辑; 之前为 \"\"\n console.log(\"pul--form\" + index);\n pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().publish(publishKey, {\n ...item,\n msg: val,\n isClickByUser,\n isDraft: this.isDraft\n });\n });\n }\n }, 0);\n },\n updateStatusByScribe(data, status, flag) {\n if ([\"string\", \"number\"].includes(typeof data.msg)) {\n if (data.operateValue.split(\",\").includes(data.msg)) {\n this.widget.options[status] = flag;\n this.resetByflag(flag);\n } else {\n this.widget.options[status] = !flag;\n this.resetByflag(!flag);\n }\n } else {\n //暂时实现等于条件;其他 >= != <= 未实现|只包括单选 (2021.2.03/czj)\n let _string = data.operateValue.split(\"==\");\n let _sub = _string[0];\n let _arr = _string[1].split(\",\");\n if (_sub) {\n if (_arr.includes(data.msg[0] ? data.msg[0][_sub] : \"\")) {\n //清空 状态还原 data.msg 为 []\n this.widget.options[status] = flag;\n this.resetByflag(flag);\n //禁用和隐藏 重置 组件的dataModel;\n } else {\n this.widget.options[status] = !flag;\n this.resetByflag(!flag);\n }\n }\n }\n },\n updateModelByScribe(data) {\n let values = data.msg;\n let labelArr = data.operateValue.split(\",\");\n if (Array.isArray(values)) {\n if (values.length == 0) {\n this.dataModel = \"\";\n return false;\n }\n let labelsStr = \"\";\n let splitSign = labelArr.length > 0 ? \"/\" : \"\";\n values.forEach(item => {\n let _labelStr = \"\";\n labelArr.forEach(i => {\n if (item[i] != undefined || item[i] != null) {\n _labelStr += splitSign + item[i];\n }\n });\n if (splitSign) {\n _labelStr = _labelStr.substring(1);\n }\n labelsStr += \",\" + _labelStr;\n });\n this.dataModel = labelsStr.substring(1);\n }\n },\n //更新labelWidth\n // updatelabelWidth(val) {\n // if (!val && val !== 0) return false;\n // this.labelCol.style.width = val + \"px\";\n // this.wrapperCol.style.width = \"calc(100% - \" + val + \"px)\";\n // if (val == 0) {\n // this.labelCol.style.border = 0\n // }\n // },\n //唯一值校验\n validateonly(rule, value, callback) {\n const {\n disabled,\n canView,\n canEdit,\n onlyurl_type = 'GET'\n } = this.widget.options;\n if (disabled || canView == false || canEdit == false) return callback();\n if (value) {\n let params = {\n formId: this.formId,\n model: this.widget.model,\n kssjKey: this.widget.options.kssjKey,\n jssjKey: this.widget.options.jssjKey,\n failMessage: this.widget.options.failMessage,\n checkFieIdKey: this.widget.options.checkFieIdKey,\n value: Object.assign({}, this.getFormData(), this.models)\n };\n if (typeof this.formDataId == 'object' && this.formDataId.id) {\n params.formDataId = this.formDataId.id;\n } else if (typeof this.formDataId == 'string') {\n params.formDataId = this.formDataId;\n } else {\n params.formDataId = '';\n }\n let currHttpAction = _api_manage__WEBPACK_IMPORTED_MODULE_6__.getAction;\n if (onlyurl_type === 'POST') currHttpAction = _api_manage__WEBPACK_IMPORTED_MODULE_6__.postAction;\n currHttpAction(this.widget.options.onlyurl, params).then(res => {\n if (res.result && !this.widget.options.disabled) {\n callback(new Error(res.message));\n } else {\n callback();\n }\n });\n } else {\n callback();\n }\n },\n // 通过消息发布 改变dataModel\n updateModelByPulish(value) {\n if (value == undefined || value == null) {\n return false;\n }\n this.dataModel = value;\n },\n resetByflag(flag) {\n if (flag) {\n this.resetDataModel();\n }\n },\n updateStringModel(key, data, tag = 'add') {\n const modelData = String(this.models[key] || '').split(',');\n if (modelData[0] === '') modelData.shift();\n if (tag === 'add' && !modelData.includes(data)) {\n modelData.push(data);\n } else if (tag === 'del' && modelData.includes(data)) {\n modelData.splice(modelData.indexOf(data), 1);\n }\n // 需要异步调用, 不然会影响 updateModels\n setTimeout(() => {\n this.models[key] = modelData.join(',');\n }, 0);\n }\n },\n beforeDestroy() {\n // 子表单某一行销毁后需要重新更新脚本\n if (this.tableKey) this.pulishMsg(\"\");\n },\n destroyed() {\n if (this.pubsubSign) {\n pubsub_js__WEBPACK_IMPORTED_MODULE_5___default().unsubscribe(this.pubsubSign);\n }\n }\n});\n\n//# sourceURL=webpack://form-component/./src/form/mixins/widgetMixins.js?");
2445
2445
 
2446
2446
  /***/ }),
2447
2447
 
@@ -2957,7 +2957,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
2957
2957
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2958
2958
 
2959
2959
  "use strict";
2960
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateUUID\": () => (/* binding */ generateUUID),\n/* harmony export */ \"getRecursionWidget\": () => (/* binding */ getRecursionWidget),\n/* harmony export */ \"loadCss\": () => (/* binding */ loadCss),\n/* harmony export */ \"loadJs\": () => (/* binding */ loadJs)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n\nconst loadJs = url => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = url;\n script.type = 'text/javascript';\n document.body.appendChild(script);\n script.onload = () => {\n resolve();\n };\n });\n};\nconst loadCss = url => {\n return new Promise((resolve, reject) => {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = url;\n document.head.appendChild(link);\n link.onload = () => {\n resolve();\n };\n });\n};\nfunction getRecursionWidget(widgetList) {\n const res_list = [];\n let func = (res_list, val) => {\n if (val instanceof Array && val.length > 0) {\n val.forEach(item => {\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\"].includes(item.type)) {\n // columns.list\n item.columns.forEach(columnsItem => {\n columnsItem.list.type = item.type;\n func(res_list, columnsItem.list);\n });\n } else if ([\"table\"].includes(item.type)) {\n // columns\n item.columns.type = item.type;\n func(res_list, item.columns);\n } else {\n item.parentType = val.type;\n res_list.push(item);\n }\n });\n }\n };\n func(res_list, widgetList);\n func = null;\n return res_list;\n}\nconst generateUUID = () => {\n var d = new Date().getTime();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : r & 0x7 | 0x8).toString(16);\n });\n return uuid;\n};\n\n//# sourceURL=webpack://form-component/./src/form/util/index.js?");
2960
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"generateUUID\": () => (/* binding */ generateUUID),\n/* harmony export */ \"getRecursionWidget\": () => (/* binding */ getRecursionWidget),\n/* harmony export */ \"loadCss\": () => (/* binding */ loadCss),\n/* harmony export */ \"loadJs\": () => (/* binding */ loadJs)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/_core-js@3.30.2@core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n\nconst loadJs = url => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.src = url;\n script.type = 'text/javascript';\n document.body.appendChild(script);\n script.onload = () => {\n resolve();\n };\n });\n};\nconst loadCss = url => {\n return new Promise((resolve, reject) => {\n const link = document.createElement('link');\n link.rel = 'stylesheet';\n link.href = url;\n document.head.appendChild(link);\n link.onload = () => {\n resolve();\n };\n });\n};\nfunction getRecursionWidget(widgetList) {\n const res_list = [];\n let func = (res_list, val) => {\n if (val instanceof Array && val.length > 0) {\n val.forEach(item => {\n if ([\"grid\", \"grid-lay-out\", \"all-lay-out\"].includes(item.type)) {\n // columns.list\n item.columns.forEach(columnsItem => {\n columnsItem.list.type = item.type;\n func(res_list, columnsItem.list);\n });\n } else if ([\"table\"].includes(item.type)) {\n // columns\n item.columns.p_type = item.type;\n item.columns.p_model = item.model;\n func(res_list, item.columns);\n } else {\n item.parentType = val.p_type;\n item.parentModel = val.p_model;\n res_list.push(item);\n }\n });\n }\n };\n func(res_list, widgetList);\n func = null;\n return res_list;\n}\nconst generateUUID = () => {\n var d = new Date().getTime();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : r & 0x7 | 0x8).toString(16);\n });\n return uuid;\n};\n\n//# sourceURL=webpack://form-component/./src/form/util/index.js?");
2961
2961
 
2962
2962
  /***/ }),
2963
2963
 
@@ -15194,7 +15194,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
15194
15194
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15195
15195
 
15196
15196
  "use strict";
15197
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"a-modal\",\n {\n staticClass: \"form-formula-dialog\",\n attrs: {\n visible: _vm.dialogVisible,\n width: \"800px\",\n \"append-to-body\": \"\",\n },\n on: {\n \"update:visible\": function ($event) {\n _vm.dialogVisible = $event\n },\n cancel: _vm.closeDialog,\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\"div\", { staticStyle: { display: \"flex\" } }, [\n _vm._v(\" 公式编辑 \"),\n _c(\n \"div\",\n {\n staticStyle: {\n color: \"#838892\",\n \"margin-left\": \"10px\",\n \"font-size\": \"12px\",\n },\n },\n [_vm._v(\"使用数学运算符编辑公式\")]\n ),\n ]),\n ]),\n _vm.dialogVisible\n ? _c(\n \"div\",\n {\n on: {\n click: function ($event) {\n _vm.replaceVisible && (_vm.replaceVisible = false)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"formula-head-title\" }, [\n _c(\n \"div\",\n {\n staticClass: \"CodeMirror-wrap\",\n staticStyle: { \"line-height\": \"18px\" },\n },\n [\n _c(\"div\", { staticClass: \"head-options\" }, [\n _c(\n \"div\",\n {\n staticStyle: {\n overflow: \"hidden\",\n \"line-break\": \"anywhere\",\n \"text-overflow\": \"ellipsis\",\n \"white-space\": \"nowrap\",\n },\n attrs: { title: _vm.widgetName },\n },\n [_vm._v(\" \" + _vm._s(_vm.widgetName) + \" \")]\n ),\n _c(\"span\", { staticStyle: { \"margin-right\": \"auto\" } }, [\n _vm._v(\" =\"),\n ]),\n _c(\n \"div\",\n { staticClass: \"head-opt-btns\" },\n [\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"copy\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"15px\" },\n attrs: { type: \"icon-Copy\" },\n }),\n _vm._v(\"复制\"),\n ],\n 1\n ),\n _c(\n \"a-popconfirm\",\n {\n attrs: {\n visible: _vm.replaceVisible,\n placement: \"bottomRight\",\n \"ok-text\": \"确认\",\n icon: [],\n \"cancel-text\": \"取消\",\n },\n on: {\n cancel: function ($event) {\n _vm.replaceVisible = false\n },\n confirm: _vm.replaceConfirm,\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\n \"div\",\n {\n staticClass: \"replace-param-content\",\n staticStyle: {\n width: \"200px\",\n \"margin-left\": \"-20px\",\n },\n },\n [\n _c(\"div\", { staticClass: \"tip\" }, [\n _vm._v(\" 仅支持替换引用的当前表单字段 \"),\n ]),\n _c(\n \"a-form\",\n { attrs: { form: _vm.replaceForm } },\n [\n _c(\n \"a-form-item\",\n {\n staticStyle: {\n \"margin-bottom\": \"0\",\n },\n attrs: {\n label: \"1. 选择要替换的变量\",\n },\n },\n [\n _c(\n \"a-select\",\n {\n directives: [\n {\n name: \"decorator\",\n rawName: \"v-decorator\",\n value: [\n \"curr\",\n {\n rules: [\n {\n required: true,\n message:\n \"此内容必填\",\n },\n ],\n },\n ],\n expression:\n \"[\\n 'curr',\\n {\\n rules: [{ required: true, message: '此内容必填' }],\\n },\\n ]\",\n },\n ],\n staticClass: \"param-combo\",\n staticStyle: { width: \"100%\" },\n attrs: {\n \"show-search\": \"\",\n filterOption:\n _vm.replaceFilterOption,\n },\n },\n _vm._l(\n _vm.replaceObject\n .currReplaceParams,\n function (curr) {\n return _c(\n \"a-select-option\",\n {\n key: curr.value,\n attrs: {\n title: curr.text,\n },\n },\n [_vm._v(_vm._s(curr.text))]\n )\n }\n ),\n 1\n ),\n ],\n 1\n ),\n _vm.currReplaceTotal\n ? _c(\n \"div\",\n { staticClass: \"tip count\" },\n [\n _vm._v(\" 此变量在公式中引用\"),\n _c(\n \"a-button\",\n {\n attrs: {\n type: \"link\",\n size: \"small\",\n },\n },\n [\n _vm._v(\n _vm._s(\n _vm.currReplaceTotal\n )\n ),\n ]\n ),\n _vm._v(\"次 \"),\n ],\n 1\n )\n : _vm._e(),\n _vm.replaceObject.curr\n ? _c(\n \"a-form-item\",\n {\n staticStyle: {\n \"margin-bottom\": \"0\",\n },\n attrs: {\n label: \"2. 选择替换后的变量\",\n },\n },\n [\n _c(\n \"a-select\",\n {\n directives: [\n {\n name: \"decorator\",\n rawName: \"v-decorator\",\n value: [\n \"replace\",\n {\n rules: [\n {\n required: true,\n message:\n \"此内容必填\",\n },\n ],\n },\n ],\n expression:\n \"[\\n 'replace',\\n {\\n rules: [{ required: true, message: '此内容必填' }],\\n },\\n ]\",\n },\n ],\n staticClass: \"param-combo\",\n staticStyle: {\n width: \"100%\",\n },\n attrs: {\n \"show-search\": \"\",\n filterOption:\n _vm.replaceFilterOption,\n },\n },\n _vm._l(\n Object.keys(_vm.f_dataObj),\n function (item) {\n return _c(\n \"a-select-option\",\n {\n key: item,\n attrs: {\n title:\n _vm.f_dataObj[\n item\n ],\n },\n },\n [\n _vm._v(\n _vm._s(\n _vm.f_dataObj[\n item\n ]\n )\n ),\n ]\n )\n }\n ),\n 1\n ),\n ],\n 1\n )\n : _vm._e(),\n ],\n 1\n ),\n ],\n 1\n ),\n ]),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"replace\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"14px\" },\n attrs: { type: \"icon-replace\" },\n }),\n _vm._v(\"替换变量\"),\n ],\n 1\n ),\n ],\n 2\n ),\n _c(\n \"a-popconfirm\",\n {\n attrs: {\n placement: \"bottomRight\",\n icon: [],\n \"ok-text\": \"确认\",\n \"cancel-text\": \"取消\",\n },\n on: {\n confirm: function ($event) {\n _vm.form.remark = _vm.remark\n },\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\n \"div\",\n {\n staticStyle: {\n \"margin-left\": \"-20px\",\n width: \"200px\",\n },\n },\n [\n _c(\"a-textarea\", {\n staticStyle: {\n height: \"100px\",\n resize: \"none\",\n },\n attrs: {\n \"auto-size\": false,\n placeholder: \"请输入备注\",\n },\n model: {\n value: _vm.remark,\n callback: function ($$v) {\n _vm.remark = $$v\n },\n expression: \"remark\",\n },\n }),\n ],\n 1\n ),\n ]),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"remark\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"12px\" },\n attrs: { type: \"icon-beizhu\" },\n }),\n _vm._v(\"备注\"),\n ],\n 1\n ),\n ],\n 2\n ),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"debug\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"14px\" },\n attrs: { type: \"icon-tiaoshi\" },\n }),\n _vm._v(\"调试\"),\n ],\n 1\n ),\n ],\n 1\n ),\n ]),\n _c(\"div\", { staticStyle: { padding: \"0 5px\" } }, [\n _c(\"textarea\", {\n directives: [\n {\n name: \"model\",\n rawName: \"v-model\",\n value: _vm.form.formula,\n expression: \"form.formula\",\n },\n ],\n ref: \"formula\",\n staticClass: \"cm-s-default\",\n staticStyle: { height: \"180px\", \"font-size\": \"14px\" },\n domProps: { value: _vm.form.formula },\n on: {\n input: function ($event) {\n if ($event.target.composing) {\n return\n }\n _vm.$set(_vm.form, \"formula\", $event.target.value)\n },\n },\n }),\n ]),\n ]\n ),\n _vm.err_msg\n ? _c(\"div\", { staticClass: \"formula-error\" }, [\n _vm._v(\" \" + _vm._s(_vm.err_msg) + \" \"),\n ])\n : _vm._e(),\n ]),\n _c(\n \"a-row\",\n [\n _c(\"a-col\", { attrs: { span: 8 } }, [\n _c(\"div\", { staticClass: \"formula-info-main\" }, [\n _c(\n \"div\",\n {\n staticClass: \"head\",\n staticStyle: { height: \"35px\" },\n },\n [\n _c(\n \"a-input\",\n {\n attrs: {\n \"allow-clear\": \"\",\n placeholder: \"搜索变量\",\n },\n model: {\n value: _vm.search_variable,\n callback: function ($$v) {\n _vm.search_variable = $$v\n },\n expression: \"search_variable\",\n },\n },\n [\n _c(\"a-icon\", {\n attrs: { slot: \"prefix\", type: \"search\" },\n slot: \"prefix\",\n }),\n ],\n 1\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"formula-container\" },\n [\n _vm.boData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"无可用变量,请添加或保存表单后重试\"),\n ])\n : _vm.filter_boData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"无搜索结果\"),\n ])\n : _vm._e(),\n _vm._l(_vm.filter_boData, function (item, idx) {\n return _c(\n \"div\",\n {\n key: item.id,\n on: {\n click: function ($event) {\n return _vm.clickBoNode(item)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"variable-list\" }, [\n _c(\"div\", { attrs: { title: item.name } }, [\n _vm._v(_vm._s(item.name)),\n ]),\n _c(\"div\", { class: \"style-\" + item.type }, [\n _vm._v(_vm._s(_vm.TypesName[item.type])),\n ]),\n ]),\n ]\n )\n }),\n ],\n 2\n ),\n ]),\n ]),\n _c(\"a-col\", { attrs: { span: 6 } }, [\n _c(\n \"div\",\n {\n staticClass: \"formula-info-main \",\n staticStyle: {\n \"border-left\": \"none\",\n \"border-right\": \"none\",\n },\n },\n [\n _c(\n \"div\",\n {\n staticClass: \"head\",\n staticStyle: { height: \"35px\" },\n },\n [\n _c(\n \"a-input\",\n {\n attrs: {\n \"allow-clear\": \"\",\n placeholder: \"搜索函数\",\n },\n model: {\n value: _vm.search_methods,\n callback: function ($$v) {\n _vm.search_methods = $$v\n },\n expression: \"search_methods\",\n },\n },\n [\n _c(\"a-icon\", {\n attrs: { slot: \"prefix\", type: \"search\" },\n slot: \"prefix\",\n }),\n ],\n 1\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n {\n staticStyle: {\n height: \"100%\",\n \"overflow-y\": \"auto\",\n },\n on: { mouseleave: _vm.handleMouseLeave },\n },\n [\n _vm.filter_treeData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"没有对应的函数\"),\n ])\n : _vm._e(),\n _c(\"div\", { staticClass: \"formula-menu\" }, [\n _c(\n \"div\",\n { staticClass: \"formula-list\" },\n _vm._l(\n _vm.filter_treeData,\n function (tree, idx) {\n return _c(\n \"div\",\n {\n key: tree.key,\n class:\n \"formula-category \" +\n (_vm.expandIndex[idx]\n ? \"expand\"\n : \"\"),\n },\n [\n _c(\n \"div\",\n {\n staticClass: \"title\",\n on: {\n click: function ($event) {\n return _vm.$set(\n _vm.expandIndex,\n idx,\n !_vm.expandIndex[idx]\n )\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticClass: \"arrow-icon\",\n staticStyle: {\n \"font-size\": \"13px\",\n },\n attrs: { type: \"icon-rightyou\" },\n }),\n _vm._v(\n \" \" + _vm._s(tree.title) + \" \"\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"children\" },\n _vm._l(\n tree.children,\n function (child) {\n return _c(\n \"div\",\n {\n key: child.title,\n class:\n \"formula-item \" +\n (_vm.formulaIntro.title ===\n child.title\n ? \"select\"\n : \"\"),\n on: {\n click: function ($event) {\n return _vm.clickFunctionNode(\n child\n )\n },\n mouseenter: function (\n $event\n ) {\n return _vm.handleFunctionHover(\n child\n )\n },\n },\n },\n [\n _c(\n \"span\",\n {\n staticClass:\n \"formula-item-name\",\n },\n [\n _vm._v(\n _vm._s(child.title)\n ),\n ]\n ),\n _c(\n \"span\",\n {\n staticClass:\n \"formula-item-subName\",\n },\n [\n _vm._v(\n _vm._s(child.subName)\n ),\n ]\n ),\n ]\n )\n }\n ),\n 0\n ),\n ]\n )\n }\n ),\n 0\n ),\n ]),\n ]\n ),\n ]\n ),\n ]),\n _c(\"a-col\", { attrs: { span: 10 } }, [\n _c(\"div\", { staticClass: \"formula-info-main \" }, [\n _vm.formulaIntro\n ? _c(\"div\", { staticClass: \"formula-intro\" }, [\n _c(\"div\", { staticClass: \"formula-title head\" }, [\n _vm._v(_vm._s(_vm.formulaIntro.name)),\n ]),\n _c(\"div\", { staticStyle: { padding: \"0 10px\" } }, [\n _c(\n \"div\",\n { staticStyle: { \"line-height\": \"22px\" } },\n [\n _c(\n \"div\",\n {\n staticClass: \"intro\",\n staticStyle: { margin: \"5px 0\" },\n },\n [\n _vm._v(\n \" \" +\n _vm._s(_vm.formulaIntro.intro) +\n \" \"\n ),\n ]\n ),\n _c(\n \"div\",\n {\n staticClass: \"usage\",\n staticStyle: {\n \"margin-bottom\": \"5px\",\n \"line-break\": \"anywhere\",\n },\n },\n [\n _vm._v(\"用法:\"),\n _c(\n \"span\",\n { staticClass: \"formula-name\" },\n [_vm._v(_vm._s(_vm.formulaIntro.name))]\n ),\n _vm._v(\n _vm._s(\n _vm.formulaIntro.usage.replace(\n _vm.formulaIntro.name,\n \"\"\n )\n )\n ),\n ]\n ),\n _c(\n \"div\",\n {\n staticClass: \"example\",\n staticStyle: {\n \"margin-bottom\": \"5px\",\n \"line-break\": \"anywhere\",\n },\n },\n [\n _vm._v(\"示例:\"),\n _c(\"span\", {\n domProps: {\n innerHTML: _vm._s(\n _vm.formulaIntro.example\n ),\n },\n }),\n ]\n ),\n ]\n ),\n ]),\n ])\n : _vm._e(),\n _c(\"div\", { staticClass: \"formula-container\" }, [\n !_vm.formulaIntro\n ? _c(\n \"ul\",\n { staticStyle: { \"padding-left\": \"20px\" } },\n [\n _c(\n \"li\",\n {\n staticStyle: {\n \"list-style\": \"initial\",\n \"margin-bottom\": \"20px\",\n },\n },\n [\n _vm._v(\n \" 从左侧面板选择字段名和函数,或输入函数 \"\n ),\n ]\n ),\n _c(\n \"li\",\n { staticStyle: { \"list-style\": \"initial\" } },\n [\n _vm._v(\"公式编辑样式举例:\"),\n _c(\n \"span\",\n { staticClass: \"formula-name\" },\n [_vm._v(\" AVERAGE\")]\n ),\n _vm._v(\"(\"),\n _c(\n \"span\",\n { staticClass: \"formula-field\" },\n [_vm._v(\"基本工资\")]\n ),\n _vm._v(\",\"),\n _c(\n \"span\",\n { staticClass: \"formula-field\" },\n [_vm._v(\"加班工资\")]\n ),\n _vm._v(\") \"),\n ]\n ),\n ]\n )\n : _vm._e(),\n ]),\n ]),\n ]),\n ],\n 1\n ),\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"div\",\n { attrs: { slot: \"footer\" }, slot: \"footer\" },\n [\n _c(\"a-button\", { on: { click: _vm.closeDialog } }, [_vm._v(\"取消\")]),\n _c(\n \"a-button\",\n { attrs: { type: \"primary\" }, on: { click: _vm.handleConfirm } },\n [_vm._v(\"确定\")]\n ),\n ],\n 1\n ),\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://form-component/./src/form/formula/formula-edit.vue?./node_modules/_vue-loader@15.10.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
15197
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"a-modal\",\n {\n staticClass: \"form-formula-dialog\",\n attrs: {\n visible: _vm.dialogVisible,\n width: \"800px\",\n \"append-to-body\": \"\",\n },\n on: {\n \"update:visible\": function ($event) {\n _vm.dialogVisible = $event\n },\n cancel: _vm.closeDialog,\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\"div\", { staticStyle: { display: \"flex\" } }, [\n _vm._v(\" 公式编辑 \"),\n _c(\n \"div\",\n {\n staticStyle: {\n color: \"#838892\",\n \"margin-left\": \"10px\",\n \"font-size\": \"12px\",\n },\n },\n [_vm._v(\"使用数学运算符编辑公式\")]\n ),\n ]),\n ]),\n _vm.dialogVisible\n ? _c(\n \"div\",\n {\n on: {\n click: function ($event) {\n _vm.replaceVisible && (_vm.replaceVisible = false)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"formula-head-title\" }, [\n _c(\n \"div\",\n {\n staticClass: \"CodeMirror-wrap\",\n staticStyle: { \"line-height\": \"18px\" },\n },\n [\n _c(\"div\", { staticClass: \"head-options\" }, [\n _c(\n \"div\",\n {\n staticStyle: {\n overflow: \"hidden\",\n \"line-break\": \"anywhere\",\n \"text-overflow\": \"ellipsis\",\n \"white-space\": \"nowrap\",\n },\n attrs: { title: _vm.widgetName },\n },\n [_vm._v(\" \" + _vm._s(_vm.widgetName) + \" \")]\n ),\n _c(\"span\", { staticStyle: { \"margin-right\": \"auto\" } }, [\n _vm._v(\" =\"),\n ]),\n _c(\n \"div\",\n { staticClass: \"head-opt-btns\" },\n [\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"copy\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"15px\" },\n attrs: { type: \"icon-Copy\" },\n }),\n _vm._v(\"复制\"),\n ],\n 1\n ),\n _c(\n \"a-popconfirm\",\n {\n attrs: {\n visible: _vm.replaceVisible,\n placement: \"bottomRight\",\n \"ok-text\": \"确认\",\n icon: [],\n \"cancel-text\": \"取消\",\n },\n on: {\n cancel: function ($event) {\n _vm.replaceVisible = false\n },\n confirm: _vm.replaceConfirm,\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\n \"div\",\n {\n staticClass: \"replace-param-content\",\n staticStyle: {\n width: \"200px\",\n \"margin-left\": \"-20px\",\n },\n },\n [\n _c(\"div\", { staticClass: \"tip\" }, [\n _vm._v(\" 仅支持替换引用的当前表单字段 \"),\n ]),\n _c(\n \"a-form\",\n { attrs: { form: _vm.replaceForm } },\n [\n _c(\n \"a-form-item\",\n {\n staticStyle: {\n \"margin-bottom\": \"0\",\n },\n attrs: {\n label: \"1. 选择要替换的变量\",\n },\n },\n [\n _c(\n \"a-select\",\n {\n directives: [\n {\n name: \"decorator\",\n rawName: \"v-decorator\",\n value: [\n \"curr\",\n {\n rules: [\n {\n required: true,\n message:\n \"此内容必填\",\n },\n ],\n },\n ],\n expression:\n \"[\\n 'curr',\\n {\\n rules: [{ required: true, message: '此内容必填' }],\\n },\\n ]\",\n },\n ],\n staticClass: \"param-combo\",\n staticStyle: { width: \"100%\" },\n attrs: {\n \"show-search\": \"\",\n filterOption:\n _vm.replaceFilterOption,\n },\n },\n _vm._l(\n _vm.replaceObject\n .currReplaceParams,\n function (curr) {\n return _c(\n \"a-select-option\",\n {\n key: curr.value,\n attrs: {\n title: curr.text,\n },\n },\n [_vm._v(_vm._s(curr.text))]\n )\n }\n ),\n 1\n ),\n ],\n 1\n ),\n _vm.currReplaceTotal\n ? _c(\n \"div\",\n { staticClass: \"tip count\" },\n [\n _vm._v(\" 此变量在公式中引用\"),\n _c(\n \"a-button\",\n {\n attrs: {\n type: \"link\",\n size: \"small\",\n },\n },\n [\n _vm._v(\n _vm._s(\n _vm.currReplaceTotal\n )\n ),\n ]\n ),\n _vm._v(\"次 \"),\n ],\n 1\n )\n : _vm._e(),\n _vm.replaceObject.curr\n ? _c(\n \"a-form-item\",\n {\n staticStyle: {\n \"margin-bottom\": \"0\",\n },\n attrs: {\n label: \"2. 选择替换后的变量\",\n },\n },\n [\n _c(\n \"a-select\",\n {\n directives: [\n {\n name: \"decorator\",\n rawName: \"v-decorator\",\n value: [\n \"replace\",\n {\n rules: [\n {\n required: true,\n message:\n \"此内容必填\",\n },\n ],\n },\n ],\n expression:\n \"[\\n 'replace',\\n {\\n rules: [{ required: true, message: '此内容必填' }],\\n },\\n ]\",\n },\n ],\n staticClass: \"param-combo\",\n staticStyle: {\n width: \"100%\",\n },\n attrs: {\n \"show-search\": \"\",\n filterOption:\n _vm.replaceFilterOption,\n },\n },\n _vm._l(\n Object.keys(_vm.f_dataObj),\n function (item) {\n return _c(\n \"a-select-option\",\n {\n key: item,\n attrs: {\n title:\n _vm.f_dataObj[\n item\n ],\n },\n },\n [\n _vm._v(\n _vm._s(\n _vm.f_dataObj[\n item\n ]\n )\n ),\n ]\n )\n }\n ),\n 1\n ),\n ],\n 1\n )\n : _vm._e(),\n ],\n 1\n ),\n ],\n 1\n ),\n ]),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"replace\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"14px\" },\n attrs: { type: \"icon-replace\" },\n }),\n _vm._v(\"替换变量\"),\n ],\n 1\n ),\n ],\n 2\n ),\n _c(\n \"a-popconfirm\",\n {\n attrs: {\n placement: \"bottomRight\",\n icon: [],\n \"ok-text\": \"确认\",\n \"cancel-text\": \"取消\",\n },\n on: {\n confirm: function ($event) {\n _vm.form.remark = _vm.remark\n },\n },\n },\n [\n _c(\"template\", { slot: \"title\" }, [\n _c(\n \"div\",\n {\n staticStyle: {\n \"margin-left\": \"-20px\",\n width: \"200px\",\n },\n },\n [\n _c(\"a-textarea\", {\n staticStyle: {\n height: \"100px\",\n resize: \"none\",\n },\n attrs: {\n \"auto-size\": false,\n placeholder: \"请输入备注\",\n },\n model: {\n value: _vm.remark,\n callback: function ($$v) {\n _vm.remark = $$v\n },\n expression: \"remark\",\n },\n }),\n ],\n 1\n ),\n ]),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"remark\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"12px\" },\n attrs: { type: \"icon-beizhu\" },\n }),\n _vm._v(\"备注\"),\n ],\n 1\n ),\n ],\n 2\n ),\n _c(\n \"button\",\n {\n on: {\n click: function ($event) {\n return _vm.handleClick(\"debug\")\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticStyle: { \"font-size\": \"14px\" },\n attrs: { type: \"icon-tiaoshi\" },\n }),\n _vm._v(\"调试\"),\n ],\n 1\n ),\n ],\n 1\n ),\n ]),\n _c(\"div\", { staticStyle: { padding: \"0 5px\" } }, [\n _c(\"textarea\", {\n ref: \"formula\",\n staticClass: \"cm-s-default\",\n staticStyle: { height: \"180px\", \"font-size\": \"14px\" },\n }),\n ]),\n ]\n ),\n _vm.err_msg\n ? _c(\"div\", { staticClass: \"formula-error\" }, [\n _vm._v(\" \" + _vm._s(_vm.err_msg) + \" \"),\n ])\n : _vm._e(),\n ]),\n _c(\n \"a-row\",\n [\n _c(\"a-col\", { attrs: { span: 8 } }, [\n _c(\"div\", { staticClass: \"formula-info-main\" }, [\n _c(\n \"div\",\n {\n staticClass: \"head\",\n staticStyle: { height: \"35px\" },\n },\n [\n _c(\n \"a-input\",\n {\n attrs: {\n \"allow-clear\": \"\",\n placeholder: \"搜索变量\",\n },\n model: {\n value: _vm.search_variable,\n callback: function ($$v) {\n _vm.search_variable = $$v\n },\n expression: \"search_variable\",\n },\n },\n [\n _c(\"a-icon\", {\n attrs: { slot: \"prefix\", type: \"search\" },\n slot: \"prefix\",\n }),\n ],\n 1\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"formula-container\" },\n [\n _vm.boData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"无可用变量,请添加或保存表单后重试\"),\n ])\n : _vm.filter_boData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"无搜索结果\"),\n ])\n : _vm._e(),\n _vm._l(_vm.filter_boData, function (item, idx) {\n return _c(\n \"div\",\n {\n key: item.id,\n on: {\n click: function ($event) {\n return _vm.clickBoNode(item)\n },\n },\n },\n [\n _c(\"div\", { staticClass: \"variable-list\" }, [\n _c(\"div\", { attrs: { title: item.name } }, [\n _vm._v(_vm._s(item.name)),\n ]),\n _c(\"div\", { class: \"style-\" + item.type }, [\n _vm._v(_vm._s(_vm.TypesName[item.type])),\n ]),\n ]),\n ]\n )\n }),\n ],\n 2\n ),\n ]),\n ]),\n _c(\"a-col\", { attrs: { span: 6 } }, [\n _c(\n \"div\",\n {\n staticClass: \"formula-info-main \",\n staticStyle: {\n \"border-left\": \"none\",\n \"border-right\": \"none\",\n },\n },\n [\n _c(\n \"div\",\n {\n staticClass: \"head\",\n staticStyle: { height: \"35px\" },\n },\n [\n _c(\n \"a-input\",\n {\n attrs: {\n \"allow-clear\": \"\",\n placeholder: \"搜索函数\",\n },\n model: {\n value: _vm.search_methods,\n callback: function ($$v) {\n _vm.search_methods = $$v\n },\n expression: \"search_methods\",\n },\n },\n [\n _c(\"a-icon\", {\n attrs: { slot: \"prefix\", type: \"search\" },\n slot: \"prefix\",\n }),\n ],\n 1\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n {\n staticStyle: {\n height: \"100%\",\n \"overflow-y\": \"auto\",\n },\n on: { mouseleave: _vm.handleMouseLeave },\n },\n [\n _vm.filter_treeData.length === 0\n ? _c(\"div\", { staticClass: \"empty-tip\" }, [\n _vm._v(\"没有对应的函数\"),\n ])\n : _vm._e(),\n _c(\"div\", { staticClass: \"formula-menu\" }, [\n _c(\n \"div\",\n { staticClass: \"formula-list\" },\n _vm._l(\n _vm.filter_treeData,\n function (tree, idx) {\n return _c(\n \"div\",\n {\n key: tree.key,\n class:\n \"formula-category \" +\n (_vm.expandIndex[idx]\n ? \"expand\"\n : \"\"),\n },\n [\n _c(\n \"div\",\n {\n staticClass: \"title\",\n on: {\n click: function ($event) {\n return _vm.$set(\n _vm.expandIndex,\n idx,\n !_vm.expandIndex[idx]\n )\n },\n },\n },\n [\n _c(\"form-iconfont\", {\n staticClass: \"arrow-icon\",\n staticStyle: {\n \"font-size\": \"13px\",\n },\n attrs: { type: \"icon-rightyou\" },\n }),\n _vm._v(\n \" \" + _vm._s(tree.title) + \" \"\n ),\n ],\n 1\n ),\n _c(\n \"div\",\n { staticClass: \"children\" },\n _vm._l(\n tree.children,\n function (child) {\n return _c(\n \"div\",\n {\n key: child.title,\n class:\n \"formula-item \" +\n (_vm.formulaIntro.title ===\n child.title\n ? \"select\"\n : \"\"),\n on: {\n click: function ($event) {\n return _vm.clickFunctionNode(\n child\n )\n },\n mouseenter: function (\n $event\n ) {\n return _vm.handleFunctionHover(\n child\n )\n },\n },\n },\n [\n _c(\n \"span\",\n {\n staticClass:\n \"formula-item-name\",\n },\n [\n _vm._v(\n _vm._s(child.title)\n ),\n ]\n ),\n _c(\n \"span\",\n {\n staticClass:\n \"formula-item-subName\",\n },\n [\n _vm._v(\n _vm._s(child.subName)\n ),\n ]\n ),\n ]\n )\n }\n ),\n 0\n ),\n ]\n )\n }\n ),\n 0\n ),\n ]),\n ]\n ),\n ]\n ),\n ]),\n _c(\"a-col\", { attrs: { span: 10 } }, [\n _c(\"div\", { staticClass: \"formula-info-main \" }, [\n _vm.formulaIntro\n ? _c(\"div\", { staticClass: \"formula-intro\" }, [\n _c(\"div\", { staticClass: \"formula-title head\" }, [\n _vm._v(_vm._s(_vm.formulaIntro.name)),\n ]),\n _c(\"div\", { staticStyle: { padding: \"0 10px\" } }, [\n _c(\n \"div\",\n { staticStyle: { \"line-height\": \"22px\" } },\n [\n _c(\n \"div\",\n {\n staticClass: \"intro\",\n staticStyle: { margin: \"5px 0\" },\n },\n [\n _vm._v(\n \" \" +\n _vm._s(_vm.formulaIntro.intro) +\n \" \"\n ),\n ]\n ),\n _c(\n \"div\",\n {\n staticClass: \"usage\",\n staticStyle: {\n \"margin-bottom\": \"5px\",\n \"line-break\": \"anywhere\",\n },\n },\n [\n _vm._v(\"用法:\"),\n _c(\n \"span\",\n { staticClass: \"formula-name\" },\n [_vm._v(_vm._s(_vm.formulaIntro.name))]\n ),\n _vm._v(\n _vm._s(\n _vm.formulaIntro.usage.replace(\n _vm.formulaIntro.name,\n \"\"\n )\n )\n ),\n ]\n ),\n _c(\n \"div\",\n {\n staticClass: \"example\",\n staticStyle: {\n \"margin-bottom\": \"5px\",\n \"line-break\": \"anywhere\",\n },\n },\n [\n _vm._v(\"示例:\"),\n _c(\"span\", {\n domProps: {\n innerHTML: _vm._s(\n _vm.formulaIntro.example\n ),\n },\n }),\n ]\n ),\n ]\n ),\n ]),\n ])\n : _vm._e(),\n _c(\"div\", { staticClass: \"formula-container\" }, [\n !_vm.formulaIntro\n ? _c(\n \"ul\",\n { staticStyle: { \"padding-left\": \"20px\" } },\n [\n _c(\n \"li\",\n {\n staticStyle: {\n \"list-style\": \"initial\",\n \"margin-bottom\": \"20px\",\n },\n },\n [\n _vm._v(\n \" 从左侧面板选择字段名和函数,或输入函数 \"\n ),\n ]\n ),\n _c(\n \"li\",\n { staticStyle: { \"list-style\": \"initial\" } },\n [\n _vm._v(\"公式编辑样式举例:\"),\n _c(\n \"span\",\n { staticClass: \"formula-name\" },\n [_vm._v(\" AVERAGE\")]\n ),\n _vm._v(\"(\"),\n _c(\n \"span\",\n { staticClass: \"formula-field\" },\n [_vm._v(\"基本工资\")]\n ),\n _vm._v(\",\"),\n _c(\n \"span\",\n { staticClass: \"formula-field\" },\n [_vm._v(\"加班工资\")]\n ),\n _vm._v(\") \"),\n ]\n ),\n ]\n )\n : _vm._e(),\n ]),\n ]),\n ]),\n ],\n 1\n ),\n ],\n 1\n )\n : _vm._e(),\n _c(\n \"div\",\n { attrs: { slot: \"footer\" }, slot: \"footer\" },\n [\n _c(\"a-button\", { on: { click: _vm.closeDialog } }, [_vm._v(\"取消\")]),\n _c(\n \"a-button\",\n { attrs: { type: \"primary\" }, on: { click: _vm.handleConfirm } },\n [_vm._v(\"确定\")]\n ),\n ],\n 1\n ),\n ],\n 2\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://form-component/./src/form/formula/formula-edit.vue?./node_modules/_vue-loader@15.10.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
15198
15198
 
15199
15199
  /***/ }),
15200
15200
 
@@ -15205,7 +15205,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
15205
15205
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15206
15206
 
15207
15207
  "use strict";
15208
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n [\n _c(\n \"a-button\",\n {\n attrs: { type: _vm.hasInValid ? \"\" : \"primary\" },\n on: {\n click: function ($event) {\n return _vm.init(_vm.widget)\n },\n },\n },\n [\n _c(\"span\", { style: { color: _vm.hasInValid ? \"red\" : \"inherit\" } }, [\n _vm._v(\n \" \" +\n _vm._s(\n _vm.hasInValid ? \"存在已删除字段,请重新设置\" : \"公式编辑\"\n ) +\n \" \"\n ),\n ]),\n ]\n ),\n _c(\"formula-edit\", {\n attrs: {\n visible: _vm.visible,\n widgetName: _vm.widget.name,\n \"bo-data\": _vm.widgetsData,\n data: _vm.formula,\n },\n on: {\n callback: _vm.setFormulaValue,\n debug: _vm.handleDebug,\n close: function (_visible) {\n return (_vm.visible = false)\n },\n },\n }),\n _c(\n \"a-modal\",\n {\n attrs: { title: \"公式调试\", footer: null, width: \"900px\" },\n model: {\n value: _vm.debugVisible,\n callback: function ($$v) {\n _vm.debugVisible = $$v\n },\n expression: \"debugVisible\",\n },\n },\n [\n _c(\n \"div\",\n {\n staticStyle: {\n display: \"flex\",\n \"justify-content\": \"center\",\n overflow: \"auto\",\n },\n },\n [\n _vm.debugVisible\n ? _c(\"layout-for-paper\", {\n ref: \"layoutForPaper\",\n staticStyle: { \"min-height\": \"initial!important\" },\n attrs: {\n insite: \"true\",\n data: _vm.warpDebugForm,\n value: {},\n },\n })\n : _vm._e(),\n ],\n 1\n ),\n ]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://form-component/./src/form/formula/warpFormulaEdit.vue?./node_modules/_vue-loader@15.10.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
15208
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => (/* binding */ render),\n/* harmony export */ \"staticRenderFns\": () => (/* binding */ staticRenderFns)\n/* harmony export */ });\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"div\",\n [\n _c(\n \"a-button\",\n {\n attrs: { type: _vm.hasInValid ? \"\" : \"primary\" },\n on: {\n click: function ($event) {\n return _vm.init(_vm.widget)\n },\n },\n },\n [\n _c(\"span\", { style: { color: _vm.hasInValid ? \"red\" : \"inherit\" } }, [\n _vm._v(\n \" \" +\n _vm._s(\n _vm.hasInValid ? \"存在已删除字段,请重新设置\" : \"公式编辑\"\n ) +\n \" \"\n ),\n ]),\n ]\n ),\n _c(\"formula-edit\", {\n attrs: {\n visible: _vm.visible,\n widgetName: _vm.widget.name,\n \"bo-data\": _vm.widgetsData,\n data: _vm.formula,\n },\n on: {\n \"update:data\": function ($event) {\n _vm.formula = $event\n },\n callback: _vm.setFormulaValue,\n debug: _vm.handleDebug,\n close: function (_visible) {\n return (_vm.visible = false)\n },\n },\n }),\n _c(\n \"a-modal\",\n {\n attrs: { title: \"公式调试\", footer: null, width: \"900px\" },\n model: {\n value: _vm.debugVisible,\n callback: function ($$v) {\n _vm.debugVisible = $$v\n },\n expression: \"debugVisible\",\n },\n },\n [\n _c(\n \"div\",\n {\n staticStyle: {\n display: \"flex\",\n \"justify-content\": \"center\",\n overflow: \"auto\",\n },\n },\n [\n _vm.debugVisible\n ? _c(\"layout-for-paper\", {\n ref: \"layoutForPaper\",\n staticStyle: { \"min-height\": \"initial!important\" },\n attrs: {\n insite: \"true\",\n data: _vm.warpDebugForm,\n value: {},\n },\n })\n : _vm._e(),\n ],\n 1\n ),\n ]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://form-component/./src/form/formula/warpFormulaEdit.vue?./node_modules/_vue-loader@15.10.1@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.1@vue-loader/lib/index.js??vue-loader-options");
15209
15209
 
15210
15210
  /***/ }),
15211
15211
 
@@ -19864,7 +19864,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
19864
19864
  /***/ ((module) => {
19865
19865
 
19866
19866
  "use strict";
19867
- eval("module.exports = JSON.parse('{\"name\":\"@zscreate/form-component\",\"version\":\"1.1.221-test.47\",\"private\":false,\"description\":\"\",\"main\":\"dist/form-component.umd.js\",\"unpkg\":\"dist/form-component.umd.js\",\"scripts\":{\"version\":\"npm run build\",\"postversion\":\"git push && git push --tags\",\"build\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd \",\"build:common\":\"vue-cli-service build --target lib --name form-component src/main.js --formats commonjs \",\"build:watch\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd --watch\"},\"publishConfig\":{\"access\":\"public\",\"registry\":\"https://registry.npmjs.org/\"},\"files\":[\"/dist/**\",\"/dist/*\"],\"exclude\":[\"node_modules\"],\"keywords\":[],\"author\":\"\",\"license\":\"ISC\",\"dependencies\":{\"@uppy/core\":\"^3.1.2\",\"@uppy/dashboard\":\"^3.3.2\",\"@uppy/drag-drop\":\"^3.0.1\",\"@uppy/progress-bar\":\"^3.0.1\",\"@uppy/tus\":\"^3.0.6\",\"@uppy/vue\":\"^1.0.1\",\"@wangeditor/editor\":\"5.1.10\",\"@wangeditor/editor-for-vue\":\"1.0.2\",\"core-js\":\"^3.8.3\",\"moment\":\"^2.29.1\",\"pubsub-js\":\"^1.9.3\",\"vue\":\"2.6.14\",\"vue-draggable-resizable\":\"2.2.0\",\"vue-draggable-resizable-gorkys\":\"2.0.0\",\"vue-grid-layout\":\"^2.3.12\",\"vue-signature-pad\":\"^2.0.2\",\"vue2-editor\":\"^2.10.3\",\"vuedraggable\":\"^2.24.3\",\"wangeditor\":\"^4.7.15\"},\"devDependencies\":{\"@vue/cli-plugin-babel\":\"~5.0.0\",\"@vue/cli-service\":\"~5.0.0\",\"@zscreate/formula\":\"^1.0.1\",\"ant-design-vue\":\"^1.7.8\",\"axios\":\"^1.6.2\",\"clipboard\":\"2.0.4\",\"codemirror\":\"^5.65.16\",\"less\":\"^3.0.4\",\"less-loader\":\"^5.0.0\",\"node-sass\":\"^4.11.0\",\"sass-loader\":\"^7.0.1\",\"vue-codemirror\":\"^4.0.6\",\"vue-template-compiler\":\"2.6.14\",\"vue-virtual-scroll-list\":\"^2.3.5\"}}');\n\n//# sourceURL=webpack://form-component/./package.json?");
19867
+ eval("module.exports = JSON.parse('{\"name\":\"@zscreate/form-component\",\"version\":\"1.1.221-test.49\",\"private\":false,\"description\":\"\",\"main\":\"dist/form-component.umd.js\",\"unpkg\":\"dist/form-component.umd.js\",\"scripts\":{\"version\":\"npm run build\",\"postversion\":\"git push && git push --tags\",\"build\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd \",\"build:common\":\"vue-cli-service build --target lib --name form-component src/main.js --formats commonjs \",\"build:watch\":\"vue-cli-service build --target lib --name form-component src/main.js --formats umd --watch\"},\"publishConfig\":{\"access\":\"public\",\"registry\":\"https://registry.npmjs.org/\"},\"files\":[\"/dist/**\",\"/dist/*\"],\"exclude\":[\"node_modules\"],\"keywords\":[],\"author\":\"\",\"license\":\"ISC\",\"dependencies\":{\"@uppy/core\":\"^3.1.2\",\"@uppy/dashboard\":\"^3.3.2\",\"@uppy/drag-drop\":\"^3.0.1\",\"@uppy/progress-bar\":\"^3.0.1\",\"@uppy/tus\":\"^3.0.6\",\"@uppy/vue\":\"^1.0.1\",\"@wangeditor/editor\":\"5.1.10\",\"@wangeditor/editor-for-vue\":\"1.0.2\",\"core-js\":\"^3.8.3\",\"moment\":\"^2.29.1\",\"pubsub-js\":\"^1.9.3\",\"vue\":\"2.6.14\",\"vue-draggable-resizable\":\"2.2.0\",\"vue-draggable-resizable-gorkys\":\"2.0.0\",\"vue-grid-layout\":\"^2.3.12\",\"vue-signature-pad\":\"^2.0.2\",\"vue2-editor\":\"^2.10.3\",\"vuedraggable\":\"^2.24.3\",\"wangeditor\":\"^4.7.15\"},\"devDependencies\":{\"@vue/cli-plugin-babel\":\"~5.0.0\",\"@vue/cli-service\":\"~5.0.0\",\"@zscreate/formula\":\"^1.0.1\",\"ant-design-vue\":\"^1.7.8\",\"axios\":\"^1.6.2\",\"clipboard\":\"2.0.4\",\"codemirror\":\"^5.65.16\",\"less\":\"^3.0.4\",\"less-loader\":\"^5.0.0\",\"node-sass\":\"^4.11.0\",\"sass-loader\":\"^7.0.1\",\"vue-codemirror\":\"^4.0.6\",\"vue-template-compiler\":\"2.6.14\",\"vue-virtual-scroll-list\":\"^2.3.5\"}}');\n\n//# sourceURL=webpack://form-component/./package.json?");
19868
19868
 
19869
19869
  /***/ })
19870
19870
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zscreate/form-component",
3
- "version": "1.1.221-test.47",
3
+ "version": "1.1.221-test.49",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "dist/form-component.umd.js",