olp-table 7.2.99 → 7.2.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-report.html +3 -3
- package/olp-table.common.js +3 -3
- package/olp-table.umd.js +3 -3
- package/olp-table.umd.min.js +3 -3
- package/package.json +1 -1
package/olp-table.common.js
CHANGED
|
@@ -278,7 +278,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
278
278
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
279
279
|
|
|
280
280
|
"use strict";
|
|
281
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! element-plus/dist/index.css */ \"./node_modules/element-plus/dist/index.css\");\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smallwei/avue/lib/index.css */ \"./node_modules/@smallwei/avue/lib/index.css\");\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vxe-table/lib/style.css */ \"./node_modules/vxe-table/lib/style.css\");\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/auto-height/index.vue */ \"./src/components/auto-height/index.vue\");\n/* harmony import */ var _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/index.vue */ \"./src/components/tree/index.vue\");\n/* harmony import */ var _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtil */ \"./src/utils/http/httpUtil.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/ol-dialog-upload-file.vue */ \"./src/components/ol-dialog-upload-file.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_7__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_8__.storeDictType)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n components: {\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n OlDialogUploadFile: _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n OlTree: _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AutoHeight: _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n provide() {\n return {\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n tableAll: this.table\n };\n },\n data() {\n return {\n uuid: '
|
|
281
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! element-plus/dist/index.css */ \"./node_modules/element-plus/dist/index.css\");\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smallwei/avue/lib/index.css */ \"./node_modules/@smallwei/avue/lib/index.css\");\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vxe-table/lib/style.css */ \"./node_modules/vxe-table/lib/style.css\");\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/auto-height/index.vue */ \"./src/components/auto-height/index.vue\");\n/* harmony import */ var _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/index.vue */ \"./src/components/tree/index.vue\");\n/* harmony import */ var _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtil */ \"./src/utils/http/httpUtil.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/ol-dialog-upload-file.vue */ \"./src/components/ol-dialog-upload-file.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_7__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_8__.storeDictType)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n components: {\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n OlDialogUploadFile: _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n OlTree: _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AutoHeight: _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n provide() {\n return {\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n tableAll: this.table\n };\n },\n data() {\n return {\n uuid: '2034875354140880896',\n treeUuid: '1815551679408418816',\n table: {},\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n formConfig: undefined\n };\n },\n methods: {\n nodeClick(e) {\n console.log(e);\n this.uuid = undefined;\n this.$nextTick(() => {\n this.uuid = e.uuid;\n });\n },\n initOk({\n theme,\n table,\n customerForm\n }) {\n if (theme == 't1') {\n this.formConfig = table.formConfig; //给原有的自定义搜索\n //customerForm();//执行自定义表单,这个方法会隐藏table的表单,隐藏搜索按钮\n }\n console.log(this.formConfig);\n },\n //主子表更新或者保存\n testSave() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n mianColumnAndValueMap: {\n id: '1231564546',\n name: '韦邦杠',\n sex: ''\n },\n //保存主表的数据{表字段:value}\n //mainGenIdMap:{id: 'uuid'} //主表要自动生成的唯一字段 如果没有 可以忽略\n mainTableKey: ['code'],\n //主表的唯一字段\n subTables: [{\n subTableName: 'sys_dict_data',\n //子表名称\n subColumnAndValueList: [{\n dict_code: 'test_code_2',\n dict_value: '1',\n dict_label: 'label'\n }],\n //子表子主表的数据\n subGenIdMap: {\n id: 'uuid'\n },\n //子表要自动生成的唯一字段 如果没有 可以忽略\n subTableKey: ['id'],\n //子表的唯一字段\n subForeignKey: {\n 'code': 'dict_type'\n },\n //表的关联key,这里框架自动复制 {主表字段,子表的字段}\n subDeleteMapWhere: {}\n }]\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/saveMainAndSubs\", params);\n },\n //主子表删除\n testDelete() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n subTableName: 'sys_dict_data',\n //子表名称\n whereMap: {\n id: 'test_code'\n },\n //主表删除条件\n subForeignKey: {\n 'id': 'parent_id'\n } ////表的关联key,{主表字段,子表的字段}\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/deleteMainAndSubs\", params);\n },\n //单表更新\n updateOne() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n columnAndValueMap: {\n code: 'test_code',\n sex: 'xxx'\n },\n //更新字段\n whereMap: {\n code: 'test_code'\n } //更新条件\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/modify\", params);\n },\n //单表批量更新\n updateBatch() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n list: [{\n columnAndValueMap: {\n code: 'test_code'\n },\n //更新字段\n whereMap: {\n code: 'test_code'\n }\n } //更新条件}\n ]\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/batchModify\", params);\n }\n },\n created() {\n dict.refresh(this.http);\n dictType.refresh(this.http);\n window.$onlineHttps = _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n //this.testDelete();\n //this.nodeClick({uuid:'1787452516924563456'})\n //window.olpTableAxiosBaseURL = \"http://localhost:48090/\"\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
282
282
|
|
|
283
283
|
/***/ }),
|
|
284
284
|
|
|
@@ -1356,7 +1356,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
1356
1356
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1357
1357
|
|
|
1358
1358
|
"use strict";
|
|
1359
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n style: {\n \"height\": \"95vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"table-right\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_tree = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"ol-tree\");\n const _component_el_card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-card\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_card, {\n class: \"tree-left\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ol_tree, (0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)(_ctx.$attrs, {\n onNodeClick: $options.nodeClick,\n uuid: $data.treeUuid\n }), null, 16 /* FULL_PROPS */, [\"onNodeClick\", \"uuid\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [$data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n http: $data.http,\n uuid: $data.uuid,\n onInitOk: $options.initOk\n }, null, 8 /* PROPS */, [\"http\", \"uuid\", \"onInitOk\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 95vh\\\">\\r\\n <model-index :http=\\\"http\\\" :uuid=\\\"uuid\\\"/>\\r\\n </div>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <cp-image></cp-image>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 100vh\\\">\\r\\n <div style=\\\"height: 100%\\\">\\r\\n <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree v-bind=\\\"$attrs\\\" @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" v-if=\\\"uuid\\\" :uuid=\\\"uuid\\\" @initOk=\\\"initOk\\\">\\r\\n <!– <template #headerLeftLeft_t1>\\r\\n 工具栏按钮左边左边\\r\\n </template>\\r\\n <template #headerLeftRight_t1>\\r\\n 工具栏按钮左边右边\\r\\n </template>\\r\\n <template #headerRightLeft_t1>\\r\\n 工具栏按钮右边左边\\r\\n </template>\\r\\n <template #headerRightRight_t1>\\r\\n 工具栏按钮右边右边\\r\\n </template>\\r\\n <template #operateLeft_t1>\\r\\n 操作栏左边\\r\\n </template>\\r\\n <template #operateRight_t1>\\r\\n 操作栏右边\\r\\n </template>\\r\\n <template #pageLeft_t1>\\r\\n 分页栏左边\\r\\n </template>\\r\\n <template #pageRight_t1>\\r\\n 分页栏右边\\r\\n </template>–>\\r\\n </model-index>\\r\\n </div>\\r\\n </div>\\r\\n <!– <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>\\r\\n </div>–>\\r\\n </div>\\r\\n <!–\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>–>\\r\\n <!–<db-index></db-index>–>\\r\\n <div style=\\\"height: calc(100vh - 30px);background-color: #00000014\\\">\\r\\n\\r\\n <!– <el-upload\\r\\n ref=\\\"uploadRef\\\"\\r\\n :action=\\\"action\\\"\\r\\n :show-file-list=\\\"false\\\"\\r\\n :on-success=\\\"Change\\\"\\r\\n >\\r\\n <el-button type=\\\"primary\\\">上传预览</el-button>\\r\\n </el-upload>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <model-index uuid=\\\"1787766229951041536\\\"/>\\r\\n </div>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <ol-table-search v-if=\\\"formConfig\\\" :formConfig=\\\"formConfig\\\"></ol-table-search>\\r\\n <model-index uuid=\\\"1749619280421036032\\\" ref=\\\"oTable\\\" @initOk=\\\"initOk\\\"/>\\r\\n </div>–>\\r\\n </div>\")], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);\n}\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1359
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n style: {\n \"height\": \"95vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"table-right\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_tree = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"ol-tree\");\n const _component_el_card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-card\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_card, {\n class: \"tree-left\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ol_tree, (0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)(_ctx.$attrs, {\n onNodeClick: $options.nodeClick,\n uuid: $data.treeUuid\n }), null, 16 /* FULL_PROPS */, [\"onNodeClick\", \"uuid\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [$data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n http: $data.http,\n paneSize: {\n minSize: 20,\n maxSize: 80,\n left: 80\n },\n uuid: $data.uuid,\n onInitOk: $options.initOk\n }, null, 8 /* PROPS */, [\"http\", \"uuid\", \"onInitOk\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 95vh\\\">\\r\\n <model-index :http=\\\"http\\\" :uuid=\\\"uuid\\\"/>\\r\\n </div>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <cp-image></cp-image>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 100vh\\\">\\r\\n <div style=\\\"height: 100%\\\">\\r\\n <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree v-bind=\\\"$attrs\\\" @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" v-if=\\\"uuid\\\" :uuid=\\\"uuid\\\" @initOk=\\\"initOk\\\">\\r\\n <!– <template #headerLeftLeft_t1>\\r\\n 工具栏按钮左边左边\\r\\n </template>\\r\\n <template #headerLeftRight_t1>\\r\\n 工具栏按钮左边右边\\r\\n </template>\\r\\n <template #headerRightLeft_t1>\\r\\n 工具栏按钮右边左边\\r\\n </template>\\r\\n <template #headerRightRight_t1>\\r\\n 工具栏按钮右边右边\\r\\n </template>\\r\\n <template #operateLeft_t1>\\r\\n 操作栏左边\\r\\n </template>\\r\\n <template #operateRight_t1>\\r\\n 操作栏右边\\r\\n </template>\\r\\n <template #pageLeft_t1>\\r\\n 分页栏左边\\r\\n </template>\\r\\n <template #pageRight_t1>\\r\\n 分页栏右边\\r\\n </template>–>\\r\\n </model-index>\\r\\n </div>\\r\\n </div>\\r\\n <!– <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>\\r\\n </div>–>\\r\\n </div>\\r\\n <!–\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>–>\\r\\n <!–<db-index></db-index>–>\\r\\n <div style=\\\"height: calc(100vh - 30px);background-color: #00000014\\\">\\r\\n\\r\\n <!– <el-upload\\r\\n ref=\\\"uploadRef\\\"\\r\\n :action=\\\"action\\\"\\r\\n :show-file-list=\\\"false\\\"\\r\\n :on-success=\\\"Change\\\"\\r\\n >\\r\\n <el-button type=\\\"primary\\\">上传预览</el-button>\\r\\n </el-upload>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <model-index uuid=\\\"1787766229951041536\\\"/>\\r\\n </div>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <ol-table-search v-if=\\\"formConfig\\\" :formConfig=\\\"formConfig\\\"></ol-table-search>\\r\\n <model-index uuid=\\\"1749619280421036032\\\" ref=\\\"oTable\\\" @initOk=\\\"initOk\\\"/>\\r\\n </div>–>\\r\\n </div>\")], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);\n}\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1360
1360
|
|
|
1361
1361
|
/***/ }),
|
|
1362
1362
|
|
|
@@ -12775,7 +12775,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12775
12775
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12776
12776
|
|
|
12777
12777
|
"use strict";
|
|
12778
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\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/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_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{{?([^{}]+)\\}}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: true\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.close();\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n close() {\n this.state.dialogVisible = false;\n this.$emit('emits', {});\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n getChineseMonth(monthIndex) {\n const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];\n return monthNames[monthIndex] || `${monthIndex + 1}月`;\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n this.setDepRoleDefault(column);\n if (column.selectDom === '11') {\n let slotObj = {\n slotName: column.prop,\n type: column.type,\n format: column.format,\n valueFormat: column.valueFormat\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n } else {\n this.state.saveUrl = undefined;\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n // 设置订单号\n for (const column of data.form.column) {\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n onDateChange(val, field) {\n if (typeof this.dynamicSlotsField[field].change === 'function') {\n this.dynamicSlotsField[field].change(val); //字段数据更新回调\n }\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12778
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\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/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_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{{?([^{}]+)\\}}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: true\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.close();\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n close() {\n this.state.dialogVisible = false;\n this.$emit('emits', {});\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n getChineseMonth(monthIndex) {\n const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];\n return monthNames[monthIndex] || `${monthIndex + 1}月`;\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n async initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n if (column.value != undefined) {\n this.formData[column.prop] = column.value;\n }\n console.log(column.value);\n this.setDepRoleDefault(column);\n if (column.selectDom === '11') {\n let slotObj = {\n slotName: column.prop,\n type: column.type,\n format: column.format,\n valueFormat: column.valueFormat\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n } else {\n this.state.saveUrl = undefined;\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n await this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n onDateChange(val, field) {\n if (typeof this.dynamicSlotsField[field].change === 'function') {\n this.dynamicSlotsField[field].change(val); //字段数据更新回调\n }\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12779
12779
|
|
|
12780
12780
|
/***/ }),
|
|
12781
12781
|
|
package/olp-table.umd.js
CHANGED
|
@@ -278,7 +278,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
278
278
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
279
279
|
|
|
280
280
|
"use strict";
|
|
281
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! element-plus/dist/index.css */ \"./node_modules/element-plus/dist/index.css\");\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smallwei/avue/lib/index.css */ \"./node_modules/@smallwei/avue/lib/index.css\");\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vxe-table/lib/style.css */ \"./node_modules/vxe-table/lib/style.css\");\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/auto-height/index.vue */ \"./src/components/auto-height/index.vue\");\n/* harmony import */ var _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/index.vue */ \"./src/components/tree/index.vue\");\n/* harmony import */ var _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtil */ \"./src/utils/http/httpUtil.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/ol-dialog-upload-file.vue */ \"./src/components/ol-dialog-upload-file.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_7__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_8__.storeDictType)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n components: {\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n OlDialogUploadFile: _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n OlTree: _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AutoHeight: _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n provide() {\n return {\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n tableAll: this.table\n };\n },\n data() {\n return {\n uuid: '
|
|
281
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! element-plus/dist/index.css */ \"./node_modules/element-plus/dist/index.css\");\n/* harmony import */ var element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_plus_dist_index_css__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @smallwei/avue/lib/index.css */ \"./node_modules/@smallwei/avue/lib/index.css\");\n/* harmony import */ var _smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smallwei_avue_lib_index_css__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vxe-table/lib/style.css */ \"./node_modules/vxe-table/lib/style.css\");\n/* harmony import */ var vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vxe_table_lib_style_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/auto-height/index.vue */ \"./src/components/auto-height/index.vue\");\n/* harmony import */ var _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/index.vue */ \"./src/components/tree/index.vue\");\n/* harmony import */ var _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtil */ \"./src/utils/http/httpUtil.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/ol-dialog-upload-file.vue */ \"./src/components/ol-dialog-upload-file.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_7__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_8__.storeDictType)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n components: {\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n OlDialogUploadFile: _components_ol_dialog_upload_file_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n OlTree: _components_tree_index_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AutoHeight: _components_auto_height_index_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n },\n provide() {\n return {\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n tableAll: this.table\n };\n },\n data() {\n return {\n uuid: '2034875354140880896',\n treeUuid: '1815551679408418816',\n table: {},\n http: _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n formConfig: undefined\n };\n },\n methods: {\n nodeClick(e) {\n console.log(e);\n this.uuid = undefined;\n this.$nextTick(() => {\n this.uuid = e.uuid;\n });\n },\n initOk({\n theme,\n table,\n customerForm\n }) {\n if (theme == 't1') {\n this.formConfig = table.formConfig; //给原有的自定义搜索\n //customerForm();//执行自定义表单,这个方法会隐藏table的表单,隐藏搜索按钮\n }\n console.log(this.formConfig);\n },\n //主子表更新或者保存\n testSave() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n mianColumnAndValueMap: {\n id: '1231564546',\n name: '韦邦杠',\n sex: ''\n },\n //保存主表的数据{表字段:value}\n //mainGenIdMap:{id: 'uuid'} //主表要自动生成的唯一字段 如果没有 可以忽略\n mainTableKey: ['code'],\n //主表的唯一字段\n subTables: [{\n subTableName: 'sys_dict_data',\n //子表名称\n subColumnAndValueList: [{\n dict_code: 'test_code_2',\n dict_value: '1',\n dict_label: 'label'\n }],\n //子表子主表的数据\n subGenIdMap: {\n id: 'uuid'\n },\n //子表要自动生成的唯一字段 如果没有 可以忽略\n subTableKey: ['id'],\n //子表的唯一字段\n subForeignKey: {\n 'code': 'dict_type'\n },\n //表的关联key,这里框架自动复制 {主表字段,子表的字段}\n subDeleteMapWhere: {}\n }]\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/saveMainAndSubs\", params);\n },\n //主子表删除\n testDelete() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n subTableName: 'sys_dict_data',\n //子表名称\n whereMap: {\n id: 'test_code'\n },\n //主表删除条件\n subForeignKey: {\n 'id': 'parent_id'\n } ////表的关联key,{主表字段,子表的字段}\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/deleteMainAndSubs\", params);\n },\n //单表更新\n updateOne() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n columnAndValueMap: {\n code: 'test_code',\n sex: 'xxx'\n },\n //更新字段\n whereMap: {\n code: 'test_code'\n } //更新条件\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/modify\", params);\n },\n //单表批量更新\n updateBatch() {\n let params = {\n dbName: 'online',\n //数据库名称\n tableName: 'sys_dict_type',\n //主表名称\n list: [{\n columnAndValueMap: {\n code: 'test_code'\n },\n //更新字段\n whereMap: {\n code: 'test_code'\n }\n } //更新条件}\n ]\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.postAes)(this.http, \"/online/crudAes/batchModify\", params);\n }\n },\n created() {\n dict.refresh(this.http);\n dictType.refresh(this.http);\n window.$onlineHttps = _utils_http_httpUtil__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n //this.testDelete();\n //this.nodeClick({uuid:'1787452516924563456'})\n //window.olpTableAxiosBaseURL = \"http://localhost:48090/\"\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
282
282
|
|
|
283
283
|
/***/ }),
|
|
284
284
|
|
|
@@ -1356,7 +1356,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
1356
1356
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1357
1357
|
|
|
1358
1358
|
"use strict";
|
|
1359
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n style: {\n \"height\": \"95vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"table-right\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_tree = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"ol-tree\");\n const _component_el_card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-card\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_card, {\n class: \"tree-left\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ol_tree, (0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)(_ctx.$attrs, {\n onNodeClick: $options.nodeClick,\n uuid: $data.treeUuid\n }), null, 16 /* FULL_PROPS */, [\"onNodeClick\", \"uuid\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [$data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n http: $data.http,\n uuid: $data.uuid,\n onInitOk: $options.initOk\n }, null, 8 /* PROPS */, [\"http\", \"uuid\", \"onInitOk\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 95vh\\\">\\r\\n <model-index :http=\\\"http\\\" :uuid=\\\"uuid\\\"/>\\r\\n </div>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <cp-image></cp-image>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 100vh\\\">\\r\\n <div style=\\\"height: 100%\\\">\\r\\n <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree v-bind=\\\"$attrs\\\" @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" v-if=\\\"uuid\\\" :uuid=\\\"uuid\\\" @initOk=\\\"initOk\\\">\\r\\n <!– <template #headerLeftLeft_t1>\\r\\n 工具栏按钮左边左边\\r\\n </template>\\r\\n <template #headerLeftRight_t1>\\r\\n 工具栏按钮左边右边\\r\\n </template>\\r\\n <template #headerRightLeft_t1>\\r\\n 工具栏按钮右边左边\\r\\n </template>\\r\\n <template #headerRightRight_t1>\\r\\n 工具栏按钮右边右边\\r\\n </template>\\r\\n <template #operateLeft_t1>\\r\\n 操作栏左边\\r\\n </template>\\r\\n <template #operateRight_t1>\\r\\n 操作栏右边\\r\\n </template>\\r\\n <template #pageLeft_t1>\\r\\n 分页栏左边\\r\\n </template>\\r\\n <template #pageRight_t1>\\r\\n 分页栏右边\\r\\n </template>–>\\r\\n </model-index>\\r\\n </div>\\r\\n </div>\\r\\n <!– <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>\\r\\n </div>–>\\r\\n </div>\\r\\n <!–\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>–>\\r\\n <!–<db-index></db-index>–>\\r\\n <div style=\\\"height: calc(100vh - 30px);background-color: #00000014\\\">\\r\\n\\r\\n <!– <el-upload\\r\\n ref=\\\"uploadRef\\\"\\r\\n :action=\\\"action\\\"\\r\\n :show-file-list=\\\"false\\\"\\r\\n :on-success=\\\"Change\\\"\\r\\n >\\r\\n <el-button type=\\\"primary\\\">上传预览</el-button>\\r\\n </el-upload>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <model-index uuid=\\\"1787766229951041536\\\"/>\\r\\n </div>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <ol-table-search v-if=\\\"formConfig\\\" :formConfig=\\\"formConfig\\\"></ol-table-search>\\r\\n <model-index uuid=\\\"1749619280421036032\\\" ref=\\\"oTable\\\" @initOk=\\\"initOk\\\"/>\\r\\n </div>–>\\r\\n </div>\")], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);\n}\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1359
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n style: {\n \"height\": \"95vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"table-right\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_tree = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"ol-tree\");\n const _component_el_card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-card\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_card, {\n class: \"tree-left\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ol_tree, (0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)(_ctx.$attrs, {\n onNodeClick: $options.nodeClick,\n uuid: $data.treeUuid\n }), null, 16 /* FULL_PROPS */, [\"onNodeClick\", \"uuid\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [$data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n http: $data.http,\n paneSize: {\n minSize: 20,\n maxSize: 80,\n left: 80\n },\n uuid: $data.uuid,\n onInitOk: $options.initOk\n }, null, 8 /* PROPS */, [\"http\", \"uuid\", \"onInitOk\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 95vh\\\">\\r\\n <model-index :http=\\\"http\\\" :uuid=\\\"uuid\\\"/>\\r\\n </div>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <cp-image></cp-image>\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <div style=\\\"height: 100vh\\\">\\r\\n <div style=\\\"height: 100%\\\">\\r\\n <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree v-bind=\\\"$attrs\\\" @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" v-if=\\\"uuid\\\" :uuid=\\\"uuid\\\" @initOk=\\\"initOk\\\">\\r\\n <!– <template #headerLeftLeft_t1>\\r\\n 工具栏按钮左边左边\\r\\n </template>\\r\\n <template #headerLeftRight_t1>\\r\\n 工具栏按钮左边右边\\r\\n </template>\\r\\n <template #headerRightLeft_t1>\\r\\n 工具栏按钮右边左边\\r\\n </template>\\r\\n <template #headerRightRight_t1>\\r\\n 工具栏按钮右边右边\\r\\n </template>\\r\\n <template #operateLeft_t1>\\r\\n 操作栏左边\\r\\n </template>\\r\\n <template #operateRight_t1>\\r\\n 操作栏右边\\r\\n </template>\\r\\n <template #pageLeft_t1>\\r\\n 分页栏左边\\r\\n </template>\\r\\n <template #pageRight_t1>\\r\\n 分页栏右边\\r\\n </template>–>\\r\\n </model-index>\\r\\n </div>\\r\\n </div>\\r\\n <!– <el-card class=\\\"tree-left\\\">\\r\\n <ol-tree @node-click=\\\"nodeClick\\\" :uuid=\\\"treeUuid\\\"></ol-tree>\\r\\n </el-card>\\r\\n <div class=\\\"table-right\\\">\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>\\r\\n </div>–>\\r\\n </div>\\r\\n <!–\\r\\n <model-index :http=\\\"http\\\" uuid=\\\"1787452516924563456\\\"/>–>\\r\\n <!–<db-index></db-index>–>\\r\\n <div style=\\\"height: calc(100vh - 30px);background-color: #00000014\\\">\\r\\n\\r\\n <!– <el-upload\\r\\n ref=\\\"uploadRef\\\"\\r\\n :action=\\\"action\\\"\\r\\n :show-file-list=\\\"false\\\"\\r\\n :on-success=\\\"Change\\\"\\r\\n >\\r\\n <el-button type=\\\"primary\\\">上传预览</el-button>\\r\\n </el-upload>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <model-index uuid=\\\"1787766229951041536\\\"/>\\r\\n </div>–>\\r\\n <!– <div style=\\\"height: 90%;width: 100%;position: relative;float: left\\\">\\r\\n <ol-table-search v-if=\\\"formConfig\\\" :formConfig=\\\"formConfig\\\"></ol-table-search>\\r\\n <model-index uuid=\\\"1749619280421036032\\\" ref=\\\"oTable\\\" @initOk=\\\"initOk\\\"/>\\r\\n </div>–>\\r\\n </div>\")], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */);\n}\n\n//# sourceURL=webpack://olp-table/./src/App.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1360
1360
|
|
|
1361
1361
|
/***/ }),
|
|
1362
1362
|
|
|
@@ -12775,7 +12775,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12775
12775
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12776
12776
|
|
|
12777
12777
|
"use strict";
|
|
12778
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\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/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_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{{?([^{}]+)\\}}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: true\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.close();\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n close() {\n this.state.dialogVisible = false;\n this.$emit('emits', {});\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n getChineseMonth(monthIndex) {\n const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];\n return monthNames[monthIndex] || `${monthIndex + 1}月`;\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n this.setDepRoleDefault(column);\n if (column.selectDom === '11') {\n let slotObj = {\n slotName: column.prop,\n type: column.type,\n format: column.format,\n valueFormat: column.valueFormat\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n } else {\n this.state.saveUrl = undefined;\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n // 设置订单号\n for (const column of data.form.column) {\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n onDateChange(val, field) {\n if (typeof this.dynamicSlotsField[field].change === 'function') {\n this.dynamicSlotsField[field].change(val); //字段数据更新回调\n }\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12778
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\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/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_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{{?([^{}]+)\\}}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: true\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.close();\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n close() {\n this.state.dialogVisible = false;\n this.$emit('emits', {});\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n getChineseMonth(monthIndex) {\n const monthNames = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];\n return monthNames[monthIndex] || `${monthIndex + 1}月`;\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n async initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n if (column.value != undefined) {\n this.formData[column.prop] = column.value;\n }\n console.log(column.value);\n this.setDepRoleDefault(column);\n if (column.selectDom === '11') {\n let slotObj = {\n slotName: column.prop,\n type: column.type,\n format: column.format,\n valueFormat: column.valueFormat\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n } else {\n this.state.saveUrl = undefined;\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n await this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n onDateChange(val, field) {\n if (typeof this.dynamicSlotsField[field].change === 'function') {\n this.dynamicSlotsField[field].change(val); //字段数据更新回调\n }\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12779
12779
|
|
|
12780
12780
|
/***/ }),
|
|
12781
12781
|
|