olp-table 7.2.107 → 7.2.109
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 +14 -14
- package/olp-table.umd.js +14 -14
- package/olp-table.umd.min.js +14 -14
- 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: '2036014937024966656',\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
|
|
|
@@ -388,7 +388,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
|
|
|
388
388
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
389
389
|
|
|
390
390
|
"use strict";
|
|
391
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olDialogTable',\n components: {\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n inject: ['http'],\n props: {\n name: {\n default: undefined\n }\n },\n data() {\n return {\n title: undefined,\n show: false,\n uuid: undefined,\n fullscreen: false,\n width: '80%',\n js: undefined,\n style: 'height:70vh',\n selectionMode: 'multiple',\n // 'single' | 'multiple' | 'none'\n showFooter: true\n };\n },\n computed: {\n https() {\n return this.http;\n }\n },\n methods: {\n init({\n uuid,\n title,\n width,\n height,\n fullscreen,\n js,\n mode = 'multiple'\n }) {\n this.show = true;\n this.uuid = uuid;\n this.js = js;\n if (width) {\n this.width = width;\n }\n this.title = title;\n this.fullscreen = fullscreen == true;\n if (height) {\n this.style = 'height:' + height + \"px\";\n }\n },\n ok() {\n let param = {\n js: this.js\n };\n if (this.$refs.table.theme == 7) {\n
|
|
391
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olDialogTable',\n components: {\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n },\n inject: ['http'],\n props: {\n name: {\n default: undefined\n }\n },\n data() {\n return {\n title: undefined,\n show: false,\n uuid: undefined,\n fullscreen: false,\n width: '80%',\n js: undefined,\n style: 'height:70vh',\n selectionMode: 'multiple',\n // 'single' | 'multiple' | 'none'\n showFooter: true,\n table: {\n queryParams: '',\n tableJs: ''\n }\n };\n },\n computed: {\n https() {\n return this.http;\n }\n },\n methods: {\n init({\n uuid,\n title,\n width,\n height,\n fullscreen,\n js,\n mode = 'multiple',\n queryParam,\n tableJs\n }) {\n this.show = true;\n this.uuid = uuid;\n this.js = js;\n if (width) {\n this.width = width;\n }\n this.table.queryParams = queryParam;\n this.table.tableJs = tableJs;\n this.title = title;\n this.fullscreen = fullscreen == true;\n if (height) {\n this.style = 'height:' + height + \"px\";\n }\n },\n initOk(params) {\n if (this.table.queryParams) {\n params.queryParams(this.table.queryParams);\n }\n },\n ok() {\n let param = {\n js: this.js\n };\n if (this.$refs.table.theme == 7) {\n param['v'] = this.$refs.table.getTableRefs().$refs.t1.getSelectRows();\n } else {\n param['v'] = this.$refs.table.getTableRefs().$refs.tableModel.getSelectRows();\n }\n this.$emit('emits', param);\n },\n cancelEvent() {\n this.show = false;\n this.$emit('emits', {});\n }\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/ol-dialog-table.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");
|
|
392
392
|
|
|
393
393
|
/***/ }),
|
|
394
394
|
|
|
@@ -476,7 +476,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */
|
|
|
476
476
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
477
477
|
|
|
478
478
|
"use strict";
|
|
479
|
-
eval("__webpack_require__.r(__webpack_exports__);\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_map_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: {\n modelValue: {},\n height: {},\n title: {\n default: ''\n },\n size: {},\n describe: {\n default: ''\n }\n },\n data() {\n return {\n formData: {\n // olTableSelect: {\n // uuid: \"1901841070608990208\",\n // key: \"id\",\n // label: \"name\",\n // labelIsAppendCode: false,\n // otherResult: \"name原:name,age:age,sex:sex\"\n // }\n },\n defaultData: {\n \"olTableSelect\": {\n \"uuid\": \"
|
|
479
|
+
eval("__webpack_require__.r(__webpack_exports__);\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_map_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: {\n modelValue: {},\n height: {},\n title: {\n default: ''\n },\n size: {},\n describe: {\n default: ''\n }\n },\n data() {\n return {\n formData: {\n // olTableSelect: {\n // uuid: \"1901841070608990208\",\n // key: \"id\",\n // label: \"name\",\n // labelIsAppendCode: false,\n // otherResult: \"name原:name,age:age,sex:sex\"\n // }\n },\n defaultData: {\n \"olTableSelect\": {\n \"uuid\": \"\",\n \"key\": \"\",\n \"label\": \"\",\n \"labelIsAppendCode\": false,\n \"otherResult\": \"\"\n }\n },\n fieldMappings: [],\n selectMappings: [],\n state: {\n show: false,\n values: null,\n err: false\n }\n };\n },\n computed: {\n formattedJson() {\n return JSON.stringify(this.formData, null, 2);\n },\n values: {\n get() {\n return this.modelValue;\n },\n set(value) {\n this.$emit(\"update:modelValue\", value);\n }\n }\n },\n created() {\n if (this.modelValue) {\n this.formData = JSON.parse(this.modelValue);\n this.parseOtherResult();\n }\n },\n methods: {\n generateJson() {\n // 更新 otherResult 字段\n this.formData.olTableSelect.otherResult = this.fieldMappings.filter(m => m.target).map(m => {\n if (m.source && m.target) {\n return `${m.target}:${m.source}`; // 格式: 目标:源\n } else if (m.target) {\n return `${m.target}`; // 仅目标\n }\n return ''; // 理论上不会走到这里(因为 filter 已过滤)\n }).join(',');\n this.formData.olTableSelect.queryParams = this.selectMappings.filter(m => m.target).map(m => {\n if (m.source && m.target) {\n return `${m.target}:${m.source}`; // 格式: 目标:源\n } else if (m.target) {\n return `${m.target}`; // 仅目标\n }\n return ''; // 理论上不会走到这里(因为 filter 已过滤)\n }).join(',');\n },\n handleClick() {\n if (!this.modelValue) {\n this.formData = this.defaultData;\n this.parseOtherResult();\n }\n this.state.show = true;\n },\n parseOtherResult() {\n const otherResult = this.formData.olTableSelect.otherResult || '';\n const mappings = otherResult.split(',');\n this.fieldMappings = mappings.map(item => {\n // const [source, target] = item.split(':');\n // return {source, target};\n const [target, source] = item.split(':');\n return {\n target,\n source\n };\n });\n const queryParams = this.formData.olTableSelect.queryParams || '';\n this.selectMappings = queryParams.split(',').map(item => {\n // const [source, target] = item.split(':');\n // return {source, target};\n const [target, source] = item.split(':');\n return {\n target,\n source\n };\n });\n },\n addMapping(key) {\n this[key].push({\n source: '',\n target: ''\n });\n },\n removeMapping(key, index) {\n this[key].splice(index, 1);\n },\n confirm() {\n this.generateJson();\n this.state.show = false;\n this.values = this.formattedJson;\n console.info('confirm', this.values);\n this.$emit(\"confirm\", this.values);\n },\n onOpen() {\n this.$emit(\"open\");\n }\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/ol-table-select-config.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");
|
|
480
480
|
|
|
481
481
|
/***/ }),
|
|
482
482
|
|
|
@@ -696,7 +696,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
696
696
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
697
697
|
|
|
698
698
|
"use strict";
|
|
699
|
-
eval("__webpack_require__.r(__webpack_exports__);\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 _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_columnIndex_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/columnIndex.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTableColumnConfig',\n inject: ['http'],\n components: {\n ColumnIndex: _components_table_ol_table_components_ol_table_column_config_columnIndex_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n data() {\n return {\n uuid: '',\n show: false,\n loading: true\n };\n },\n methods: {\n cancelClick() {\n this.show = false;\n },\n confirmClick() {\n let gridOptions = this.$refs.columnIndex.gridOptions;\n let datas = [];\n for (let data of gridOptions.data) {\n let o = {\n id: data.id,\n visible: data.visible == 1 ? 1 : 0\n };\n for (let j = 2; j < gridOptions.columns.length; j++) {\n let column = gridOptions.columns[j];\n o[column.field] = data[column.field];\n if (column.field.indexOf(\"ToOtherProp\") != -1) {\n data.otherProp[column.field] = data[column.field];\n o.otherProp = data.otherProp;\n }\n }\n delete o.groupTotalToOtherProp;\n if (o.fixed == 'left') {\n o.fixed = 1;\n } else if (o.fixed == 'right') {\n o.fixed = 2;\n }\n datas.push(o);\n }\n let i = 1;\n for (let data1 of datas) {\n i++;\n data1.sort = i;\n if (data1.otherProp) {\n data1.otherProp = JSON.stringify(data1.otherProp);\n }\n }\n datas[0].uuid =
|
|
699
|
+
eval("__webpack_require__.r(__webpack_exports__);\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 _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_columnIndex_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/columnIndex.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTableColumnConfig',\n inject: ['http'],\n components: {\n ColumnIndex: _components_table_ol_table_components_ol_table_column_config_columnIndex_vue__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n },\n data() {\n return {\n uuid: '',\n show: false,\n loading: true,\n theme: ''\n };\n },\n methods: {\n cancelClick() {\n this.show = false;\n },\n confirmClick() {\n let gridOptions = this.$refs.columnIndex.gridOptions;\n let datas = [];\n for (let data of gridOptions.data) {\n let o = {\n id: data.id,\n visible: data.visible == 1 ? 1 : 0\n };\n for (let j = 2; j < gridOptions.columns.length; j++) {\n let column = gridOptions.columns[j];\n o[column.field] = data[column.field];\n if (column.field.indexOf(\"ToOtherProp\") != -1) {\n data.otherProp[column.field] = data[column.field];\n o.otherProp = data.otherProp;\n }\n }\n delete o.groupTotalToOtherProp;\n if (o.fixed == 'left') {\n o.fixed = 1;\n } else if (o.fixed == 'right') {\n o.fixed = 2;\n }\n datas.push(o);\n }\n let i = 1;\n for (let data1 of datas) {\n i++;\n data1.sort = i;\n if (data1.otherProp) {\n data1.otherProp = JSON.stringify(data1.otherProp);\n }\n }\n datas[0].uuid = this.uuid;\n datas[0].theme = this.theme;\n this.loading = true;\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_1__.put)(this.http, '/online/tableConfigColumn/editBatch', datas).then(res => {\n if (res) {\n this.$emit('ok');\n this.show = false;\n }\n }).finally(() => {\n this.loading = false;\n });\n },\n copyTextToClipboard(text) {\n navigator.clipboard.writeText(text).then(() => {\n console.log('Text copied to clipboard');\n }).catch(err => {\n console.error('Failed to copy text: ', err);\n });\n },\n open(tableConfig, id, columns) {\n this.show = true;\n this.loading = true;\n this.uuid = id;\n this.theme = tableConfig.theme;\n this.$nextTick(() => {\n this.$refs.columnIndex.init(tableConfig, JSON.parse(JSON.stringify(columns)));\n this.loading = false;\n });\n }\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-table/components/ol-table-column-config/index.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");
|
|
700
700
|
|
|
701
701
|
/***/ }),
|
|
702
702
|
|
|
@@ -729,7 +729,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
729
729
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
730
730
|
|
|
731
731
|
"use strict";
|
|
732
|
-
eval("__webpack_require__.r(__webpack_exports__);\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_find_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin */ \"./src/mixins/VTMixin/index.js\");\n/* harmony import */ var _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-table-operate */ \"./src/components/table/ol-table-operate/index.vue\");\n/* harmony import */ var _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/ol-pager */ \"./src/components/table/ol-pager/index.vue\");\n/* harmony import */ var _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/index.vue\");\n/* harmony import */ var _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/table/ol-table-tool-btn/index.vue */ \"./src/components/table/ol-table-tool-btn/index.vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-dict-color/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-dict-color/index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/table/ol-main-form-sub-table/index.vue */ \"./src/components/table/ol-main-form-sub-table/index.vue\");\n/* harmony import */ var _store_permi__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/store/permi */ \"./src/store/permi.js\");\n/* harmony import */ var _utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/utils/filterUtil */ \"./src/utils/filterUtil.js\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-dialog-table.vue */ \"./src/components/ol-dialog-table.vue\");\n\n\n\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)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\nconst permi = (0,_store_permi__WEBPACK_IMPORTED_MODULE_16__.storePermi)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n props: {\n theme: {\n type: String\n },\n initDataSource: {\n default: true\n }\n },\n mixins: [_mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__.OTMixin],\n components: {\n OlDialogTable: _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n OlMainFormSubTable: _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n OlTableColumnDictColor: _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Delete: _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__.Delete,\n OlTableToolBtn: _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n OlTableColumnConfig: _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n olTableOperate: _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n olPager: _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n olForm: _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Icon: _components_Icon__WEBPACK_IMPORTED_MODULE_18__.Icon\n },\n data() {\n return {\n uuid: this.$attrs.uuid,\n videoDialogVisible: false,\n currentVideoSrc: '',\n selectTable: {\n config: {\n uuid: ''\n }\n }\n };\n },\n methods: {\n showToolName(code) {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return true;\n }\n }\n return false;\n },\n isOpenSelectTable(column) {\n const columnSource = this.table.columnSource.find(o => o.field === column.field);\n if (!(columnSource.editDisplay === '1' || columnSource.addDisplay === '1')) {\n return false; //如果不是可编辑字段,那么返回\n }\n if (!columnSource.tableSelectConfToOtherProp) {\n return false;\n }\n if (!JSON.parse(columnSource.tableSelectConfToOtherProp)?.olTableSelect) {\n return false;\n }\n return true;\n },\n openSelectTable(column, row) {\n this.selectTable.config = {\n uuid: ''\n };\n\n // console.group('表格选取')\n // console.info('column', column)\n // console.info('columnSource', this.table.columnSource)\n // console.info('原始column', this.table.columnSource.find(o=>o.field === column.field))\n // console.info('row', row)\n // console.info('column.params', column.params)\n this.selectTable.column = column;\n this.selectTable.rowData = row;\n this.selectTable.config = JSON.parse(column.params.tableSelectConfToOtherProp).olTableSelect;\n /** 打开表格选取窗口 **/\n this.$refs.selectTableDialogRef.init({\n uuid: this.selectTable.config.uuid,\n title: '选择数据'\n });\n },\n getSelectRowChangeButClick(p) {\n const {\n js,\n v\n } = p; //v是选中的数据对象\n if (!v) {\n return;\n }\n const sourceRowData = v[0];\n\n /*赋值逻辑*/\n //字典回显\n this.selectTable.column.params.tableDataObj[sourceRowData[this.selectTable.config.key]] = sourceRowData[this.selectTable.config.label];\n let rowData = JSON.parse(JSON.stringify(this.selectTable.rowData));\n const otherResult = this.selectTable.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({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n //给其他字段赋值\n otherResultArray.forEach(item => {\n this.selectTable.rowData[item.targetField] = sourceRowData[item.sourceField];\n });\n }\n let params = this.getDifferingProperties(this.selectTable.rowData, rowData);\n if (this.selectTable.rowData[this.tableConfig.cardKey]) {\n if (Object.keys(params).length != 0) {\n this.doPostAes(null, '/online/crudAes/modify', {\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n columnAndValueMap: params,\n whereMap: this.doGetWhereMap(this.selectTable.rowData, this.tableConfig.cardKey)\n });\n }\n }\n this.$refs.selectTableDialogRef.cancelEvent(); //关闭表格选取弹窗\n },\n getFiledName: _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n getSelectTableValue(column, row, isClick) {\n let cellValue = row[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(column)];\n let v = this.getPKArrays(cellValue);\n\n // if(column.field==='creator'){\n // console.info('----------------------')\n // console.info('column',column)\n // console.info('row',row)\n // console.info('cellValue',cellValue)\n // console.info('v',v)\n // console.info('tableDataObj',column.params.tableDataObj)\n // }\n\n let labels = '';\n for (let k of v) {\n if (!column.params.tableDataObj) {\n continue;\n }\n let d = column.params.tableDataObj[k];\n if (d != undefined) {\n if (labels.length > 0) {\n labels += \",\";\n }\n labels += column.params.tableDataObj[k];\n }\n }\n if (!isClick) {\n return labels || cellValue;\n }\n return labels || \"请选择\";\n },\n handleClose() {\n this.selectRowChange();\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n openVideoDialog(src) {\n this.currentVideoSrc = src;\n this.videoDialogVisible = true;\n },\n preventOriginalPlay(player) {\n player.pause();\n },\n filterFields() {},\n initFilterValues() {},\n handleFilter() {},\n handleReset() {}\n },\n mounted() {\n setTimeout(() => {\n this.updateSort();\n }, 500);\n },\n created() {\n // 注册筛选器\n (0,_utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__.registerFilterRenderer)(this.theme);\n dict.init();\n dictType.init();\n permi.init();\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-table/index.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");
|
|
732
|
+
eval("__webpack_require__.r(__webpack_exports__);\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_find_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin */ \"./src/mixins/VTMixin/index.js\");\n/* harmony import */ var _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-table-operate */ \"./src/components/table/ol-table-operate/index.vue\");\n/* harmony import */ var _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/ol-pager */ \"./src/components/table/ol-pager/index.vue\");\n/* harmony import */ var _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/index.vue\");\n/* harmony import */ var _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/table/ol-table-tool-btn/index.vue */ \"./src/components/table/ol-table-tool-btn/index.vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-dict-color/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-dict-color/index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/table/ol-main-form-sub-table/index.vue */ \"./src/components/table/ol-main-form-sub-table/index.vue\");\n/* harmony import */ var _store_permi__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/store/permi */ \"./src/store/permi.js\");\n/* harmony import */ var _utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/utils/filterUtil */ \"./src/utils/filterUtil.js\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-dialog-table.vue */ \"./src/components/ol-dialog-table.vue\");\n\n\n\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)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\nconst permi = (0,_store_permi__WEBPACK_IMPORTED_MODULE_16__.storePermi)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n props: {\n theme: {\n type: String\n },\n initDataSource: {\n default: true\n }\n },\n mixins: [_mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__.OTMixin],\n components: {\n OlDialogTable: _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n OlMainFormSubTable: _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n OlTableColumnDictColor: _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Delete: _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__.Delete,\n OlTableToolBtn: _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n OlTableColumnConfig: _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n olTableOperate: _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n olPager: _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n olForm: _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Icon: _components_Icon__WEBPACK_IMPORTED_MODULE_18__.Icon\n },\n data() {\n return {\n uuid: this.$attrs.uuid,\n videoDialogVisible: false,\n currentVideoSrc: '',\n selectTable: {\n config: {\n uuid: ''\n }\n }\n };\n },\n methods: {\n showToolName(code) {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return true;\n }\n }\n return false;\n },\n isOpenSelectTable(column) {\n const columnSource = this.table.columnSource.find(o => o.field === column.field);\n if (!(columnSource.editDisplay === '1' || columnSource.addDisplay === '1')) {\n return false; //如果不是可编辑字段,那么返回\n }\n if (!columnSource.tableSelectConfToOtherProp) {\n return false;\n }\n if (!JSON.parse(columnSource.tableSelectConfToOtherProp)?.olTableSelect) {\n return false;\n }\n return true;\n },\n openSelectTable(column, row) {\n this.selectTable.config = {\n uuid: ''\n };\n\n // console.group('表格选取')\n // console.info('column', column)\n // console.info('columnSource', this.table.columnSource)\n // console.info('原始column', this.table.columnSource.find(o=>o.field === column.field))\n // console.info('row', row)\n // console.info('column.params', column.params)\n this.selectTable.column = column;\n this.selectTable.rowData = row;\n this.selectTable.config = JSON.parse(column.params.tableSelectConfToOtherProp).olTableSelect;\n const queryParams = this.selectTable.config.queryParams; //返回额外参数字段配置\n let queryParam = {};\n if (queryParams !== null && queryParams !== undefined && queryParams !== '') {\n let otherResultArray = [];\n queryParams.split(\",\").forEach(m => {\n let k = m.split(\":\");\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n //给其他字段赋值\n otherResultArray.forEach(item => {\n queryParam[item.targetField] = row[item.sourceField];\n });\n }\n /** 打开表格选取窗口 **/\n this.$refs.selectTableDialogRef.init({\n uuid: this.selectTable.config.uuid,\n title: '选择数据',\n queryParam: queryParam\n });\n },\n getSelectRowChangeButClick(p) {\n const {\n js,\n v\n } = p; //v是选中的数据对象\n if (!v) {\n return;\n }\n const sourceRowData = v[0];\n\n /*赋值逻辑*/\n //字典回显\n this.selectTable.column.params.tableDataObj[sourceRowData[this.selectTable.config.key]] = sourceRowData[this.selectTable.config.label];\n let rowData = JSON.parse(JSON.stringify(this.selectTable.rowData));\n const otherResult = this.selectTable.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({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n //给其他字段赋值\n otherResultArray.forEach(item => {\n this.selectTable.rowData[item.targetField] = sourceRowData[item.sourceField];\n });\n }\n let params = this.getDifferingProperties(this.selectTable.rowData, rowData);\n if (this.selectTable.rowData[this.tableConfig.cardKey]) {\n if (Object.keys(params).length != 0) {\n this.doPostAes(null, '/online/crudAes/modify', {\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n columnAndValueMap: params,\n whereMap: this.doGetWhereMap(this.selectTable.rowData, this.tableConfig.cardKey)\n });\n }\n }\n this.$refs.selectTableDialogRef.cancelEvent(); //关闭表格选取弹窗\n },\n getFiledName: _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n getSelectTableValue(column, row, isClick) {\n let cellValue = row[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(column)];\n let v = this.getPKArrays(cellValue);\n\n // if(column.field==='creator'){\n // console.info('----------------------')\n // console.info('column',column)\n // console.info('row',row)\n // console.info('cellValue',cellValue)\n // console.info('v',v)\n // console.info('tableDataObj',column.params.tableDataObj)\n // }\n\n let labels = '';\n for (let k of v) {\n if (!column.params.tableDataObj) {\n continue;\n }\n let d = column.params.tableDataObj[k];\n if (d != undefined) {\n if (labels.length > 0) {\n labels += \",\";\n }\n labels += column.params.tableDataObj[k];\n }\n }\n if (!isClick) {\n return labels || cellValue;\n }\n return labels || \"请选择\";\n },\n handleClose() {\n this.selectRowChange();\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n openVideoDialog(src) {\n this.currentVideoSrc = src;\n this.videoDialogVisible = true;\n },\n preventOriginalPlay(player) {\n player.pause();\n },\n filterFields() {},\n initFilterValues() {},\n handleFilter() {},\n handleReset() {}\n },\n mounted() {\n setTimeout(() => {\n this.updateSort();\n }, 500);\n },\n created() {\n // 注册筛选器\n (0,_utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__.registerFilterRenderer)(this.theme);\n dict.init();\n dictType.init();\n permi.init();\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-table/index.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");
|
|
733
733
|
|
|
734
734
|
/***/ }),
|
|
735
735
|
|
|
@@ -938,7 +938,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
938
938
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
939
939
|
|
|
940
940
|
"use strict";
|
|
941
|
-
eval("__webpack_require__.r(__webpack_exports__);\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_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vxe-table */ \"vxe-table\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vxe_table__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var xe_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! xe-utils */ \"./node_modules/xe-utils/index.js\");\n/* harmony import */ var xe_utils__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(xe_utils__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _views_table_add_or_edit_config_column_config_header_config_vue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/views/table/add-or-edit/config/column-config/header-config.vue */ \"./src/views/table/add-or-edit/config/column-config/header-config.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_dialog_tagForm_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/ol-dialog-tagForm.vue */ \"./src/components/ol-dialog-tagForm.vue\");\n/* harmony import */ var _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/ol-table-select-config.vue */ \"./src/components/ol-table-select-config.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n props: {\n addVisible: {},\n editVisible: {},\n isTable: {\n default: true,\n type: Boolean\n }\n },\n emits: ['checkBoxChange'],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const show = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)(false);\n const vexGridRef = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)();\n const headerConfig = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)();\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_10__.storeDict)();\n const dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_11__.storeDictType)();\n function setShow(value) {\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.nextTick)(() => {\n show.value = value;\n updateSort();\n setCardColumnVisible();\n });\n }\n function setGroupByMin() {\n gridOptions.data.forEach(item => {\n if (item.groupToOtherProp != 1 && !item.groupTotalToOtherProp) {\n item.groupTotalToOtherProp = 'sum';\n }\n });\n }\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_5__.inject)('http');\n dict.init(http);\n dictType.init(http);\n function headerConfigShow() {\n if (gridOptions.data) {\n let d = gridOptions.groupColumns ? gridOptions.groupColumns : gridOptions.data;\n headerConfig.value.setColumn(d);\n }\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.watch)(props, () => {\n for (let column of gridOptions.columns) {\n if (column.prop == 'addDisplay' || column.field == 'addDisplay') {\n if (!column.visible && props.addVisible) {\n checkBoxAllChange(column.field);\n }\n column.visible = props.addVisible;\n }\n if (column.prop == 'editDisplay' || column.field == 'editDisplay') {\n if (!column.visible && props.editVisible) {\n checkBoxAllChange(column.field);\n }\n column.visible = props.editVisible;\n }\n }\n if (show.value) {\n vexGridRef.value.loadColumn(gridOptions.columns);\n }\n }, {\n deep: true\n });\n const checkBoxAllChange = field => {\n emits('checkBoxAll', {\n checkBoxName: field == 'editDisplay' ? 'edit' : 'add',\n isAll: true,\n list: gridOptions.data.filter(row => row[field] == '1')\n });\n };\n const setCardColumnVisible = () => {\n let field = ['tableSaveToOtherProp', 'totalToOtherProp', 'groupTotalToOtherProp', 'groupToOtherProp', 'mergeFlag', 'columnAuth', 'width', 'resizable', 'spanSEARCHToOtherProp', 'totalToOtherProp'];\n for (let column of gridOptions.columns) {\n if (field.includes(column.field)) {\n column.visible = props.isTable;\n }\n // 标签配置只有card配置才显示\n if ('tagJsonToOtherProp' === column.field) {\n column.visible = !props.isTable;\n }\n }\n };\n //表头全选框更新\n const headerClick = column => {\n if (column.field != 'columnAuth' && column.field == 'visible') {\n let columnField = vexGridRef.value.getColumnByField('columnAuth');\n columnField.params.all = column.params.all;\n headerClick(columnField);\n }\n gridOptions.data.forEach(item => {\n item[column.field] = column.params.all ? '1' : '0';\n });\n if (column.params.all == '0') {\n //全不选的时候\n if (column.field == 'addDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"add\",\n isAll: false,\n list: gridOptions.data\n });\n } else if (column.field == 'editDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"edit\",\n isAll: false,\n list: gridOptions.data\n });\n }\n } else if (column.params.all == '1') {\n //全选\n if (column.field == 'addDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"add\",\n isAll: true,\n list: gridOptions.data\n });\n } else if (column.field == 'editDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"edit\",\n isAll: true,\n list: gridOptions.data\n });\n }\n }\n };\n //表格多选框更新\n const checkBoxClick = (column, row) => {\n emits(\"checkBoxChange\", {\n row: row,\n column: column\n });\n if (column.field != 'columnAuth' && column.field == 'visible') {\n let columnField = vexGridRef.value.getColumnByField('columnAuth');\n row.columnAuth = row.visible;\n checkBoxClick(columnField, row);\n }\n let f = true;\n gridOptions.data.forEach(item => {\n if (item[column.field] != '1') {\n f = false;\n }\n });\n column.params.all = f;\n };\n\n //拿到数据\n const setData = (data, data2) => {\n console.log(data2);\n gridOptions.groupColumns = data2;\n if (!data) {\n return;\n }\n gridOptions.data = data;\n //查看多选框是否多选\n gridOptions.columns.forEach(item => {\n if (item.slots && item.slots.default == \"checkedBox_default\") {\n //默认全选状态\n let flag = gridOptions.data.length > 0;\n gridOptions.data.forEach(row => {\n if (row[item.field] != \"1\") {\n //有某个参数没选择则不是全选的状态\n flag = false;\n }\n });\n item.params.all = flag;\n }\n });\n };\n\n // 移除指定 field 的分组列(第一段代码封装)\n const handleRemoveGroupColumn = row => {\n if (hasGroupColChange()) {\n gridOptions.groupColumns = gridOptions.groupColumns.map(group => {\n if (group.children) {\n return {\n ...group,\n children: group.children.filter(child => child.field !== row.field)\n };\n }\n return group;\n }).filter(group => {\n if (group.children) {\n return group.children.length > 0;\n }\n return group.field !== row.field;\n });\n }\n };\n const hasGroupColChange = () => {\n return props.isTable && gridOptions.groupColumns?.length > 0;\n };\n\n // 添加新按钮到分组列(第二段代码封装)\n const handleAddGroupColumn = newBtn => {\n if (hasGroupColChange()) {\n gridOptions.groupColumns.push(newBtn);\n }\n };\n\n //新增新字段\n const onAdd = () => {\n let newBtn = {\n visible: 0,\n form: {},\n sort: gridOptions.data.length + 1\n };\n gridOptions.data.push(newBtn);\n // 新增分组列\n handleAddGroupColumn(newBtn);\n vexGridRef.value.loadData(gridOptions.data);\n setTimeout(() => {\n vexGridRef.value.scrollToRow(gridOptions.data[newBtn.sort - 1], null);\n }, 500);\n };\n\n //删除数据\n const removeRowEvent = row => {\n vxe_table__WEBPACK_IMPORTED_MODULE_7___default().modal.confirm('您确定要删除该数据?').then(() => {\n gridOptions.data = gridOptions.data.filter(item => item._X_ROW_KEY != row._X_ROW_KEY);\n // 删除分组列\n handleRemoveGroupColumn(row);\n handleCheckBoxClick(row);\n }).catch(() => {});\n };\n const handleCheckBoxClick = row => {\n for (let column of gridOptions.columns) {\n if (column.field == 'addDisplay' || column.field == 'editDisplay') {\n row.addDisplay = undefined;\n row.editDisplay = undefined;\n checkBoxClick(column, row);\n }\n }\n };\n\n //表更新\n const updateData = data => {\n let list = gridOptions.data;\n // 字段映射hash表\n let map = {};\n for (let item of list) {\n if (item.visible == 1) {\n item.visible = \"1\";\n }\n map[item.asName] = item;\n }\n gridOptions.data = [];\n if (!data) {\n return;\n }\n data.forEach((item, index) => {\n if (map[item.prop]) {\n // 存在字段不覆盖\n gridOptions.data.push(map[item.prop]);\n return;\n }\n if (!item.column_comment || !item.column_comment.toString().trim()) {\n item.column_comment = item.prop;\n }\n let data = {\n field: item.prop,\n title: item.column_comment,\n tableField: item.column_name,\n asName: item.prop,\n sort: index,\n visible: \"1\",\n form: {},\n label: item.column_comment\n };\n //映射表更新返回的字段\n gridOptions.data.push(data);\n });\n // title格式化\n updateTitleAndWidth();\n // 列权限更新\n updateColumnAuth();\n };\n const visible = item => {\n return item.visible && '1' == item.visible;\n };\n const setAddDisplay = value => {\n let data = [];\n gridOptions.data.forEach(item => {\n if (visible(item)) {\n item.addDisplay = value;\n data.push(item);\n }\n });\n doEmits('add', data);\n };\n const doEmits = (name, data) => {\n emits('checkBoxAll', {\n checkBoxName: name,\n isAll: true,\n list: data\n });\n };\n const setEditDisplay = value => {\n let data = [];\n gridOptions.data.forEach(item => {\n if (visible(item)) {\n item.editDisplay = value;\n data.push(item);\n }\n });\n doEmits('edit', data);\n };\n const updateColumnAuth = () => {\n gridOptions.data.forEach(item => {\n if (item.visible == '0') {\n item.columnAuth = item.visible;\n }\n });\n };\n const updateTitleAndWidth = () => {\n gridOptions.data.forEach(item => {\n let index = -1;\n if (item.title) {\n item.title = item.title.trim();\n }\n if (item.title && (index = item.title.indexOf(' ')) != -1) {\n item.title = item.title.substring(0, index);\n }\n if (item.title && (index = item.title.indexOf('(')) >= 1) {\n item.title = item.title.substring(0, index);\n }\n if (item.title && (index = item.title.lastIndexOf('(')) >= 1) {\n item.title = item.title.substring(0, index);\n }\n });\n };\n\n //表格配置项\n const gridOptions = (0,vue__WEBPACK_IMPORTED_MODULE_5__.reactive)({\n scrollX: {\n enabled: true,\n gt: 1\n },\n scrollY: {\n enabled: true,\n gt: 1\n },\n border: true,\n showHeaderOverflow: true,\n showOverflow: true,\n height: 620,\n align: \"center\",\n size: 'mini',\n rowConfig: {\n isHover: true,\n isCurrent: true\n },\n editConfig: {\n trigger: 'click',\n mode: 'cell'\n },\n toolbarConfig: {\n custom: true,\n zoom: true,\n slots: {\n buttons: 'toolbar_buttons'\n },\n perfect: true\n },\n columns: [\n /* {\r\n type: \"expand\",\r\n title: \"其他属性\",\r\n width: 80,\r\n fixed: \"left\",\r\n slots: {\r\n content: 'content',\r\n },\r\n },*/\n {\n type: \"seq\",\n width: 60,\n title: \"序号\",\n slots: {\n default: 'seq'\n }\n }, {\n title: '字段',\n field: 'field',\n fixed: 'left',\n width: 200,\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n },\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '字段描述',\n field: 'label',\n fixed: 'left',\n width: 200,\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '标题',\n field: 'title',\n width: 200,\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n },\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '显示',\n field: 'visible',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '新增',\n field: 'addDisplay',\n align: 'center',\n visible: props.addVisible,\n params: {\n all: 1\n },\n width: 80,\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '编辑',\n field: 'editDisplay',\n align: 'center',\n width: 80,\n visible: props.editVisible,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '不保存',\n field: 'tableSaveToOtherProp',\n width: 95,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '必填',\n field: 'required',\n width: 60,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '不导入',\n field: 'importToOtherProp',\n width: 95,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '列宽',\n width: 80,\n field: 'width',\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n }\n }, {\n title: '排序',\n field: 'sortable',\n align: 'center',\n width: 100,\n params: {\n all: 0,\n dictCode: 'order_by_type'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('order_by_type')\n }\n }, {\n title: '数据字典',\n field: 'dictCode',\n params: {\n dictCode: 'dictCode'\n },\n width: 200,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dictType.val()\n }\n // editRender: {props: {clearable: true, filterable: true}, name: 'input', options: dictType.val()}\n }, {\n title: '数据字典表',\n field: 'dictTableToOtherProp',\n width: 200,\n editRender: {\n name: '$input'\n }\n // editRender: {props: {clearable: true, filterable: true}, name: 'input', options: dictType.val()}\n }, {\n title: '搜索类型',\n field: 'selectType',\n params: {\n dictCode: 'select_type'\n },\n width: 120,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('select_type')\n }\n }, {\n title: '固定',\n field: 'fixed',\n params: {\n dictCode: 'table_fixed'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('table_fixed')\n },\n width: 80\n }, {\n title: '控件类型',\n field: 'selectDom',\n /*params: {\r\n dictCode: 'select_dom'\r\n },*/\n width: 180,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('select_dom')\n }\n /*slots: {\r\n default: 'select_default'\r\n },*/\n }, {\n title: '表尾',\n field: 'totalToOtherProp',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('online_calculation_type')\n }\n }, {\n title: '插槽',\n field: 'customSlotsToOtherProp',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '分组合计',\n field: 'groupTotalToOtherProp',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('online_calculation_type')\n }\n }, {\n title: '分组',\n field: 'groupToOtherProp',\n width: 100,\n params: {\n all: null\n },\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '行合并',\n field: 'mergeFlag',\n width: 100,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '可列配置',\n field: 'columnAuth',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '对齐',\n field: 'align',\n params: {\n dictCode: 'align'\n },\n editRender: {\n props: {\n clearable: true\n },\n name: '$select',\n options: dict.val('align')\n },\n width: 80\n }, {\n title: '列宽拖动',\n field: 'resizable',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: 'formatter',\n field: 'formatter',\n width: 168,\n slots: {\n default: 'dialog_default'\n }\n }, {\n title: '搜索顺序',\n field: 'searchSort',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n type: 'number'\n }\n }\n }, {\n title: '搜索默认值',\n field: 'valueSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input'\n }\n }, {\n title: '不可清空',\n field: 'clearableSEARCHToOtherProp',\n width: 100,\n params: {},\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '时间',\n field: 'toDateSEARCHToOtherProp',\n width: 80,\n params: {},\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '搜索span',\n field: 'spanSEARCHToOtherProp',\n width: 110,\n editRender: {\n name: '$input',\n props: {\n clearable: true,\n min: 2,\n max: 24,\n type: 'number'\n }\n }\n }, {\n title: '搜索label',\n field: 'titleSEARCHToOtherProp',\n width: 120,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '搜索字段',\n field: 'fieldNameSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '搜索表别名',\n field: 'tableNameSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '操作',\n width: 100,\n fixed: 'right',\n align: 'center',\n slots: {\n default: 'operate'\n }\n }, {\n title: '表尾自定义',\n field: 'totalToOtherProp',\n width: 100,\n params: {\n all: null\n },\n slots: {\n default: 'totalToOtherProp_default'\n }\n }, {\n title: '标签配置',\n field: 'tagJsonToOtherProp',\n width: 168,\n slots: {\n default: 'tag_form_default'\n }\n }, {\n title: '表格选取配置',\n field: 'tableSelectConfToOtherProp',\n width: 100,\n slots: {\n default: 'tableSelectConf_default'\n }\n }],\n data: [],\n groupColumns: []\n });\n //表格拖动更新\n const updateSort = () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.nextTick)(() => {\n if (!vexGridRef.value) {\n return;\n }\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_9__[\"default\"].create(vexGridRef.value.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 200,\n //拖拽动画过渡时间\n sort: true,\n handle: '.col--seq',\n //必须设置该属性,属性值为你要拖动的该单元格的样式名\n // 元素被选中\n onStart: function (/**Event*/evt) {\n //关闭所有展开行\n vexGridRef.value.clearRowExpand();\n evt.oldIndex; // element index within parent\n },\n // 结束拖拽\n onEnd: function (/**Event*/{\n oldIndex,\n newIndex,\n item\n }) {\n //evt.to; // 目标列表\n //evt.from; // 来自以前的列表\n //evt.oldIndex; // 元素在旧父元素中的旧索引\n //evt.newIndex; // 元素在新父元素中的新索引\n //evt.clone // 克隆元素\n //evt.pullMode; // 当项在另一个可排序中时:\"clone\"(克隆),\"true\"(移动)\n let rowNode = vexGridRef.value.getRowNode(item);\n newIndex = rowNode.index - oldIndex + newIndex;\n const list = JSON.parse(JSON.stringify(gridOptions.data)); //保存旧数据\n const targetRow = list.splice(rowNode.index, 1)[0]; //保存移动的元素并删除原列表中移动的元素\n list.splice(newIndex, 0, targetRow); //插入到目标新索引中\n const newsArr = JSON.parse(JSON.stringify(list)); //重新赋值数组\n //将新数据重新排序\n for (let i = 0; i < newsArr.length; i++) {\n newsArr[i].sort = i + 1;\n }\n gridOptions.data = newsArr;\n }\n });\n });\n };\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.onMounted)(() => {\n updateSort();\n });\n const enterFilterEvent = ({\n $panel\n }) => {\n $panel.confirmFilter();\n };\n\n // 子组件调用父组件\n const emits = __emit; //声明 emits\n function getColumns() {\n return gridOptions.data;\n }\n function getGroupColumnData() {\n return gridOptions.groupColumns;\n }\n function setGroupColumnData(value) {\n gridOptions.groupColumns = value.groupColumns;\n }\n\n // 对外暴露\n __expose({\n setData,\n updateData,\n gridOptions,\n vexGridRef,\n getColumns,\n setAddDisplay,\n setEditDisplay,\n setShow,\n getGroupColumnData\n });\n const __returned__ = {\n props,\n show,\n vexGridRef,\n headerConfig,\n dict,\n dictType,\n setShow,\n setGroupByMin,\n http,\n headerConfigShow,\n checkBoxAllChange,\n setCardColumnVisible,\n headerClick,\n checkBoxClick,\n setData,\n handleRemoveGroupColumn,\n hasGroupColChange,\n handleAddGroupColumn,\n onAdd,\n removeRowEvent,\n handleCheckBoxClick,\n updateData,\n visible,\n setAddDisplay,\n doEmits,\n setEditDisplay,\n updateColumnAuth,\n updateTitleAndWidth,\n gridOptions,\n updateSort,\n enterFilterEvent,\n emits,\n getColumns,\n getGroupColumnData,\n setGroupColumnData,\n ref: vue__WEBPACK_IMPORTED_MODULE_5__.ref,\n reactive: vue__WEBPACK_IMPORTED_MODULE_5__.reactive,\n onMounted: vue__WEBPACK_IMPORTED_MODULE_5__.onMounted,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_5__.nextTick,\n watch: vue__WEBPACK_IMPORTED_MODULE_5__.watch,\n inject: vue__WEBPACK_IMPORTED_MODULE_5__.inject,\n get Delete() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Delete;\n },\n get VXETable() {\n return (vxe_table__WEBPACK_IMPORTED_MODULE_7___default());\n },\n get XEUtils() {\n return (xe_utils__WEBPACK_IMPORTED_MODULE_8___default());\n },\n get Sortable() {\n return sortablejs__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n },\n get storeDict() {\n return _store_dict__WEBPACK_IMPORTED_MODULE_10__.storeDict;\n },\n get storeDictType() {\n return _store_dictType__WEBPACK_IMPORTED_MODULE_11__.storeDictType;\n },\n HeaderConfig: _views_table_add_or_edit_config_column_config_header_config_vue__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_13__.get;\n },\n OlDialogTagForm: _components_ol_dialog_tagForm_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n OlTableSelectConfig: _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/column-config/index.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");
|
|
941
|
+
eval("__webpack_require__.r(__webpack_exports__);\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_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vxe-table */ \"vxe-table\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vxe_table__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var xe_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! xe-utils */ \"./node_modules/xe-utils/index.js\");\n/* harmony import */ var xe_utils__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(xe_utils__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _views_table_add_or_edit_config_column_config_header_config_vue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/views/table/add-or-edit/config/column-config/header-config.vue */ \"./src/views/table/add-or-edit/config/column-config/header-config.vue\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_ol_dialog_tagForm_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/ol-dialog-tagForm.vue */ \"./src/components/ol-dialog-tagForm.vue\");\n/* harmony import */ var _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/ol-table-select-config.vue */ \"./src/components/ol-table-select-config.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n props: {\n addVisible: {},\n editVisible: {},\n isTable: {\n default: true,\n type: Boolean\n }\n },\n emits: ['checkBoxChange'],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const show = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)(false);\n const vexGridRef = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)();\n const headerConfig = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)();\n const sortOldIndex = (0,vue__WEBPACK_IMPORTED_MODULE_5__.ref)(0);\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_10__.storeDict)();\n const dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_11__.storeDictType)();\n function setShow(value) {\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.nextTick)(() => {\n show.value = value;\n updateSort();\n setCardColumnVisible();\n });\n }\n function setGroupByMin() {\n gridOptions.data.forEach(item => {\n if (item.groupToOtherProp != 1 && !item.groupTotalToOtherProp) {\n item.groupTotalToOtherProp = 'sum';\n }\n });\n }\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_5__.inject)('http');\n dict.init(http);\n dictType.init(http);\n function headerConfigShow() {\n if (gridOptions.data) {\n let d = gridOptions.groupColumns ? gridOptions.groupColumns : gridOptions.data;\n headerConfig.value.setColumn(d);\n }\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.watch)(props, () => {\n for (let column of gridOptions.columns) {\n if (column.prop == 'addDisplay' || column.field == 'addDisplay') {\n if (!column.visible && props.addVisible) {\n checkBoxAllChange(column.field);\n }\n column.visible = props.addVisible;\n }\n if (column.prop == 'editDisplay' || column.field == 'editDisplay') {\n if (!column.visible && props.editVisible) {\n checkBoxAllChange(column.field);\n }\n column.visible = props.editVisible;\n }\n }\n if (show.value) {\n vexGridRef.value.loadColumn(gridOptions.columns);\n }\n }, {\n deep: true\n });\n const checkBoxAllChange = field => {\n emits('checkBoxAll', {\n checkBoxName: field == 'editDisplay' ? 'edit' : 'add',\n isAll: true,\n list: gridOptions.data.filter(row => row[field] == '1')\n });\n };\n const setCardColumnVisible = () => {\n let field = ['tableSaveToOtherProp', 'totalToOtherProp', 'groupTotalToOtherProp', 'groupToOtherProp', 'mergeFlag', 'columnAuth', 'width', 'resizable', 'spanSEARCHToOtherProp', 'totalToOtherProp'];\n for (let column of gridOptions.columns) {\n if (field.includes(column.field)) {\n column.visible = props.isTable;\n }\n // 标签配置只有card配置才显示\n if ('tagJsonToOtherProp' === column.field) {\n column.visible = !props.isTable;\n }\n }\n };\n //表头全选框更新\n const headerClick = column => {\n if (column.field != 'columnAuth' && column.field == 'visible') {\n let columnField = vexGridRef.value.getColumnByField('columnAuth');\n columnField.params.all = column.params.all;\n headerClick(columnField);\n }\n gridOptions.data.forEach(item => {\n item[column.field] = column.params.all ? '1' : '0';\n });\n if (column.params.all == '0') {\n //全不选的时候\n if (column.field == 'addDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"add\",\n isAll: false,\n list: gridOptions.data\n });\n } else if (column.field == 'editDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"edit\",\n isAll: false,\n list: gridOptions.data\n });\n }\n } else if (column.params.all == '1') {\n //全选\n if (column.field == 'addDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"add\",\n isAll: true,\n list: gridOptions.data\n });\n } else if (column.field == 'editDisplay') {\n emits(\"checkBoxAll\", {\n checkBoxName: \"edit\",\n isAll: true,\n list: gridOptions.data\n });\n }\n }\n };\n //表格多选框更新\n const checkBoxClick = (column, row) => {\n emits(\"checkBoxChange\", {\n row: row,\n column: column\n });\n if (column.field != 'columnAuth' && column.field == 'visible') {\n let columnField = vexGridRef.value.getColumnByField('columnAuth');\n row.columnAuth = row.visible;\n checkBoxClick(columnField, row);\n }\n let f = true;\n gridOptions.data.forEach(item => {\n if (item[column.field] != '1') {\n f = false;\n }\n });\n column.params.all = f;\n };\n\n //拿到数据\n const setData = (data, data2) => {\n console.log(data2);\n gridOptions.groupColumns = data2;\n if (!data) {\n return;\n }\n gridOptions.data = data;\n //查看多选框是否多选\n gridOptions.columns.forEach(item => {\n if (item.slots && item.slots.default == \"checkedBox_default\") {\n //默认全选状态\n let flag = gridOptions.data.length > 0;\n gridOptions.data.forEach(row => {\n if (row[item.field] != \"1\") {\n //有某个参数没选择则不是全选的状态\n flag = false;\n }\n });\n item.params.all = flag;\n }\n });\n };\n\n // 移除指定 field 的分组列(第一段代码封装)\n const handleRemoveGroupColumn = row => {\n if (hasGroupColChange()) {\n gridOptions.groupColumns = gridOptions.groupColumns.map(group => {\n if (group.children) {\n return {\n ...group,\n children: group.children.filter(child => child.field !== row.field)\n };\n }\n return group;\n }).filter(group => {\n if (group.children) {\n return group.children.length > 0;\n }\n return group.field !== row.field;\n });\n }\n };\n const hasGroupColChange = () => {\n return props.isTable && gridOptions.groupColumns?.length > 0;\n };\n\n // 添加新按钮到分组列(第二段代码封装)\n const handleAddGroupColumn = newBtn => {\n if (hasGroupColChange()) {\n gridOptions.groupColumns.push(newBtn);\n }\n };\n\n //新增新字段\n const onAdd = () => {\n let newBtn = {\n visible: 0,\n form: {},\n sort: gridOptions.data.length + 1\n };\n gridOptions.data.push(newBtn);\n // 新增分组列\n handleAddGroupColumn(newBtn);\n vexGridRef.value.loadData(gridOptions.data);\n setTimeout(() => {\n vexGridRef.value.scrollToRow(gridOptions.data[newBtn.sort - 1], null);\n }, 500);\n };\n\n //删除数据\n const removeRowEvent = row => {\n vxe_table__WEBPACK_IMPORTED_MODULE_7___default().modal.confirm('您确定要删除该数据?').then(() => {\n gridOptions.data = gridOptions.data.filter(item => item._X_ROW_KEY != row._X_ROW_KEY);\n // 删除分组列\n handleRemoveGroupColumn(row);\n handleCheckBoxClick(row);\n }).catch(() => {});\n };\n const handleCheckBoxClick = row => {\n for (let column of gridOptions.columns) {\n if (column.field == 'addDisplay' || column.field == 'editDisplay') {\n row.addDisplay = undefined;\n row.editDisplay = undefined;\n checkBoxClick(column, row);\n }\n }\n };\n\n //表更新\n const updateData = data => {\n let list = gridOptions.data;\n // 字段映射hash表\n let map = {};\n for (let item of list) {\n if (item.visible == 1) {\n item.visible = \"1\";\n }\n map[item.asName] = item;\n }\n gridOptions.data = [];\n if (!data) {\n return;\n }\n data.forEach((item, index) => {\n if (map[item.prop]) {\n // 存在字段不覆盖\n gridOptions.data.push(map[item.prop]);\n return;\n }\n if (!item.column_comment || !item.column_comment.toString().trim()) {\n item.column_comment = item.prop;\n }\n let data = {\n field: item.prop,\n title: item.column_comment,\n tableField: item.column_name,\n asName: item.prop,\n sort: index,\n visible: \"1\",\n form: {},\n label: item.column_comment\n };\n //映射表更新返回的字段\n gridOptions.data.push(data);\n });\n // title格式化\n updateTitleAndWidth();\n // 列权限更新\n updateColumnAuth();\n };\n const visible = item => {\n return item.visible && '1' == item.visible;\n };\n const setAddDisplay = value => {\n let data = [];\n gridOptions.data.forEach(item => {\n if (visible(item)) {\n item.addDisplay = value;\n data.push(item);\n }\n });\n doEmits('add', data);\n };\n const doEmits = (name, data) => {\n emits('checkBoxAll', {\n checkBoxName: name,\n isAll: true,\n list: data\n });\n };\n const setEditDisplay = value => {\n let data = [];\n gridOptions.data.forEach(item => {\n if (visible(item)) {\n item.editDisplay = value;\n data.push(item);\n }\n });\n doEmits('edit', data);\n };\n const updateColumnAuth = () => {\n gridOptions.data.forEach(item => {\n if (item.visible == '0') {\n item.columnAuth = item.visible;\n }\n });\n };\n const updateTitleAndWidth = () => {\n gridOptions.data.forEach(item => {\n let index = -1;\n if (item.title) {\n item.title = item.title.trim();\n }\n if (item.title && (index = item.title.indexOf(' ')) != -1) {\n item.title = item.title.substring(0, index);\n }\n if (item.title && (index = item.title.indexOf('(')) >= 1) {\n item.title = item.title.substring(0, index);\n }\n if (item.title && (index = item.title.lastIndexOf('(')) >= 1) {\n item.title = item.title.substring(0, index);\n }\n });\n };\n\n //表格配置项\n const gridOptions = (0,vue__WEBPACK_IMPORTED_MODULE_5__.reactive)({\n scrollX: {\n enabled: true,\n gt: 1\n },\n scrollY: {\n enabled: true,\n gt: 1\n },\n border: true,\n showHeaderOverflow: true,\n showOverflow: true,\n height: 620,\n align: \"center\",\n size: 'mini',\n rowConfig: {\n isHover: true,\n isCurrent: true\n },\n editConfig: {\n trigger: 'click',\n mode: 'cell'\n },\n toolbarConfig: {\n custom: true,\n zoom: true,\n slots: {\n buttons: 'toolbar_buttons'\n },\n perfect: true\n },\n columns: [\n /* {\r\n type: \"expand\",\r\n title: \"其他属性\",\r\n width: 80,\r\n fixed: \"left\",\r\n slots: {\r\n content: 'content',\r\n },\r\n },*/\n {\n type: \"seq\",\n width: 60,\n title: \"序号\",\n slots: {\n default: 'seq'\n }\n }, {\n title: '字段',\n field: 'field',\n fixed: 'left',\n width: 200,\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n },\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '字段描述',\n field: 'label',\n fixed: 'left',\n width: 200,\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '标题',\n field: 'title',\n width: 200,\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n },\n filters: [{\n data: ''\n }],\n filterMethod({\n option,\n row,\n column\n }) {\n if (option.data) {\n return xe_utils__WEBPACK_IMPORTED_MODULE_8___default().toValueString(row[column.field]).toLowerCase().indexOf(option.data) > -1;\n }\n return true;\n },\n slots: {\n filter: 'label_filter'\n }\n }, {\n title: '显示',\n field: 'visible',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '新增',\n field: 'addDisplay',\n align: 'center',\n visible: props.addVisible,\n params: {\n all: 1\n },\n width: 80,\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '编辑',\n field: 'editDisplay',\n align: 'center',\n width: 80,\n visible: props.editVisible,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '不保存',\n field: 'tableSaveToOtherProp',\n width: 95,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '必填',\n field: 'required',\n width: 60,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '不导入',\n field: 'importToOtherProp',\n width: 95,\n params: {\n all: 0\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '列宽',\n width: 80,\n field: 'width',\n editRender: {\n props: {\n clearable: true\n },\n name: '$input'\n }\n }, {\n title: '排序',\n field: 'sortable',\n align: 'center',\n width: 100,\n params: {\n all: 0,\n dictCode: 'order_by_type'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('order_by_type')\n }\n }, {\n title: '数据字典',\n field: 'dictCode',\n params: {\n dictCode: 'dictCode'\n },\n width: 200,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dictType.val()\n }\n // editRender: {props: {clearable: true, filterable: true}, name: 'input', options: dictType.val()}\n }, {\n title: '数据字典表',\n field: 'dictTableToOtherProp',\n width: 200,\n editRender: {\n name: '$input'\n }\n // editRender: {props: {clearable: true, filterable: true}, name: 'input', options: dictType.val()}\n }, {\n title: '搜索类型',\n field: 'selectType',\n params: {\n dictCode: 'select_type'\n },\n width: 120,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('select_type')\n }\n }, {\n title: '固定',\n field: 'fixed',\n params: {\n dictCode: 'table_fixed'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('table_fixed')\n },\n width: 80\n }, {\n title: '控件类型',\n field: 'selectDom',\n /*params: {\r\n dictCode: 'select_dom'\r\n },*/\n width: 180,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('select_dom')\n }\n /*slots: {\r\n default: 'select_default'\r\n },*/\n }, {\n title: '表尾',\n field: 'totalToOtherProp',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('online_calculation_type')\n }\n }, {\n title: '插槽',\n field: 'customSlotsToOtherProp',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '分组合计',\n field: 'groupTotalToOtherProp',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n options: dict.val('online_calculation_type')\n }\n }, {\n title: '分组',\n field: 'groupToOtherProp',\n width: 100,\n params: {\n all: null\n },\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '行合并',\n field: 'mergeFlag',\n width: 100,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '可列配置',\n field: 'columnAuth',\n align: 'center',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: '对齐',\n field: 'align',\n params: {\n dictCode: 'align'\n },\n editRender: {\n props: {\n clearable: true\n },\n name: '$select',\n options: dict.val('align')\n },\n width: 80\n }, {\n title: '列宽拖动',\n field: 'resizable',\n width: 80,\n params: {\n all: null\n },\n slots: {\n header: 'checkedBox_header',\n default: 'checkedBox_default'\n }\n }, {\n title: 'formatter',\n field: 'formatter',\n width: 168,\n slots: {\n default: 'dialog_default'\n }\n }, {\n title: '搜索顺序',\n field: 'searchSort',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n type: 'number'\n }\n }\n }, {\n title: '搜索默认值',\n field: 'valueSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input'\n }\n }, {\n title: '不可清空',\n field: 'clearableSEARCHToOtherProp',\n width: 100,\n params: {},\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '时间',\n field: 'toDateSEARCHToOtherProp',\n width: 80,\n params: {},\n slots: {\n default: 'checkedBox_default'\n }\n }, {\n title: '搜索span',\n field: 'spanSEARCHToOtherProp',\n width: 110,\n editRender: {\n name: '$input',\n props: {\n clearable: true,\n min: 2,\n max: 24,\n type: 'number'\n }\n }\n }, {\n title: '搜索label',\n field: 'titleSEARCHToOtherProp',\n width: 120,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '搜索字段',\n field: 'fieldNameSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '搜索表别名',\n field: 'tableNameSEARCHToOtherProp',\n width: 100,\n editRender: {\n name: '$input',\n props: {\n clearable: true\n }\n }\n }, {\n title: '操作',\n width: 100,\n fixed: 'right',\n align: 'center',\n slots: {\n default: 'operate'\n }\n }, {\n title: '表尾自定义',\n field: 'totalToOtherProp',\n width: 100,\n params: {\n all: null\n },\n slots: {\n default: 'totalToOtherProp_default'\n }\n }, {\n title: '标签配置',\n field: 'tagJsonToOtherProp',\n width: 168,\n slots: {\n default: 'tag_form_default'\n }\n }, {\n title: '表格选取配置',\n field: 'tableSelectConfToOtherProp',\n width: 100,\n slots: {\n default: 'tableSelectConf_default'\n }\n }],\n data: [],\n groupColumns: []\n });\n //表格拖动更新\n const updateSort = () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.nextTick)(() => {\n if (!vexGridRef.value) {\n return;\n }\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_9__[\"default\"].create(vexGridRef.value.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 200,\n //拖拽动画过渡时间\n sort: true,\n handle: '.col--seq',\n //必须设置该属性,属性值为你要拖动的该单元格的样式名\n // 元素被选中\n onStart: function (/**Event*/evt) {\n //关闭所有展开行\n vexGridRef.value.clearRowExpand();\n let rowNode = vexGridRef.value.getRowNode(evt.item);\n sortOldIndex.value = rowNode.index;\n },\n // 结束拖拽\n onEnd: function ({\n newIndex\n }) {\n const list = JSON.parse(JSON.stringify(gridOptions.data)); //保存旧数据\n const targetRow = list.splice(sortOldIndex.value, 1)[0]; //保存移动的元素并删除原列表中移动的元素\n list.splice(newIndex, 0, JSON.parse(JSON.stringify(targetRow))); //插入到目标新索引中\n const newsArr = JSON.parse(JSON.stringify(list)); //重新赋值数组\n //将新数据重新排序\n for (let i = 0; i < newsArr.length; i++) {\n newsArr[i].sort = i + 1;\n }\n gridOptions.data = newsArr;\n }\n });\n });\n };\n (0,vue__WEBPACK_IMPORTED_MODULE_5__.onMounted)(() => {\n updateSort();\n });\n const enterFilterEvent = ({\n $panel\n }) => {\n $panel.confirmFilter();\n };\n\n // 子组件调用父组件\n const emits = __emit; //声明 emits\n function getColumns() {\n return gridOptions.data;\n }\n function getGroupColumnData() {\n return gridOptions.groupColumns;\n }\n function setGroupColumnData(value) {\n gridOptions.groupColumns = value.groupColumns;\n }\n\n // 对外暴露\n __expose({\n setData,\n updateData,\n gridOptions,\n vexGridRef,\n getColumns,\n setAddDisplay,\n setEditDisplay,\n setShow,\n getGroupColumnData\n });\n const __returned__ = {\n props,\n show,\n vexGridRef,\n headerConfig,\n sortOldIndex,\n dict,\n dictType,\n setShow,\n setGroupByMin,\n http,\n headerConfigShow,\n checkBoxAllChange,\n setCardColumnVisible,\n headerClick,\n checkBoxClick,\n setData,\n handleRemoveGroupColumn,\n hasGroupColChange,\n handleAddGroupColumn,\n onAdd,\n removeRowEvent,\n handleCheckBoxClick,\n updateData,\n visible,\n setAddDisplay,\n doEmits,\n setEditDisplay,\n updateColumnAuth,\n updateTitleAndWidth,\n gridOptions,\n updateSort,\n enterFilterEvent,\n emits,\n getColumns,\n getGroupColumnData,\n setGroupColumnData,\n ref: vue__WEBPACK_IMPORTED_MODULE_5__.ref,\n reactive: vue__WEBPACK_IMPORTED_MODULE_5__.reactive,\n onMounted: vue__WEBPACK_IMPORTED_MODULE_5__.onMounted,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_5__.nextTick,\n watch: vue__WEBPACK_IMPORTED_MODULE_5__.watch,\n inject: vue__WEBPACK_IMPORTED_MODULE_5__.inject,\n get Delete() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Delete;\n },\n get VXETable() {\n return (vxe_table__WEBPACK_IMPORTED_MODULE_7___default());\n },\n get XEUtils() {\n return (xe_utils__WEBPACK_IMPORTED_MODULE_8___default());\n },\n get Sortable() {\n return sortablejs__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n },\n get storeDict() {\n return _store_dict__WEBPACK_IMPORTED_MODULE_10__.storeDict;\n },\n get storeDictType() {\n return _store_dictType__WEBPACK_IMPORTED_MODULE_11__.storeDictType;\n },\n HeaderConfig: _views_table_add_or_edit_config_column_config_header_config_vue__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_13__.get;\n },\n OlDialogTagForm: _components_ol_dialog_tagForm_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n OlTableSelectConfig: _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/column-config/index.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");
|
|
942
942
|
|
|
943
943
|
/***/ }),
|
|
944
944
|
|
|
@@ -982,7 +982,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
982
982
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
983
983
|
|
|
984
984
|
"use strict";
|
|
985
|
-
eval("__webpack_require__.r(__webpack_exports__);\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_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _views_table_add_or_edit_config_base_config_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/table/add-or-edit/config/base-config/index.vue */ \"./src/views/table/add-or-edit/config/base-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_column_config_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/views/table/add-or-edit/config/column-config/index.vue */ \"./src/views/table/add-or-edit/config/column-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_table_config_index_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/views/table/add-or-edit/config/table-config/index.vue */ \"./src/views/table/add-or-edit/config/table-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/table/add-or-edit/config/form-config/index.vue */ \"./src/views/table/add-or-edit/config/form-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/views/table/add-or-edit/config/initFormObject.js */ \"./src/views/table/add-or-edit/config/initFormObject.js\");\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 _utils_message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _views_table_add_or_edit_config_card_config_index_vue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/views/table/add-or-edit/config/card-config/index.vue */ \"./src/views/table/add-or-edit/config/card-config/index.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n emits: [\"emits\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const msg = (0,_utils_message__WEBPACK_IMPORTED_MODULE_11__.useMessage)(); // 消息弹窗\n const refMap = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)({});\n const setRefMap = (el, item) => {\n if (el) {\n refMap.value[item] = el;\n }\n };\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_4__.inject)(\"http\");\n const show = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(false);\n const loading = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(true);\n const baseConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const tableConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const cardConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const columnConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const columns = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)([]);\n const provides = (0,vue__WEBPACK_IMPORTED_MODULE_4__.reactive)({\n loadingText: '正在获取数据...',\n form: {\n mainTable: '',\n hump: '0',\n definitionSql: '0',\n executeSql: '',\n executeWhere: '',\n parameterDefault: '',\n paging: '1',\n selectBox: '2',\n tips: '1',\n tree: '0',\n treeParentId: '',\n selectChildren: '',\n openColumn: '',\n operationBut: [],\n tableDelete: {},\n toolBut: [],\n parentId: '',\n theme: '',\n toolButOptions: [],\n operationButOptions: []\n },\n updateIndex: 0,\n tableColumn: [],\n tableOption: '{}',\n operationButConfig: [],\n toolButConfig: []\n });\n const activeName = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)('baseConfig');\n\n //列配置多选框更新\n const columnCheckBoxChange = ({\n row,\n column\n }) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n if (column.field == 'addDisplay' && refMap.value['add']) {\n //新增多选点击\n refMap.value['add'].updateData(row, column);\n } else if (column.field == 'editDisplay' && refMap.value['edit']) {\n refMap.value['edit'].updateData(row, column);\n }\n });\n };\n function updateShow(v) {\n if (v == 'columnConfig') {\n columnConfig.value.setShow(true);\n } else if (refMap.value[v]) {\n refMap.value[v].setShow(true);\n refMap.value[v].setUpdateKey(getDeleteKey(provides));\n }\n }\n function getDeleteKey(data) {\n return data?.form?.deleteWhere?.wheres?.split('=')[0]?.trim() || null;\n }\n\n //列配置全选框更新\n const columnCheckBoxAll = ({\n checkBoxName,\n isAll,\n list\n }) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n //新增全选和全不选\n if (refMap.value[checkBoxName]) {\n refMap.value[checkBoxName].setAll({\n list,\n isAll\n });\n }\n });\n };\n function setOtherProp(item) {\n let filedToOtherProp = Object.keys(item).filter(item => item.indexOf(\"ToOtherProp\") != -1);\n if (filedToOtherProp.length != 0) {\n let otherProp = {};\n if (item.otherProp) {\n try {\n otherProp = JSON.parse(item.otherProp);\n if (!otherProp) {\n otherProp = {};\n }\n } catch (e) {}\n }\n for (let filed of filedToOtherProp) {\n otherProp[filed] = item[filed];\n }\n //将展开行的表单设置为json的形式传给其他属性\n item.otherProp = JSON.stringify(otherProp);\n }\n }\n\n //点击保存\n const saveClick = () => {\n let columnConfigData = columnConfig.value.gridOptions.data;\n baseConfig.value.parseData(provides.form);\n if ((provides.form.toolBut.indexOf(\"batchDelete\") != -1 || provides.form.operationBut.indexOf(\"delete\") != -1) && !provides.form.deleteWhere) {\n msg.error(\"您启用删除功能,请填写删除条件!\");\n return;\n }\n // let tableConfigData = provides.form.tableType === '1' ? tableConfig.value: cardConfig.value\n let tableConfigData = tableConfig.value;\n //保存列配置\n columnConfigData.forEach(item => {\n setOtherProp(item);\n item.field = item.field.toString().trim();\n //下拉值为空字符串时置为Null处理\n item.selectType = item.selectType != '' ? item.selectType : null;\n item.tableField = item.tableField ? item.tableField : item.field;\n item.fixed = item.fixed != '' ? item.fixed : null;\n item.selectDom = item.selectDom != '' ? item.selectDom : null;\n });\n provides.tableColumn = columnConfigData;\n provides.tableGroupHeader = columnConfig.value.getGroupColumnData();\n let options = tableConfigData.getOptions();\n provides.form.optionJson = JSON.stringify(options);\n if (refMap.value['add'] && refMap.value['add'].getData()) {\n try {\n JSON.parse(refMap.value['add'].getData().codeForm);\n } catch (e) {\n console.error(e);\n msg.error('解析编码设计json失败,请检查对象格式是否正确' + e);\n return;\n }\n }\n setFormList();\n if (provides.form.operationBut.includes('edit') && provides.formMainList) {\n for (const item of provides.formMainList) {\n // 基础表单 编辑时,更新条件或保存路径不能为空!\n if (item.formMain.designer == '0' && item.formMain.formType == 'edit' && item.formMain.updateKey.trim() == '' && item.formMain.saveUrl.trim() == '') {\n activeName.value = 'edit';\n msg.error(\"基础表单 编辑时,更新条件或保存路径不能为空!\");\n return;\n }\n }\n }\n saveData();\n };\n function setFormList() {\n //保存新增和编辑表单配置\n provides.formMainList = [];\n for (let key of Object.keys(refMap.value)) {\n provides.formMainList.push(getFormMain(refMap.value[key]));\n }\n }\n function getFormMain(formConfig) {\n let form = formConfig.getForm();\n let formConfigData = formConfig.getData();\n let formMain = {\n uuid: provides.form.uuid\n };\n let formJson = {};\n if (formConfigData) {\n formMain.designer = \"\" + formConfigData.designer; //表单类型 (0)基础表单 (1)自定义表单\n formMain.customForm = formConfigData.customForm;\n formJson.optionJson = formConfigData.codeForm;\n formJson.customJson = JSON.stringify(formConfigData.customJson);\n }\n for (let key of Object.keys(form)) {\n formMain[key] = form[key];\n }\n return {\n formMain,\n formJson\n };\n }\n function saveData() {\n loading.value = true;\n // baseConfig.value.setDeleteTable();\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.post)(http, \"/online/tableConfig/saveJson\", (0,vue__WEBPACK_IMPORTED_MODULE_4__.toRaw)(provides), undefined, false).then(({\n code\n }) => {\n if (code == 200) {\n show.value = false;\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n emits('configClose', provides.form.theme);\n });\n }\n }).finally(() => {\n loading.value = false;\n });\n }\n\n //数据配置更新数据表\n function updateTable(data) {\n columnConfig.value.updateData(data);\n loading.value = false;\n }\n const updateCurd = () => {\n columnConfig.value.setAddDisplay(\"1\");\n columnConfig.value.setEditDisplay(\"1\");\n };\n\n //配置中心更新数据\n function tableConfigChange(map) {\n columnConfig.value.updateColumnConfig(map);\n }\n const updateBtnData = (options, type) => {\n let butType = type.substr(0, type.indexOf('Options'));\n for (let i = options.length - 1; i >= 0; i--) {\n let o = options[i];\n if (provides.form[butType].indexOf(o.code) == -1) {\n provides.form[butType].push(o.code);\n }\n }\n provides.form[type] = options;\n };\n function initForm(res) {\n res.form = JSON.parse(JSON.stringify(_views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]));\n res.tableColumn = [];\n }\n function parseOtherProp(res) {\n if (!res.tableColumn) {\n return;\n }\n for (let column of res.tableColumn) {\n if (column.otherProp && column.otherProp != '') {\n try {\n let otherProp = JSON.parse(column.otherProp);\n for (let key of Object.keys(otherProp)) {\n column[key] = otherProp[key];\n }\n } catch (e) {}\n }\n }\n }\n function setCardToolButConfig(type) {\n if (type === '2') {\n const excludedCodes = ['upload', 'download', 'olp_fullscreen', 'olp_setting', 'olp_search'];\n provides.toolButConfig = provides.toolButConfig.filter(o => !excludedCodes.includes(o.code));\n }\n }\n function init({\n o,\n v\n }) {\n show.value = true;\n loading.value = true;\n provides.loadingText = \"正在加载数据...\";\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.get)(http, \"/online/tableConfig/getJson\", {\n uuid: v.uuid,\n theme: o\n }).then(res => {\n parseOtherProp(res);\n provides.toolButConfig = res.toolButConfig;\n provides.operationButConfig = res.operationButConfig;\n if (res.newConfig) {\n initForm(res);\n res.form.parentId = v.parentId;\n res.form.uuid = v.uuid;\n res.form.theme = o;\n }\n res.form.tableType = v.type;\n setCardToolButConfig(v.type);\n if (res.form?.deleteWhere?.wheres && !res.form.cardKey) {\n res.form.cardKey = getDeleteKey(res);\n }\n provides.form = res.form;\n if (!res.form.optionJson) {\n res.form.optionJson = \"{}\";\n }\n // 将json解析为对象\n provides.form.optionObj = JSON.parse(res.form.optionJson);\n if (provides.form.optionObj.table) {\n provides.form.tableObj = provides.form.optionObj.table;\n } else {\n provides.form.tableObj = {};\n }\n provides.tableColumn = res.tableColumn;\n provides.groupColumns = res.groupColumns;\n columnConfig.value.setData(res.tableColumn, res.groupColumns);\n baseConfig.value.setData(res.form);\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n tableConfig.value.setData(res.form);\n // if (provides.form.tableType === '1') {\n // tableConfig.value.setData(res.form)\n // } else {\n // cardConfig.value.setData(res.form)\n // }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n if (res.formMainList) {\n for (let obj of provides.form.toolButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n for (let obj of provides.form.operationButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n }\n });\n loading.value = false;\n }).catch(() => {\n loading.value = false;\n });\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.provide)('configData', provides);\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.provide)('updateBtnData', updateBtnData);\n const emits = (m, v) => {\n if (m == \"updateVisible\") {\n baseConfig.value.refreshColumn();\n } else {\n emit(\"emits\", {\n m: m,\n v\n });\n }\n };\n\n // 子组件调用父组件\n const emit = __emit; //声明 emits\n __expose({\n init\n });\n const __returned__ = {\n msg,\n refMap,\n setRefMap,\n http,\n show,\n loading,\n baseConfig,\n tableConfig,\n cardConfig,\n columnConfig,\n columns,\n provides,\n activeName,\n columnCheckBoxChange,\n updateShow,\n getDeleteKey,\n columnCheckBoxAll,\n setOtherProp,\n saveClick,\n setFormList,\n getFormMain,\n saveData,\n updateTable,\n updateCurd,\n tableConfigChange,\n updateBtnData,\n initForm,\n parseOtherProp,\n setCardToolButConfig,\n init,\n emits,\n emit,\n inject: vue__WEBPACK_IMPORTED_MODULE_4__.inject,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_4__.nextTick,\n provide: vue__WEBPACK_IMPORTED_MODULE_4__.provide,\n reactive: vue__WEBPACK_IMPORTED_MODULE_4__.reactive,\n ref: vue__WEBPACK_IMPORTED_MODULE_4__.ref,\n toRaw: vue__WEBPACK_IMPORTED_MODULE_4__.toRaw,\n BaseConfig: _views_table_add_or_edit_config_base_config_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n ColumnConfig: _views_table_add_or_edit_config_column_config_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n TableConfig: _views_table_add_or_edit_config_table_config_index_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n FormConfig: _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n get initFormObject() {\n return _views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n },\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.get;\n },\n get post() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.post;\n },\n get useMessage() {\n return _utils_message__WEBPACK_IMPORTED_MODULE_11__.useMessage;\n },\n CardConfig: _views_table_add_or_edit_config_card_config_index_vue__WEBPACK_IMPORTED_MODULE_12__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/index.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");
|
|
985
|
+
eval("__webpack_require__.r(__webpack_exports__);\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_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _views_table_add_or_edit_config_base_config_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/table/add-or-edit/config/base-config/index.vue */ \"./src/views/table/add-or-edit/config/base-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_column_config_index_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/views/table/add-or-edit/config/column-config/index.vue */ \"./src/views/table/add-or-edit/config/column-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_table_config_index_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/views/table/add-or-edit/config/table-config/index.vue */ \"./src/views/table/add-or-edit/config/table-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/views/table/add-or-edit/config/form-config/index.vue */ \"./src/views/table/add-or-edit/config/form-config/index.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/views/table/add-or-edit/config/initFormObject.js */ \"./src/views/table/add-or-edit/config/initFormObject.js\");\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 _utils_message__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _views_table_add_or_edit_config_card_config_index_vue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/views/table/add-or-edit/config/card-config/index.vue */ \"./src/views/table/add-or-edit/config/card-config/index.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n emits: [\"emits\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const msg = (0,_utils_message__WEBPACK_IMPORTED_MODULE_11__.useMessage)(); // 消息弹窗\n const refMap = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)({});\n const setRefMap = (el, item) => {\n if (el) {\n refMap.value[item] = el;\n }\n };\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_4__.inject)(\"http\");\n const show = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(false);\n const loading = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(true);\n const baseConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const tableConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const cardConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const columnConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)(null);\n const columns = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)([]);\n const mainConfig = (0,vue__WEBPACK_IMPORTED_MODULE_4__.reactive)({\n o: {},\n uuids: '',\n v: {}\n });\n const provides = (0,vue__WEBPACK_IMPORTED_MODULE_4__.reactive)({\n loadingText: '正在获取数据...',\n form: {\n mainTable: '',\n hump: '0',\n definitionSql: '0',\n executeSql: '',\n executeWhere: '',\n parameterDefault: '',\n paging: '1',\n selectBox: '2',\n tips: '1',\n tree: '0',\n treeParentId: '',\n selectChildren: '',\n openColumn: '',\n operationBut: [],\n tableDelete: {},\n toolBut: [],\n parentId: '',\n theme: '',\n toolButOptions: [],\n operationButOptions: []\n },\n updateIndex: 0,\n tableColumn: [],\n tableOption: '{}',\n operationButConfig: [],\n toolButConfig: []\n });\n const activeName = (0,vue__WEBPACK_IMPORTED_MODULE_4__.ref)('baseConfig');\n\n //列配置多选框更新\n const columnCheckBoxChange = ({\n row,\n column\n }) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n if (column.field == 'addDisplay' && refMap.value['add']) {\n //新增多选点击\n refMap.value['add'].updateData(row, column);\n } else if (column.field == 'editDisplay' && refMap.value['edit']) {\n refMap.value['edit'].updateData(row, column);\n }\n });\n };\n function updateShow(v) {\n if (v == 'columnConfig') {\n columnConfig.value.setShow(true);\n } else if (refMap.value[v]) {\n refMap.value[v].setShow(true);\n refMap.value[v].setUpdateKey(getDeleteKey(provides));\n }\n }\n function getDeleteKey(data) {\n return data?.form?.deleteWhere?.wheres?.split('=')[0]?.trim() || null;\n }\n\n //列配置全选框更新\n const columnCheckBoxAll = ({\n checkBoxName,\n isAll,\n list\n }) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n //新增全选和全不选\n if (refMap.value[checkBoxName]) {\n refMap.value[checkBoxName].setAll({\n list,\n isAll\n });\n }\n });\n };\n function setOtherProp(item) {\n let filedToOtherProp = Object.keys(item).filter(item => item.indexOf(\"ToOtherProp\") != -1);\n if (filedToOtherProp.length != 0) {\n let otherProp = {};\n if (item.otherProp) {\n try {\n otherProp = JSON.parse(item.otherProp);\n if (!otherProp) {\n otherProp = {};\n }\n } catch (e) {}\n }\n for (let filed of filedToOtherProp) {\n otherProp[filed] = item[filed];\n }\n //将展开行的表单设置为json的形式传给其他属性\n item.otherProp = JSON.stringify(otherProp);\n }\n }\n const saveClickCp = () => {\n let uuids = mainConfig.uuids.toString().split(\",\");\n if (uuids.length != 2) {\n msg.error(\"请填写格式为:uuid,theme\");\n return;\n }\n //init({o, v},uuid,theme)\n init({\n o: mainConfig.o,\n v: mainConfig.v\n }, uuids[0], uuids[1]);\n };\n //点击保存\n const saveClick = () => {\n let columnConfigData = columnConfig.value.gridOptions.data;\n baseConfig.value.parseData(provides.form);\n if ((provides.form.toolBut.indexOf(\"batchDelete\") != -1 || provides.form.operationBut.indexOf(\"delete\") != -1) && !provides.form.deleteWhere) {\n msg.error(\"您启用删除功能,请填写删除条件!\");\n return;\n }\n // let tableConfigData = provides.form.tableType === '1' ? tableConfig.value: cardConfig.value\n let tableConfigData = tableConfig.value;\n //保存列配置\n columnConfigData.forEach(item => {\n setOtherProp(item);\n item.field = item.field.toString().trim();\n //下拉值为空字符串时置为Null处理\n item.selectType = item.selectType != '' ? item.selectType : null;\n item.tableField = item.tableField ? item.tableField : item.field;\n item.fixed = item.fixed != '' ? item.fixed : null;\n item.selectDom = item.selectDom != '' ? item.selectDom : null;\n });\n provides.tableColumn = columnConfigData;\n provides.tableGroupHeader = columnConfig.value.getGroupColumnData();\n let options = tableConfigData.getOptions();\n provides.form.optionJson = JSON.stringify(options);\n if (refMap.value['add'] && refMap.value['add'].getData()) {\n try {\n JSON.parse(refMap.value['add'].getData().codeForm);\n } catch (e) {\n console.error(e);\n msg.error('解析编码设计json失败,请检查对象格式是否正确' + e);\n return;\n }\n }\n setFormList();\n if (provides.form.operationBut.includes('edit') && provides.formMainList) {\n for (const item of provides.formMainList) {\n // 基础表单 编辑时,更新条件或保存路径不能为空!\n if (item.formMain.designer == '0' && item.formMain.formType == 'edit' && item.formMain.updateKey.trim() == '' && item.formMain.saveUrl.trim() == '') {\n activeName.value = 'edit';\n msg.error(\"基础表单 编辑时,更新条件或保存路径不能为空!\");\n return;\n }\n }\n }\n saveData();\n };\n function setFormList() {\n //保存新增和编辑表单配置\n provides.formMainList = [];\n for (let key of Object.keys(refMap.value)) {\n provides.formMainList.push(getFormMain(refMap.value[key]));\n }\n }\n function getFormMain(formConfig) {\n let form = formConfig.getForm();\n let formConfigData = formConfig.getData();\n let formMain = {\n uuid: provides.form.uuid\n };\n let formJson = {};\n if (formConfigData) {\n formMain.designer = \"\" + formConfigData.designer; //表单类型 (0)基础表单 (1)自定义表单\n formMain.customForm = formConfigData.customForm;\n formJson.optionJson = formConfigData.codeForm;\n formJson.customJson = JSON.stringify(formConfigData.customJson);\n }\n for (let key of Object.keys(form)) {\n formMain[key] = form[key];\n }\n return {\n formMain,\n formJson\n };\n }\n function saveData() {\n loading.value = true;\n // baseConfig.value.setDeleteTable();\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.post)(http, \"/online/tableConfig/saveJson\", (0,vue__WEBPACK_IMPORTED_MODULE_4__.toRaw)(provides), undefined, false).then(({\n code\n }) => {\n if (code == 200) {\n show.value = false;\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n emits('configClose', provides.form.theme);\n });\n }\n }).finally(() => {\n loading.value = false;\n });\n }\n\n //数据配置更新数据表\n function updateTable(data) {\n columnConfig.value.updateData(data);\n loading.value = false;\n }\n const updateCurd = () => {\n columnConfig.value.setAddDisplay(\"1\");\n columnConfig.value.setEditDisplay(\"1\");\n };\n\n //配置中心更新数据\n function tableConfigChange(map) {\n columnConfig.value.updateColumnConfig(map);\n }\n const updateBtnData = (options, type) => {\n let butType = type.substr(0, type.indexOf('Options'));\n for (let i = options.length - 1; i >= 0; i--) {\n let o = options[i];\n if (provides.form[butType].indexOf(o.code) == -1) {\n provides.form[butType].push(o.code);\n }\n }\n provides.form[type] = options;\n };\n function initForm(res) {\n res.form = JSON.parse(JSON.stringify(_views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]));\n res.tableColumn = [];\n }\n function parseOtherProp(res) {\n if (!res.tableColumn) {\n return;\n }\n for (let column of res.tableColumn) {\n if (column.otherProp && column.otherProp != '') {\n try {\n let otherProp = JSON.parse(column.otherProp);\n for (let key of Object.keys(otherProp)) {\n column[key] = otherProp[key];\n }\n } catch (e) {}\n }\n }\n }\n function setCardToolButConfig(type) {\n if (type === '2') {\n const excludedCodes = ['upload', 'download', 'olp_fullscreen', 'olp_setting', 'olp_search'];\n provides.toolButConfig = provides.toolButConfig.filter(o => !excludedCodes.includes(o.code));\n }\n }\n function init({\n o,\n v\n }, uuid, theme) {\n show.value = true;\n loading.value = true;\n mainConfig.v = v;\n mainConfig.o = o;\n provides.loadingText = \"正在加载数据...\";\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.get)(http, \"/online/tableConfig/getJson\", {\n uuid: uuid ? uuid : theme,\n theme: theme ? theme : o\n }).then(res => {\n parseOtherProp(res);\n provides.toolButConfig = res.toolButConfig;\n provides.operationButConfig = res.operationButConfig;\n if (res.newConfig && !uuid) {\n initForm(res);\n res.form.parentId = v.parentId;\n res.form.uuid = v.uuid;\n res.form.theme = o;\n }\n if (uuid) {\n res.form.parentId = v.parentId;\n res.form.uuid = v.uuid;\n res.form.theme = o;\n delete res.form.version;\n }\n res.form.tableType = v.type;\n setCardToolButConfig(v.type);\n if (res.form?.deleteWhere?.wheres && !res.form.cardKey) {\n res.form.cardKey = getDeleteKey(res);\n }\n provides.form = res.form;\n if (!res.form.optionJson) {\n res.form.optionJson = \"{}\";\n }\n // 将json解析为对象\n provides.form.optionObj = JSON.parse(res.form.optionJson);\n if (provides.form.optionObj.table) {\n provides.form.tableObj = provides.form.optionObj.table;\n } else {\n provides.form.tableObj = {};\n }\n provides.tableColumn = res.tableColumn;\n provides.groupColumns = res.groupColumns;\n columnConfig.value.setData(res.tableColumn, res.groupColumns);\n baseConfig.value.setData(res.form);\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n tableConfig.value.setData(res.form);\n // if (provides.form.tableType === '1') {\n // tableConfig.value.setData(res.form)\n // } else {\n // cardConfig.value.setData(res.form)\n // }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n if (res.formMainList) {\n for (let obj of provides.form.toolButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n for (let obj of provides.form.operationButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n }\n });\n loading.value = false;\n }).catch(() => {\n loading.value = false;\n });\n }\n function copeTheme({\n o,\n v\n }) {\n show.value = true;\n loading.value = true;\n provides.loadingText = \"正在加载数据...\";\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.get)(http, \"/online/tableConfig/getJson\", {\n uuid: v.uuid,\n theme: o\n }).then(res => {\n parseOtherProp(res);\n provides.toolButConfig = res.toolButConfig;\n provides.operationButConfig = res.operationButConfig;\n if (res.newConfig) {\n initForm(res);\n res.form.parentId = v.parentId;\n res.form.uuid = v.uuid;\n res.form.theme = o;\n }\n res.form.tableType = v.type;\n setCardToolButConfig(v.type);\n if (res.form?.deleteWhere?.wheres && !res.form.cardKey) {\n res.form.cardKey = getDeleteKey(res);\n }\n provides.form = res.form;\n if (!res.form.optionJson) {\n res.form.optionJson = \"{}\";\n }\n // 将json解析为对象\n provides.form.optionObj = JSON.parse(res.form.optionJson);\n if (provides.form.optionObj.table) {\n provides.form.tableObj = provides.form.optionObj.table;\n } else {\n provides.form.tableObj = {};\n }\n provides.tableColumn = res.tableColumn;\n provides.groupColumns = res.groupColumns;\n columnConfig.value.setData(res.tableColumn, res.groupColumns);\n baseConfig.value.setData(res.form);\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n tableConfig.value.setData(res.form);\n // if (provides.form.tableType === '1') {\n // tableConfig.value.setData(res.form)\n // } else {\n // cardConfig.value.setData(res.form)\n // }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.nextTick)(() => {\n if (res.formMainList) {\n for (let obj of provides.form.toolButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n for (let obj of provides.form.operationButOptions) {\n let data = res.formMainList[obj.code];\n if (data && refMap.value[obj.code]) {\n refMap.value[obj.code].setData(data);\n }\n }\n }\n });\n loading.value = false;\n }).catch(() => {\n loading.value = false;\n });\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.provide)('configData', provides);\n (0,vue__WEBPACK_IMPORTED_MODULE_4__.provide)('updateBtnData', updateBtnData);\n const emits = (m, v) => {\n if (m == \"updateVisible\") {\n baseConfig.value.refreshColumn();\n } else {\n emit(\"emits\", {\n m: m,\n v\n });\n }\n };\n\n // 子组件调用父组件\n const emit = __emit; //声明 emits\n __expose({\n init\n });\n const __returned__ = {\n msg,\n refMap,\n setRefMap,\n http,\n show,\n loading,\n baseConfig,\n tableConfig,\n cardConfig,\n columnConfig,\n columns,\n mainConfig,\n provides,\n activeName,\n columnCheckBoxChange,\n updateShow,\n getDeleteKey,\n columnCheckBoxAll,\n setOtherProp,\n saveClickCp,\n saveClick,\n setFormList,\n getFormMain,\n saveData,\n updateTable,\n updateCurd,\n tableConfigChange,\n updateBtnData,\n initForm,\n parseOtherProp,\n setCardToolButConfig,\n init,\n copeTheme,\n emits,\n emit,\n inject: vue__WEBPACK_IMPORTED_MODULE_4__.inject,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_4__.nextTick,\n provide: vue__WEBPACK_IMPORTED_MODULE_4__.provide,\n reactive: vue__WEBPACK_IMPORTED_MODULE_4__.reactive,\n ref: vue__WEBPACK_IMPORTED_MODULE_4__.ref,\n toRaw: vue__WEBPACK_IMPORTED_MODULE_4__.toRaw,\n BaseConfig: _views_table_add_or_edit_config_base_config_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n ColumnConfig: _views_table_add_or_edit_config_column_config_index_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n TableConfig: _views_table_add_or_edit_config_table_config_index_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n FormConfig: _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n get initFormObject() {\n return _views_table_add_or_edit_config_initFormObject_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n },\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.get;\n },\n get post() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_10__.post;\n },\n get useMessage() {\n return _utils_message__WEBPACK_IMPORTED_MODULE_11__.useMessage;\n },\n CardConfig: _views_table_add_or_edit_config_card_config_index_vue__WEBPACK_IMPORTED_MODULE_12__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/index.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");
|
|
986
986
|
|
|
987
987
|
/***/ }),
|
|
988
988
|
|
|
@@ -1466,7 +1466,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1466
1466
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1467
1467
|
|
|
1468
1468
|
"use strict";
|
|
1469
|
-
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\": \"75vh\",\n \"overflow-y\": \"auto\"\n }\n};\nconst _hoisted_2 = {\n class: \"dialog-footer\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-button\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-dialog\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_el_dialog, {\n modelValue: $data.show,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $data.show = $event),\n \"destroy-on-close\": \"\",\n title: $data.title,\n width: $data.width,\n fullscreen: $data.fullscreen,\n top: \"5vh\",\n \"show-footer\": \"\",\n \"append-to-body\": \"\"\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n onClick: $options.cancelEvent\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[1] || (_cache[1] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"取消\")])),\n _: 1 /* STABLE */,\n __: [1]\n }, 8 /* PROPS */, [\"onClick\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $options.ok\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 确认 \")])),\n _: 1 /* STABLE */,\n __: [2]\n }, 8 /* PROPS */, [\"onClick\"])])]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"表单开始\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <el-scrollbar class=\\\"content-wrapper\\\">\"), $data.show && $data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n ref: \"table\",\n http: $options.https,\n uuid: $data.uuid,\n style: {\n \"height\": \"calc(100% - 50px)\"\n }\n }, null, 8 /* PROPS */, [\"http\", \"uuid\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" </el-scrollbar>\")])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"width\", \"fullscreen\"]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/ol-dialog-table.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");
|
|
1469
|
+
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\": \"75vh\",\n \"overflow-y\": \"auto\"\n }\n};\nconst _hoisted_2 = {\n class: \"dialog-footer\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"model-index\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-button\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-dialog\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_el_dialog, {\n modelValue: $data.show,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $data.show = $event),\n \"destroy-on-close\": \"\",\n title: $data.title,\n width: $data.width,\n fullscreen: $data.fullscreen,\n top: \"5vh\",\n \"show-footer\": \"\",\n \"append-to-body\": \"\"\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n onClick: $options.cancelEvent\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[1] || (_cache[1] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"取消\")])),\n _: 1 /* STABLE */,\n __: [1]\n }, 8 /* PROPS */, [\"onClick\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $options.ok\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 确认 \")])),\n _: 1 /* STABLE */,\n __: [2]\n }, 8 /* PROPS */, [\"onClick\"])])]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"表单开始\"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" <el-scrollbar class=\\\"content-wrapper\\\">\"), $data.show && $data.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_model_index, {\n key: 0,\n ref: \"table\",\n onInitOk: $options.initOk,\n http: $options.https,\n uuid: $data.uuid,\n style: {\n \"height\": \"calc(100% - 50px)\"\n }\n }, null, 8 /* PROPS */, [\"onInitOk\", \"http\", \"uuid\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" </el-scrollbar>\")])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"width\", \"fullscreen\"]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/ol-dialog-table.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");
|
|
1470
1470
|
|
|
1471
1471
|
/***/ }),
|
|
1472
1472
|
|
|
@@ -1554,7 +1554,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1554
1554
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1555
1555
|
|
|
1556
1556
|
"use strict";
|
|
1557
|
-
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 class: \"json-configurator\"\n};\nconst _hoisted_2 = {\n class: \"field-mappings\"\n};\nconst _hoisted_3 = {\n class: \"json-output\"\n};\nconst _hoisted_4 = {\n style: {\n \"display\": \"flex\",\n \"justify-content\": \"flex-end\"\n }\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_input = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-input\");\n const _component_el_form_item = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-form-item\");\n const _component_el_switch = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-switch\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-button\");\n const _component_el_form = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-form\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-dialog\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n clearable: \"\",\n size: _ctx.sizes,\n modelValue: $options.values,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $options.values = $event),\n onClick: $options.handleClick\n }, null, 8 /* PROPS */, [\"size\", \"modelValue\", \"onClick\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_dialog, {\n modelValue: $data.state.show,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = $event => $data.state.show = $event),\n title: $props.title,\n class: \"select-el-dialog\",\n width: \"50%\",\n top: \"20px\",\n \"close-on-press-escape\": false,\n \"close-on-click-modal\": false,\n \"append-to-body\": \"true\",\n onOpen: $options.onOpen\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form, {\n model: $data.formData,\n \"label-width\": \"180px\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"UUID\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.uuid,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $data.formData.olTableSelect.uuid = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"从该表格读取数据用于选取\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [6]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Key\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.key,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $data.formData.olTableSelect.key = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[7] || (_cache[7] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"该字段将作为主表的外键使用(一般使用被选取表的主键)\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [7]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Label\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.label,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => $data.formData.olTableSelect.label = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[8] || (_cache[8] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"将该字段作为下拉框回显的值\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [8]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Label追加编码\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_switch, {\n modelValue: $data.formData.olTableSelect.labelIsAppendCode,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => $data.formData.olTableSelect.labelIsAppendCode = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[9] || (_cache[9] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \" 开启后会在显示值后追加编码信息如:[1]男\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [9]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"字段映射\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($data.fieldMappings, (mapping, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: index,\n class: \"mapping-item\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 目标字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.target,\n \"onUpdate:modelValue\": $event => mapping.target = $event,\n placeholder: \"目标字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), _cache[10] || (_cache[10] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"separator\"\n }, \"→\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 源字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.source,\n \"onUpdate:modelValue\": $event => mapping.source = $event,\n placeholder: \"源字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"danger\",\n icon: \"el-icon-delete\",\n circle: \"\",\n onClick: $event => $options.removeMapping(index),\n style: {\n \"margin-left\": \"10px\"\n }\n }, null, 8 /* PROPS */, [\"onClick\"])]);\n }), 128 /* KEYED_FRAGMENT */)), _cache[12] || (_cache[12] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"格式:目标字段 → 源原字段 (如果目标字段与源字段命名一致,可以只填写左边目标字段栏即可)\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n icon: \"el-icon-plus\",\n onClick: $options.addMapping,\n style: {\n \"margin-top\": \"10px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[11] || (_cache[11] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 新增映射 \")])),\n _: 1 /* STABLE */,\n __: [11]\n }, 8 /* PROPS */, [\"onClick\"])])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, null, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $options.generateJson\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[13] || (_cache[13] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"生成JSON\")])),\n _: 1 /* STABLE */,\n __: [13]\n }, 8 /* PROPS */, [\"onClick\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"success\",\n onClick: $options.confirm,\n style: {\n \"width\": \"100px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[14] || (_cache[14] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"确 定\")])),\n _: 1 /* STABLE */,\n __: [14]\n }, 8 /* PROPS */, [\"onClick\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"model\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [_cache[15] || (_cache[15] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h3\", null, \"生成的JSON:\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"pre\", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formattedJson), 1 /* TEXT */)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"success\",\n onClick: $options.confirm,\n style: {\n \"width\": \"100px\",\n \"margin-top\": \"15px\",\n \"margin-right\": \"15px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[16] || (_cache[16] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"确 定\")])),\n _: 1 /* STABLE */,\n __: [16]\n }, 8 /* PROPS */, [\"onClick\"])])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"onOpen\"])])]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/ol-table-select-config.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");
|
|
1557
|
+
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 class: \"json-configurator\"\n};\nconst _hoisted_2 = {\n class: \"field-mappings\"\n};\nconst _hoisted_3 = {\n class: \"select-mappings\"\n};\nconst _hoisted_4 = {\n class: \"json-output\"\n};\nconst _hoisted_5 = {\n style: {\n \"display\": \"flex\",\n \"justify-content\": \"flex-end\"\n }\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_input = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-input\");\n const _component_el_form_item = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-form-item\");\n const _component_el_switch = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-switch\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-button\");\n const _component_el_form = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-form\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-dialog\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n clearable: \"\",\n size: _ctx.sizes,\n modelValue: $options.values,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $options.values = $event),\n onClick: $options.handleClick\n }, null, 8 /* PROPS */, [\"size\", \"modelValue\", \"onClick\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_dialog, {\n modelValue: $data.state.show,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = $event => $data.state.show = $event),\n title: $props.title,\n class: \"select-el-dialog\",\n width: \"50%\",\n top: \"20px\",\n \"close-on-press-escape\": false,\n \"close-on-click-modal\": false,\n \"append-to-body\": \"true\",\n onOpen: $options.onOpen\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form, {\n model: $data.formData,\n \"label-width\": \"180px\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"UUID\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.uuid,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $data.formData.olTableSelect.uuid = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[9] || (_cache[9] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"从该表格读取数据用于选取\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [9]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Key\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.key,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $data.formData.olTableSelect.key = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[10] || (_cache[10] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"该字段将作为主表的外键使用(一般使用被选取表的主键)\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [10]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Label\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: $data.formData.olTableSelect.label,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => $data.formData.olTableSelect.label = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[11] || (_cache[11] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"将该字段作为下拉框回显的值\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [11]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"Label追加编码\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_switch, {\n modelValue: $data.formData.olTableSelect.labelIsAppendCode,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => $data.formData.olTableSelect.labelIsAppendCode = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), _cache[12] || (_cache[12] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \" 开启后会在显示值后追加编码信息如:[1]男\", -1 /* CACHED */))]),\n _: 1 /* STABLE */,\n __: [12]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"字段映射\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($data.fieldMappings, (mapping, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: index,\n class: \"mapping-item\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 目标字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.target,\n \"onUpdate:modelValue\": $event => mapping.target = $event,\n placeholder: \"目标字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), _cache[13] || (_cache[13] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"separator\"\n }, \"→\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 源字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.source,\n \"onUpdate:modelValue\": $event => mapping.source = $event,\n placeholder: \"源字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"danger\",\n icon: \"el-icon-delete\",\n circle: \"\",\n onClick: $event => $options.removeMapping('fieldMappings', index),\n style: {\n \"margin-left\": \"10px\"\n }\n }, null, 8 /* PROPS */, [\"onClick\"])]);\n }), 128 /* KEYED_FRAGMENT */)), _cache[15] || (_cache[15] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"格式:目标字段 → 源原字段 (如果目标字段与源字段命名一致,可以只填写左边目标字段栏即可)\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n icon: \"el-icon-plus\",\n onClick: _cache[5] || (_cache[5] = $event => $options.addMapping('fieldMappings')),\n style: {\n \"margin-top\": \"10px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[14] || (_cache[14] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 新增映射 \")])),\n _: 1 /* STABLE */,\n __: [14]\n })])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, {\n label: \"查询映射\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($data.selectMappings, (mapping, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: index,\n class: \"mapping-item\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 目标字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.target,\n \"onUpdate:modelValue\": $event => mapping.target = $event,\n placeholder: \"目标字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), _cache[16] || (_cache[16] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"separator\"\n }, \"→\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 源字段\" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(index + 1) + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_input, {\n modelValue: mapping.source,\n \"onUpdate:modelValue\": $event => mapping.source = $event,\n placeholder: \"源字段名\",\n style: {\n \"width\": \"200px\"\n }\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"danger\",\n icon: \"el-icon-delete\",\n circle: \"\",\n onClick: $event => $options.removeMapping('selectMappings', index),\n style: {\n \"margin-left\": \"10px\"\n }\n }, null, 8 /* PROPS */, [\"onClick\"])]);\n }), 128 /* KEYED_FRAGMENT */)), _cache[18] || (_cache[18] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"form-item-description\"\n }, \"格式:目标字段 → 源原字段 (如果目标字段与源字段命名一致,可以只填写左边目标字段栏即可)\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n icon: \"el-icon-plus\",\n onClick: _cache[6] || (_cache[6] = $event => $options.addMapping('selectMappings')),\n style: {\n \"margin-top\": \"10px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[17] || (_cache[17] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" 新增映射 \")])),\n _: 1 /* STABLE */,\n __: [17]\n })])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_form_item, null, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $options.generateJson\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[19] || (_cache[19] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"生成JSON\")])),\n _: 1 /* STABLE */,\n __: [19]\n }, 8 /* PROPS */, [\"onClick\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"model\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [_cache[20] || (_cache[20] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h3\", null, \"生成的JSON:\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"pre\", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formattedJson), 1 /* TEXT */)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n onClick: _cache[7] || (_cache[7] = $event => this.state.show = false),\n style: {\n \"width\": \"100px\",\n \"margin-top\": \"15px\",\n \"margin-right\": \"15px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[21] || (_cache[21] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"取消\")])),\n _: 1 /* STABLE */,\n __: [21]\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $options.confirm,\n style: {\n \"width\": \"100px\",\n \"margin-top\": \"15px\",\n \"margin-right\": \"15px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[22] || (_cache[22] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"确 定\")])),\n _: 1 /* STABLE */,\n __: [22]\n }, 8 /* PROPS */, [\"onClick\"])])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"onOpen\"])])]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/ol-table-select-config.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");
|
|
1558
1558
|
|
|
1559
1559
|
/***/ }),
|
|
1560
1560
|
|
|
@@ -2049,7 +2049,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
2049
2049
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2050
2050
|
|
|
2051
2051
|
"use strict";
|
|
2052
|
-
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 core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __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_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_tab_pane = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-tab-pane\");\n const _component_el_tabs = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-tabs\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-dialog\");\n const _directive_loading = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveDirective)(\"loading\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n modelValue: $setup.show,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => $setup.show = $event),\n title: '配置中心 - ' + $setup.provides.form.theme,\n width: \"90%\",\n \"close-on-press-escape\": false,\n \"close-on-click-modal\": false,\n \"destroy-on-close\": \"\",\n \"show-close\": false,\n \"align-center\": \"\"\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n onClick: _cache[2] || (_cache[2] = $event => {\n $setup.show = false;\n $setup.emits('configClose');\n }),\n loading: $setup.loading\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[4] || (_cache[4] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"取 消\")])),\n _: 1 /* STABLE */,\n __: [4]\n }, 8 /* PROPS */, [\"loading\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $setup.saveClick,\n loading: $setup.loading\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[5] || (_cache[5] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"保 存\")])),\n _: 1 /* STABLE */,\n __: [5]\n }, 8 /* PROPS */, [\"loading\"])]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tabs, {\n modelValue: $setup.activeName,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $setup.activeName = $event),\n onTabChange: $setup.updateShow,\n \"element-loading-text\": $setup.provides.loadingText,\n \"element-loading-background\": \"rgba(122, 122, 122, 0.8)\",\n key: 'config_el_tables_1',\n style: {\n \"height\": \"680px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: \"数据配置\",\n name: \"baseConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"BaseConfig\"], {\n columns: $setup.columns,\n ref: \"baseConfig\",\n onUpdateTable: $setup.updateTable,\n onLoading: _cache[0] || (_cache[0] = $event => $setup.loading = $event),\n onUpdateCurd: $setup.updateCurd\n }, null, 8 /* PROPS */, [\"columns\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: $setup.provides.form.tableType === '1' ? 'table配置' : 'card配置',\n name: \"tableConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [$setup.provides.form.tableType === '1' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)($setup[\"TableConfig\"], {\n key: 0,\n ref: \"tableConfig\",\n onTableConfigChange: $setup.tableConfigChange\n }, null, 512 /* NEED_PATCH */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)($setup[\"CardConfig\"], {\n key: 1,\n ref: \"tableConfig\",\n onTableConfigChange: $setup.tableConfigChange\n }, null, 512 /* NEED_PATCH */))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"label\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: \"列配置\",\n name: \"columnConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"ColumnConfig\"], {\n addVisible: $setup.provides.form.toolBut.indexOf('add') != -1,\n editVisible: $setup.provides.form.operationBut.indexOf('edit') != -1,\n ref: \"columnConfig\",\n isTable: $setup.provides.form.tableType === '1',\n onCheckBoxChange: $setup.columnCheckBoxChange,\n onCheckBoxAll: $setup.columnCheckBoxAll\n }, null, 8 /* PROPS */, [\"addVisible\", \"editVisible\", \"isTable\"])]),\n _: 1 /* STABLE */\n }), ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)($setup.provides.form.toolButOptions.filter(option => option.isForm == 1), item => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tab_pane, {\n label: item.name + '表单配置',\n name: item.code\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"FormConfig\"], {\n type: item.code,\n ref_for: true,\n ref: el => $setup.setRefMap(el, item.code)\n }, null, 8 /* PROPS */, [\"type\"])]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"label\", \"name\"]);\n }), 256 /* UNKEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 编辑表单配置 \"), ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)($setup.provides.form.operationButOptions.filter(option => option.isForm == 1), item => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tab_pane, {\n label: item.name + '表单配置',\n name: item.code\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"FormConfig\"], {\n type: item.code,\n ref_for: true,\n ref: el => $setup.setRefMap(el, item.code)\n }, null, 8 /* PROPS */, [\"type\"])]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"label\", \"name\"]);\n }), 256 /* UNKEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-tab-pane label=\\\"新增表单配置\\\" name=\\\"add\\\" v-if=\\\"provides.form.toolBut.indexOf('add') != -1\\\">\\r\\n <FormConfig type=\\\"add\\\" :ref=\\\"(el) => setRefMap(el, 'add')\\\"/>\\r\\n </el-tab-pane>\\r\\n <el-tab-pane label=\\\"编辑表单配置\\\" name=\\\"edit\\\" v-if=\\\"provides.form.operationBut.indexOf('edit') != -1\\\">\\r\\n <FormConfig type=\\\"edit\\\" :ref=\\\"(el) => setRefMap(el, 'edit')\\\"/>\\r\\n </el-tab-pane>\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-tab-pane label=\\\"脚本配置\\\" name=\\\"scriptConfig\\\">\\r\\n <ScriptConfig ref=\\\"scriptConfig\\\"/>\\r\\n </el-tab-pane>\")]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"element-loading-text\"])), [[_directive_loading, $setup.loading]])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\"]);\n}\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/index.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");
|
|
2052
|
+
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 core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __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_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_tab_pane = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-tab-pane\");\n const _component_el_tabs = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-tabs\");\n const _component_el_input = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-input\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-dialog\");\n const _directive_loading = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveDirective)(\"loading\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n modelValue: $setup.show,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => $setup.show = $event),\n title: '配置中心 - ' + $setup.provides.form.theme,\n width: \"90%\",\n \"close-on-press-escape\": false,\n \"close-on-click-modal\": false,\n \"destroy-on-close\": \"\",\n \"show-close\": false,\n \"align-center\": \"\"\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_input, {\n placeholder: \"uuid,theme\",\n style: {\n \"width\": \"250px\",\n \"float\": \"left\"\n },\n modelValue: $setup.mainConfig.uuids,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $setup.mainConfig.uuids = $event)\n }, null, 8 /* PROPS */, [\"modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n type: \"success\",\n style: {\n \"float\": \"left\"\n },\n onClick: $setup.saveClickCp,\n loading: $setup.loading\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[5] || (_cache[5] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"复制其他配置\")])),\n _: 1 /* STABLE */,\n __: [5]\n }, 8 /* PROPS */, [\"loading\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n onClick: _cache[3] || (_cache[3] = $event => {\n $setup.show = false;\n $setup.emits('configClose');\n }),\n loading: $setup.loading\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[6] || (_cache[6] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"取 消\")])),\n _: 1 /* STABLE */,\n __: [6]\n }, 8 /* PROPS */, [\"loading\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n type: \"primary\",\n onClick: $setup.saveClick,\n loading: $setup.loading\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[7] || (_cache[7] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"保 存\")])),\n _: 1 /* STABLE */,\n __: [7]\n }, 8 /* PROPS */, [\"loading\"])]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tabs, {\n modelValue: $setup.activeName,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => $setup.activeName = $event),\n onTabChange: $setup.updateShow,\n \"element-loading-text\": $setup.provides.loadingText,\n \"element-loading-background\": \"rgba(122, 122, 122, 0.8)\",\n key: 'config_el_tables_1',\n style: {\n \"height\": \"680px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: \"数据配置\",\n name: \"baseConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"BaseConfig\"], {\n columns: $setup.columns,\n ref: \"baseConfig\",\n onUpdateTable: $setup.updateTable,\n onLoading: _cache[0] || (_cache[0] = $event => $setup.loading = $event),\n onUpdateCurd: $setup.updateCurd\n }, null, 8 /* PROPS */, [\"columns\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: $setup.provides.form.tableType === '1' ? 'table配置' : 'card配置',\n name: \"tableConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [$setup.provides.form.tableType === '1' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)($setup[\"TableConfig\"], {\n key: 0,\n ref: \"tableConfig\",\n onTableConfigChange: $setup.tableConfigChange\n }, null, 512 /* NEED_PATCH */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)($setup[\"CardConfig\"], {\n key: 1,\n ref: \"tableConfig\",\n onTableConfigChange: $setup.tableConfigChange\n }, null, 512 /* NEED_PATCH */))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"label\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_tab_pane, {\n label: \"列配置\",\n name: \"columnConfig\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"ColumnConfig\"], {\n addVisible: $setup.provides.form.toolBut.indexOf('add') != -1,\n editVisible: $setup.provides.form.operationBut.indexOf('edit') != -1,\n ref: \"columnConfig\",\n isTable: $setup.provides.form.tableType === '1',\n onCheckBoxChange: $setup.columnCheckBoxChange,\n onCheckBoxAll: $setup.columnCheckBoxAll\n }, null, 8 /* PROPS */, [\"addVisible\", \"editVisible\", \"isTable\"])]),\n _: 1 /* STABLE */\n }), ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)($setup.provides.form.toolButOptions.filter(option => option.isForm == 1), item => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tab_pane, {\n label: item.name + '表单配置',\n name: item.code\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"FormConfig\"], {\n type: item.code,\n ref_for: true,\n ref: el => $setup.setRefMap(el, item.code)\n }, null, 8 /* PROPS */, [\"type\"])]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"label\", \"name\"]);\n }), 256 /* UNKEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 编辑表单配置 \"), ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)($setup.provides.form.operationButOptions.filter(option => option.isForm == 1), item => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_tab_pane, {\n label: item.name + '表单配置',\n name: item.code\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)($setup[\"FormConfig\"], {\n type: item.code,\n ref_for: true,\n ref: el => $setup.setRefMap(el, item.code)\n }, null, 8 /* PROPS */, [\"type\"])]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"label\", \"name\"]);\n }), 256 /* UNKEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-tab-pane label=\\\"新增表单配置\\\" name=\\\"add\\\" v-if=\\\"provides.form.toolBut.indexOf('add') != -1\\\">\\r\\n <FormConfig type=\\\"add\\\" :ref=\\\"(el) => setRefMap(el, 'add')\\\"/>\\r\\n </el-tab-pane>\\r\\n <el-tab-pane label=\\\"编辑表单配置\\\" name=\\\"edit\\\" v-if=\\\"provides.form.operationBut.indexOf('edit') != -1\\\">\\r\\n <FormConfig type=\\\"edit\\\" :ref=\\\"(el) => setRefMap(el, 'edit')\\\"/>\\r\\n </el-tab-pane>\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-tab-pane label=\\\"脚本配置\\\" name=\\\"scriptConfig\\\">\\r\\n <ScriptConfig ref=\\\"scriptConfig\\\"/>\\r\\n </el-tab-pane>\")]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"element-loading-text\"])), [[_directive_loading, $setup.loading]])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\"]);\n}\n\n//# sourceURL=webpack://olp-table/./src/views/table/add-or-edit/config/index.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");
|
|
2053
2053
|
|
|
2054
2054
|
/***/ }),
|
|
2055
2055
|
|
|
@@ -12872,7 +12872,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12872
12872
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12873
12873
|
|
|
12874
12874
|
"use strict";
|
|
12875
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinBodyMethods: function() { return /* binding */ OTMixinBodyMethods; }\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_some_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.some.js */ \"./node_modules/core-js/modules/es.iterator.some.js\");\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/util */ \"./src/utils/util.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 vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/TableSortUtil */ \"./src/utils/TableSortUtil.js\");\n/* harmony import */ var _mixins_VTMixin_DefaultMethods__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/mixins/VTMixin/DefaultMethods */ \"./src/mixins/VTMixin/DefaultMethods.js\");\n/* harmony import */ var _directives_permission_hasPermi__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/directives/permission/hasPermi */ \"./src/directives/permission/hasPermi.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst message = (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)(); // 消息弹窗\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_4__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_5__.storeDictType)();\nconst OTMixinBodyMethods = {\n mixins: [_mixins_VTMixin_DefaultMethods__WEBPACK_IMPORTED_MODULE_11__.DefaultMethods],\n emits: ['handleOperationClick', 'toolbarBtnClick', 'initComponents', 'selectRowChange'],\n methods: {\n /**\r\n * 自定义表单方法\r\n * @returns {*}\r\n */\n customerForm(show) {\n this.toggleFormDisplay();\n this.table.formConfig.show = show == true;\n return this.table.formConfig;\n },\n /**\r\n * 搜索隐藏/显示\r\n */\n toggleFormDisplay() {\n // 获取组件的根 DOM 元素\n const rootEl = this.$refs[this.table.ref].$el;\n\n // 查询第一个子标签是否为 vxe-grid--form-wrapper\n const formWrapperEl = rootEl.querySelector('.vxe-grid--form-wrapper');\n if (formWrapperEl) {\n // 查询 formWrapperEl 下的第一个 form 标签\n const formEl = formWrapperEl.querySelector('form');\n if (formEl) {\n // 获取 form 标签的当前 display 样式\n const currentDisplay = window.getComputedStyle(formEl).display;\n\n // 根据当前 display 样式设置新的样式\n if (currentDisplay === 'none') {\n // 如果当前是 none,则移除 display 样式(设置为空字符串)\n formEl.style.display = '';\n } else {\n // 否则设置为 none\n formEl.style.display = 'none';\n }\n }\n }\n },\n /**\r\n * 选中回调\r\n */\n selectRowChange() {\n let rows = this.getSelectRows();\n if (!rows) {\n return;\n }\n this.pagination.selectionRowsLength = rows.length;\n this.setToolBtn('batchDelete', 'disabled', rows.length == 0);\n rows = this.selectBox == 1 ? rows[0] : rows;\n if (this.events['selectRowChange']) {\n this.events['selectRowChange'](rows);\n }\n this.$emit(\"selectRowChange\", rows);\n },\n /**\r\n * 切换表格最大化/还原\r\n */\n zoomEvent() {\n if (this.$table) {\n this.$table.zoom();\n this.isMaximized = this.$table.isMaximized();\n }\n },\n initToolBtn(toolBut) {\n let obj = undefined;\n for (let i = 0; i < toolBut.length; i++) {\n let toolButElement = toolBut[i];\n toolButElement.disabled = toolButElement.defaultDisabled == 1;\n toolButElement.show = toolButElement.defaultShow == 1;\n if (toolButElement.code == 'sortable') {\n toolButElement.values = false;\n obj = JSON.parse(JSON.stringify(toolButElement));\n obj.id = obj.id + \"_sortable\";\n obj.name = \"调整完成\";\n obj.code = \"sortableOk\";\n obj.icon = \"vxe-icon-check\";\n obj.show = false;\n obj.disabled = true;\n obj.index = i + 1;\n }\n }\n if (obj) {\n toolBut.splice(obj.index, 0, obj);\n }\n this.toolBtn = toolBut;\n },\n initOperationBtn(operationBtn) {\n this.operationBtn = operationBtn;\n let permissEx = 0;\n for (let i = 0; i < this.operationBtn.length; i++) {\n let operationBtnElement = this.operationBtn[i];\n let flag = (0,_directives_permission_hasPermi__WEBPACK_IMPORTED_MODULE_12__.doPermission)({\n parentNode: false\n }, [this.uuid + ':' + this.theme + ':' + operationBtnElement.code]);\n if (!flag) {\n operationBtnElement.permission = false;\n permissEx++;\n }\n }\n let length = this.operationBtn.length - permissEx;\n let width = 35;\n if (length != 0) {\n if (this.table.operationWidth) {\n width = this.table.operationWidth;\n } else {\n for (let o of this.operationBtn.filter(o => o.permission !== false)) {\n width += o.name.length * (35 - length) + (o.icon !== undefined ? 5 : 0);\n }\n }\n const hasOperateColumn = this.table.columns.some(col => ['操作'].includes(col.title));\n if (!hasOperateColumn) {\n this.table.columns.push({\n title: '操作',\n width: width,\n fixed: \"right\",\n slots: {\n default: 'operate'\n }\n });\n }\n }\n },\n initTree({\n tree,\n treeId,\n treeParentId\n }) {\n if (tree == 1) {\n this.table.treeConfig = {\n show: true,\n transform: false,\n indent: 15,\n reserve: tree,\n rowField: treeId,\n parentField: treeParentId,\n treeId: treeId,\n treeParentId: treeParentId,\n iconClose: \"vxe-icon-arrow-right\",\n iconOpen: \"vxe-icon-arrow-down\"\n };\n this.table.rowConfig.keyField = treeId;\n }\n },\n initFormMainList(formMainList) {\n this.formMainList = formMainList;\n },\n async doSetComponents(customUrl, method, props, multipleProps) {\n this.customUrl = (0,vue__WEBPACK_IMPORTED_MODULE_9__.markRaw)(customUrl);\n await this.$nextTick(async () => {\n if (multipleProps == '1' || multipleProps == true) {\n doCallback(this.$refs.components[method], props);\n } else if (multipleProps == '2') {\n doCallback2(this.$refs.components[method], props);\n } else {\n this.$refs.components[method](props);\n }\n });\n },\n setComponent(url, method, props, multipleProps) {\n if (url.indexOf(\"@\") == 0) {\n this.$emit('initComponents', {\n url: url,\n method: method,\n props: props,\n multipleProps: multipleProps,\n doSetComponents: this.doSetComponents\n });\n } else {\n this.doSetComponents(__webpack_require__(\"./src sync recursive ^\\\\.\\\\/.*$\")(`./${url}`).default, method, props, multipleProps);\n }\n },\n async toolbarBtnClick(code) {\n let {\n customFunction,\n isForm\n } = this.getToolBtn(code);\n if (customFunction != undefined && customFunction.toString().trim().length > 0) {\n eval(customFunction);\n return;\n } else if (isForm == 1) {\n this.showForm(code);\n return;\n }\n if (code == \"batchDelete\") {\n this.batchRemove();\n this.$emit('toolbarBtnClick', code);\n return;\n } else if (code == 'download') {\n this.setComponent(\"components/ol-dialog-excel\", \"open\", {\n column: JSON.parse(JSON.stringify(this.table.columnSource)),\n selectData: this.pagination.selectionRowsLength >= 1 ? '2' : '1'\n });\n return;\n } else if (code == 'upload') {\n let toolBtn = this.getToolBtn(code);\n let {\n json,\n beforeFunction\n } = toolBtn;\n if (json) {\n json = json.replace(/([{,]\\s*)([a-zA-Z0-9_]+)(\\s*:)/g, '$1\"$2\"$3').replace(/:(\\s*)'([^']+)'(\\s*[,}])/g, ':$1\"$2\"$3'); // 修正字符串值\n json = JSON.parse(json);\n }\n let defaultValue = {};\n if (beforeFunction) {\n // 第一次分割:按逗号分割成键值对\n //\"department_id=#{department_id},sex=1\"\n let pairs = beforeFunction.split(',');\n for (const pair of pairs) {\n // 第二次分割:按等号分割键和值\n let [key, value] = pair.split('=');\n if (value != undefined) {\n let value2 = value.toString().trim();\n if (value2.trim().startsWith('#{') && value2.endsWith('}')) {\n // 处理 #{department_id} 格式的值\n let key2 = value.slice(2, -1).trim(); // 去掉 #{ 和 }\n this.setParamsValue(defaultValue, key2);\n } else {\n defaultValue[key] = value;\n }\n } else {\n this.setParamsValue(defaultValue, key);\n }\n }\n }\n this.setComponent(\"components/ol-dialog-import\", \"open\", {\n column: JSON.parse(JSON.stringify(this.table.columnSource)),\n tableConfigId: this.tableConfig.id,\n json: json,\n defaultValue: defaultValue,\n saveParams: {\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n tableConfigId: this.tableConfig.id\n }\n });\n return;\n } else if (code == 'sortable') {\n this.sortableClick();\n return;\n } else if (code == 'sortableOk') {\n this.loading['sortableOk'] = true;\n this.sortableOkClick();\n return;\n }\n if (code == 'print') {\n this.openPrint();\n return;\n }\n this.$emit('toolbarBtnClick', code);\n },\n setParamsValue(params, key) {\n key = key.trim();\n let v = this.table.formConfig.data[key];\n if (v == undefined) {\n v = this.parameter[key];\n }\n if (v != undefined) {\n params[key] = v;\n }\n },\n getBtnJson(code) {\n for (const toolBtn of this.operationBtn) {\n if (toolBtn.code == code) {\n return this.getSubParam(toolBtn.json);\n }\n }\n for (const toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return this.getSubParam(toolBtn.json);\n }\n }\n },\n getDeleteId(param) {\n for (let key of Object.keys(param)) {\n if (key != '$parentId') {\n return key;\n }\n }\n },\n sortableClick() {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == 'sortable') {\n toolBtn.values = !toolBtn.values;\n this.loading['sortableOk'] = false;\n this.setToolBtn('sortableOk', 'show', toolBtn.values);\n toolBtn.start = 999999;\n toolBtn.end = -1;\n if (toolBtn.values) {\n if (toolBtn.beforeFunction == undefined || toolBtn.beforeFunction == '' || toolBtn.beforeFunction.split(\",\") < 2) {\n message.error(\"排序字段未配置,请在做工具栏按钮配置中配置参数1(sort,id)\");\n return;\n }\n toolBtn.updateData = {};\n toolBtn.$elm = (0,_utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__.updateSortRowCall)(this.$table, (oldIndex, newIndex) => {\n let start = Math.min(oldIndex, newIndex);\n let end = Math.max(oldIndex, newIndex);\n toolBtn.start = Math.min(start, toolBtn.start);\n toolBtn.end = Math.max(end, toolBtn.end);\n this.setToolBtn('sortableOk', 'disabled', false);\n this.table.data = (0,_utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__.getNewArrDataToolBtn)(oldIndex, newIndex, this.table.data, toolBtn);\n });\n } else if (toolBtn.$elm) {\n this.setToolBtn('sortableOk', 'disabled', true);\n toolBtn.$elm.destroy();\n toolBtn.$elm = undefined;\n this.query();\n }\n return;\n }\n }\n },\n print() {\n this.$table.print();\n },\n openPrint() {\n this.$table.openPrint({\n style: `.vxe-table--print-wrapper.vxe-body--row td,.vxe-table--print-wrapper.vxe-header--row th{white-space:nowrap!important;overflow:visible!important}@page{size:landscape;margin:10mm}@media print{@page{margin:0}body{margin:1cm}}`,\n zoom: 0.8\n });\n },\n sortableOkClick() {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == 'sortable') {\n let url;\n this.loading['sortableOk'] = true;\n this.table.loading = true;\n let params = {\n list: [],\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable\n };\n //sort,id 排序字段,更新主键\n let kw = toolBtn.beforeFunction.split(\",\");\n if (toolBtn.alterFunction) {\n url = toolBtn.alterFunction;\n } else {\n url = '/online/crud/batchModify';\n params.tableConfigId = this.tableConfig.id;\n }\n //这里肯定只有一个值\n for (let key of Object.keys(toolBtn.updateData)) {\n if (toolBtn.alterFunction) {\n let kv = {};\n kv[kw[1]] = key;\n kv[kw[0]] = toolBtn.updateData[key];\n params.list.push(kv);\n } else {\n let columnAndValueMap = {};\n let whereMap = {};\n whereMap[kw[1]] = key;\n columnAndValueMap[kw[0]] = toolBtn.updateData[key];\n params.list.push({\n columnAndValueMap,\n whereMap\n });\n }\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n if (status) {\n this.query();\n this.setToolBtn('sortableOk', 'disabled', true);\n }\n }).finally(() => {\n this.loading['sortableOk'] = false;\n this.table.loading = false;\n });\n }\n }\n },\n showRender(descCode, url, title) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, '/online/formDesigner/getOne', {\n descCode: descCode\n }, undefined, true).then(d => {\n let data = {\n type: 1,\n saveUrl: url,\n title: title,\n form: JSON.parse(d.formJson),\n tableConfigId: this.tableConfig.id\n };\n this.$refs[\"form\"].init(data, false);\n });\n },\n showForm(code, formData, js) {\n if (!formData) {\n formData = {};\n }\n let disabled = false;\n let btnJson = this.getBtnJson(code);\n //详情\n if (code == 'details') {\n disabled = true;\n code = 'edit';\n let btnJson2 = this.getBtnJson(code);\n if (btnJson2) {\n btnJson = {\n ...btnJson,\n ...btnJson2\n };\n } else if (btnJson2 !== undefined) {\n btnJson = btnJson2;\n }\n if (!btnJson || !btnJson.title) {\n btnJson.title = '详情';\n }\n }\n let form = this.formMainList[code];\n if (!form) {\n return;\n }\n let formJsonStr = form.formJson[form.formMain.designer == 0 ? 'optionJson' : 'customJson'];\n let data = {\n type: form.formMain.designer,\n saveUrl: form.formMain.saveUrl,\n requestType: form.formMain.requestType,\n updateKey: form.formMain.updateKey,\n otherProp: form.formMain.otherProp,\n formData,\n theme: this.theme,\n form: JSON.parse(formJsonStr),\n tableConfigId: this.tableConfig.id,\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n code,\n disabled\n };\n if (btnJson && btnJson.type == 1) {\n data.uuid = btnJson.subUuid;\n data.title = btnJson.title;\n data.deleteId = btnJson.deleteId;\n data.foreignKey = btnJson.subForeignKey;\n data.exBtnDisabled = btnJson.exBtnDisabled;\n this.$refs[\"subForm\"].init(data, js);\n } else {\n this.$nextTick(() => {\n data.title = btnJson.title;\n this.$refs[\"form\"].init(data, js);\n });\n }\n },\n async handleOperationClick(o) {\n let {\n obj,\n row\n } = o;\n if (obj.customFunction) {\n eval(obj.customFunction);\n } else if (obj.code == \"delete\") {\n this.remove(o);\n } else if (obj.code == 'edit' || obj.code == 'details' || obj.isForm == 1) {\n this.showForm(obj.code, row);\n }\n this.$emit(\"handleOperationClick\", o);\n },\n getSubParam(json) {\n let obj = {\n deleteId: this.getDeleteId(this.deleteParameter)\n }; // 初始化为空对象\n if (json) {\n return {\n ...obj,\n ...JSON.parse(json)\n };\n }\n return {\n ...obj\n };\n }\n },\n created() {\n dict.init(this.http);\n dictType.init(this.http);\n }\n};\nfunction rowCamelCase(o) {\n let obj = {};\n for (let key of Object.keys(o)) {\n if (key == 'XROWKEY') {\n continue;\n }\n let k = key;\n if (re(key)) {\n k = key.substring(3);\n }\n obj[(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__.toCamelCase)(k)] = o[key];\n }\n return obj;\n}\nfunction re(k) {\n let reg = /^t\\d_/;\n return reg.test(k);\n}\nfunction doCallback(fn, args) {\n for (let arg of args) {\n fn.apply(this, arg);\n }\n}\nfunction doCallback2(fn, args) {\n fn.apply(this, args);\n}\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OTMixinBodyMethods.js?");
|
|
12875
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinBodyMethods: function() { return /* binding */ OTMixinBodyMethods; }\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_some_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.some.js */ \"./node_modules/core-js/modules/es.iterator.some.js\");\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/util */ \"./src/utils/util.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 vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/TableSortUtil */ \"./src/utils/TableSortUtil.js\");\n/* harmony import */ var _mixins_VTMixin_DefaultMethods__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/mixins/VTMixin/DefaultMethods */ \"./src/mixins/VTMixin/DefaultMethods.js\");\n/* harmony import */ var _directives_permission_hasPermi__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/directives/permission/hasPermi */ \"./src/directives/permission/hasPermi.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst message = (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)(); // 消息弹窗\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_4__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_5__.storeDictType)();\nconst OTMixinBodyMethods = {\n mixins: [_mixins_VTMixin_DefaultMethods__WEBPACK_IMPORTED_MODULE_11__.DefaultMethods],\n emits: ['handleOperationClick', 'toolbarBtnClick', 'initComponents', 'selectRowChange'],\n methods: {\n /**\r\n * 自定义表单方法\r\n * @returns {*}\r\n */\n customerForm(show) {\n this.toggleFormDisplay();\n this.table.formConfig.show = show == true;\n return this.table.formConfig;\n },\n /**\r\n * 搜索隐藏/显示\r\n */\n toggleFormDisplay() {\n // 获取组件的根 DOM 元素\n const rootEl = this.$refs[this.table.ref].$el;\n\n // 查询第一个子标签是否为 vxe-grid--form-wrapper\n const formWrapperEl = rootEl.querySelector('.vxe-grid--form-wrapper');\n if (formWrapperEl) {\n // 查询 formWrapperEl 下的第一个 form 标签\n const formEl = formWrapperEl.querySelector('form');\n if (formEl) {\n // 获取 form 标签的当前 display 样式\n const currentDisplay = window.getComputedStyle(formEl).display;\n\n // 根据当前 display 样式设置新的样式\n if (currentDisplay === 'none') {\n // 如果当前是 none,则移除 display 样式(设置为空字符串)\n formEl.style.display = '';\n } else {\n // 否则设置为 none\n formEl.style.display = 'none';\n }\n }\n }\n },\n /**\r\n * 选中回调\r\n */\n selectRowChange() {\n let rows = this.getSelectRows();\n if (!rows) {\n return;\n }\n this.pagination.selectionRowsLength = rows.length;\n this.setToolBtn('batchDelete', 'disabled', rows.length == 0);\n rows = this.selectBox == 1 ? rows[0] : rows;\n if (this.events['selectRowChange']) {\n this.events['selectRowChange'](rows);\n }\n this.$emit(\"selectRowChange\", rows);\n },\n /**\r\n * 切换表格最大化/还原\r\n */\n zoomEvent() {\n if (this.$table) {\n this.$table.zoom();\n this.isMaximized = this.$table.isMaximized();\n }\n },\n initToolBtn(toolBut) {\n let obj = undefined;\n for (let i = 0; i < toolBut.length; i++) {\n let toolButElement = toolBut[i];\n toolButElement.disabled = toolButElement.defaultDisabled == 1;\n toolButElement.show = toolButElement.defaultShow == 1;\n if (toolButElement.code == 'sortable') {\n toolButElement.values = false;\n obj = JSON.parse(JSON.stringify(toolButElement));\n obj.id = obj.id + \"_sortable\";\n obj.name = \"调整完成\";\n obj.code = \"sortableOk\";\n obj.icon = \"vxe-icon-check\";\n obj.show = false;\n obj.disabled = true;\n obj.index = i + 1;\n }\n }\n if (obj) {\n toolBut.splice(obj.index, 0, obj);\n }\n this.toolBtn = toolBut;\n },\n initOperationBtn(operationBtn) {\n this.operationBtn = operationBtn;\n let permissEx = 0;\n for (let i = 0; i < this.operationBtn.length; i++) {\n let operationBtnElement = this.operationBtn[i];\n let flag = (0,_directives_permission_hasPermi__WEBPACK_IMPORTED_MODULE_12__.doPermission)({\n parentNode: false\n }, [this.uuid + ':' + this.theme + ':' + operationBtnElement.code]);\n if (!flag) {\n operationBtnElement.permission = false;\n permissEx++;\n }\n }\n let length = this.operationBtn.length - permissEx;\n let width = 35;\n if (length != 0) {\n if (this.table.operationWidth) {\n width = this.table.operationWidth;\n } else {\n for (let o of this.operationBtn.filter(o => o.permission !== false)) {\n width += o.name.length * (35 - length) + (o.icon !== undefined ? 5 : 0);\n }\n }\n const hasOperateColumn = this.table.columns.some(col => ['操作'].includes(col.title));\n if (!hasOperateColumn) {\n this.table.columns.push({\n title: '操作',\n width: width,\n fixed: \"right\",\n slots: {\n default: 'operate'\n }\n });\n }\n }\n },\n initTree({\n tree,\n treeId,\n treeParentId\n }) {\n if (tree == 1) {\n this.table.treeConfig = {\n show: true,\n transform: false,\n indent: 15,\n reserve: tree,\n rowField: treeId,\n parentField: treeParentId,\n treeId: treeId,\n treeParentId: treeParentId,\n iconClose: \"vxe-icon-arrow-right\",\n iconOpen: \"vxe-icon-arrow-down\"\n };\n this.table.rowConfig.keyField = treeId;\n }\n },\n initFormMainList(formMainList) {\n this.formMainList = formMainList;\n },\n async doSetComponents(customUrl, method, props, multipleProps) {\n this.customUrl = (0,vue__WEBPACK_IMPORTED_MODULE_9__.markRaw)(customUrl);\n await this.$nextTick(async () => {\n if (multipleProps == '1' || multipleProps == true) {\n doCallback(this.$refs.components[method], props);\n } else if (multipleProps == '2') {\n doCallback2(this.$refs.components[method], props);\n } else {\n this.$refs.components[method](props);\n }\n });\n },\n setComponent(url, method, props, multipleProps) {\n if (url.indexOf(\"@\") == 0) {\n this.$emit('initComponents', {\n url: url,\n method: method,\n props: props,\n multipleProps: multipleProps,\n doSetComponents: this.doSetComponents\n });\n } else {\n this.doSetComponents(__webpack_require__(\"./src sync recursive ^\\\\.\\\\/.*$\")(`./${url}`).default, method, props, multipleProps);\n }\n },\n async toolbarBtnClick(code) {\n let {\n customFunction,\n isForm\n } = this.getToolBtn(code);\n if (customFunction != undefined && customFunction.toString().trim().length > 0) {\n eval(customFunction);\n return;\n } else if (isForm == 1) {\n this.showForm(code);\n return;\n }\n if (code == \"batchDelete\") {\n this.batchRemove();\n this.$emit('toolbarBtnClick', code);\n return;\n } else if (code == 'download') {\n this.setComponent(\"components/ol-dialog-excel\", \"open\", {\n column: JSON.parse(JSON.stringify(this.table.columnSource)),\n selectData: this.pagination.selectionRowsLength >= 1 ? '2' : '1'\n });\n return;\n } else if (code == 'upload') {\n let toolBtn = this.getToolBtn(code);\n let {\n json,\n beforeFunction\n } = toolBtn;\n if (json) {\n json = json.replace(/([{,]\\s*)([a-zA-Z0-9_]+)(\\s*:)/g, '$1\"$2\"$3').replace(/:(\\s*)'([^']+)'(\\s*[,}])/g, ':$1\"$2\"$3'); // 修正字符串值\n json = JSON.parse(json);\n }\n let defaultValue = {};\n if (beforeFunction) {\n // 第一次分割:按逗号分割成键值对\n //\"department_id=#{department_id},sex=1\"\n let pairs = beforeFunction.split(',');\n for (const pair of pairs) {\n // 第二次分割:按等号分割键和值\n let [key, value] = pair.split('=');\n if (value != undefined) {\n let value2 = value.toString().trim();\n if (value2.trim().startsWith('#{') && value2.endsWith('}')) {\n // 处理 #{department_id} 格式的值\n let key2 = value.slice(2, -1).trim(); // 去掉 #{ 和 }\n this.setParamsValue(defaultValue, key2);\n } else {\n defaultValue[key] = value;\n }\n } else {\n this.setParamsValue(defaultValue, key);\n }\n }\n }\n this.setComponent(\"components/ol-dialog-import\", \"open\", {\n column: JSON.parse(JSON.stringify(this.table.columnSource)),\n tableConfigId: this.tableConfig.id,\n json: json,\n defaultValue: defaultValue,\n saveParams: {\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n tableConfigId: this.tableConfig.id\n }\n });\n return;\n } else if (code == 'sortable') {\n this.sortableClick();\n return;\n } else if (code == 'sortableOk') {\n this.loading['sortableOk'] = true;\n this.sortableOkClick();\n return;\n }\n if (code == 'print') {\n this.openPrint();\n return;\n }\n this.$emit('toolbarBtnClick', code);\n },\n setParamsValue(params, key) {\n key = key.trim();\n let v = this.table.formConfig.data[key];\n if (v == undefined) {\n v = this.parameter[key];\n }\n if (v != undefined) {\n params[key] = v;\n }\n },\n getBtnJson(code) {\n for (const toolBtn of this.operationBtn) {\n if (toolBtn.code == code) {\n return this.getSubParam(toolBtn.json);\n }\n }\n for (const toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return this.getSubParam(toolBtn.json);\n }\n }\n },\n getDeleteId(param) {\n for (let key of Object.keys(param)) {\n if (key != '$parentId') {\n return key;\n }\n }\n },\n sortableClick() {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == 'sortable') {\n toolBtn.values = !toolBtn.values;\n this.loading['sortableOk'] = false;\n this.setToolBtn('sortableOk', 'show', toolBtn.values);\n if (toolBtn.values) {\n //关闭虚拟滚动\n }\n toolBtn.start = 999999;\n toolBtn.end = -1;\n if (toolBtn.values) {\n if (toolBtn.beforeFunction == undefined || toolBtn.beforeFunction == '' || toolBtn.beforeFunction.split(\",\") < 2) {\n message.error(\"排序字段未配置,请在做工具栏按钮配置中配置参数1(sort,id)\");\n return;\n }\n toolBtn.updateData = {};\n toolBtn.updateFiled = toolBtn.beforeFunction.split(\",\")[0];\n toolBtn.$elm = (0,_utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__.updateSortRowCall)(toolBtn, this.$table, () => {\n this.table.loading = true;\n this.setToolBtn('sortableOk', 'disabled', false);\n let newData = (0,_utils_TableSortUtil__WEBPACK_IMPORTED_MODULE_10__.getNewArrDataToolBtn)(this.table.data, toolBtn);\n this.table.data = [];\n this.$nextTick(() => {\n this.table.data = newData;\n this.table.loading = false;\n });\n });\n } else if (toolBtn.$elm) {\n this.setToolBtn('sortableOk', 'disabled', true);\n toolBtn.$elm.destroy();\n toolBtn.$elm = undefined;\n this.query();\n }\n return;\n }\n }\n },\n print() {\n this.$table.print();\n },\n openPrint() {\n this.$table.openPrint({\n style: `.vxe-table--print-wrapper.vxe-body--row td,.vxe-table--print-wrapper.vxe-header--row th{white-space:nowrap!important;overflow:visible!important}@page{size:landscape;margin:10mm}@media print{@page{margin:0}body{margin:1cm}}`,\n zoom: 0.8\n });\n },\n sortableOkClick() {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == 'sortable') {\n let url;\n this.loading['sortableOk'] = true;\n this.table.loading = true;\n let params = {\n list: [],\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable\n };\n //sort,id 排序字段,更新主键\n let kw = toolBtn.beforeFunction.split(\",\");\n if (toolBtn.alterFunction) {\n url = toolBtn.alterFunction;\n } else {\n url = '/online/crud/batchModify';\n params.tableConfigId = this.tableConfig.id;\n }\n //这里肯定只有一个值\n for (let key of Object.keys(toolBtn.updateData)) {\n if (toolBtn.alterFunction) {\n let kv = {};\n kv[kw[1]] = key;\n kv[kw[0]] = toolBtn.updateData[key];\n params.list.push(kv);\n } else {\n let columnAndValueMap = {};\n let whereMap = {};\n whereMap[kw[1]] = key;\n columnAndValueMap[kw[0]] = toolBtn.updateData[key];\n params.list.push({\n columnAndValueMap,\n whereMap\n });\n }\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n if (status) {\n this.query();\n this.setToolBtn('sortableOk', 'disabled', true);\n }\n }).finally(() => {\n this.loading['sortableOk'] = false;\n this.table.loading = false;\n });\n }\n }\n },\n showRender(descCode, url, title) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, '/online/formDesigner/getOne', {\n descCode: descCode\n }, undefined, true).then(d => {\n let data = {\n type: 1,\n saveUrl: url,\n title: title,\n form: JSON.parse(d.formJson),\n tableConfigId: this.tableConfig.id\n };\n this.$refs[\"form\"].init(data, false);\n });\n },\n showForm(code, formData, js) {\n if (!formData) {\n formData = {};\n }\n let disabled = false;\n let btnJson = this.getBtnJson(code);\n //详情\n if (code == 'details') {\n disabled = true;\n code = 'edit';\n let btnJson2 = this.getBtnJson(code);\n if (btnJson2) {\n btnJson = {\n ...btnJson,\n ...btnJson2\n };\n } else if (btnJson2 !== undefined) {\n btnJson = btnJson2;\n }\n if (!btnJson || !btnJson.title) {\n btnJson.title = '详情';\n }\n }\n let form = this.formMainList[code];\n if (!form) {\n return;\n }\n let formJsonStr = form.formJson[form.formMain.designer == 0 ? 'optionJson' : 'customJson'];\n let data = {\n type: form.formMain.designer,\n saveUrl: form.formMain.saveUrl,\n requestType: form.formMain.requestType,\n updateKey: form.formMain.updateKey,\n otherProp: form.formMain.otherProp,\n formData,\n theme: this.theme,\n form: JSON.parse(formJsonStr),\n tableConfigId: this.tableConfig.id,\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n code,\n disabled\n };\n if (btnJson && btnJson.type == 1) {\n data.uuid = btnJson.subUuid;\n data.title = btnJson.title;\n data.deleteId = btnJson.deleteId;\n data.foreignKey = btnJson.subForeignKey;\n data.exBtnDisabled = btnJson.exBtnDisabled;\n this.$refs[\"subForm\"].init(data, js);\n } else {\n this.$nextTick(() => {\n data.title = btnJson.title;\n this.$refs[\"form\"].init(data, js);\n });\n }\n },\n async handleOperationClick(o) {\n let {\n obj,\n row\n } = o;\n if (obj.customFunction) {\n eval(obj.customFunction);\n } else if (obj.code == \"delete\") {\n this.remove(o);\n } else if (obj.code == 'edit' || obj.code == 'details' || obj.isForm == 1) {\n this.showForm(obj.code, row);\n }\n this.$emit(\"handleOperationClick\", o);\n },\n getSubParam(json) {\n let obj = {\n deleteId: this.getDeleteId(this.deleteParameter)\n }; // 初始化为空对象\n if (json) {\n return {\n ...obj,\n ...JSON.parse(json)\n };\n }\n return {\n ...obj\n };\n }\n },\n created() {\n dict.init(this.http);\n dictType.init(this.http);\n }\n};\nfunction rowCamelCase(o) {\n let obj = {};\n for (let key of Object.keys(o)) {\n if (key == 'XROWKEY') {\n continue;\n }\n let k = key;\n if (re(key)) {\n k = key.substring(3);\n }\n obj[(0,_utils_util__WEBPACK_IMPORTED_MODULE_6__.toCamelCase)(k)] = o[key];\n }\n return obj;\n}\nfunction re(k) {\n let reg = /^t\\d_/;\n return reg.test(k);\n}\nfunction doCallback(fn, args) {\n for (let arg of args) {\n fn.apply(this, arg);\n }\n}\nfunction doCallback2(fn, args) {\n fn.apply(this, args);\n}\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OTMixinBodyMethods.js?");
|
|
12876
12876
|
|
|
12877
12877
|
/***/ }),
|
|
12878
12878
|
|
|
@@ -12916,7 +12916,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12916
12916
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12917
12917
|
|
|
12918
12918
|
"use strict";
|
|
12919
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinSortable: function() { return /* binding */ OTMixinSortable; }\n/* harmony export */ });\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n\nconst OTMixinSortable = {\n methods: {\n updateSort() {\n if (!this.table.sortable) {\n return;\n }\n this.$nextTick(() => {\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_0__[\"default\"].create(this.$table.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'), {\n
|
|
12919
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinSortable: function() { return /* binding */ OTMixinSortable; }\n/* harmony export */ });\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n\nconst OTMixinSortable = {\n methods: {\n updateSort() {\n if (!this.table.sortable) {\n return;\n }\n this.$nextTick(() => {\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_0__[\"default\"].create(this.$table.$el.querySelector('.body--wrapper>.vxe-table--header .vxe-header--row'), {\n handle: '.vxe-header--column',\n onEnd: ({\n newIndex,\n oldIndex\n }) => {\n console.log(newIndex, oldIndex);\n let tableColumn = JSON.parse(JSON.stringify(this.$table.getColumns()));\n let newColumn = tableColumn[newIndex];\n let oldColumn = tableColumn[oldIndex];\n for (let i = 0; i < this.table.columns.length; i++) {\n let column = this.table.columns[i];\n if (oldColumn.field == column.field) {\n oldIndex = i;\n } else if (newColumn.field == column.field) {\n newIndex = i;\n }\n }\n let columns = this.table.columns;\n this.$table.loadColumn([]);\n let spliceElement = columns.splice(oldIndex, 1)[0];\n columns.splice(newIndex, 0, spliceElement);\n this.table.columns = columns;\n this.$nextTick(() => {\n this.$table.loadColumn(this.table.columns);\n });\n }\n });\n });\n }\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OTMixinSortable.js?");
|
|
12920
12920
|
|
|
12921
12921
|
/***/ }),
|
|
12922
12922
|
|
|
@@ -13086,7 +13086,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
13086
13086
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
13087
13087
|
|
|
13088
13088
|
"use strict";
|
|
13089
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getNewArrData: function() { return /* binding */ getNewArrData; },\n/* harmony export */ getNewArrDataToolBtn: function() { return /* binding */ getNewArrDataToolBtn; },\n/* harmony export */ updateSort: function() { return /* binding */ updateSort; },\n/* harmony export */ updateSortCall: function() { return /* binding */ updateSortCall; },\n/* harmony export */ updateSortRowCall: function() { return /* binding */ updateSortRowCall; }\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/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n\n\nconst updateSort = (vexGridRef, gridOptions, key) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => {\n if (!key) {\n key = 'sort';\n }\n vexGridRef = vexGridRef.value ? vexGridRef.value : vexGridRef;\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create(vexGridRef.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 150,\n //拖拽动画过渡时间\n sort: true,\n handle: '.move',\n //必须设置该属性,属性值为你要拖动的该单元格的样式名\n //
|
|
13089
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getNewArrData: function() { return /* binding */ getNewArrData; },\n/* harmony export */ getNewArrDataToolBtn: function() { return /* binding */ getNewArrDataToolBtn; },\n/* harmony export */ updateSort: function() { return /* binding */ updateSort; },\n/* harmony export */ updateSortCall: function() { return /* binding */ updateSortCall; },\n/* harmony export */ updateSortRowCall: function() { return /* binding */ updateSortRowCall; }\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/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n\n\nconst updateSort = (vexGridRef, gridOptions, key) => {\n (0,vue__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => {\n if (!key) {\n key = 'sort';\n }\n vexGridRef = vexGridRef.value ? vexGridRef.value : vexGridRef;\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create(vexGridRef.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 150,\n //拖拽动画过渡时间\n sort: true,\n handle: '.move',\n //必须设置该属性,属性值为你要拖动的该单元格的样式名\n // 元素被选中\n onStart: function (/**Event*/evt) {\n let vex = vexGridRef.value ? vexGridRef.value : vexGridRef;\n let rowNode = vex.getRowNode(evt.item);\n sessionStorage.setItem(\"olp_table_startIndex\", rowNode.index);\n },\n onEnd: function ({\n newIndex\n }) {\n let oldIndex = sessionStorage.getItem(\"olp_table_startIndex\");\n let newsArr = getNewArrData(oldIndex, newIndex, gridOptions.data);\n for (let i = 0; i < newsArr.length; i++) {\n newsArr[i][key] = i + 1;\n }\n gridOptions.data = newsArr;\n gridOptions.updateSortMethod(undefined);\n }\n });\n });\n};\nconst updateSortRowCall = (toolBtn, vexGridRef, call) => {\n let el = vexGridRef.value ? vexGridRef.value.$el : vexGridRef.$el;\n //el绑定元素需要找到vxe的DOM下的tbody元素\n return sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create(el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 150,\n //拖拽动画过渡时间\n // 元素被选中\n onStart: function (/**Event*/evt) {\n let vex = vexGridRef.value ? vexGridRef.value : vexGridRef;\n let rowNode = vex.getRowNode(evt.item);\n toolBtn.startIndex = rowNode.index;\n },\n onEnd: function ({\n newIndex\n }) {\n toolBtn.endIndex = newIndex;\n call();\n }\n });\n};\nconst updateSortCall = (vexGridRef, call) => {\n let el = vexGridRef.value ? vexGridRef.value.$el : vexGridRef.$el;\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.nextTick)(() => {\n //el绑定元素需要找到vxe的DOM下的tbody元素\n return sortablejs__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create(el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 150,\n //拖拽动画过渡时间\n sort: true,\n handle: '.move',\n //必须设置该属性,属性值为你要拖动的该单元格的样式名\n // 元素被选中\n onStart: function (/**Event*/evt) {\n let vex = vexGridRef.value ? vexGridRef.value : vexGridRef;\n let rowNode = vex.getRowNode(evt.item);\n sessionStorage.setItem(\"olp_table_startIndex\", rowNode.index);\n },\n onEnd: function ({\n newIndex,\n item\n }) {\n let oldIndex = sessionStorage.getItem(\"olp_table_startIndex\");\n call(oldIndex, newIndex, item);\n }\n });\n });\n};\nconst getNewArrData = (oldIndex, newIndex, data, reFiled) => {\n const list = JSON.parse(JSON.stringify(data)); //保存旧数据\n const targetRow = list.splice(oldIndex, 1)[0]; //保存移动的元素并删除原列表中移动的元素\n list.splice(newIndex, 0, targetRow); //插入到目标新索引中\n if (reFiled) {\n let start = Math.min(oldIndex, newIndex);\n let end = Math.max(oldIndex, newIndex);\n for (let i = start; i <= end; i++) {\n start[i][reFiled] = data[i][reFiled];\n }\n }\n return JSON.parse(JSON.stringify(list)); //重新赋值数组\n};\nconst getNewArrDataToolBtn = (data, toolBtn) => {\n const list = JSON.parse(JSON.stringify(data)); //保存旧数据\n let oldIndex = toolBtn.startIndex;\n let newIndex = toolBtn.endIndex;\n const targetRow = list.splice(oldIndex, 1)[0]; //保存移动的元素并删除原列表中移动的元素\n list.splice(newIndex, 0, targetRow); //插入到目标新索引中\n if (toolBtn) {\n let kw = toolBtn.beforeFunction.split(\",\");\n let start = Math.min(oldIndex, newIndex);\n let end = Math.max(oldIndex, newIndex);\n let seq = Number(data[start][kw[0]]);\n for (let i = start; i <= end; i++) {\n list[i][kw[0]] = seq;\n if (kw.length == 2) {\n toolBtn.updateData[list[i][kw[1]]] = list[i][kw[0]];\n }\n seq++;\n }\n }\n return JSON.parse(JSON.stringify(list)); //重新赋值数组\n};\n\n//# sourceURL=webpack://olp-table/./src/utils/TableSortUtil.js?");
|
|
13090
13090
|
|
|
13091
13091
|
/***/ }),
|
|
13092
13092
|
|
|
@@ -13097,7 +13097,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
13097
13097
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
13098
13098
|
|
|
13099
13099
|
"use strict";
|
|
13100
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ getFiledName; },\n/* harmony export */ getDefaultValue: function() { return /* binding */ getDefaultValue; }\n/* harmony export */ });\n/* harmony import */ var _utils_DateUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/DateUtils */ \"./src/utils/DateUtils.js\");\n\nfunction getFiledName(column) {\n return column['property'];\n}\nasync function getDefaultValue(http, column) {\n const {\n value,\n selectDom\n } = column;\n
|
|
13100
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ getFiledName; },\n/* harmony export */ getDefaultValue: function() { return /* binding */ getDefaultValue; }\n/* harmony export */ });\n/* harmony import */ var _utils_DateUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/utils/DateUtils */ \"./src/utils/DateUtils.js\");\n\nfunction getFiledName(column) {\n return column['property'];\n}\nasync function getDefaultValue(http, column) {\n const {\n value,\n selectDom\n } = column;\n // 1. 处理模板字符串(含$符号)\n if (/\\$\\{[^}]+\\}/.test(value)) {\n column.seqValue = '$_OLP_$' + value;\n column.placeholder = '如不填,系统自动生成';\n return undefined;\n }\n\n // 3. 处理时间默认值\n if (value && ['3', '6'].includes(selectDom)) {\n return handleDateTimeValue(value);\n }\n return value;\n}\nfunction handleDateTimeValue(value) {\n if (value.includes('#{')) {\n return (0,_utils_DateUtils__WEBPACK_IMPORTED_MODULE_0__.replaceDateByExpression)(value);\n }\n if (value.includes('{{')) {\n return safelyEvaluateExpression(value);\n }\n return value;\n}\nfunction safelyEvaluateExpression(expr) {\n try {\n const sanitizedExpr = expr.replace(/{+|}+/g, '');\n return Function(`\"use strict\"; return (${sanitizedExpr})`)();\n } catch (e) {\n console.error('表达式执行失败', e);\n return new Date().toISOString(); // 安全后备值\n }\n}\n\n//# sourceURL=webpack://olp-table/./src/utils/columnProp.js?");
|
|
13101
13101
|
|
|
13102
13102
|
/***/ }),
|
|
13103
13103
|
|