olp-table 7.2.72 → 7.2.73
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 +7 -7
- package/olp-table.umd.js +7 -7
- package/olp-table.umd.min.js +7 -7
- package/package.json +1 -1
package/olp-table.common.js
CHANGED
|
@@ -619,7 +619,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix
|
|
|
619
619
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
620
620
|
|
|
621
621
|
"use strict";
|
|
622
|
-
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_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin/OForm */ \"./src/mixins/VTMixin/OForm.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/ol-upload-file.vue */ \"./src/components/ol-upload-file.vue\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"olMainFormSubTable\",\n mixins: [_mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_4__.OForm],\n components: {\n OlUploadFile: _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n data() {\n return {\n url: {\n saveUrl: \"/online/crudAes/saveMainAndSubs\"\n },\n uuid: undefined,\n subForeignKey: '',\n exBtnDisabled: undefined\n };\n },\n computed: {\n https() {\n return this.http;\n }\n },\n methods: {\n getDeleteId(param) {\n for (let key of Object.keys(param)) {\n if (key != '$parentId') {\n return key;\n }\n }\n },\n getSubUpdateList(table) {\n let subColumnAndValueList = [];\n for (const row of table.data) {\n subColumnAndValueList.push(this.getSubUpdate(row, table.columns));\n }\n return subColumnAndValueList;\n },\n /**\r\n * 判断是否数据库字段\r\n * @param column\r\n * @returns {*}\r\n */\n hasColumn(column) {\n return column.tableField && column.field;\n },\n getSubUpdate(row, columns) {\n let subColumnAndValue = {};\n for (const column of columns) {\n if (this.hasColumn(column) && (!column.tableSaveToOtherProp || column.tableSaveToOtherProp != '1')) {\n subColumnAndValue[column.tableField ? column.tableField : column.field] = row[column.field];\n }\n }\n return subColumnAndValue;\n },\n getParams() {\n if (!this.$refs?.subTable) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_3__.useMessage)().error(\"主子表没有子表信息!\");\n return;\n }\n // 子表信息\n let subTablesRefs = this.$refs.subTable.getTableRefs().getTabRefAll();\n let subTables = [];\n for (const subTable of subTablesRefs) {\n let deleteId = this.getDeleteId(subTable.deleteParameter);\n let subColumnAndValueList = subTable.getUpdateRecordsRow();\n if (subColumnAndValueList.length == 0) {\n continue;\n }\n subTables.push({\n // 子表名称\n subTableName: subTable.tableConfig.mainTable,\n // 子表要自动生成的唯一字段 如果没有 可以忽略\n subGenIdMap: {\n [deleteId]: 'uuid'\n },\n // 子表子主表的数据\n subColumnAndValueList: subColumnAndValueList,\n // 子表的唯一字段\n subTableKey: [deleteId],\n // 表的关联key,这里框架自动复制 {主表字段,子表的字段}\n subForeignKey: {\n [this.state.deleteId]: this.state.foreignKey\n }\n });\n }\n let params = {\n tableConfigId: this.state.tableConfigId,\n dbName: this.state.dbName,\n tableName: this.state.tableName,\n // 主表的唯一字段\n mainTableKey: [this.state.deleteId],\n //主表的唯一字段\n // 子表要自动生成的唯一字段 如果没有 可以忽略\n mainGenIdMap: {\n [this.state.deleteId]: 'uuid'\n },\n mianColumnAndValueMap: {},\n subTables: subTables\n };\n if (this.state.type != '0') {\n let formData = this.$refs.value.getFormData(false);\n for (let prop of Object.keys(formData)) {\n let value = formData[prop];\n if (value instanceof String) {\n value = value.trim();\n }\n params.mianColumnAndValueMap[prop] = value;\n }\n } else {\n params.mianColumnAndValueMap = this.getTableUpdateValue(this.form.column, this.formData);\n }\n if (this.state.edit) {\n params.whereMap = {};\n if (this.state.updateKey) {\n let split = this.state.updateKey.split(',');\n for (let kv of split) {\n let kvs = kv.split(\"=\");\n if (kvs.length == 2) {\n params.mianColumnAndValueMap[kvs[0]] = params.mianColumnAndValueMap[kvs[1]];\n } else {\n let val = params.mianColumnAndValueMap[kvs];\n params.mianColumnAndValueMap[kvs] = val != undefined ? val : this.formData[kvs];\n }\n }\n } else {\n // 编辑时默认更新条件为id\n params.mianColumnAndValueMap['id'] = this.formData['id'];\n if (!params.mianColumnAndValueMap['id']) {\n params.mianColumnAndValueMap['id'] = this.formData['t1_id'];\n }\n }\n }\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n return params;\n },\n ok(e) {\n if (!this.show) {\n this.$refs.subTable.getTableRefs().setAllBtnDisabled(this.state.exBtnDisabled);\n }\n this.setParameter(e);\n if (this.state.edit) {\n if (this.initOkTabs.length == 0 || this.initOkTabs.indexOf(this.$refs.subTable.getTableRefs().activeName) === -1) {\n this.initOkTabs.push(this.$refs.subTable.getTableRefs().activeName);\n e.query();\n }\n }\n },\n setParameter(e) {\n let param = {\n [this.state.foreignKey]: this.formData[this.state.deleteId]\n };\n e.parameter = {\n ...e.parameter,\n ...param\n };\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n }\n },\n mounted() {},\n created() {\n
|
|
622
|
+
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_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin/OForm */ \"./src/mixins/VTMixin/OForm.js\");\n/* harmony import */ var _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/model/model-index.vue */ \"./src/components/table/model/model-index.vue\");\n/* harmony import */ var _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/ol-upload-file.vue */ \"./src/components/ol-upload-file.vue\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"olMainFormSubTable\",\n mixins: [_mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_4__.OForm],\n components: {\n OlUploadFile: _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n ModelIndex: _components_table_model_model_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n data() {\n return {\n url: {\n saveUrl: \"/online/crudAes/saveMainAndSubs\"\n },\n uuid: undefined,\n subForeignKey: '',\n exBtnDisabled: undefined\n };\n },\n computed: {\n https() {\n return this.http;\n }\n },\n methods: {\n getDeleteId(param) {\n for (let key of Object.keys(param)) {\n if (key != '$parentId') {\n return key;\n }\n }\n },\n getSubUpdateList(table) {\n let subColumnAndValueList = [];\n for (const row of table.data) {\n subColumnAndValueList.push(this.getSubUpdate(row, table.columns));\n }\n return subColumnAndValueList;\n },\n /**\r\n * 判断是否数据库字段\r\n * @param column\r\n * @returns {*}\r\n */\n hasColumn(column) {\n return column.tableField && column.field;\n },\n getSubUpdate(row, columns) {\n let subColumnAndValue = {};\n for (const column of columns) {\n if (this.hasColumn(column) && (!column.tableSaveToOtherProp || column.tableSaveToOtherProp != '1')) {\n subColumnAndValue[column.tableField ? column.tableField : column.field] = row[column.field];\n }\n }\n return subColumnAndValue;\n },\n getParams() {\n if (!this.$refs?.subTable) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_3__.useMessage)().error(\"主子表没有子表信息!\");\n return;\n }\n // 子表信息\n let subTablesRefs = this.$refs.subTable.getTableRefs().getTabRefAll();\n let subTables = [];\n if (!this.state.saveUrl || this.state.saveUrl.trim().length == 0) {\n this.state.saveUrl = \"/online/crudAes/saveMainAndSubs\";\n } else {\n let params = {\n formData: this.formData,\n tables: {}\n };\n for (const subTable of subTablesRefs) {\n params[\"tables\"][subTable.theme] = subTable.getUpdateRecordsRow();\n }\n return params;\n }\n for (const subTable of subTablesRefs) {\n let deleteId = this.getDeleteId(subTable.deleteParameter);\n let subColumnAndValueList = subTable.getUpdateRecordsRow();\n if (subColumnAndValueList.length == 0) {\n continue;\n }\n subTables.push({\n // 子表名称\n subTableName: subTable.tableConfig.mainTable,\n // 子表要自动生成的唯一字段 如果没有 可以忽略\n subGenIdMap: {\n [deleteId]: 'uuid'\n },\n // 子表子主表的数据\n subColumnAndValueList: subColumnAndValueList,\n // 子表的唯一字段\n subTableKey: [deleteId],\n // 表的关联key,这里框架自动复制 {主表字段,子表的字段}\n subForeignKey: {\n [this.state.deleteId]: this.state.foreignKey\n }\n });\n }\n let params = {\n tableConfigId: this.state.tableConfigId,\n dbName: this.state.dbName,\n tableName: this.state.tableName,\n // 主表的唯一字段\n mainTableKey: [this.state.deleteId],\n //主表的唯一字段\n // 子表要自动生成的唯一字段 如果没有 可以忽略\n mainGenIdMap: {\n [this.state.deleteId]: 'uuid'\n },\n mianColumnAndValueMap: {},\n subTables: subTables\n };\n if (this.state.type != '0') {\n let formData = this.$refs.value.getFormData(false);\n for (let prop of Object.keys(formData)) {\n let value = formData[prop];\n if (value instanceof String) {\n value = value.trim();\n }\n params.mianColumnAndValueMap[prop] = value;\n }\n } else {\n params.mianColumnAndValueMap = this.getTableUpdateValue(this.form.column, this.formData);\n }\n if (this.state.edit) {\n params.whereMap = {};\n if (this.state.updateKey) {\n let split = this.state.updateKey.split(',');\n for (let kv of split) {\n let kvs = kv.split(\"=\");\n if (kvs.length == 2) {\n params.mianColumnAndValueMap[kvs[0]] = params.mianColumnAndValueMap[kvs[1]];\n } else {\n let val = params.mianColumnAndValueMap[kvs];\n params.mianColumnAndValueMap[kvs] = val != undefined ? val : this.formData[kvs];\n }\n }\n } else {\n // 编辑时默认更新条件为id\n params.mianColumnAndValueMap['id'] = this.formData['id'];\n if (!params.mianColumnAndValueMap['id']) {\n params.mianColumnAndValueMap['id'] = this.formData['t1_id'];\n }\n }\n }\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n return params;\n },\n ok(e) {\n if (!this.show) {\n this.$refs.subTable.getTableRefs().setAllBtnDisabled(this.state.exBtnDisabled);\n }\n this.setParameter(e);\n if (this.state.edit) {\n if (this.initOkTabs.length == 0 || this.initOkTabs.indexOf(this.$refs.subTable.getTableRefs().activeName) === -1) {\n this.initOkTabs.push(this.$refs.subTable.getTableRefs().activeName);\n e.query();\n }\n }\n },\n setParameter(e) {\n let param = {\n [this.state.foreignKey]: this.formData[this.state.deleteId]\n };\n e.parameter = {\n ...e.parameter,\n ...param\n };\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n }\n },\n mounted() {},\n created() {\n // console.info(\"我是主子表\")\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-main-form-sub-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");
|
|
623
623
|
|
|
624
624
|
/***/ }),
|
|
625
625
|
|
|
@@ -971,7 +971,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
971
971
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
972
972
|
|
|
973
973
|
"use strict";
|
|
974
|
-
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 _components_table_ol_form__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\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 vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _components_v_component_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/v-component/index.vue */ \"./src/components/v-component/index.vue\");\n/* harmony import */ var vue_codemirror__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue-codemirror */ \"./node_modules/vue-codemirror/dist/vue-codemirror.esm.js\");\n/* harmony import */ var _codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @codemirror/lang-javascript */ \"./node_modules/@codemirror/lang-javascript/dist/index.js\");\n/* harmony import */ var _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @codemirror/theme-one-dark */ \"./node_modules/@codemirror/theme-one-dark/dist/index.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vxe-table */ \"vxe-table\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(vxe_table__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n/* harmony import */ var _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-table-select-config.vue */ \"./src/components/ol-table-select-config.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n props: {\n type: {}\n },\n setup(__props, {\n expose: __expose\n }) {\n const msg = (0,_utils_message__WEBPACK_IMPORTED_MODULE_10__.useMessage)(); // 消息弹窗\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_7__.inject)('http');\n const dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\n const props = __props;\n const customUrl = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(undefined);\n const vexGridRef = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const vFormViewer = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const dialogTableVisible = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(false);\n function setShow() {\n updateSort();\n }\n\n /**\r\n * 设置新增、编辑表单uuid和更新条件\r\n * @param key\r\n */\n function setUpdateKey(key) {\n if (!form.updateKey) {\n form.updateKey = key;\n }\n }\n function showViewForm() {\n dialogTableVisible.value = true;\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n let data = {\n type: formType.value,\n theme: 't1',\n otherProp: otherProp,\n formData: {}\n };\n data.form = data.type == 0 ? baseOption.value : formJson.value;\n vFormViewer.value.init(data);\n });\n }\n const otherProp = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n beforeSave: '',\n afterSave: '',\n afterInit: '',\n beforeInit: '',\n createBy: '',\n updateBy: ''\n });\n // 基础表单\n const baseOption = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n submitBtn: false,\n emptyBtn: false,\n labelWidth: 125,\n comCommit: false,\n //如果为true,只提交form\n column: []\n });\n //编码设计\n const codeForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)();\n const copeFiled = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)();\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict)();\n //表单类型\n const formType = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n //表单设计\n const formConfig = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n //快捷设计表单\n const designForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n span: 2\n });\n //快捷设计表格\n const gridOptions = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n border: true,\n resizable: true,\n showOverflow: true,\n size: 'mini',\n height: '420px',\n editConfig: {\n trigger: 'click',\n mode: 'cell'\n },\n rowConfig: {\n useKey: true\n },\n align: 'center',\n columns: [{\n title: '操作',\n width: 70,\n slots: {\n default: 'operate'\n }\n }, {\n type: 'checkbox',\n width: 40\n }, {\n type: \"expand\",\n width: 61,\n title: \"序号\",\n className: 'colExpand',\n slots: {\n content: 'content',\n default: 'seq'\n }\n }, {\n field: 'prop',\n minWidth: 130,\n editRender: {\n props: {\n clearable: true\n },\n events: {\n change: refreshForm\n },\n name: 'input'\n },\n title: \"字段名\"\n }, {\n field: 'title',\n width: 80,\n title: \"原标题\"\n }, {\n field: 'showName',\n width: 120,\n title: \"label\",\n editRender: {\n props: {\n clearable: true\n },\n events: {\n change: refreshForm\n },\n name: 'input'\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: 'tableField',\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: 'selectDom',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n events: {\n change: refreshForm\n },\n options: dict.val('select_dom')\n }\n }, {\n title: '数据字典',\n field: 'dictCode',\n allowCreate: true,\n width: 120,\n filterable: true,\n //数据字典属性的配置对象\n props: {\n label: 'dictLabel',\n value: 'dictValue'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n events: {\n change: refreshForm\n },\n options: dictType.val()\n }\n }, {\n title: '更新回调',\n field: 'change',\n width: 100,\n slots: {\n default: 'change'\n }\n }],\n data: []\n });\n //展开行表单\n const expandForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n submitBtn: false,\n emptyBtn: false,\n span: 8,\n column: [{\n label: '禁用',\n prop: 'disabled',\n type: 'switch',\n value: false,\n dicData: [{\n label: '否',\n value: false\n }, {\n label: '是',\n value: true\n }]\n }, {\n label: '隐藏',\n prop: 'display',\n type: 'switch',\n value: true,\n dicData: [{\n label: '否',\n value: true\n }, {\n label: '是',\n value: false\n }]\n }, {\n label: '多选',\n prop: 'multiple',\n type: 'switch',\n value: false,\n dicData: [{\n label: '否',\n value: false\n }, {\n label: '是',\n value: true\n }]\n }, {\n label: '标题宽度',\n prop: 'labelWidth'\n }, {\n label: '默认值',\n prop: 'value'\n }, {\n label: '输入框提示',\n prop: 'placeholder'\n }, {\n label: '数据字典表',\n prop: 'dictTable'\n }, {\n label: '字典dictUrl',\n prop: 'dictUrl'\n }, {\n label: '其他属性',\n prop: 'attrs',\n slots: {\n default: 'attrs'\n }\n }]\n });\n //自定义表单值\n const formJson = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({});\n const formData = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n const formKey = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n const optionData = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n const vFormRef = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const customForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(\"\");\n const copeFiledMethod = value => {\n let checkboxRecords = vexGridRef.value.getCheckboxRecords();\n if (checkboxRecords.length != 0) {\n let filed = \"\";\n for (let {\n prop\n } of checkboxRecords) {\n if (filed.length != 0) {\n filed += \",\";\n }\n filed += prop;\n }\n if (value == 1) {\n filed = \"hideColumn('\" + filed + \"');\";\n } else if (value == 2) {\n filed = \"showColumn('\" + filed + \"');\";\n }\n navigator.clipboard.writeText(filed).then(() => {\n msg.success(\"复制成功!\" + filed);\n }).catch(err => {\n msg.error(\"复制失败!\" + filed);\n });\n }\n };\n //表头全选框更新\n const headerClick = column => {\n gridOptions.value.data.forEach(item => {\n if (column.params.all) {\n item.rules = [{\n required: true,\n message: '请输入' + item.title,\n trigger: 'blur'\n }];\n item[column.field] = '1';\n } else {\n item[column.field] = '0';\n item.rules = null;\n }\n });\n refreshForm();\n };\n\n //获取数据\n const setData = data => {\n if (!data) {\n return;\n }\n formType.value = parseInt(data.formMain.designer);\n for (let key of Object.keys(form)) {\n form[key] = data.formMain[key];\n }\n if (form.otherProp && form.otherProp.toString().trim()) {\n try {\n let otherPropJson = JSON.parse(form.otherProp);\n for (let key of Object.keys(otherProp)) {\n otherProp[key] = otherPropJson[key];\n }\n } catch (e) {\n console.error(e);\n }\n }\n customForm.value = data.formMain.customForm;\n //基础表单\n //JSON字符串\n if (data.formJson.optionJson) {\n codeForm.value = data.formJson.optionJson;\n codeToData();\n }\n if (data.formJson.customJson) {\n //自定义表单\n formJson.value = JSON.parse(data.formJson.customJson);\n }\n };\n function getColumn(item) {\n let obj = {\n prop: item.field,\n title: item.title || item.label,\n sort: gridOptions.value.data ? gridOptions.value.data.length : 0,\n //为空默认文本框\n selectDom: item.selectDom ? item.selectDom : 1,\n dictCode: item.dictCode,\n form: {\n dictTable: item.dictTable\n }\n };\n return obj;\n }\n\n //列配置新增多选更新\n const updateData = (row, column) => {\n if (row[column.field] == '1') {\n for (const item of gridOptions.value.data) {\n if (item.prop == row.field) return;\n }\n let tableObj = getColumn(row);\n gridOptions.value.data.push(tableObj);\n } else {\n gridOptions.value.data = gridOptions.value.data.filter(item => item.prop != row.field);\n }\n reloadData();\n refreshForm();\n };\n function parseJson(column) {\n let attrs = column.attrs;\n if (attrs) {\n try {\n attrs = JSON.parse(attrs);\n for (let key of Object.keys(attrs)) {\n column[key] = attrs;\n }\n } catch (e) {\n console.error(\"解析attrs异常\", attrs);\n }\n }\n }\n function reloadData(data) {\n if (data) {\n gridOptions.value.data = data;\n }\n if (vexGridRef.value) {\n vexGridRef.value.reloadData(gridOptions.value.data);\n }\n }\n\n //列配置新增全选与全不选\n const setAll = ({\n list,\n isAll\n }) => {\n let data = [];\n if (isAll) {\n for (let item of list) {\n data.push(getColumn(item));\n }\n }\n reloadData(data);\n refreshForm();\n };\n\n //基础表单 > 快捷设计表单更新\n const designFormChange = () => {\n //行数转换为尺寸\n baseOption.value.span = parseInt(24 / designForm.value.span);\n //JSON格式化\n codeForm.value = jsonFormat(baseOption.value);\n updateSort();\n };\n\n //控件类型更新\n const dictChange = ({\n row\n }) => {\n if (row.selectDom === '22') {\n //如果是表格选择器,则展开行,因为一定要配置其他属性,所以需要展开行\n if (row.form.attrs == null || row.form.attrs === '') {\n row.form.attrs = '{\\n' + ' \"olTableSelect\":{\\n' + ' \"uuid\":\"1901841070608990208\",\\n' + ' \"key\":\"id\",\\n' +\n //数据库要存的值,如:外键ID或某个编码\n ' \"label\":\"name\",\\n' +\n //选中数据后回显的数据\n ' \"labelIsAppendCode\":false,\\n' +\n //默认,可不填或不该\n ' \"otherResult\":\"目标字段1:源字段1,目标字段2:源字段2,目标字段3:源字段3\"\\n' +\n //需要额外字段数据格式配置:\"目标字段1:源字段1,目标字段2:源字段2\n ' }\\n' + '}';\n }\n vexGridRef.value.setRowExpand([row], true); //展开行\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n baseOption.value.column.forEach(item => {\n if (item.prop == row.prop) {\n item.type = getFormType(row); //控件类型\n if (item.type === 'month') {\n item.format = 'YYYY-MM';\n item.valueFormat = 'YYYY-MM';\n }\n if (row.selectDom == 8) {\n item.multiple = true;\n }\n codeForm.value = jsonFormat(baseOption.value);\n return;\n }\n });\n });\n };\n let update = true;\n function refreshForm() {\n if (update != true) {\n setTimeout(() => {\n refreshForm();\n }, 200);\n }\n update = false;\n let data = JSON.parse(JSON.stringify(gridOptions.value.data));\n let columns = [];\n let index = 1;\n for (let d of data) {\n d.sort = index;\n let column = getCodeColumn(d);\n columns.push(column);\n index++;\n }\n columns.sort((a, b) => {\n return a.sort - b.sort;\n });\n setCodeForm(columns);\n setBaseOption(columns);\n update = true;\n }\n function setDictCode(column) {\n if (column.selectDom != 1 && (column.dictCode || column.dictTable || column.dictUrl)) {\n getDicData(column);\n }\n }\n function codeToData(alter) {\n try {\n getFormatter();\n let value = JSON.parse(codeForm.value);\n setSort(value);\n codeForm.value = jsonFormat(value);\n //更新快捷设计表格的数据\n setTableData(value);\n if (!value.labelWidth) value.labelWidth = 125;\n baseOption.value = value;\n setBaseOption(value.column);\n value.span = value.span ? value.span : 12;\n //计算表单每行个数\n designForm.value.span = parseInt(24 / value.span);\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n refreshForm();\n });\n if (alter) {\n msg.success(\"生成成功!\");\n }\n } catch (e) {\n console.error(e);\n msg.error('生成失败,请检查对象格式是否正确' + e);\n }\n }\n function setCodeForm(columns) {\n let option = JSON.parse(JSON.stringify(baseOption.value));\n option.column = JSON.parse(JSON.stringify(columns));\n codeForm.value = jsonFormat(option);\n }\n function setEvents(column) {\n for (let event of events) {\n if (column[event] != undefined && column[event] != '') {\n try {\n let e = replaceDollarBraces(column[event]);\n column[event] = eval(\"(params)=>{\" + e + \"}\");\n } catch (e) {\n console.error(e);\n }\n } else {\n delete column[event];\n }\n }\n }\n function replaceDollarBraces(str) {\n return str.replace(/\\$\\{?([^{}]+)\\}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n }\n function setBaseOption(columns) {\n columns = JSON.parse(JSON.stringify(columns));\n for (let column of columns) {\n try {\n parseJson(column);\n setEvents(column);\n setDictCode(column);\n } catch (e) {\n console.error(e);\n }\n }\n baseOption.value.column = columns;\n }\n let events = ['change'];\n function getFormatter() {\n //正则表达式替换字符串的值\n let v = codeForm.value.replace(/,}/gi, \"}\").replace(/,]/gi, \"]\");\n codeForm.value = JSON.stringify(JSON.parse(v), null, 4);\n }\n function setSort(value) {\n value.column.sort((a, b) => {\n return a.sort - b.sort;\n });\n for (let i = 0; i < value.column.length; i++) {\n value.column.sort = i + 1;\n }\n }\n function getCodeColumn(row) {\n let columnObj = {};\n for (let column of gridOptions.value.columns) {\n if (column.field !== undefined && row[column.field] !== undefined && row[column.field] !== '' && row[column.field] !== null) {\n columnObj[column.field] = row[column.field];\n }\n }\n for (let column of expandForm.value.column) {\n if (column.prop !== undefined && row.form[column.prop] !== undefined && row.form[column.prop] !== '' && row.form[column.prop] !== null) {\n columnObj[column.prop] = row.form[column.prop];\n }\n }\n columnObj.label = columnObj.showName ? columnObj.showName : columnObj.title;\n if (columnObj.required == '1') {\n columnObj.rules = [{\n required: true,\n message: '请输入' + row.title,\n trigger: 'blur'\n }];\n }\n if (columnObj.required == '0') {\n delete columnObj.rules;\n delete columnObj.required;\n }\n if (columnObj != 1) {\n columnObj.type = getFormType(row);\n if (columnObj.type === 'month') {\n columnObj.format = 'YYYY-MM';\n columnObj.valueFormat = 'YYYY-MM';\n }\n if (row.selectDom == 8) {\n columnObj.multiple = true;\n }\n }\n return columnObj;\n }\n function getTableRow(data) {\n let obj = JSON.parse(JSON.stringify(data));\n obj.form = {};\n for (let column of gridOptions.value.columns) {\n if (column.field !== undefined && data[column.field] !== undefined && data[column.field].toString().trim() !== '') {\n obj[column.field] = data[column.field];\n }\n }\n for (let column of expandForm.value.column) {\n if (column.prop !== undefined && data[column.prop] !== undefined && data[column.prop].toString().trim() !== '') {\n obj.form[column.prop] = data[column.prop];\n }\n }\n for (let event of events) {\n if (obj[event] != undefined && !(obj[event] instanceof Function)) {\n obj[event] = obj[event].toString();\n }\n }\n if (data.label) {\n obj.showName = data.label;\n if (!obj.title) {\n obj.title = data.label;\n }\n }\n if (data.label) {\n obj.showName = data.label;\n obj.title = data.label;\n }\n delete obj.type;\n return obj;\n }\n\n //编码设计生成后更新快捷设计表格数据\n const setTableData = value => {\n let datas = [];\n for (let column of value.column) {\n let data = getTableRow(column);\n datas.push(data);\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n gridOptions.value.data = datas;\n });\n };\n function setDicData(column) {\n baseOption.value.column.forEach(item => {\n if (item.prop == column.prop) {\n item.dicData = column.dicData;\n return;\n }\n });\n }\n const setDictUrl = column => {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get)(http, url).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.post)(http, column.dictUrl, false, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n };\n //获取字典\n const getDicData = column => {\n let code = column.dictCode;\n if (code == \"\" || !code) {\n delete column.dicData;\n } else if (column.dictTable) {\n getParameter(column);\n } else if (column.dictUrl) {\n setDictUrl(column);\n } else {\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict)();\n column.dicData = dict.val(column.dictCode);\n setDicData(column);\n }\n };\n function getParameter(column) {\n let params = {};\n let dictTable = JSON.parse(JSON.stringify(column.dictTable));\n if (dictTable instanceof Object) {\n params = dictTable;\n } else {\n dictTable = column.dictTable.split(\",\");\n params[\"dbName\"] = dictTable[0];\n params[\"tableName\"] = dictTable[1];\n params[\"label\"] = dictTable[2];\n params[\"value\"] = dictTable[3];\n if (dictTable[4]) {\n params[\"parentValue\"] = dictTable[4];\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_17__.initDictTable)(http, params).then(data => {\n column.dicData.length = 0;\n for (let d of data) {\n d.label = d.dictLabel;\n d.value = d.dictValue;\n }\n if (params[\"parentValue\"]) {\n data = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, 'value', 'parentValue');\n column.dicData.push(data);\n } else {\n for (let d of data) {\n d.label = d.dictLabel;\n d.value = d.dictValue;\n column.dicData.push(d);\n }\n }\n setDicData(column);\n });\n }\n\n //JSON格式化\n const jsonFormat = val => {\n return JSON.stringify(JSON.parse(JSON.stringify(val)), null, 4);\n };\n\n //控件类型转换\n const getFormType = row => {\n let val = row.selectDom;\n if (val != '' || val != undefined || val) {\n let type;\n let map = {\n input: '1',\n select: '2',\n datetime: '3',\n time: '30',\n radio: '4',\n checkbox: '5',\n date: '6',\n month: '11',\n number: '7',\n tree: '15',\n textarea: '10'\n };\n if (isNaN(val)) {\n //不是数字,通过健找值\n type = map[val];\n } else {\n if (val == 8) {\n type = \"select\";\n } else {\n //是数字,通过值找健\n // 使用 Object.values() 获取对象的所有值\n const arr = Object.values(map);\n // 使用 Array.prototype.indexOf() 查找指定值在数组中的索引位置\n const index = arr.indexOf(val);\n // 使用 Object.keys()[index] 获取对应索引位置的键名\n type = Object.keys(map)[index];\n }\n if (type == null) {\n type = 'input';\n } else if (['select', 'checkbox', 'radio', 'tree'].indexOf(type) != -1) {\n getDicData(row);\n }\n }\n return type;\n }\n };\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.onMounted)(() => {\n updateSort();\n });\n function addColumn() {\n gridOptions.value.data.push({\n sort: gridOptions.value.data.length,\n prop: \"\",\n title: \"\",\n showName: \"\",\n selectDom: \"1\",\n label: \"\",\n type: \"input\",\n form: {}\n });\n refreshForm();\n }\n\n //表格拖动更新\n const updateSort = () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n if (!vexGridRef.value) {\n return;\n }\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_12__[\"default\"].create(vexGridRef.value.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 130,\n //拖拽动画过渡时间\n handle: '.vxe-icon-sort',\n // 结束拖拽\n onEnd: function (/**Event*/{\n oldIndex,\n newIndex\n }) {\n const list = JSON.parse(JSON.stringify(gridOptions.value.data)); //保存旧数据\n const targetRow = list.splice(oldIndex, 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;\n }\n gridOptions.value.data = newsArr;\n //把表单的排序号和表格的排序号保持一致\n newsArr.forEach(tableItem => {\n baseOption.value.column.forEach(formItem => {\n if (tableItem.prop == formItem.prop) {\n formItem.sort = tableItem.sort;\n }\n });\n });\n //将表单重新排序\n baseOption.value.column.sort((a, b) => {\n return a.sort - b.sort;\n });\n codeForm.value = jsonFormat(baseOption.value);\n }\n });\n });\n };\n const form = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n updateKey: '',\n createBy: '',\n updateBy: '',\n saveUrl: '',\n title: '',\n otherProp: {},\n requestType: 'post',\n formType: props.type\n });\n const state = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n extensions: [(0,_codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__.javascript)(), _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__.oneDark],\n values: null,\n err: false,\n baseForm: {},\n baseFormRender: {}\n });\n const formMap = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n\n // 更换表单\n const onChangeForm = value => {\n if (value) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get)(http, \"/online/formDesigner/queryById\", {\n id: value\n }).then(data => {\n formJson.value = JSON.parse(data.formJson);\n formKey.value++;\n });\n }\n };\n const getForm = () => {\n form.otherProp = JSON.stringify(otherProp);\n return (0,vue__WEBPACK_IMPORTED_MODULE_7__.markRaw)(form);\n };\n // 获取新增表单配置数据\n const getData = () => {\n if (formType.value == 0 && gridOptions.value.data.length == 0) {\n return undefined;\n }\n refreshForm();\n let obj = {\n vexTable: gridOptions.value,\n baseForm: baseOption.value,\n codeForm: codeForm.value,\n designer: formType.value,\n customJson: formJson.value,\n customForm: customForm.value\n };\n return obj;\n };\n /**\r\n * 右边字段配置删除行数据\r\n * @param row\r\n * @returns {Promise<void>}\r\n */\n const removeRowEvent = async row => {\n const type = await vxe_table__WEBPACK_IMPORTED_MODULE_15___default().modal.confirm('您确定要删除该数据?');\n const $grid = vexGridRef.value;\n if ($grid && type === 'confirm') {\n await $grid.remove(row);\n gridOptions.value.data = gridOptions.value.data.filter(item => item._X_ROW_KEY != row._X_ROW_KEY);\n removeColumnEvent(row);\n }\n };\n /**\r\n * 删除表单属性(快捷设计属性)\r\n * @param row\r\n */\n const removeColumnEvent = row => {\n baseOption.value.column = baseOption.value.column.filter(item => item.prop != row.prop);\n codeForm.value = jsonFormat(baseOption.value);\n };\n\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n function olTableSelectChange(slotName, data) {\n console.info('插槽名称', slotName);\n console.info('表格回传的数据', data);\n }\n\n // 动态获取需要渲染的插槽名称列表\n const dynamicSlotsTable = (0,vue__WEBPACK_IMPORTED_MODULE_7__.computed)(() => {\n const result = baseOption.value.column.filter(item => item.selectDom === '22' || item.selectDom === '21') // 筛选出需要动态插槽的字段(表单选择)\n .map(item => {\n let slotObj = {\n slotName: item.prop,\n type: item.selectDom,\n config: item.attrs != null ? JSON.parse(item.attrs).olTableSelect : {}\n };\n return slotObj;\n }); // 获取字段名作为插槽名\n return result;\n });\n\n // 对外暴露\n __expose({\n setData,\n updateData,\n setAll,\n getData,\n setShow,\n getForm,\n setUpdateKey\n });\n const __returned__ = {\n msg,\n http,\n dictType,\n props,\n customUrl,\n vexGridRef,\n vFormViewer,\n dialogTableVisible,\n setShow,\n setUpdateKey,\n showViewForm,\n otherProp,\n baseOption,\n codeForm,\n copeFiled,\n dict,\n formType,\n formConfig,\n designForm,\n gridOptions,\n expandForm,\n formJson,\n formData,\n formKey,\n optionData,\n vFormRef,\n customForm,\n copeFiledMethod,\n headerClick,\n setData,\n getColumn,\n updateData,\n parseJson,\n reloadData,\n setAll,\n designFormChange,\n dictChange,\n get update() {\n return update;\n },\n set update(v) {\n update = v;\n },\n refreshForm,\n setDictCode,\n codeToData,\n setCodeForm,\n setEvents,\n replaceDollarBraces,\n setBaseOption,\n get events() {\n return events;\n },\n set events(v) {\n events = v;\n },\n getFormatter,\n setSort,\n getCodeColumn,\n getTableRow,\n setTableData,\n setDicData,\n setDictUrl,\n getDicData,\n getParameter,\n jsonFormat,\n getFormType,\n addColumn,\n updateSort,\n form,\n state,\n formMap,\n onChangeForm,\n getForm,\n getData,\n removeRowEvent,\n removeColumnEvent,\n olTableSelectChange,\n dynamicSlotsTable,\n get vForm() {\n return _components_table_ol_form__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n },\n get Delete() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Delete;\n },\n get Search() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Search;\n },\n reactive: vue__WEBPACK_IMPORTED_MODULE_7__.reactive,\n ref: vue__WEBPACK_IMPORTED_MODULE_7__.ref,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_7__.nextTick,\n onMounted: vue__WEBPACK_IMPORTED_MODULE_7__.onMounted,\n inject: vue__WEBPACK_IMPORTED_MODULE_7__.inject,\n markRaw: vue__WEBPACK_IMPORTED_MODULE_7__.markRaw,\n computed: vue__WEBPACK_IMPORTED_MODULE_7__.computed,\n vComponent: _components_v_component_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n get Codemirror() {\n return vue_codemirror__WEBPACK_IMPORTED_MODULE_9__.Codemirror;\n },\n get javascript() {\n return _codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__.javascript;\n },\n get oneDark() {\n return _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__.oneDark;\n },\n get useMessage() {\n return _utils_message__WEBPACK_IMPORTED_MODULE_10__.useMessage;\n },\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get;\n },\n get post() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.post;\n },\n get Sortable() {\n return sortablejs__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n },\n get storeDictType() {\n return _store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType;\n },\n get storeDict() {\n return _store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict;\n },\n get VXETable() {\n return (vxe_table__WEBPACK_IMPORTED_MODULE_15___default());\n },\n get handleTree() {\n return _utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree;\n },\n get initDictTable() {\n return _api_dist__WEBPACK_IMPORTED_MODULE_17__.initDictTable;\n },\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n OlTableSelectConfig: _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n get IconSelect() {\n return _components_Icon__WEBPACK_IMPORTED_MODULE_20__.IconSelect;\n }\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/form-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");
|
|
974
|
+
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 _components_table_ol_form__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\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 vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _components_v_component_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/v-component/index.vue */ \"./src/components/v-component/index.vue\");\n/* harmony import */ var vue_codemirror__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue-codemirror */ \"./node_modules/vue-codemirror/dist/vue-codemirror.esm.js\");\n/* harmony import */ var _codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @codemirror/lang-javascript */ \"./node_modules/@codemirror/lang-javascript/dist/index.js\");\n/* harmony import */ var _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @codemirror/theme-one-dark */ \"./node_modules/@codemirror/theme-one-dark/dist/index.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var sortablejs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! sortablejs */ \"./node_modules/sortablejs/modular/sortable.esm.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! vxe-table */ \"vxe-table\");\n/* harmony import */ var vxe_table__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(vxe_table__WEBPACK_IMPORTED_MODULE_15__);\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n/* harmony import */ var _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-table-select-config.vue */ \"./src/components/ol-table-select-config.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n __name: 'index',\n props: {\n type: {}\n },\n setup(__props, {\n expose: __expose\n }) {\n const msg = (0,_utils_message__WEBPACK_IMPORTED_MODULE_10__.useMessage)(); // 消息弹窗\n const http = (0,vue__WEBPACK_IMPORTED_MODULE_7__.inject)('http');\n const dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\n const props = __props;\n const customUrl = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(undefined);\n const vexGridRef = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const vFormViewer = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const dialogTableVisible = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(false);\n function setShow() {\n updateSort();\n }\n\n /**\r\n * 设置新增、编辑表单uuid和更新条件\r\n * @param key\r\n */\n function setUpdateKey(key) {\n if (form.updateKey != undefined && form.updateKey.toString.trim().length != 0) {\n form.updateKey = key;\n }\n }\n function showViewForm() {\n dialogTableVisible.value = true;\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n let data = {\n type: formType.value,\n theme: 't1',\n otherProp: otherProp,\n formData: {}\n };\n data.form = data.type == 0 ? baseOption.value : formJson.value;\n vFormViewer.value.init(data);\n });\n }\n const otherProp = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n beforeSave: '',\n afterSave: '',\n afterInit: '',\n beforeInit: '',\n createBy: '',\n updateBy: ''\n });\n // 基础表单\n const baseOption = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n submitBtn: false,\n emptyBtn: false,\n labelWidth: 125,\n comCommit: false,\n //如果为true,只提交form\n column: []\n });\n //编码设计\n const codeForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)();\n const copeFiled = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)();\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict)();\n //表单类型\n const formType = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n //表单设计\n const formConfig = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n //快捷设计表单\n const designForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n span: 2\n });\n //快捷设计表格\n const gridOptions = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n border: true,\n resizable: true,\n showOverflow: true,\n size: 'mini',\n height: '420px',\n editConfig: {\n trigger: 'click',\n mode: 'cell'\n },\n rowConfig: {\n useKey: true\n },\n align: 'center',\n columns: [{\n title: '操作',\n width: 70,\n slots: {\n default: 'operate'\n }\n }, {\n type: 'checkbox',\n width: 40\n }, {\n type: \"expand\",\n width: 61,\n title: \"序号\",\n className: 'colExpand',\n slots: {\n content: 'content',\n default: 'seq'\n }\n }, {\n field: 'prop',\n minWidth: 130,\n editRender: {\n props: {\n clearable: true\n },\n events: {\n change: refreshForm\n },\n name: 'input'\n },\n title: \"字段名\"\n }, {\n field: 'title',\n width: 80,\n title: \"原标题\"\n }, {\n field: 'showName',\n width: 120,\n title: \"label\",\n editRender: {\n props: {\n clearable: true\n },\n events: {\n change: refreshForm\n },\n name: 'input'\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: 'tableField',\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: 'selectDom',\n width: 100,\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n events: {\n change: refreshForm\n },\n options: dict.val('select_dom')\n }\n }, {\n title: '数据字典',\n field: 'dictCode',\n allowCreate: true,\n width: 120,\n filterable: true,\n //数据字典属性的配置对象\n props: {\n label: 'dictLabel',\n value: 'dictValue'\n },\n editRender: {\n props: {\n clearable: true,\n filterable: true\n },\n name: '$select',\n events: {\n change: refreshForm\n },\n options: dictType.val()\n }\n }, {\n title: '更新回调',\n field: 'change',\n width: 100,\n slots: {\n default: 'change'\n }\n }],\n data: []\n });\n //展开行表单\n const expandForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({\n submitBtn: false,\n emptyBtn: false,\n span: 8,\n column: [{\n label: '禁用',\n prop: 'disabled',\n type: 'switch',\n value: false,\n dicData: [{\n label: '否',\n value: false\n }, {\n label: '是',\n value: true\n }]\n }, {\n label: '隐藏',\n prop: 'display',\n type: 'switch',\n value: true,\n dicData: [{\n label: '否',\n value: true\n }, {\n label: '是',\n value: false\n }]\n }, {\n label: '多选',\n prop: 'multiple',\n type: 'switch',\n value: false,\n dicData: [{\n label: '否',\n value: false\n }, {\n label: '是',\n value: true\n }]\n }, {\n label: '标题宽度',\n prop: 'labelWidth'\n }, {\n label: '默认值',\n prop: 'value'\n }, {\n label: '输入框提示',\n prop: 'placeholder'\n }, {\n label: '数据字典表',\n prop: 'dictTable'\n }, {\n label: '字典dictUrl',\n prop: 'dictUrl'\n }, {\n label: '其他属性',\n prop: 'attrs',\n slots: {\n default: 'attrs'\n }\n }]\n });\n //自定义表单值\n const formJson = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)({});\n const formData = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n const formKey = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(0);\n const optionData = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n const vFormRef = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(null);\n const customForm = (0,vue__WEBPACK_IMPORTED_MODULE_7__.ref)(\"\");\n const copeFiledMethod = value => {\n let checkboxRecords = vexGridRef.value.getCheckboxRecords();\n if (checkboxRecords.length != 0) {\n let filed = \"\";\n for (let {\n prop\n } of checkboxRecords) {\n if (filed.length != 0) {\n filed += \",\";\n }\n filed += prop;\n }\n if (value == 1) {\n filed = \"hideColumn('\" + filed + \"');\";\n } else if (value == 2) {\n filed = \"showColumn('\" + filed + \"');\";\n }\n navigator.clipboard.writeText(filed).then(() => {\n msg.success(\"复制成功!\" + filed);\n }).catch(err => {\n msg.error(\"复制失败!\" + filed);\n });\n }\n };\n //表头全选框更新\n const headerClick = column => {\n gridOptions.value.data.forEach(item => {\n if (column.params.all) {\n item.rules = [{\n required: true,\n message: '请输入' + item.title,\n trigger: 'blur'\n }];\n item[column.field] = '1';\n } else {\n item[column.field] = '0';\n item.rules = null;\n }\n });\n refreshForm();\n };\n\n //获取数据\n const setData = data => {\n if (!data) {\n return;\n }\n formType.value = parseInt(data.formMain.designer);\n for (let key of Object.keys(form)) {\n form[key] = data.formMain[key];\n }\n if (form.otherProp && form.otherProp.toString().trim()) {\n try {\n let otherPropJson = JSON.parse(form.otherProp);\n for (let key of Object.keys(otherProp)) {\n otherProp[key] = otherPropJson[key];\n }\n } catch (e) {\n console.error(e);\n }\n }\n customForm.value = data.formMain.customForm;\n //基础表单\n //JSON字符串\n if (data.formJson.optionJson) {\n codeForm.value = data.formJson.optionJson;\n codeToData();\n }\n if (data.formJson.customJson) {\n //自定义表单\n formJson.value = JSON.parse(data.formJson.customJson);\n }\n };\n function getColumn(item) {\n let obj = {\n prop: item.field,\n title: item.title || item.label,\n sort: gridOptions.value.data ? gridOptions.value.data.length : 0,\n //为空默认文本框\n selectDom: item.selectDom ? item.selectDom : 1,\n dictCode: item.dictCode,\n form: {\n dictTable: item.dictTable\n }\n };\n return obj;\n }\n\n //列配置新增多选更新\n const updateData = (row, column) => {\n if (row[column.field] == '1') {\n for (const item of gridOptions.value.data) {\n if (item.prop == row.field) return;\n }\n let tableObj = getColumn(row);\n gridOptions.value.data.push(tableObj);\n } else {\n gridOptions.value.data = gridOptions.value.data.filter(item => item.prop != row.field);\n }\n reloadData();\n refreshForm();\n };\n function parseJson(column) {\n let attrs = column.attrs;\n if (attrs) {\n try {\n attrs = JSON.parse(attrs);\n for (let key of Object.keys(attrs)) {\n column[key] = attrs;\n }\n } catch (e) {\n console.error(\"解析attrs异常\", attrs);\n }\n }\n }\n function reloadData(data) {\n if (data) {\n gridOptions.value.data = data;\n }\n if (vexGridRef.value) {\n vexGridRef.value.reloadData(gridOptions.value.data);\n }\n }\n\n //列配置新增全选与全不选\n const setAll = ({\n list,\n isAll\n }) => {\n let data = [];\n if (isAll) {\n for (let item of list) {\n data.push(getColumn(item));\n }\n }\n reloadData(data);\n refreshForm();\n };\n\n //基础表单 > 快捷设计表单更新\n const designFormChange = () => {\n //行数转换为尺寸\n baseOption.value.span = parseInt(24 / designForm.value.span);\n //JSON格式化\n codeForm.value = jsonFormat(baseOption.value);\n updateSort();\n };\n\n //控件类型更新\n const dictChange = ({\n row\n }) => {\n if (row.selectDom === '22') {\n //如果是表格选择器,则展开行,因为一定要配置其他属性,所以需要展开行\n if (row.form.attrs == null || row.form.attrs === '') {\n row.form.attrs = '{\\n' + ' \"olTableSelect\":{\\n' + ' \"uuid\":\"1901841070608990208\",\\n' + ' \"key\":\"id\",\\n' +\n //数据库要存的值,如:外键ID或某个编码\n ' \"label\":\"name\",\\n' +\n //选中数据后回显的数据\n ' \"labelIsAppendCode\":false,\\n' +\n //默认,可不填或不该\n ' \"otherResult\":\"目标字段1:源字段1,目标字段2:源字段2,目标字段3:源字段3\"\\n' +\n //需要额外字段数据格式配置:\"目标字段1:源字段1,目标字段2:源字段2\n ' }\\n' + '}';\n }\n vexGridRef.value.setRowExpand([row], true); //展开行\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n baseOption.value.column.forEach(item => {\n if (item.prop == row.prop) {\n item.type = getFormType(row); //控件类型\n if (item.type === 'month') {\n item.format = 'YYYY-MM';\n item.valueFormat = 'YYYY-MM';\n }\n if (row.selectDom == 8) {\n item.multiple = true;\n }\n codeForm.value = jsonFormat(baseOption.value);\n return;\n }\n });\n });\n };\n let update = true;\n function refreshForm() {\n if (update != true) {\n setTimeout(() => {\n refreshForm();\n }, 200);\n }\n update = false;\n let data = JSON.parse(JSON.stringify(gridOptions.value.data));\n let columns = [];\n let index = 1;\n for (let d of data) {\n d.sort = index;\n let column = getCodeColumn(d);\n columns.push(column);\n index++;\n }\n columns.sort((a, b) => {\n return a.sort - b.sort;\n });\n setCodeForm(columns);\n setBaseOption(columns);\n update = true;\n }\n function setDictCode(column) {\n if (column.selectDom != 1 && (column.dictCode || column.dictTable || column.dictUrl)) {\n getDicData(column);\n }\n }\n function codeToData(alter) {\n try {\n getFormatter();\n let value = JSON.parse(codeForm.value);\n setSort(value);\n codeForm.value = jsonFormat(value);\n //更新快捷设计表格的数据\n setTableData(value);\n if (!value.labelWidth) value.labelWidth = 125;\n baseOption.value = value;\n setBaseOption(value.column);\n value.span = value.span ? value.span : 12;\n //计算表单每行个数\n designForm.value.span = parseInt(24 / value.span);\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n refreshForm();\n });\n if (alter) {\n msg.success(\"生成成功!\");\n }\n } catch (e) {\n console.error(e);\n msg.error('生成失败,请检查对象格式是否正确' + e);\n }\n }\n function setCodeForm(columns) {\n let option = JSON.parse(JSON.stringify(baseOption.value));\n option.column = JSON.parse(JSON.stringify(columns));\n codeForm.value = jsonFormat(option);\n }\n function setEvents(column) {\n for (let event of events) {\n if (column[event] != undefined && column[event] != '') {\n try {\n let e = replaceDollarBraces(column[event]);\n column[event] = eval(\"(params)=>{\" + e + \"}\");\n } catch (e) {\n console.error(e);\n }\n } else {\n delete column[event];\n }\n }\n }\n function replaceDollarBraces(str) {\n return str.replace(/\\$\\{?([^{}]+)\\}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n }\n function setBaseOption(columns) {\n columns = JSON.parse(JSON.stringify(columns));\n for (let column of columns) {\n try {\n parseJson(column);\n setEvents(column);\n setDictCode(column);\n } catch (e) {\n console.error(e);\n }\n }\n baseOption.value.column = columns;\n }\n let events = ['change'];\n function getFormatter() {\n //正则表达式替换字符串的值\n let v = codeForm.value.replace(/,}/gi, \"}\").replace(/,]/gi, \"]\");\n codeForm.value = JSON.stringify(JSON.parse(v), null, 4);\n }\n function setSort(value) {\n value.column.sort((a, b) => {\n return a.sort - b.sort;\n });\n for (let i = 0; i < value.column.length; i++) {\n value.column.sort = i + 1;\n }\n }\n function getCodeColumn(row) {\n let columnObj = {};\n for (let column of gridOptions.value.columns) {\n if (column.field !== undefined && row[column.field] !== undefined && row[column.field] !== '' && row[column.field] !== null) {\n columnObj[column.field] = row[column.field];\n }\n }\n for (let column of expandForm.value.column) {\n if (column.prop !== undefined && row.form[column.prop] !== undefined && row.form[column.prop] !== '' && row.form[column.prop] !== null) {\n columnObj[column.prop] = row.form[column.prop];\n }\n }\n columnObj.label = columnObj.showName ? columnObj.showName : columnObj.title;\n if (columnObj.required == '1') {\n columnObj.rules = [{\n required: true,\n message: '请输入' + row.title,\n trigger: 'blur'\n }];\n }\n if (columnObj.required == '0') {\n delete columnObj.rules;\n delete columnObj.required;\n }\n if (columnObj != 1) {\n columnObj.type = getFormType(row);\n if (columnObj.type === 'month') {\n columnObj.format = 'YYYY-MM';\n columnObj.valueFormat = 'YYYY-MM';\n }\n if (row.selectDom == 8) {\n columnObj.multiple = true;\n }\n }\n return columnObj;\n }\n function getTableRow(data) {\n let obj = JSON.parse(JSON.stringify(data));\n obj.form = {};\n for (let column of gridOptions.value.columns) {\n if (column.field !== undefined && data[column.field] !== undefined && data[column.field].toString().trim() !== '') {\n obj[column.field] = data[column.field];\n }\n }\n for (let column of expandForm.value.column) {\n if (column.prop !== undefined && data[column.prop] !== undefined && data[column.prop].toString().trim() !== '') {\n obj.form[column.prop] = data[column.prop];\n }\n }\n for (let event of events) {\n if (obj[event] != undefined && !(obj[event] instanceof Function)) {\n obj[event] = obj[event].toString();\n }\n }\n if (data.label) {\n obj.showName = data.label;\n if (!obj.title) {\n obj.title = data.label;\n }\n }\n if (data.label) {\n obj.showName = data.label;\n obj.title = data.label;\n }\n delete obj.type;\n return obj;\n }\n\n //编码设计生成后更新快捷设计表格数据\n const setTableData = value => {\n let datas = [];\n for (let column of value.column) {\n let data = getTableRow(column);\n datas.push(data);\n }\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n gridOptions.value.data = datas;\n });\n };\n function setDicData(column) {\n baseOption.value.column.forEach(item => {\n if (item.prop == column.prop) {\n item.dicData = column.dicData;\n return;\n }\n });\n }\n const setDictUrl = column => {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get)(http, url).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.post)(http, column.dictUrl, false, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n };\n //获取字典\n const getDicData = column => {\n let code = column.dictCode;\n if (code == \"\" || !code) {\n delete column.dicData;\n } else if (column.dictTable) {\n getParameter(column);\n } else if (column.dictUrl) {\n setDictUrl(column);\n } else {\n const dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict)();\n column.dicData = dict.val(column.dictCode);\n setDicData(column);\n }\n };\n function getParameter(column) {\n let params = {};\n let dictTable = JSON.parse(JSON.stringify(column.dictTable));\n if (dictTable instanceof Object) {\n params = dictTable;\n } else {\n dictTable = column.dictTable.split(\",\");\n params[\"dbName\"] = dictTable[0];\n params[\"tableName\"] = dictTable[1];\n params[\"label\"] = dictTable[2];\n params[\"value\"] = dictTable[3];\n if (dictTable[4]) {\n params[\"parentValue\"] = dictTable[4];\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_17__.initDictTable)(http, params).then(data => {\n column.dicData.length = 0;\n for (let d of data) {\n d.label = d.dictLabel;\n d.value = d.dictValue;\n }\n if (params[\"parentValue\"]) {\n data = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree)(data, 'value', 'parentValue');\n column.dicData.push(data);\n } else {\n for (let d of data) {\n d.label = d.dictLabel;\n d.value = d.dictValue;\n column.dicData.push(d);\n }\n }\n setDicData(column);\n });\n }\n\n //JSON格式化\n const jsonFormat = val => {\n return JSON.stringify(JSON.parse(JSON.stringify(val)), null, 4);\n };\n\n //控件类型转换\n const getFormType = row => {\n let val = row.selectDom;\n if (val != '' || val != undefined || val) {\n let type;\n let map = {\n input: '1',\n select: '2',\n datetime: '3',\n time: '30',\n radio: '4',\n checkbox: '5',\n date: '6',\n month: '11',\n number: '7',\n tree: '15',\n textarea: '10'\n };\n if (isNaN(val)) {\n //不是数字,通过健找值\n type = map[val];\n } else {\n if (val == 8) {\n type = \"select\";\n } else {\n //是数字,通过值找健\n // 使用 Object.values() 获取对象的所有值\n const arr = Object.values(map);\n // 使用 Array.prototype.indexOf() 查找指定值在数组中的索引位置\n const index = arr.indexOf(val);\n // 使用 Object.keys()[index] 获取对应索引位置的键名\n type = Object.keys(map)[index];\n }\n if (type == null) {\n type = 'input';\n } else if (['select', 'checkbox', 'radio', 'tree'].indexOf(type) != -1) {\n getDicData(row);\n }\n }\n return type;\n }\n };\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.onMounted)(() => {\n updateSort();\n });\n function addColumn() {\n gridOptions.value.data.push({\n sort: gridOptions.value.data.length,\n prop: \"\",\n title: \"\",\n showName: \"\",\n selectDom: \"1\",\n label: \"\",\n type: \"input\",\n form: {}\n });\n refreshForm();\n }\n\n //表格拖动更新\n const updateSort = () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_7__.nextTick)(() => {\n if (!vexGridRef.value) {\n return;\n }\n //el绑定元素需要找到vxe的DOM下的tbody元素\n sortablejs__WEBPACK_IMPORTED_MODULE_12__[\"default\"].create(vexGridRef.value.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), {\n animation: 130,\n //拖拽动画过渡时间\n handle: '.vxe-icon-sort',\n // 结束拖拽\n onEnd: function (/**Event*/{\n oldIndex,\n newIndex\n }) {\n const list = JSON.parse(JSON.stringify(gridOptions.value.data)); //保存旧数据\n const targetRow = list.splice(oldIndex, 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;\n }\n gridOptions.value.data = newsArr;\n //把表单的排序号和表格的排序号保持一致\n newsArr.forEach(tableItem => {\n baseOption.value.column.forEach(formItem => {\n if (tableItem.prop == formItem.prop) {\n formItem.sort = tableItem.sort;\n }\n });\n });\n //将表单重新排序\n baseOption.value.column.sort((a, b) => {\n return a.sort - b.sort;\n });\n codeForm.value = jsonFormat(baseOption.value);\n }\n });\n });\n };\n const form = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n updateKey: '',\n createBy: '',\n updateBy: '',\n saveUrl: '',\n title: '',\n otherProp: {},\n requestType: 'post',\n formType: props.type\n });\n const state = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({\n extensions: [(0,_codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__.javascript)(), _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__.oneDark],\n values: null,\n err: false,\n baseForm: {},\n baseFormRender: {}\n });\n const formMap = (0,vue__WEBPACK_IMPORTED_MODULE_7__.reactive)({});\n\n // 更换表单\n const onChangeForm = value => {\n if (value) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get)(http, \"/online/formDesigner/queryById\", {\n id: value\n }).then(data => {\n formJson.value = JSON.parse(data.formJson);\n formKey.value++;\n });\n }\n };\n const getForm = () => {\n form.otherProp = JSON.stringify(otherProp);\n return (0,vue__WEBPACK_IMPORTED_MODULE_7__.markRaw)(form);\n };\n // 获取新增表单配置数据\n const getData = () => {\n if (formType.value == 0 && gridOptions.value.data.length == 0) {\n return undefined;\n }\n refreshForm();\n let obj = {\n vexTable: gridOptions.value,\n baseForm: baseOption.value,\n codeForm: codeForm.value,\n designer: formType.value,\n customJson: formJson.value,\n customForm: customForm.value\n };\n return obj;\n };\n /**\r\n * 右边字段配置删除行数据\r\n * @param row\r\n * @returns {Promise<void>}\r\n */\n const removeRowEvent = async row => {\n const type = await vxe_table__WEBPACK_IMPORTED_MODULE_15___default().modal.confirm('您确定要删除该数据?');\n const $grid = vexGridRef.value;\n if ($grid && type === 'confirm') {\n await $grid.remove(row);\n gridOptions.value.data = gridOptions.value.data.filter(item => item._X_ROW_KEY != row._X_ROW_KEY);\n removeColumnEvent(row);\n }\n };\n /**\r\n * 删除表单属性(快捷设计属性)\r\n * @param row\r\n */\n const removeColumnEvent = row => {\n baseOption.value.column = baseOption.value.column.filter(item => item.prop != row.prop);\n codeForm.value = jsonFormat(baseOption.value);\n };\n\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n function olTableSelectChange(slotName, data) {\n console.info('插槽名称', slotName);\n console.info('表格回传的数据', data);\n }\n\n // 动态获取需要渲染的插槽名称列表\n const dynamicSlotsTable = (0,vue__WEBPACK_IMPORTED_MODULE_7__.computed)(() => {\n const result = baseOption.value.column.filter(item => item.selectDom === '22' || item.selectDom === '21') // 筛选出需要动态插槽的字段(表单选择)\n .map(item => {\n let slotObj = {\n slotName: item.prop,\n type: item.selectDom,\n config: item.attrs != null ? JSON.parse(item.attrs).olTableSelect : {}\n };\n return slotObj;\n }); // 获取字段名作为插槽名\n return result;\n });\n\n // 对外暴露\n __expose({\n setData,\n updateData,\n setAll,\n getData,\n setShow,\n getForm,\n setUpdateKey\n });\n const __returned__ = {\n msg,\n http,\n dictType,\n props,\n customUrl,\n vexGridRef,\n vFormViewer,\n dialogTableVisible,\n setShow,\n setUpdateKey,\n showViewForm,\n otherProp,\n baseOption,\n codeForm,\n copeFiled,\n dict,\n formType,\n formConfig,\n designForm,\n gridOptions,\n expandForm,\n formJson,\n formData,\n formKey,\n optionData,\n vFormRef,\n customForm,\n copeFiledMethod,\n headerClick,\n setData,\n getColumn,\n updateData,\n parseJson,\n reloadData,\n setAll,\n designFormChange,\n dictChange,\n get update() {\n return update;\n },\n set update(v) {\n update = v;\n },\n refreshForm,\n setDictCode,\n codeToData,\n setCodeForm,\n setEvents,\n replaceDollarBraces,\n setBaseOption,\n get events() {\n return events;\n },\n set events(v) {\n events = v;\n },\n getFormatter,\n setSort,\n getCodeColumn,\n getTableRow,\n setTableData,\n setDicData,\n setDictUrl,\n getDicData,\n getParameter,\n jsonFormat,\n getFormType,\n addColumn,\n updateSort,\n form,\n state,\n formMap,\n onChangeForm,\n getForm,\n getData,\n removeRowEvent,\n removeColumnEvent,\n olTableSelectChange,\n dynamicSlotsTable,\n get vForm() {\n return _components_table_ol_form__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n },\n get Delete() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Delete;\n },\n get Search() {\n return _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_6__.Search;\n },\n reactive: vue__WEBPACK_IMPORTED_MODULE_7__.reactive,\n ref: vue__WEBPACK_IMPORTED_MODULE_7__.ref,\n nextTick: vue__WEBPACK_IMPORTED_MODULE_7__.nextTick,\n onMounted: vue__WEBPACK_IMPORTED_MODULE_7__.onMounted,\n inject: vue__WEBPACK_IMPORTED_MODULE_7__.inject,\n markRaw: vue__WEBPACK_IMPORTED_MODULE_7__.markRaw,\n computed: vue__WEBPACK_IMPORTED_MODULE_7__.computed,\n vComponent: _components_v_component_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n get Codemirror() {\n return vue_codemirror__WEBPACK_IMPORTED_MODULE_9__.Codemirror;\n },\n get javascript() {\n return _codemirror_lang_javascript__WEBPACK_IMPORTED_MODULE_21__.javascript;\n },\n get oneDark() {\n return _codemirror_theme_one_dark__WEBPACK_IMPORTED_MODULE_22__.oneDark;\n },\n get useMessage() {\n return _utils_message__WEBPACK_IMPORTED_MODULE_10__.useMessage;\n },\n get get() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.get;\n },\n get post() {\n return _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_11__.post;\n },\n get Sortable() {\n return sortablejs__WEBPACK_IMPORTED_MODULE_12__[\"default\"];\n },\n get storeDictType() {\n return _store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType;\n },\n get storeDict() {\n return _store_dict__WEBPACK_IMPORTED_MODULE_14__.storeDict;\n },\n get VXETable() {\n return (vxe_table__WEBPACK_IMPORTED_MODULE_15___default());\n },\n get handleTree() {\n return _utils_tree__WEBPACK_IMPORTED_MODULE_16__.handleTree;\n },\n get initDictTable() {\n return _api_dist__WEBPACK_IMPORTED_MODULE_17__.initDictTable;\n },\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n OlTableSelectConfig: _components_ol_table_select_config_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n get IconSelect() {\n return _components_Icon__WEBPACK_IMPORTED_MODULE_20__.IconSelect;\n }\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/form-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");
|
|
975
975
|
|
|
976
976
|
/***/ }),
|
|
977
977
|
|
|
@@ -1675,7 +1675,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1675
1675
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1676
1676
|
|
|
1677
1677
|
"use strict";
|
|
1678
|
-
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_find_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_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_ol_table_select = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-select\");\n const _component_IconSelect = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"IconSelect\");\n const _component_olUploadFile = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olUploadFile\");\n const _component_el_cascader = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-cascader\");\n const _component_avue_form = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"avue-form\");\n const _component_VFormRender = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"VFormRender\");\n const _component_el_scrollbar = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-scrollbar\");\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 _component_FileUpload = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"FileUpload\");\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__.createElementBlock)(\"div\", null, [_ctx.isDialog === true && _ctx.state.isDialog === true ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n key: 0,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => _ctx.state.dialogVisible = $event),\n title: _ctx.state.title,\n \"align-center\": \"\",\n \"destroy-on-close\": \"\",\n width: _ctx.state.width,\n \"close-on-click-modal\": false\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n onClick: _cache[1] || (_cache[1] = $event => {\n _ctx.state.dialogVisible = false;\n })\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 }), _ctx.show ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 0,\n type: \"primary\",\n loading: _ctx.state.loading,\n onClick: _ctx.doSave\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\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_scrollbar, {\n \"max-height\": _ctx.state.maxHeight,\n style: {\n \"padding-right\": \"10px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.state.type == '0' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_avue_form, {\n key: _ctx.state.key,\n ref: \"formRef\",\n option: _ctx.form,\n modelValue: _ctx.formData,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => _ctx.formData = $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.dynamicSlotsTable, slotRow => {\n return {\n name: slotRow.slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n disabled,\n size\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 根据配置动态渲染插槽内容 \"), slotRow.type == '22' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_ol_table_select, {\n key: 0,\n onOlTableSelectChange: _ctx.olTableSelectChange,\n slotName: slotRow.slotName,\n http: _ctx.http,\n defaultValue: _ctx.formData[slotRow.slotName],\n uuid: slotRow.config.uuid,\n disabled: disabled,\n size: size,\n config: slotRow.config\n }, null, 8 /* PROPS */, [\"onOlTableSelectChange\", \"slotName\", \"http\", \"defaultValue\", \"uuid\", \"disabled\", \"size\", \"config\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type == '21' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_IconSelect, {\n key: 1,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n clearable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <FileUpload v-if=\\\"slotRow.type === '20'\\\" v-model=\\\"formData[slotRow.slotName]\\\" :limit=\\\"1\\\" @emits=\\\"(eventData) => handleEmits(eventData, slotRow.slotName)\\\" />\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" {url:\\\"/infra/file/uploadFile\\\",autoClose:true,multiple:true,query:false,js:js})\"), slotRow.type === '20' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_olUploadFile, {\n key: 2,\n slotName: slotRow.slotName,\n column: this.form.column.find(item => item.prop === slotRow.slotName),\n url: \"/infra/file/uploadFile\",\n testMode: true,\n multiple: true,\n fileListData: _ctx.formData[slotRow.slotName],\n onUploadChange: _ctx.uploadChange\n }, null, 8 /* PROPS */, [\"slotName\", \"column\", \"fileListData\", \"onUploadChange\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type === 'tree' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_cascader, {\n key: 3,\n style: {\n \"width\": \"100%\"\n },\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n options: _ctx.getCascaderOptions(slotRow.slotName),\n props: _ctx.elCascaderProps,\n clearable: \"\",\n filterable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\", \"options\", \"props\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"option\", \"modelValue\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_VFormRender, {\n key: 1,\n \"form-json\": _ctx.form,\n \"form-data\": _ctx.formData,\n \"option-data\": _ctx.optionData,\n ref: \"formRef\"\n }, null, 8 /* PROPS */, [\"form-json\", \"form-data\", \"option-data\"]))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"max-height\"])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"width\"])), [[_directive_loading, _ctx.state.loading]]) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_scrollbar, {\n key: 1,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => _ctx.state.dialogVisible = $event),\n \"max-height\": _ctx.state.maxHeight\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.state.type == '0' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_avue_form, {\n key: _ctx.state.key,\n ref: \"formRef\",\n option: _ctx.form,\n modelValue: _ctx.formData,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => _ctx.formData = $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.dynamicSlotsTable, slotRow => {\n return {\n name: slotRow.slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n disabled,\n size\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 根据配置动态渲染插槽内容 \"), slotRow.type == '22' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_ol_table_select, {\n key: 0,\n onOlTableSelectChange: _ctx.olTableSelectChange,\n slotName: slotRow.slotName,\n http: _ctx.http,\n defaultValue: _ctx.formData[slotRow.slotName],\n uuid: slotRow.config.uuid,\n disabled: disabled,\n size: size,\n config: slotRow.config\n }, null, 8 /* PROPS */, [\"onOlTableSelectChange\", \"slotName\", \"http\", \"defaultValue\", \"uuid\", \"disabled\", \"size\", \"config\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type == '21' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_IconSelect, {\n key: 1,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n clearable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type === '20' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_FileUpload, {\n key: 2,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n limit: 1,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\", \"onEmits\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"option\", \"modelValue\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_VFormRender, {\n key: 1,\n \"form-json\": _ctx.form,\n \"form-data\": _ctx.formData,\n \"option-data\": _ctx.optionData,\n ref: \"formRef\"\n }, null, 8 /* PROPS */, [\"form-json\", \"form-data\", \"option-data\"]))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"max-height\"]))]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-form/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");
|
|
1678
|
+
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_find_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_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_ol_table_select = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-select\");\n const _component_IconSelect = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"IconSelect\");\n const _component_olUploadFile = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olUploadFile\");\n const _component_el_cascader = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-cascader\");\n const _component_avue_form = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"avue-form\");\n const _component_VFormRender = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"VFormRender\");\n const _component_el_scrollbar = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-scrollbar\");\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 _component_FileUpload = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"FileUpload\");\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__.createElementBlock)(\"div\", null, [_ctx.isDialog === true && _ctx.state.isDialog === true ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n key: 0,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => _ctx.state.dialogVisible = $event),\n title: _ctx.state.title,\n \"align-center\": \"\",\n \"destroy-on-close\": \"\",\n width: _ctx.state.width,\n \"close-on-click-modal\": false\n }, {\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n onClick: _ctx.close\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 */, [\"onClick\"]), _ctx.show ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 0,\n type: \"primary\",\n loading: _ctx.state.loading,\n onClick: _ctx.doSave\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\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_scrollbar, {\n \"max-height\": _ctx.state.maxHeight,\n style: {\n \"padding-right\": \"10px\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.state.type == '0' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_avue_form, {\n key: _ctx.state.key,\n ref: \"formRef\",\n option: _ctx.form,\n modelValue: _ctx.formData,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => _ctx.formData = $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.dynamicSlotsTable, slotRow => {\n return {\n name: slotRow.slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n disabled,\n size\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 根据配置动态渲染插槽内容 \"), slotRow.type == '22' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_ol_table_select, {\n key: 0,\n onOlTableSelectChange: _ctx.olTableSelectChange,\n slotName: slotRow.slotName,\n http: _ctx.http,\n defaultValue: _ctx.formData[slotRow.slotName],\n uuid: slotRow.config.uuid,\n disabled: disabled,\n size: size,\n config: slotRow.config\n }, null, 8 /* PROPS */, [\"onOlTableSelectChange\", \"slotName\", \"http\", \"defaultValue\", \"uuid\", \"disabled\", \"size\", \"config\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type == '21' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_IconSelect, {\n key: 1,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n clearable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <FileUpload v-if=\\\"slotRow.type === '20'\\\" v-model=\\\"formData[slotRow.slotName]\\\" :limit=\\\"1\\\" @emits=\\\"(eventData) => handleEmits(eventData, slotRow.slotName)\\\" />\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" {url:\\\"/infra/file/uploadFile\\\",autoClose:true,multiple:true,query:false,js:js})\"), slotRow.type === '20' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_olUploadFile, {\n key: 2,\n slotName: slotRow.slotName,\n column: this.form.column.find(item => item.prop === slotRow.slotName),\n url: \"/infra/file/uploadFile\",\n testMode: true,\n multiple: true,\n fileListData: _ctx.formData[slotRow.slotName],\n onUploadChange: _ctx.uploadChange\n }, null, 8 /* PROPS */, [\"slotName\", \"column\", \"fileListData\", \"onUploadChange\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type === 'tree' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_cascader, {\n key: 3,\n style: {\n \"width\": \"100%\"\n },\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n options: _ctx.getCascaderOptions(slotRow.slotName),\n props: _ctx.elCascaderProps,\n clearable: \"\",\n filterable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\", \"options\", \"props\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"option\", \"modelValue\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_VFormRender, {\n key: 1,\n \"form-json\": _ctx.form,\n \"form-data\": _ctx.formData,\n \"option-data\": _ctx.optionData,\n ref: \"formRef\"\n }, null, 8 /* PROPS */, [\"form-json\", \"form-data\", \"option-data\"]))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"max-height\"])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\", \"width\"])), [[_directive_loading, _ctx.state.loading]]) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_scrollbar, {\n key: 1,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = $event => _ctx.state.dialogVisible = $event),\n \"max-height\": _ctx.state.maxHeight\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.state.type == '0' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_avue_form, {\n key: _ctx.state.key,\n ref: \"formRef\",\n option: _ctx.form,\n modelValue: _ctx.formData,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => _ctx.formData = $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.dynamicSlotsTable, slotRow => {\n return {\n name: slotRow.slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n disabled,\n size\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 根据配置动态渲染插槽内容 \"), slotRow.type == '22' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_ol_table_select, {\n key: 0,\n onOlTableSelectChange: _ctx.olTableSelectChange,\n slotName: slotRow.slotName,\n http: _ctx.http,\n defaultValue: _ctx.formData[slotRow.slotName],\n uuid: slotRow.config.uuid,\n disabled: disabled,\n size: size,\n config: slotRow.config\n }, null, 8 /* PROPS */, [\"onOlTableSelectChange\", \"slotName\", \"http\", \"defaultValue\", \"uuid\", \"disabled\", \"size\", \"config\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type == '21' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_IconSelect, {\n key: 1,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n clearable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type === '20' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_FileUpload, {\n key: 2,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n limit: 1,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\", \"onEmits\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"option\", \"modelValue\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_VFormRender, {\n key: 1,\n \"form-json\": _ctx.form,\n \"form-data\": _ctx.formData,\n \"option-data\": _ctx.optionData,\n ref: \"formRef\"\n }, null, 8 /* PROPS */, [\"form-json\", \"form-data\", \"option-data\"]))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"max-height\"]))]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-form/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");
|
|
1679
1679
|
|
|
1680
1680
|
/***/ }),
|
|
1681
1681
|
|
|
@@ -1686,7 +1686,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1686
1686
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1687
1687
|
|
|
1688
1688
|
"use strict";
|
|
1689
|
-
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_find_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_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\nconst _hoisted_1 = {\n style: {\n \"padding-right\": \"10px\",\n \"height\": \"86vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"footer-container\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_table_select = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-select\");\n const _component_IconSelect = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"IconSelect\");\n const _component_olUploadFile = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olUploadFile\");\n const _component_el_cascader = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-cascader\");\n const _component_avue_form = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"avue-form\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"model-index\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_el_row = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-row\");\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 _ctx.isDialog === true && _ctx.state.isDialog === true ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n key: 0,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[
|
|
1689
|
+
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_find_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_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\nconst _hoisted_1 = {\n style: {\n \"padding-right\": \"10px\",\n \"height\": \"86vh\"\n }\n};\nconst _hoisted_2 = {\n class: \"footer-container\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ol_table_select = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-select\");\n const _component_IconSelect = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"IconSelect\");\n const _component_olUploadFile = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olUploadFile\");\n const _component_el_cascader = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-cascader\");\n const _component_avue_form = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"avue-form\");\n const _component_model_index = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"model-index\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_el_row = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-row\");\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 _ctx.isDialog === true && _ctx.state.isDialog === true ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_dialog, {\n key: 0,\n modelValue: _ctx.state.dialogVisible,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = $event => _ctx.state.dialogVisible = $event),\n title: _ctx.state.title,\n \"align-center\": \"\",\n \"destroy-on-close\": \"\",\n fullscreen: \"\",\n \"close-on-click-modal\": false\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_avue_form, {\n key: _ctx.state.key,\n ref: \"formRef\",\n option: _ctx.form,\n modelValue: _ctx.formData,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => _ctx.formData = $event)\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.dynamicSlotsTable, slotRow => {\n return {\n name: slotRow.slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n disabled,\n size\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 根据配置动态渲染插槽内容 \"), slotRow.type == '22' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_ol_table_select, {\n key: 0,\n onOlTableSelectChange: $options.olTableSelectChange,\n slotName: slotRow.slotName,\n http: _ctx.http,\n defaultValue: _ctx.formData[slotRow.slotName],\n uuid: slotRow.config.uuid,\n disabled: disabled,\n size: size,\n config: slotRow.config\n }, null, 8 /* PROPS */, [\"onOlTableSelectChange\", \"slotName\", \"http\", \"defaultValue\", \"uuid\", \"disabled\", \"size\", \"config\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type == '21' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_IconSelect, {\n key: 1,\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n clearable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <FileUpload v-if=\\\"slotRow.type === '20'\\\" v-model=\\\"formData[slotRow.slotName]\\\" :limit=\\\"1\\\" @emits=\\\"(eventData) => handleEmits(eventData, slotRow.slotName)\\\" />\"), slotRow.type === '20' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_olUploadFile, {\n key: 2,\n slotName: slotRow.slotName,\n column: this.form.column.find(item => item.prop === slotRow.slotName),\n url: \"/infra/file/uploadFile\",\n testMode: false,\n multiple: true,\n fileListData: _ctx.formData[slotRow.slotName],\n onUploadChange: _ctx.uploadChange\n }, null, 8 /* PROPS */, [\"slotName\", \"column\", \"fileListData\", \"onUploadChange\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), slotRow.type === 'tree' ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_cascader, {\n key: 3,\n style: {\n \"width\": \"100%\"\n },\n modelValue: _ctx.formData[slotRow.slotName],\n \"onUpdate:modelValue\": $event => _ctx.formData[slotRow.slotName] = $event,\n options: _ctx.getCascaderOptions(slotRow.slotName),\n props: _ctx.elCascaderProps,\n clearable: \"\",\n filterable: \"\"\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\", \"options\", \"props\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"option\", \"modelValue\"])), _ctx.state.uuid ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_model_index, {\n key: 0,\n ref: \"subTable\",\n uuid: _ctx.state.uuid,\n http: $options.https,\n onInitOk: $options.ok\n }, null, 8 /* PROPS */, [\"uuid\", \"http\", \"onInitOk\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_row, {\n style: {\n \"height\": \"50px\",\n \"padding\": \"10px 20px 0 0\",\n \"border-top\": \"1px solid #e8eaec\",\n \"background\": \"white\",\n \"justify-content\": \"right\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_button, {\n onClick: _ctx.close\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"返 回\")])),\n _: 1 /* STABLE */,\n __: [2]\n }, 8 /* PROPS */, [\"onClick\"]), _ctx.show ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 0,\n type: \"primary\",\n loading: _ctx.state.loading,\n onClick: _ctx.doSave\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[3] || (_cache[3] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"保 存\")])),\n _: 1 /* STABLE */,\n __: [3]\n }, 8 /* PROPS */, [\"loading\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]),\n _: 1 /* STABLE */\n })])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"title\"])), [[_directive_loading, _ctx.state.loading]]) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-main-form-sub-table/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");
|
|
1690
1690
|
|
|
1691
1691
|
/***/ }),
|
|
1692
1692
|
|
|
@@ -1796,7 +1796,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1796
1796
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1797
1797
|
|
|
1798
1798
|
"use strict";
|
|
1799
|
-
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\nconst _hoisted_1 = [\"onClick\"];\nconst _hoisted_2 = {\n class: \"video-preview\"\n};\nconst _hoisted_3 = [\"src\", \"height\"];\nconst _hoisted_4 = {\n key: 1\n};\nconst _hoisted_5 = {\n key: 0,\n class: \"title\"\n};\nconst _hoisted_6 = {\n key: 1,\n style: {\n \"margin\": \"0px 15px -30px 0px\"\n }\n};\nconst _hoisted_7 = {\n key: 0,\n class: \"vxe-icon-fullscreen\",\n title: \"全屏\"\n};\nconst _hoisted_8 = {\n key: 1,\n class: \"vxe-icon-minimize\",\n title: \"取消全屏\"\n};\nconst _hoisted_9 = {\n class: \"video-dialog-container\"\n};\nconst _hoisted_10 = [\"src\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_olSelectDom = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olSelectDom\");\n const _component_el_image = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-image\");\n const _component_vxe_checkbox = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"vxe-checkbox\");\n const _component_Icon = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"Icon\");\n const _component_el_link = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-link\");\n const _component_ol_table_tool_btn = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-tool-btn\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_olTableOperate = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olTableOperate\");\n const _component_ol_table_column_dict_color = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-column-dict-color\");\n const _component_olPager = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olPager\");\n const _component_vxe_grid = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"vxe-grid\");\n const _component_ol_table_column_config = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-column-config\");\n const _component_olForm = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olForm\");\n const _component_OlMainFormSubTable = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"OlMainFormSubTable\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-dialog\");\n const _component_ol_dialog_table = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-dialog-table\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, [_ctx.table.formConfig.show ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('search'), {\n key: 0\n }, undefined, true) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_vxe_grid, (0,vue__WEBPACK_IMPORTED_MODULE_2__.mergeProps)(_ctx.table, {\n class: \"ol-table\",\n \"footer-method\": _ctx.footerMethod,\n onCheckboxChange: _ctx.selectRowChange,\n onRadioChange: _ctx.selectRowChange\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toHandlers)(_ctx.events), {\n onCheckboxAll: _ctx.selectRowChange\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n img_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_image, {\n style: {\n \"height\": \"60px\",\n \"width\": \"60px\"\n },\n src: row[$options.getFiledName(column)],\n \"preview-src-list\": [row[$options.getFiledName(column)]],\n \"list-type\": \"picture-card\",\n class: \"w-full h-auto rounded-md\"\n }, null, 8 /* PROPS */, [\"src\", \"preview-src-list\"])]),\n checkbox_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n column,\n row\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_vxe_checkbox, {\n modelValue: row[column.field],\n \"onUpdate:modelValue\": $event => row[column.field] = $event,\n checkedValue: 1,\n uncheckedValue: 0\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-checkbox v-model=\\\"row[column.field]\\\"\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" true-value=\\\"1\\\"\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" false-value=\\\"0\\\">{{ row[column.field] }}\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" </el-checkbox>\")]),\n video_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", {\n onClick: $event => $options.openVideoDialog(row[$options.getFiledName(column)]),\n style: {\n \"cursor\": \"pointer\"\n },\n class: \"video-thumbnail-container\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"video\", {\n ref: \"videoPreview\",\n src: row[$options.getFiledName(column)],\n preload: \"metadata\",\n width: \"100%\",\n height: (this.table.rowConfig?.height ?? 180) - 20,\n muted: \"\",\n class: \"video-preview-element\"\n }, null, 8 /* PROPS */, _hoisted_3), _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", {\n class: \"video-overlay\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"el-icon-video-play\"\n })], -1 /* CACHED */))])], 8 /* PROPS */, _hoisted_1)]),\n icon_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [row[$options.getFiledName(column)]?.includes(':') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_Icon, {\n key: 0,\n icon: row[$options.getFiledName(column)]\n }, null, 8 /* PROPS */, [\"icon\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_2__.normalizeClass)(row[$options.getFiledName(column)])\n }, null, 2 /* CLASS */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)(row[column[$options.getFiledName(column)]]), 1 /* TEXT */)]),\n selectTable_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [$options.isOpenSelectTable(column) ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_link, {\n key: 0,\n type: \"primary\",\n onClick: $event => $options.openSelectTable(column, row)\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)($options.getSelectTableValue(column, row, true)), 1 /* TEXT */)]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)($options.getSelectTableValue(column, row, false)), 1 /* TEXT */))]),\n header_left: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.table['table-title'] ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)(_ctx.table['table-title']), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_6)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerLeftLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_tool_btn, {\n size: _ctx.elSize,\n loading: _ctx.loading,\n value: _ctx.toolBtn.filter(o => o.alignMode == 'left'),\n currentPermi: $data.uuid + ':' + $props.theme + ':',\n onToolbarBtnClick: _cache[0] || (_cache[0] = $event => _ctx.toolbarBtnClick($event))\n }, null, 8 /* PROPS */, [\"size\", \"loading\", \"value\", \"currentPermi\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerLeftRight'), {}, undefined, true)]),\n header_right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerRightLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_tool_btn, {\n size: _ctx.elSize,\n loading: _ctx.loading,\n value: _ctx.toolBtn.filter(o => o.alignMode == 'right' && ['olp_fullscreen', 'olp_refresh', 'olp_setting', 'olp_search'].indexOf(o.code) == -1),\n currentPermi: $data.uuid + ':' + $props.theme + ':',\n onToolbarBtnClick: _cache[2] || (_cache[2] = $event => _ctx.toolbarBtnClick($event))\n }, {\n right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [$options.showToolName('olp_fullscreen') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 0,\n size: _ctx.elSize,\n onClick: _ctx.zoomEvent,\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [!_ctx.isMaximized ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", _hoisted_7)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", _hoisted_8))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_refresh') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 1,\n size: _ctx.elSize,\n onClick: _ctx.query,\n title: \"刷新\",\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[7] || (_cache[7] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-refresh\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [7]\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_setting') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 2,\n size: _ctx.elSize,\n title: \"设置\",\n onClick: _cache[1] || (_cache[1] = $event => _ctx.$refs.olTableColumnConfig.open(_ctx.tableConfig, _ctx.tableConfig.uuid, _ctx.table.columns)),\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[8] || (_cache[8] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-setting-fill\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [8]\n }, 8 /* PROPS */, [\"size\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_search') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 3,\n size: _ctx.elSize,\n title: \"搜索\",\n onClick: _ctx.toggleFormDisplay,\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[9] || (_cache[9] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-search\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [9]\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"size\", \"loading\", \"value\", \"currentPermi\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerRightRight'), {}, undefined, true)]),\n operate: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('operateLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olTableOperate, {\n size: _ctx.elSize,\n row: row,\n value: _ctx.operationBtn,\n onHandleOperationClick: _cache[3] || (_cache[3] = $event => _ctx.handleOperationClick($event))\n }, null, 8 /* PROPS */, [\"size\", \"row\", \"value\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('operateRight'), {}, undefined, true)]),\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(Object.keys({\n ...this.$slots,\n ...this.$scopedSlots\n }), slotName => {\n return {\n name: slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(scope => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, slotName, (0,vue__WEBPACK_IMPORTED_MODULE_2__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_2__.guardReactiveProps)(scope)), undefined, true)])\n };\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.table.formConfig.items.filter(item => item.slotsName != undefined), item => {\n return {\n name: item.slotsName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olSelectDom, {\n item: item,\n modelValue: _ctx.table.formConfig.data[item.key],\n \"onUpdate:modelValue\": $event => _ctx.table.formConfig.data[item.key] = $event,\n size: _ctx.elSize\n }, null, 8 /* PROPS */, [\"item\", \"modelValue\", \"onUpdate:modelValue\", \"size\"])])\n };\n }), _ctx.pagination.enabled && _ctx.table.columns.length != 0 ? {\n name: \"pager\",\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olPager, (0,vue__WEBPACK_IMPORTED_MODULE_2__.mergeProps)(_ctx.pagination, {\n onPageChange: _ctx.handlePageChange,\n onClearSelected: _ctx.clearSelected\n }), {\n left: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_column_dict_color, {\n columns: _ctx.table.columns\n }, null, 8 /* PROPS */, [\"columns\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('pageLeft'), {}, undefined, true)]),\n right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('pageRight'), {}, undefined, true)]),\n _: 3 /* FORWARDED */\n }, 16 /* FULL_PROPS */, [\"onPageChange\", \"onClearSelected\"])]),\n key: \"0\"\n } : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, [\"footer-method\", \"onCheckboxChange\", \"onRadioChange\", \"onCheckboxAll\"]), _ctx.customUrl != undefined ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)((0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveDynamicComponent)(_ctx.customUrl), {\n key: 1,\n ref: \"components\",\n onEmits: _ctx.emits\n }, null, 40 /* PROPS, NEED_HYDRATION */, [\"onEmits\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_column_config, {\n ref: \"olTableColumnConfig\",\n onUpdate: _ctx.updateColumn,\n onOk: _cache[4] || (_cache[4] = $event => _ctx.init(true))\n }, null, 8 /* PROPS */, [\"onUpdate\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olForm, {\n ref: \"form\",\n onQuery: _ctx.query,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"onQuery\", \"onEmits\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_OlMainFormSubTable, {\n ref: \"subForm\",\n onQuery: _ctx.query,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"onQuery\", \"onEmits\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 视频播放弹框 \"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_dialog, {\n modelValue: $data.videoDialogVisible,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = $event => $data.videoDialogVisible = $event),\n width: \"800px\",\n \"destroy-on-close\": true,\n center: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_9, [$data.videoDialogVisible ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"video\", {\n key: 0,\n ref: \"dialogVideoPlayer\",\n src: $data.currentVideoSrc,\n class: \"dialog-video-player\",\n controls: \"\",\n autoplay: \"\",\n controlsList: \"nodownload\",\n width: \"100%\"\n }, null, 8 /* PROPS */, _hoisted_10)) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 表格选取弹框 \"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_dialog_table, {\n ref: \"selectTableDialogRef\",\n onEmits: $options.getSelectRowChangeButClick\n }, null, 8 /* PROPS */, [\"onEmits\"])], 64 /* STABLE_FRAGMENT */);\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/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1799
|
+
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\nconst _hoisted_1 = [\"onClick\"];\nconst _hoisted_2 = {\n class: \"video-preview\"\n};\nconst _hoisted_3 = [\"src\", \"height\"];\nconst _hoisted_4 = {\n key: 1\n};\nconst _hoisted_5 = {\n key: 0,\n class: \"title\"\n};\nconst _hoisted_6 = {\n key: 1,\n style: {\n \"margin\": \"0px 15px -30px 0px\"\n }\n};\nconst _hoisted_7 = {\n key: 0,\n class: \"vxe-icon-fullscreen\",\n title: \"全屏\"\n};\nconst _hoisted_8 = {\n key: 1,\n class: \"vxe-icon-minimize\",\n title: \"取消全屏\"\n};\nconst _hoisted_9 = {\n class: \"video-dialog-container\"\n};\nconst _hoisted_10 = [\"src\"];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_olSelectDom = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olSelectDom\");\n const _component_el_image = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-image\");\n const _component_vxe_checkbox = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"vxe-checkbox\");\n const _component_Icon = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"Icon\");\n const _component_el_link = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-link\");\n const _component_ol_table_tool_btn = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-tool-btn\");\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-button\");\n const _component_olTableOperate = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olTableOperate\");\n const _component_ol_table_column_dict_color = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-column-dict-color\");\n const _component_olPager = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olPager\");\n const _component_vxe_grid = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"vxe-grid\");\n const _component_ol_table_column_config = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-table-column-config\");\n const _component_olForm = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"olForm\");\n const _component_OlMainFormSubTable = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"OlMainFormSubTable\");\n const _component_el_dialog = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"el-dialog\");\n const _component_ol_dialog_table = (0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveComponent)(\"ol-dialog-table\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_2__.Fragment, null, [_ctx.table.formConfig.show ? (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('search'), {\n key: 0\n }, undefined, true) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_vxe_grid, (0,vue__WEBPACK_IMPORTED_MODULE_2__.mergeProps)(_ctx.table, {\n class: \"ol-table\",\n \"footer-method\": _ctx.footerMethod,\n onCheckboxChange: _ctx.selectRowChange,\n onRadioChange: _ctx.selectRowChange\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toHandlers)(_ctx.events), {\n onCheckboxAll: _ctx.selectRowChange\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createSlots)({\n img_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_image, {\n style: {\n \"height\": \"60px\",\n \"width\": \"60px\"\n },\n src: row[$options.getFiledName(column)],\n \"preview-src-list\": [row[$options.getFiledName(column)]],\n \"list-type\": \"picture-card\",\n class: \"w-full h-auto rounded-md\"\n }, null, 8 /* PROPS */, [\"src\", \"preview-src-list\"])]),\n dict_css_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", {\n style: (0,vue__WEBPACK_IMPORTED_MODULE_2__.normalizeStyle)(column.params.cssClass[row[column.field]]),\n class: \"el-tag\"\n }, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)(column.params.dictValueLabel[row[column.field]]), 5 /* TEXT, STYLE */)]),\n checkbox_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n column,\n row\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_vxe_checkbox, {\n modelValue: row[column.field],\n \"onUpdate:modelValue\": $event => row[column.field] = $event,\n checkedValue: 1,\n uncheckedValue: 0\n }, null, 8 /* PROPS */, [\"modelValue\", \"onUpdate:modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" <el-checkbox v-model=\\\"row[column.field]\\\"\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" true-value=\\\"1\\\"\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" false-value=\\\"0\\\">{{ row[column.field] }}\"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" </el-checkbox>\")]),\n video_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", {\n onClick: $event => $options.openVideoDialog(row[$options.getFiledName(column)]),\n style: {\n \"cursor\": \"pointer\"\n },\n class: \"video-thumbnail-container\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"video\", {\n ref: \"videoPreview\",\n src: row[$options.getFiledName(column)],\n preload: \"metadata\",\n width: \"100%\",\n height: (this.table.rowConfig?.height ?? 180) - 20,\n muted: \"\",\n class: \"video-preview-element\"\n }, null, 8 /* PROPS */, _hoisted_3), _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", {\n class: \"video-overlay\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"el-icon-video-play\"\n })], -1 /* CACHED */))])], 8 /* PROPS */, _hoisted_1)]),\n icon_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [row[$options.getFiledName(column)]?.includes(':') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_Icon, {\n key: 0,\n icon: row[$options.getFiledName(column)]\n }, null, 8 /* PROPS */, [\"icon\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_2__.normalizeClass)(row[$options.getFiledName(column)])\n }, null, 2 /* CLASS */)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)(row[column[$options.getFiledName(column)]]), 1 /* TEXT */)]),\n selectTable_default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row,\n column\n }) => [$options.isOpenSelectTable(column) ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_link, {\n key: 0,\n type: \"primary\",\n onClick: $event => $options.openSelectTable(column, row)\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)($options.getSelectTableValue(column, row, true)), 1 /* TEXT */)]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\"])) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)($options.getSelectTableValue(column, row, false)), 1 /* TEXT */))]),\n header_left: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [_ctx.table['table-title'] ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_2__.toDisplayString)(_ctx.table['table-title']), 1 /* TEXT */)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"span\", _hoisted_6)), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerLeftLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_tool_btn, {\n size: _ctx.elSize,\n loading: _ctx.loading,\n value: _ctx.toolBtn.filter(o => o.alignMode == 'left'),\n currentPermi: $data.uuid + ':' + $props.theme + ':',\n onToolbarBtnClick: _cache[0] || (_cache[0] = $event => _ctx.toolbarBtnClick($event))\n }, null, 8 /* PROPS */, [\"size\", \"loading\", \"value\", \"currentPermi\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerLeftRight'), {}, undefined, true)]),\n header_right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerRightLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_tool_btn, {\n size: _ctx.elSize,\n loading: _ctx.loading,\n value: _ctx.toolBtn.filter(o => o.alignMode == 'right' && ['olp_fullscreen', 'olp_refresh', 'olp_setting', 'olp_search'].indexOf(o.code) == -1),\n currentPermi: $data.uuid + ':' + $props.theme + ':',\n onToolbarBtnClick: _cache[2] || (_cache[2] = $event => _ctx.toolbarBtnClick($event))\n }, {\n right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [$options.showToolName('olp_fullscreen') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 0,\n size: _ctx.elSize,\n onClick: _ctx.zoomEvent,\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [!_ctx.isMaximized ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", _hoisted_7)) : ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"i\", _hoisted_8))]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_refresh') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 1,\n size: _ctx.elSize,\n onClick: _ctx.query,\n title: \"刷新\",\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[7] || (_cache[7] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-refresh\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [7]\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_setting') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 2,\n size: _ctx.elSize,\n title: \"设置\",\n onClick: _cache[1] || (_cache[1] = $event => _ctx.$refs.olTableColumnConfig.open(_ctx.tableConfig, _ctx.tableConfig.uuid, _ctx.table.columns)),\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[8] || (_cache[8] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-setting-fill\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [8]\n }, 8 /* PROPS */, [\"size\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), $options.showToolName('olp_search') ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)(_component_el_button, {\n key: 3,\n size: _ctx.elSize,\n title: \"搜索\",\n onClick: _ctx.toggleFormDisplay,\n circle: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => _cache[9] || (_cache[9] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"i\", {\n class: \"vxe-icon-search\"\n }, null, -1 /* CACHED */)])),\n _: 1 /* STABLE */,\n __: [9]\n }, 8 /* PROPS */, [\"size\", \"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"size\", \"loading\", \"value\", \"currentPermi\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('headerRightRight'), {}, undefined, true)]),\n operate: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(({\n row\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('operateLeft'), {}, undefined, true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olTableOperate, {\n size: _ctx.elSize,\n row: row,\n value: _ctx.operationBtn,\n onHandleOperationClick: _cache[3] || (_cache[3] = $event => _ctx.handleOperationClick($event))\n }, null, 8 /* PROPS */, [\"size\", \"row\", \"value\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('operateRight'), {}, undefined, true)]),\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(Object.keys({\n ...this.$slots,\n ...this.$scopedSlots\n }), slotName => {\n return {\n name: slotName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(scope => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, slotName, (0,vue__WEBPACK_IMPORTED_MODULE_2__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_2__.guardReactiveProps)(scope)), undefined, true)])\n };\n }), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderList)(_ctx.table.formConfig.items.filter(item => item.slotsName != undefined), item => {\n return {\n name: item.slotsName,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olSelectDom, {\n item: item,\n modelValue: _ctx.table.formConfig.data[item.key],\n \"onUpdate:modelValue\": $event => _ctx.table.formConfig.data[item.key] = $event,\n size: _ctx.elSize\n }, null, 8 /* PROPS */, [\"item\", \"modelValue\", \"onUpdate:modelValue\", \"size\"])])\n };\n }), _ctx.pagination.enabled && _ctx.table.columns.length != 0 ? {\n name: \"pager\",\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olPager, (0,vue__WEBPACK_IMPORTED_MODULE_2__.mergeProps)(_ctx.pagination, {\n onPageChange: _ctx.handlePageChange,\n onClearSelected: _ctx.clearSelected\n }), {\n left: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_column_dict_color, {\n columns: _ctx.table.columns\n }, null, 8 /* PROPS */, [\"columns\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('pageLeft'), {}, undefined, true)]),\n right: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.renderSlot)(_ctx.$slots, $options.getSlotName('pageRight'), {}, undefined, true)]),\n _: 3 /* FORWARDED */\n }, 16 /* FULL_PROPS */, [\"onPageChange\", \"onClearSelected\"])]),\n key: \"0\"\n } : undefined]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, [\"footer-method\", \"onCheckboxChange\", \"onRadioChange\", \"onCheckboxAll\"]), _ctx.customUrl != undefined ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createBlock)((0,vue__WEBPACK_IMPORTED_MODULE_2__.resolveDynamicComponent)(_ctx.customUrl), {\n key: 1,\n ref: \"components\",\n onEmits: _ctx.emits\n }, null, 40 /* PROPS, NEED_HYDRATION */, [\"onEmits\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_table_column_config, {\n ref: \"olTableColumnConfig\",\n onUpdate: _ctx.updateColumn,\n onOk: _cache[4] || (_cache[4] = $event => _ctx.init(true))\n }, null, 8 /* PROPS */, [\"onUpdate\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_olForm, {\n ref: \"form\",\n onQuery: _ctx.query,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"onQuery\", \"onEmits\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_OlMainFormSubTable, {\n ref: \"subForm\",\n onQuery: _ctx.query,\n onEmits: _ctx.emits\n }, null, 8 /* PROPS */, [\"onQuery\", \"onEmits\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 视频播放弹框 \"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_el_dialog, {\n modelValue: $data.videoDialogVisible,\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = $event => $data.videoDialogVisible = $event),\n width: \"800px\",\n \"destroy-on-close\": true,\n center: \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_2__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementVNode)(\"div\", _hoisted_9, [$data.videoDialogVisible ? ((0,vue__WEBPACK_IMPORTED_MODULE_2__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createElementBlock)(\"video\", {\n key: 0,\n ref: \"dialogVideoPlayer\",\n src: $data.currentVideoSrc,\n class: \"dialog-video-player\",\n controls: \"\",\n autoplay: \"\",\n controlsList: \"nodownload\",\n width: \"100%\"\n }, null, 8 /* PROPS */, _hoisted_10)) : (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\"v-if\", true)])]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\"]), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createCommentVNode)(\" 表格选取弹框 \"), (0,vue__WEBPACK_IMPORTED_MODULE_2__.createVNode)(_component_ol_dialog_table, {\n ref: \"selectTableDialogRef\",\n onEmits: $options.getSelectRowChangeButClick\n }, null, 8 /* PROPS */, [\"onEmits\"])], 64 /* STABLE_FRAGMENT */);\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/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
1800
1800
|
|
|
1801
1801
|
/***/ }),
|
|
1802
1802
|
|
|
@@ -12775,7 +12775,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12775
12775
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12776
12776
|
|
|
12777
12777
|
"use strict";
|
|
12778
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{?([^{}]+)\\}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: false\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.state.dialogVisible = false;\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n this.setDepRoleDefault(column);\n if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n // 设置订单号\n for (const column of data.form.column) {\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12778
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OForm: function() { return /* binding */ OForm; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/components/ol-table-select.vue */ \"./src/components/ol-table-select.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nfunction replaceDollarBraces(str) {\n return str.toString().replace(/\\$\\{?([^{}]+)\\}?/g, function (match, innerContent) {\n return innerContent ? `'${innerContent}'` : match;\n });\n}\nconst OForm = {\n name: 'OForm',\n components: {\n FileUpload: _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_15__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n },\n inject: ['http'],\n props: {\n isDialog: {\n type: Boolean,\n default: true\n }\n },\n data() {\n return {\n js: undefined,\n formData: {},\n optionData: {},\n initOkTabs: [],\n form: {\n column: []\n },\n initOk: false,\n dynamicSlotsTable: [],\n dynamicSlotsField: {},\n dynamicSlotsOtherResult: {},\n show: true,\n state: {\n deleteId: '',\n uuid: '',\n foreignKey: '',\n exBtnDisabled: undefined,\n isDialog: true,\n loading: false,\n fullscreen: false,\n dialogVisible: false,\n title: \"\",\n width: '60%',\n comCommit: true,\n maxHeight: '400px',\n type: '0',\n edit: false,\n saveUrl: '',\n requestType: 'post',\n updateKey: '',\n theme: 't1',\n tableConfigId: '',\n dbName: '',\n tableName: '',\n otherProp: {}\n },\n elCascaderProps: {\n expandTrigger: 'hover',\n emitPath: false,\n checkStrictly: false\n }\n };\n },\n methods: {\n getCascaderOptions(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName).dicData;\n },\n getCascaderColumn(slotName) {\n // console.info('getCascaderOptions',this.form.column)\n return this.form.column.find(item => item.prop === slotName);\n },\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.setArrayObjectKeyValue)(this.form.column, 'display', true, prop);\n },\n setOtherProp(params) {\n if (this.state.otherProp) {\n if (this.state.otherProp.createBy && this.state.otherProp.createBy.trim()) {\n params.createBy = this.state.otherProp.createBy.trim();\n }\n if (this.state.otherProp.updateBy && this.state.otherProp.updateBy.trim()) {\n params.updateBy = this.state.otherProp.updateBy.trim();\n }\n }\n },\n /**\r\n * 根据列配置获取数据库表更新数据\r\n * @param column\r\n * @param formData\r\n * @returns {{}}\r\n */\n getTableUpdateValue(column, formData) {\n let columnAndValueMap = {};\n for (let {\n prop,\n tableField,\n tableSaveToOtherProp\n } of column) {\n if (tableField && tableField == '1' || tableSaveToOtherProp == '1') {\n continue;\n }\n let value = formData[prop];\n if (value != undefined) {\n if (value instanceof String) {\n value = value.trim();\n }\n if (value instanceof Array) {\n columnAndValueMap[prop] = value.join(',');\n } else {\n columnAndValueMap[prop] = value;\n }\n }\n }\n return columnAndValueMap;\n },\n /**\r\n * 封装主表单校验逻辑\r\n * @returns {Promise<*>}\r\n */\n async validateMainForm() {\n return new Promise(resolve => {\n const validator = this.state.type !== '0' ? this.$refs.formRef.getNativeForm().validate : (valid, done, msg) => this.$refs.formRef.validate(valid, done, msg);\n validator((valid, ...args) => {\n const [msg, done] = this.state.type === '0' ? [args[1], args[0]] : [args[0]];\n if (!valid) {\n const keys = Object.keys(msg);\n const domRef = this.state.type !== '0' ? this.$refs.formRef.getWidgetRef(keys[0])?.$el : this.$refs.formRef.getPropRef(keys[0])?.$el;\n domRef?.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`主表单还有${keys.length}项未填写`);\n resolve(false);\n } else {\n resolve(true);\n }\n if (this.state.type === '0') done?.();\n });\n });\n },\n /**\r\n * 封装子表校验逻辑\r\n * @returns {Promise<FlatArray<Awaited<*>[], 1>[]>}\r\n */\n async validateSubTables() {\n // 1. 获取所有子表引用\n const subTablesRefs = this.$refs.subTable?.getTableRefs()?.getTabRefAll() || [];\n\n // 2. 并行执行全量校验(包含新增/修改/删除的数据)\n const validationPromises = subTablesRefs.map(subTable =>\n // 传入 true 校验所有数据(包括未修改的)\n subTable.$table.validate(true));\n\n // 3. 等待所有子表校验结果\n const results = await Promise.all(validationPromises);\n return results.flat().filter(Boolean);\n },\n /**\r\n * 错误定位工具函数\r\n * @param error\r\n */\n focusFirstError(error) {\n const targetEl = error.getElement?.();\n if (targetEl) {\n targetEl.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n } else {\n console.warn(\"无法定位错误元素:\", error.field);\n }\n },\n async doMainSubSave() {\n try {\n // ====================== 1. 主表单校验 ======================\n const mainFormValid = await this.validateMainForm();\n if (!mainFormValid) return;\n\n // ====================== 2. 子表并行校验 ======================\n const subTableErrors = await this.validateSubTables();\n if (subTableErrors.length > 0) {\n this.focusFirstError(subTableErrors[0]);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(`子表存在${subTableErrors.length}处错误,请修正后提交`);\n return;\n }\n\n // ====================== 3. 全部通过后保存 ======================\n this.save();\n } catch (error) {\n console.error(\"保存过程中发生异常:\", error);\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"系统异常,请稍后重试\");\n }\n },\n async doSave() {\n let dom;\n let keys;\n if (this.state.type != '0') {\n await this.$refs.formRef.getNativeForm().validate((valid, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getWidgetRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n });\n } else {\n await this.$refs.formRef.validate((valid, done, msg) => {\n if (!valid) {\n keys = Object.keys(msg);\n dom = this.$refs.formRef.getPropRef(keys[0]);\n dom.$el.scrollIntoView({\n block: \"center\",\n behavior: \"smooth\"\n });\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_7__.useMessage)().error(\"您还有\" + keys.length + \"项信息未填写,请填写后再操作!\");\n } else {\n this.save();\n }\n done();\n });\n }\n },\n saveOk(status) {\n this.state.loading = false;\n this.initOkTabs = [];\n if (status) {\n this.close();\n this.$emit('query');\n }\n if (this.state.otherProp && this.state.otherProp.afterSave) {\n try {\n eval(this.state.otherProp.afterSave);\n } catch (e) {\n console.log(e);\n }\n }\n },\n close() {\n this.state.dialogVisible = false;\n this.$emit('emits', {});\n },\n async save() {\n if (this.js) {\n let param = {\n js: this.js,\n v: this.formData\n };\n this.state.dialogVisible = false;\n this.$emit('emits', param);\n return;\n }\n let params = this.getParams();\n if (this.state.otherProp && this.state.otherProp.beforeSave) {\n try {\n let next = eval(\"(params)=>{\" + this.state.otherProp.beforeSave + \"}\");\n if (next(params) === false) {\n return;\n }\n } catch (e) {\n console.log(e);\n return;\n }\n }\n this.state.loading = true;\n try {\n let url = this.state.saveUrl ? this.state.saveUrl : this.state.edit ? '/online/crudAes/modify' : '/online/crudAes/save';\n if (this.state.requestType.toLowerCase() == \"put\") {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.put)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else if (!this.state.saveUrl || this.state.saveUrl.indexOf(\"/online/crudAes/\") != -1) {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n }\n } catch (e) {\n console.error(e);\n } finally {\n this.state.loading = false;\n }\n },\n setDepRoleDefault(column) {\n //人员岗位\n if (column.selectDom === '25' || column.selectDom === '26' || column.selectDom === '27' || column.selectDom === '24') {\n let dic = {\n \"24\": 'olp_cloud,system_dept,name,id',\n \"25\": 'olp_cloud,system_role,name,id',\n \"26\": 'olp_cloud,system_post,name,id',\n \"27\": 'olp_cloud,system_users,nickname,id'\n };\n column.dictTable = dic[column.selectDom];\n column.type = 'select';\n }\n },\n initFormColumn(data) {\n for (let column of this.form.column) {\n if (data.disabled || column.disabled == 1) {\n column.disabled = true;\n }\n this.setDepRoleDefault(column);\n if (column.selectDom === '20') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '21') {\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else if (column.selectDom === '22') {\n //表格选取\n let slotObj = {\n slotName: column.prop,\n type: column.selectDom,\n config: JSON.parse(column.attrs).olTableSelect\n };\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n const otherResult = slotObj.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n // otherResultArray.push({targetField: k[[k.length - 1]], sourceField: k[0]})\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n this.dynamicSlotsOtherResult[column.prop] = otherResultArray;\n }\n } else {\n this.initDict(column);\n }\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_13__.parseJson)(column);\n for (let event of ['change']) {\n if (column[event] && !(column[event] instanceof Function)) {\n try {\n column[event] = eval(\"(params)=>{this.$nextTick(()=>{\" + \"let formData = this.formData;\" + \"let {value} = params;\" + replaceDollarBraces(column[event]) + \"})\" + \"}\");\n } catch (e) {\n console.error(e);\n }\n }\n }\n }\n },\n async doInit(data) {\n this.beforeInit();\n this.show = !data.disabled;\n this.initOkTabs = [];\n if (data.saveUrl) {\n this.state.saveUrl = data.saveUrl.trim();\n if (data.requestType) {\n this.state.requestType = data.requestType;\n }\n } else {\n this.state.saveUrl = undefined;\n }\n this.state.edit = data['code'] == 'edit' == true;\n this.state.title = data.title ? data.title : this.state.edit ? '编辑' : '新增';\n if (data.form.title) {\n this.state.title = data.form.title;\n }\n // 设置订单号\n for (const column of data.form.column) {\n column.value = await (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(this.http, column);\n }\n this.formData = data.formData;\n this.form = data.form;\n this.state.dialogVisible = true;\n for (let key of Object.keys(this.state)) {\n if (data[key]) {\n this.state[key] = data[key];\n }\n }\n if (this.state.type == 0) {\n //赋值弹窗宽度和高度\n if (data.form.diaLogWidth) {\n this.state.width = data.form.diaLogWidth;\n }\n if (data.form.diaLogHeight) {\n this.state.maxHeight = data.form.diaLogHeight + 'px';\n }\n this.initFormColumn(data);\n } else {\n let {\n width,\n height\n } = this.form.formConfig;\n //赋值弹窗宽度和高度\n this.state.width = width;\n this.state.maxHeight = height + 'px';\n for (let widgetListElement of this.form.widgetList) {\n this.setDict(widgetListElement);\n }\n }\n setTimeout(() => {\n this.afterInit();\n }, 350);\n },\n setDict(column) {\n if (column && column.dict) {\n column.dictCode = column.dict;\n this.initDict(column);\n }\n if (column.cols instanceof Array) {\n for (let col of column.cols) {\n this.setDict(col);\n }\n }\n },\n init(data, js) {\n try {\n this.js = js;\n this.doInit(data);\n } catch (e) {\n console.error(e);\n }\n },\n /**\r\n * 初始化后回调\r\n */\n afterInit() {\n if (this.state.otherProp) {\n try {\n this.state.otherProp = JSON.parse(this.state.otherProp);\n if (this.state.otherProp.afterInit) {\n eval(this.state.otherProp.afterInit);\n }\n } catch (e) {\n console.log(e);\n }\n }\n },\n /**\r\n * 初始化前回调\r\n */\n beforeInit() {\n if (this.state.otherProp && this.state.otherProp.beforeInit) {\n try {\n eval(this.state.otherProp.beforeInit);\n } catch (e) {\n console.log(e);\n }\n }\n },\n initDict(column) {\n if (column.dictCode) {\n column.dicData = dict.val(column.dictCode);\n if (column.dict && column.options) {\n column.options.optionItems = column.dicData;\n }\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n //”number”、”string”、”boolean”、”object”、”function” 和 “undefined”\n let dataType = typeof this.formData[column.prop];\n if ([\"number\", \"boolean\"].indexOf(dataType) != -1) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n }\n if (this.state.edit) {\n return;\n }\n if (this.formData[column.prop] != undefined) {\n this.formData[column.prop] = String(this.formData[column.prop]);\n column.value = this.formData[column.prop];\n } else if (column.value != undefined) {\n this.formData[column.prop] = String(column.value);\n } else {\n // 数据字典与值类型不一致\n if (this.formData[column.prop] == undefined) {\n setTimeout(() => {\n if (column.dicData) {\n for (let dicDatum of column.dicData) {\n if (dicDatum.isDefault == 1) {\n this.formData[column.prop] = dicDatum.value;\n column.value = this.formData[column.prop];\n }\n }\n }\n }, 100);\n }\n }\n } else if (column.dictTable || column.dictUrl) {\n if (column.selectDom == 1 || !column.type) {\n column.type = \"select\";\n }\n column.filterable = true;\n column.dicData = [];\n setTimeout(() => {\n this.setDictTable(column, undefined);\n }, 10);\n if (column.type == 'tree') {\n column.filterable = column.filterable == undefined ? true : column.clearable;\n column.clearable = column.clearable == undefined ? true : column.clearable;\n let slotObj = {\n slotName: column.prop,\n type: 'tree'\n };\n if (column.attrs) {\n const attrs = JSON.parse(column.attrs);\n this.elCascaderProps = {\n ...this.elCascaderProps,\n ...attrs\n };\n }\n this.dynamicSlotsField[column.prop] = column; //收集继续动态改变值的字段信息,以便动态改变值时更新表单数据\n this.dynamicSlotsTable.push(slotObj); //收集需要的动态插槽字段信息\n } else {\n column.filterMethod = e => {\n this.$nextTick(() => {\n this.setDictTable(column, e);\n });\n };\n }\n }\n },\n setDictUrl(column, like) {\n let dictUrl = column.dictUrl.split(\",\");\n let url;\n let label = 'label';\n let value = 'value';\n let parentId = 'parentId';\n // get,url,label,value,parent_id\n let doGet = true;\n if (dictUrl.length > 1) {\n if (dictUrl[0].toString().toLowerCase() == 'post') {\n doGet = false;\n }\n url = dictUrl[1];\n label = dictUrl[2];\n value = dictUrl[3];\n parentId = dictUrl[4];\n } else {\n url = dictUrl[0];\n }\n if (doGet) {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.get)(this.http, url + \"?label=\" + like).then(data => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(d => {\n column.dicData.push(d);\n });\n }\n });\n } else {\n let params = {};\n if (like) {\n params['label'] = like;\n }\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_8__.post)(this.http, column.dictUrl, params, false).then(({\n data\n }) => {\n column.dicData.length = 0;\n if (column.type == 'tree') {\n for (let da of data) {\n da['label'] = da[label];\n da['value'] = da[value];\n }\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, value, parentId);\n } else {\n data.forEach(da => {\n da['label'] = da[label];\n da['value'] = da[value];\n column.dicData.push(da);\n });\n }\n });\n }\n },\n setDictTable(column, like) {\n if (column.dictTable && column.dictTable.toString().trim() != '') {\n this.doSetDictTable(column, like);\n } else if (column.dictUrl) {\n this.setDictUrl(column, like);\n }\n },\n doSetDictTable(column, like) {\n let value = this.formData[column.prop];\n /*String tableName;\r\n String dbName;\r\n String label;\r\n String value;\r\n Map<String, Object> where;*/\n // olp-vue-pro,system_users,nickname,id,parentId\n let params = {};\n // let dictTable = column.dictTable;\n try {\n // 使用Function构造函数比eval更安全\n params = new Function('return ' + column.dictTable)();\n } catch (e) {\n // 2. 业务调用侧(清晰的使用逻辑)\n params = (0,_utils_formUtils__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(column.dictTable);\n }\n if (like || value) {\n if (!params.where) {\n params.where = {};\n }\n }\n if (!params[\"parentValue\"]) {\n if (like) {\n params.where['_like_' + params[\"label\"]] = like;\n }\n if (value instanceof Array) {\n let val = '';\n for (let valueElement of value) {\n if (val.length > 0) {\n val += \",\";\n }\n val = val + \"'\" + valueElement + \"'\";\n }\n if (val) {\n params.where['_in_' + params[\"label\"]] = val;\n }\n //params.defaultValue = value;\n } else {\n params.defaultValue = value;\n }\n }\n (0,_api_dist__WEBPACK_IMPORTED_MODULE_11__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_9__.handleTree)(data, 'dictValue', 'parentValue');\n } else {\n data.forEach(d => {\n d.value = d.value + '';\n d.dictValue = d.dictValue + '';\n column.dicData.push(d);\n });\n }\n });\n },\n /**\r\n * 表格选择器回调函数\r\n * @param data\r\n */\n olTableSelectChange(slotName, data) {\n // console.info('插槽名称', slotName, '表格回传的数据', data)\n // console.info('表格', this.form.column)\n this.formData[slotName] = data.value; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data.value); //字段数据更新回调\n }\n //给其他字段赋值\n this.dynamicSlotsOtherResult[slotName]?.forEach(item => {\n this.formData[item.targetField] = data.data[item.sourceField];\n });\n },\n uploadChange(slotName, data) {\n console.info('回调', slotName, data);\n this.formData[slotName] = data; //修改表单数据,以便后续提交\n if (typeof this.dynamicSlotsField[slotName].change === 'function') {\n this.dynamicSlotsField[slotName].change(data); //字段数据更新回调\n }\n },\n handleEmits({\n m,\n v,\n d,\n js\n }, key) {\n if (typeof js === 'string') {\n eval(js);\n } else if (m && this[m]) {\n this[m](v);\n }\n if (d != false) {\n this.customUrl = undefined;\n }\n this.formData[key] = v;\n console.log('emits:', this.formData);\n }\n },\n mounted() {\n this.$nextTick(() => {\n (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)().init(this.http);\n });\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OForm.js?");
|
|
12779
12779
|
|
|
12780
12780
|
/***/ }),
|
|
12781
12781
|
|
|
@@ -12819,7 +12819,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12819
12819
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
12820
12820
|
|
|
12821
12821
|
"use strict";
|
|
12822
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinColumnMethod: function() { return /* binding */ OTMixinColumnMethod; }\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 core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __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_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_6__ = __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_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_7__ = __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_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/FilterType.js */ \"./src/utils/FilterType.js\");\n/* harmony import */ var _utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9__);\n\n\n\n\n\n\n\n\n\n\n\nfunction setColumnParams(column, key, value) {\n if (value === undefined) {\n return;\n }\n if (!column['params']) {\n column['params'] = {};\n }\n column['params'][key] = value;\n}\nconst OTMixinColumnMethod = {\n methods: {\n setColumnCssClass(o) {\n if (o.dictCode) {\n let vals = this.dictVal(o.dictCode);\n let cssClass = {};\n if (vals) {\n let dictValueLabel = {};\n for (let obj of vals) {\n dictValueLabel[obj.dictValue] = obj.dictLabel;\n if (obj.cssClass) {\n let css = obj.cssClass.trim();\n try {\n css = css.replace(/([a-zA-Z_]\\w*):/g, '\"$1\":').replace(/'/g, '\"');\n css = JSON.parse(css);\n if (Array.isArray(css)) {\n let data = {};\n if (css[0]) {\n data['backgroundColor'] = css[0];\n }\n if (css[1]) {\n data['color'] = css[1];\n }\n cssClass[obj.dictValue] = data;\n } else {\n cssClass[obj.dictValue] = css;\n }\n } catch (e) {\n console.error(\"列名:\", o.title, \"数据字典:\", obj.dictLabel, \"样式异常:\", css);\n }\n }\n }\n setColumnParams(o, 'dictValueLabel', dictValueLabel);\n }\n if (Object.keys(cssClass).length != 0) {\n setColumnParams(o, 'cssClass', cssClass);\n }\n }\n },\n initColumn(columns, tableConfig) {\n this.table.mergeFields = [];\n let items = [];\n columns = columns.sort(({\n sort: a\n }, {\n sort: b\n }) => a - b);\n for (let column of columns) {\n this.toParseOtherProp(column);\n }\n this.table.columnSource = JSON.parse(JSON.stringify(columns));\n let {\n optionJson,\n seq\n } = tableConfig;\n if (optionJson) {\n optionJson = JSON.parse(optionJson);\n }\n let enableFilter = optionJson?.table?.enableFilter;\n let hasEditConfig = this.hasEditConfig();\n if (hasEditConfig) {\n // 设置列表必填\n this.setEditRules(columns);\n }\n let uuidTableSelectConf = {\n '24': '2011044563705458688',\n //部门\n '25': '1904380469886234624',\n //角色\n '26': '2009164807696859136',\n //岗位\n '27': '2011373314888716288' //人员\n };\n for (let o of columns) {\n //部门选择器的Formatter\n if (uuidTableSelectConf[o.selectDom]) {\n o.params = {\n uuid: uuidTableSelectConf[o.selectDom],\n key: 'id',\n label: 'name',\n uniqueId: o.id,\n tableSelect: true\n };\n } else if (o.tableSelectConfToOtherProp) {\n try {\n o.params = JSON.parse(o.tableSelectConfToOtherProp).olTableSelect;\n o.params.uniqueId = o.id;\n o.params.tableSelect = true;\n } catch (e) {}\n }\n this.setColumnCssClass(o);\n this.initFormatter(o);\n this.initSlots(o);\n this.setTreeOpenColumn(o, tableConfig);\n this.setMergeField(o);\n this.setColumnShowOverFlow(o, optionJson);\n this.setProp(o);\n this.setColumnHide(o);\n this.setFixed(o);\n this.setShowFooter(o);\n this.getVNode(o, items);\n if (enableFilter) {\n this.setFilters(o);\n }\n // 可编辑配置\n if (hasEditConfig) {\n this.setEditConfig(o);\n }\n if (o.tableSelectConfToOtherProp) {\n //表格选取的配置\n o.params.tableSelectConfToOtherProp = o.tableSelectConfToOtherProp;\n }\n }\n items.sort(({\n searchSort: a\n }, {\n searchSort: b\n }) => a - b);\n this.setSearchArea(items);\n columns = this.initBodyLeftColumn(columns, seq);\n if (this.table['show-footer']) {\n if (!columns[0].width || columns[0].width < 55) {\n columns[0].width = 55;\n }\n }\n this.table.columns = columns;\n //暂时不合并,启用虚拟滚动\n this.initMergeCells();\n },\n /**\r\n * 动态设置列的 formatter(将值映射为字典标签)\r\n * @param {Object} context - Vue 组件实例(this)\r\n * @param {String} selectDomValue - 匹配的 selectDom 值(如 '24')\r\n * @param {String} typeField - 动态列配置属性名(如 'department')\r\n */\n setColumnFormatter(context, selectDomValue, typeField) {\n const configListProp = typeField + 'ColumnsConfig';\n const dictPropName = typeField + 'Dict';\n\n // 1. 过滤出目标列配置\n const configList = context.table.columnSource.filter(item => item.selectDom === selectDomValue);\n context.table.other[configListProp] = configList;\n\n // console.info(`动态列配置(${configListProp}):`, configList);\n\n // 2. 如果存在目标列,设置 formatter\n if (configList.length > 0) {\n configList.forEach(columnConfig => {\n const targetColumn = context.table.columns.find(col => col.field === columnConfig.field);\n if (targetColumn) {\n targetColumn.formatter = ({\n cellValue\n }) => {\n // 检查是否是类似'[1,2]'的数组字符串\n // if (typeof cellValue === 'string' && cellValue.startsWith('[') && cellValue.endsWith(']')) {\n if (typeof cellValue === 'string') {\n try {\n // 尝试解析为数组\n let values = [];\n if (cellValue.startsWith('[') && cellValue.endsWith(']')) {\n values = JSON.parse(cellValue);\n } else {\n values = cellValue.split(\",\");\n }\n if (Array.isArray(values)) {\n // 查找所有匹配的字典项并拼接标签\n const labels = values.map(value => {\n const dictItem = context.table.other[dictPropName]?.find(item => item.value == value // 使用宽松相等比较\n );\n return dictItem ? dictItem.label : value;\n });\n return labels.join(','); // 用逗号连接标签\n }\n } catch (e) {\n // 解析失败,按原样处理\n }\n }\n const dictItem = context.table.other[dictPropName]?.find(item => item.value == cellValue);\n return dictItem ? dictItem.label : cellValue; // 显示标签或原值\n };\n }\n });\n }\n },\n setEditRules(columns) {\n for (const column of columns) {\n if (column.required === '1') {\n this.table.editRules ||= {};\n this.table.editRules[column.field] = [{\n required: true,\n message: '必须填写'\n }];\n }\n }\n },\n hasEditConfig() {\n return this.table.editConfig && (this.table.editConfig.enabled === true || typeof this.table.editConfig.enabled === 'string' && this.table.editConfig.enabled.toLowerCase() === 'true');\n },\n setEditConfig(o) {\n if (o.tableSaveToOtherProp && o.tableSaveToOtherProp == '1') {\n return;\n }\n if (o.selectDom == '1') {\n o.editRender = {\n name: '$input',\n props: {\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 文本域\n if (o.selectDom == '10') {\n o.editRender = {\n name: 'textarea',\n props: {\n type: 'textarea',\n // 指定为多行文本框\n placeholder: '请输入' + o.title,\n rows: 3,\n // 默认显示行数\n autosize: {\n minRows: 2,\n maxRows: 6\n },\n // 自动调整高度\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 数字\n if (o.selectDom == '7') {\n o.editRender = {\n name: '$input',\n props: {\n type: this.getType(o.selectDom),\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 时间\n if (o.selectDom == '3' || o.selectDom == '6') {\n o.editRender = {\n name: 'VxeInput',\n props: {\n type: this.getType(o.selectDom),\n valueFormat: 'yyyy-MM-dd HH:mm:ss'\n }\n };\n }\n // 下拉框\n if (o.selectDom == '2' || o.selectDom == '8') {\n o.editRender = {\n name: 'VxeSelect',\n options: this.dictVal(o.dictCode),\n props: {\n placeholder: '请选择' + o.title\n }\n };\n }\n if (o.selectDom == '5') {\n console.log('复选框:', o);\n // o.slotsName = 'checkbox_default';\n // o.slots = {\n // default: 'checkbox_default'\n // }\n o.slots = {\n default: ({\n row,\n column\n }) => (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"vxe-checkbox\"), {\n \"modelValue\": row[column.field],\n \"onUpdate:modelValue\": $event => row[column.field] = $event,\n \"checkedValue\": 1,\n \"uncheckedValue\": 0\n }, null)\n };\n }\n },\n getType(selectDom) {\n if (selectDom == '3') {\n return 'datetime';\n }\n if (selectDom == '6') {\n return 'date';\n }\n if (selectDom == '7') {\n return 'number';\n }\n },\n /**\r\n * 初始化列左边\r\n * @param columns\r\n * @param type\r\n * @returns {*}\r\n */\n initBodyLeftColumn(columns, type) {\n const hasSeqColumn = columns.some(col => ['seq', 'sequence', '序号'].includes(col.field || col.prop || col.type));\n if (type == 1 && !hasSeqColumn) {\n columns.unshift({\n type: 'seq',\n width: 55,\n title: '序号',\n fixed: 'left'\n });\n }\n const hasCheckboxColumn = columns.some(col => ['checkbox'].includes(col.type));\n const hasRadioColumn = columns.some(col => ['radio'].includes(col.type));\n if (this.selectBox == 2 && !hasCheckboxColumn) {\n columns.unshift({\n type: 'checkbox',\n width: 45,\n showOverflow: false,\n fixed: 'left'\n });\n } else if (this.selectBox == 1 && !hasRadioColumn) {\n columns.unshift({\n type: 'radio',\n width: 45,\n showOverflow: false,\n fixed: 'left'\n });\n }\n return columns;\n },\n setTreeOpenColumn(o, tableConfig) {\n if (tableConfig.tree == 1 && o.field == tableConfig.openColumn) {\n o.treeNode = true;\n if (!o.align) {\n o.align = 'left';\n }\n }\n },\n setMergeField(column) {\n if (column.mergeFlag == '1') {\n this.table.mergeFields.push(column.field);\n }\n },\n setColumnHide(o) {\n //隐藏\n if (o.visible == \"0\") {\n o.visible = false;\n }\n },\n initFormatter(o) {\n try {\n if (o.formatter) {\n o.formatter = eval(\"({cellValue, row, column})=>{\" + o.formatter + \"}\");\n } else if (o.dictCode) {\n o.formatter = eval(\"\" + \"({cellValue, row, column})=>{if(column.params && column.params.dictValueLabel){ let dictValueLabelElement = column.params.dictValueLabel[cellValue];if(dictValueLabelElement){return dictValueLabelElement;} }return cellValue}\");\n }\n } catch (e) {\n console.log(o.title, \"formatter异常:\", o.formatter);\n this.$message.error(o.title + \"formatter异常!\");\n }\n },\n initSlots(o) {\n if (o.selectDom == 20) {\n o.slotsName = 'img_default';\n o.slots = {\n default: 'img_default'\n };\n } else if (o.selectDom == '21') {\n o.slotsName = 'icon_default';\n o.slots = {\n default: 'icon_default'\n };\n } else if (o.selectDom == '23') {\n o.slotsName = 'video_default';\n o.slots = {\n default: 'video_default'\n };\n } else if (o.params && o.params.tableSelect) {\n o.slotsName = 'selectTable_default';\n o.slots = {\n default: 'selectTable_default'\n };\n }\n if ('1' === o.customSlotsToOtherProp) {\n //启用自定义插槽\n o.slotsName = this.getSlotName(o.field);\n o.slots = {\n default: o.slotsName\n };\n if (!o.params) {\n o.params = {};\n }\n o.params.customSlots = true;\n }\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n /**\r\n * 播放器初始化\r\n * @param player\r\n */\n handleReady(player) {\n console.log(' 播放器已初始化', player);\n this.player = player;\n },\n /**\r\n * 视频播放\r\n */\n handlePlay() {\n console.log(' 视频开始播放');\n },\n changeToChinese() {\n console.log(\"this.playerOptions.value.player\", this.player);\n },\n handlePlay1() {\n console.log(' 视频开始播放');\n this.$refs.playerRef.player.play(); // 通过ref调用播放器方法\n this.showCustomModal.value = false;\n },\n setFixed(item) {\n //修改固定字段的值\n if (item.fixed === '1') {\n item.fixed = 'left';\n } else if (item.fixed === '2') {\n item.fixed = 'right';\n }\n if (item.align === '1') {\n item.align = 'left';\n } else if (item.align === '2') {\n item.align = 'right';\n } else if (item.align === '0') {\n item.align = 'center';\n }\n },\n setProp(item) {\n item.resizable = undefined;\n if (item.sortable != undefined && item.sortable != \"\") {\n let order = item.field + (item.sortable == 0 ? \" ASC \" : \" DESC \");\n this.orderByColumns.push(order);\n }\n ////时间类型\n if (!item.width && (item.selectDom == 3 || item.selectDom == 6)) {\n item.minWidth = 150;\n } else if (!item.width && item.title) {\n item.minWidth = item.title.length * 30;\n }\n },\n setShowFooter(item) {\n if (item['totalToOtherProp']) {\n this.table['show-footer'] = true;\n }\n },\n toParseOtherProp(item) {\n //其他属性赋值\n try {\n let otherProp = JSON.parse(item?.otherProp || {});\n item.otherProp = otherProp;\n for (let key of Object.keys(otherProp)) {\n item[key] = otherProp[key];\n }\n } catch (e) {\n if (item.otherProp) {\n console.error(item.field + \"其他属性无法解析:\" + item.otherProp);\n }\n item.otherProp = {};\n }\n if (item['totalToOtherProp'] === undefined) {\n item['totalToOtherProp'] = '';\n }\n },\n /**\r\n * 设置搜索\r\n * @param items\r\n */\n setSearchArea(items) {\n if (items.length != 0) {\n items.push({\n itemRender: {\n name: '$buttons',\n children: [{\n props: {\n type: 'submit',\n content: '查询',\n status: 'primary'\n },\n events: {\n click: this.query\n }\n }, {\n props: {\n type: 'button',\n content: '重置'\n },\n events: {\n click: this.resetQuery\n }\n }]\n }\n });\n this.table.formConfig.size = this.table.size;\n }\n this.table.formConfig.items = items;\n },\n setFilters(o) {\n if (o.dictCode) {\n o.filters = this.dictVal(o.dictCode);\n o.filterMultiple = true;\n o.filterMethod = ({\n option,\n row,\n column\n }) => {};\n } else {\n // o.slots={\n // header:'OlTableFilterRender'\n // }\n o.filters = [{\n data: ''\n }];\n o.filterMultiple = false;\n o.filterRender = {\n name: 'FilterExtend'\n };\n o.cellType = this.getType(o.selectDom);\n }\n o.filterMethod = this.filterMethod;\n },\n filterMethod({\n option,\n row,\n column\n }) {\n const {\n type,\n value,\n min,\n max\n } = option?.data || {};\n const cellValue = String(row[column.field]);\n switch (type) {\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().EQUAL):\n return this.isEqual(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().NOT_EQUAL):\n return this.isNotEqual(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().STARTS_WITH):\n return this.startsWith(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().ENDS_WITH):\n return this.endsWith(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().CONTAINS):\n return this.contains(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().BETWEEN):\n if (column.cellType === 'date' || column.cellType === 'datetime') {\n return this.dateTimeFilterMethod({\n cellValue,\n min,\n max\n });\n }\n return this.isInRange(cellValue, min, max);\n default:\n if (option.value) {\n return cellValue === option.value;\n }\n return true;\n }\n },\n /**\r\n * 数值范围筛选方法\r\n * @param cellValue\r\n * @param min\r\n * @param max\r\n * @returns {boolean}\r\n */\n isInRange(cellValue, min, max) {\n const numValue = Number(cellValue) || 0;\n const numMin = Number(min) || -Infinity;\n const numMax = Number(max) || Infinity;\n return numValue >= numMin && numValue <= numMax;\n },\n /**\r\n * 判断是否包含开头\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n endsWith(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.endsWith(item));\n }\n return cellValue.endsWith(value);\n },\n /**\r\n * 判断是否包含开头\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n startsWith(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.startsWith(item));\n }\n return cellValue.startsWith(value);\n },\n /**\r\n * 判断是否包含\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n contains(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.includes(item));\n }\n return cellValue.includes(value);\n },\n /**\r\n * 判断字符串与值是否不相等(支持值可能是数组的情况)\r\n * @param {string} cellValue - 要比较的字符串\r\n * @param {string|Array} value - 要比较的值(可以是字符串或数组)\r\n * @returns {boolean} 是否不相等\r\n */\n isNotEqual(cellValue, value) {\n // 如果value是数组,循环判断是否包含cellValue\n if (Array.isArray(value)) {\n return !value.some(item => item === cellValue);\n }\n\n // 如果value不是数组,直接比较字符串\n return cellValue !== value;\n },\n /**\r\n * 比较字符串与值是否相等(支持值可能是数组的情况)\r\n * @param {string} cellValue - 要比较的字符串\r\n * @param {string|Array} value - 要比较的值(可以是字符串或数组)\r\n * @returns {boolean} 是否相等\r\n */\n isEqual(cellValue, value) {\n // 如果value是数组,循环判断是否包含cellValue\n if (Array.isArray(value)) {\n return value.some(item => item === cellValue);\n }\n\n // 如果value不是数组,直接比较字符串\n return cellValue === value;\n },\n /**\r\n * 日期时间范围筛选方法\r\n * @param cellValue 表格数据值\r\n * @param min 最小值\r\n * @param max 最大值\r\n * @returns {boolean}\r\n */\n dateTimeFilterMethod({\n cellValue,\n min,\n max\n }) {\n if (!min && !max) {\n return true;\n }\n const rowValue = cellValue ? new Date(cellValue) : null;\n const startDate = min ? new Date(min) : null;\n const endDate = max ? new Date(max) : null;\n if (startDate && endDate) {\n return rowValue >= startDate && rowValue <= endDate;\n } else if (startDate) {\n return rowValue >= startDate;\n } else if (endDate) {\n return rowValue <= endDate;\n }\n return true;\n },\n getVNode(o, items) {\n if (o.selectType == undefined) {\n return;\n }\n //99是范围查询\n if (o.selectType == 99) {\n let itemStart = this.initFormConfig(o, 5);\n let itemEnd = this.initFormConfig(o, 6);\n //时间范围查询\n if (o.selectDom == 3 || o.selectDom == 6) {\n let placeholder = o.selectDom == 3 ? '时间' : '';\n itemStart.placeholder = '请选择开始日期' + placeholder;\n delete itemStart.itemRender;\n itemEnd.placeholder = '请选择结束日期' + placeholder;\n }\n items.push(itemStart);\n items.push(itemEnd);\n } else {\n items.push(this.initFormConfig(o));\n }\n },\n initFormConfig(o, type) {\n let key = o.fieldNameSEARCHToOtherProp != undefined && o.fieldNameSEARCHToOtherProp != '' ? o.fieldNameSEARCHToOtherProp : o.tableField;\n if (o.tableNameSEARCHToOtherProp != undefined && o.tableNameSEARCHToOtherProp != '') {\n key = o.tableNameSEARCHToOtherProp + '.' + key;\n }\n let item = {\n align: 'left',\n field: key,\n span: 6,\n searchSort: o.searchSort,\n title: o.titleSEARCHToOtherProp != undefined ? o.titleSEARCHToOtherProp : o.title,\n key: key,\n type: o.selectType,\n selectDom: o.selectDom,\n tableName: o.tableNameSEARCHToOtherProp,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true,\n toDate: o.toDateSEARCHToOtherProp,\n itemRender: {\n name: '$input',\n props: {\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n }\n };\n try {\n this.table.formConfig.data[item.key] = eval(o.valueSEARCHToOtherProp);\n } catch (e) {}\n if (type == 5) {\n item.title = o.title + \"开始\";\n item.type = 5;\n item.field = \"$\" + o.tableField;\n item.key = \"$\" + o.tableField;\n } else if (type == 6) {\n item.field = o.tableField + \"$\";\n item.type = 6;\n item.key = o.tableField + \"$\";\n item.title = o.title + \"结束\";\n }\n if ((item.type == 6 || item.type == 5) && o.selectDom == undefined) {\n o.selectDom = 7;\n }\n this.getItemRender(o, item, type);\n if (item.title && item.title.length > 6) {\n item.titleWidth = 20 * (item.title.length - 2);\n } else if (item.title.toString().trim().length == 0) {\n item.titleWidth = 0;\n }\n if (o.spanSEARCHToOtherProp != undefined) {\n item.span = 6;\n }\n return item;\n },\n getItemRender(o, item, type) {\n if (o.dictCode) {\n delete item.itemRender;\n item.slots = {\n default: o.selectDom + item.field\n };\n item.slotsName = o.selectDom + item.field;\n item.options = this.dictVal(o.dictCode);\n item.placeholder = '请选择' + o.title;\n item.clearable = o.clearableSEARCHToOtherProp != '1';\n item.multiple = o.selectDom == '8';\n item.filterable = true;\n } else if (o.selectDom == 7) {\n item.itemRender.props.type = 'number';\n } else if (o.selectDom == 10) {\n item.itemRender.name = 'textarea';\n } else if (o.selectDom == 3 || o.selectDom == 6) {\n delete item.itemRender;\n item.domDate = true;\n item.selectType = o.selectType;\n //这里跟element plus不一样\n item.domFormat = vue__WEBPACK_IMPORTED_MODULE_0__.version.split('.')[0] == 2 ? 'yyyy-MM-dd' : 'YYYY-MM-DD';\n if (item.selectDom == 3) {\n item.domFormat = item.domFormat + ' HH:mm:ss';\n item.domType = o.selectType == 98 ? \"datetimerange\" : 'datetime';\n } else {\n item.domType = o.selectType == 98 ? \"daterange\" : 'date';\n }\n item.slots = {\n default: o.selectDom + item.field + \"_time\"\n };\n item.slotsName = o.selectDom + item.field + \"_time\";\n item.placeholder = '请选择';\n if (type == 5) {\n item.placeholder += \"开始\";\n } else if (type == 6) {\n item.placeholder += \"结束\";\n }\n if (o.selectDom == 3) {\n item.placeholder += \"时间\";\n }\n }\n },\n setColumnShowOverFlow(column, optionObj) {\n if (optionObj) {\n if (optionObj.table && optionObj.table.columnConfig && optionObj.table.columnConfig.showOverflow) {\n if (column.type != 'seq' || column.type != 'checkbox') {\n column.showOverflow = optionObj.table.columnConfig.showOverflow;\n }\n }\n }\n },\n initMergeCells() {\n if (this.table.mergeCells) {\n this.table.mergeCells = JSON.parse(this.table.mergeCells);\n return;\n }\n if (this.table.mergeFields && this.table.mergeFields.length != 0) {\n this.table.spanMethod = this.mergeRowMethod;\n }\n },\n // 通用行合并函数(将相同多列数据合并为一行)\n mergeRowMethod({\n row,\n _rowIndex,\n column,\n visibleData\n }) {\n const cellValue = row[column.field];\n if (cellValue && this.table.mergeFields.includes(column.field)) {\n const prevRow = visibleData[_rowIndex - 1];\n let nextRow = visibleData[_rowIndex + 1];\n if (prevRow && prevRow[column.field] === cellValue) {\n return {\n rowspan: 0,\n colspan: 0\n };\n } else {\n let countRowspan = 1;\n while (nextRow && nextRow[column.field] === cellValue) {\n nextRow = visibleData[++countRowspan + _rowIndex];\n }\n if (countRowspan > 1) {\n return {\n rowspan: countRowspan,\n colspan: 1\n };\n }\n }\n }\n },\n setDictCellStyle({\n row,\n rowIndex,\n $rowIndex,\n column,\n columnIndex,\n $columnIndex\n }) {\n if (column.params && column.params.cssClass) {\n return column.params.cssClass[row[column[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(column)]]];\n }\n },\n setTableStyle(option) {\n if (option['cell-style'] === undefined) {\n option['cell-style'] = {\n flag: \"flag##function#\",\n isFunction: true\n };\n }\n option['cell-style']['code'] = \"let OTMixinColumnMethod_setDictCellStyle = this.setDictCellStyle(params); if(OTMixinColumnMethod_setDictCellStyle){ return OTMixinColumnMethod_setDictCellStyle;}\\n\" + option['cell-style']['code'];\n }\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OTMixinColumnMethod.js?");
|
|
12822
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OTMixinColumnMethod: function() { return /* binding */ OTMixinColumnMethod; }\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 core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__ = __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_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __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_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_5__ = __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_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_6__ = __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_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_7__ = __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_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/FilterType.js */ \"./src/utils/FilterType.js\");\n/* harmony import */ var _utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9__);\n\n\n\n\n\n\n\n\n\n\n\nfunction setColumnParams(column, key, value) {\n if (value === undefined) {\n return;\n }\n if (!column['params']) {\n column['params'] = {};\n }\n column['params'][key] = value;\n}\nconst OTMixinColumnMethod = {\n methods: {\n setColumnCssClass(o) {\n if (o.dictCode) {\n let vals = this.dictVal(o.dictCode);\n let cssClass = {};\n if (vals) {\n let dictValueLabel = {};\n for (let obj of vals) {\n dictValueLabel[obj.dictValue] = obj.dictLabel;\n if (obj.cssClass) {\n let css = obj.cssClass.trim();\n try {\n css = css.replace(/([a-zA-Z_]\\w*):/g, '\"$1\":').replace(/'/g, '\"');\n css = JSON.parse(css);\n if (Array.isArray(css)) {\n let data = {};\n if (css[0]) {\n data['backgroundColor'] = css[0];\n }\n if (css[1]) {\n data['color'] = css[1];\n } else {\n data['color'] = '#fff';\n }\n cssClass[obj.dictValue] = data;\n } else {\n if (!css.color) {\n css['color'] = '#fff';\n }\n cssClass[obj.dictValue] = css;\n }\n } catch (e) {\n console.error(\"列名:\", o.title, \"数据字典:\", obj.dictLabel, \"样式异常:\", css);\n }\n }\n }\n setColumnParams(o, 'dictValueLabel', dictValueLabel);\n }\n if (Object.keys(cssClass).length != 0) {\n setColumnParams(o, 'cssClass', cssClass);\n }\n }\n },\n initColumn(columns, tableConfig) {\n this.table.mergeFields = [];\n let items = [];\n columns = columns.sort(({\n sort: a\n }, {\n sort: b\n }) => a - b);\n for (let column of columns) {\n this.toParseOtherProp(column);\n }\n this.table.columnSource = JSON.parse(JSON.stringify(columns));\n let {\n optionJson,\n seq\n } = tableConfig;\n if (optionJson) {\n optionJson = JSON.parse(optionJson);\n }\n let enableFilter = optionJson?.table?.enableFilter;\n let hasEditConfig = this.hasEditConfig();\n if (hasEditConfig) {\n // 设置列表必填\n this.setEditRules(columns);\n }\n let uuidTableSelectConf = {\n '24': '2011044563705458688',\n //部门\n '25': '1904380469886234624',\n //角色\n '26': '2009164807696859136',\n //岗位\n '27': '2011373314888716288' //人员\n };\n for (let o of columns) {\n //部门选择器的Formatter\n if (uuidTableSelectConf[o.selectDom]) {\n o.params = {\n uuid: uuidTableSelectConf[o.selectDom],\n key: 'id',\n label: 'name',\n uniqueId: o.id,\n tableSelect: true\n };\n } else if (o.tableSelectConfToOtherProp) {\n try {\n o.params = JSON.parse(o.tableSelectConfToOtherProp).olTableSelect;\n o.params.uniqueId = o.id;\n o.params.tableSelect = true;\n } catch (e) {}\n }\n this.setColumnCssClass(o);\n this.initFormatter(o);\n this.initSlots(o);\n this.setTreeOpenColumn(o, tableConfig);\n this.setMergeField(o);\n this.setColumnShowOverFlow(o, optionJson);\n this.setProp(o);\n this.setColumnHide(o);\n this.setFixed(o);\n this.setShowFooter(o);\n this.getVNode(o, items);\n if (enableFilter) {\n this.setFilters(o);\n }\n // 可编辑配置\n if (hasEditConfig) {\n this.setEditConfig(o);\n }\n if (o.tableSelectConfToOtherProp) {\n //表格选取的配置\n o.params.tableSelectConfToOtherProp = o.tableSelectConfToOtherProp;\n }\n }\n items.sort(({\n searchSort: a\n }, {\n searchSort: b\n }) => a - b);\n this.setSearchArea(items);\n columns = this.initBodyLeftColumn(columns, seq);\n if (this.table['show-footer']) {\n if (!columns[0].width || columns[0].width < 55) {\n columns[0].width = 55;\n }\n }\n this.table.columns = columns;\n //暂时不合并,启用虚拟滚动\n this.initMergeCells();\n },\n /**\r\n * 动态设置列的 formatter(将值映射为字典标签)\r\n * @param {Object} context - Vue 组件实例(this)\r\n * @param {String} selectDomValue - 匹配的 selectDom 值(如 '24')\r\n * @param {String} typeField - 动态列配置属性名(如 'department')\r\n */\n setColumnFormatter(context, selectDomValue, typeField) {\n const configListProp = typeField + 'ColumnsConfig';\n const dictPropName = typeField + 'Dict';\n\n // 1. 过滤出目标列配置\n const configList = context.table.columnSource.filter(item => item.selectDom === selectDomValue);\n context.table.other[configListProp] = configList;\n\n // console.info(`动态列配置(${configListProp}):`, configList);\n\n // 2. 如果存在目标列,设置 formatter\n if (configList.length > 0) {\n configList.forEach(columnConfig => {\n const targetColumn = context.table.columns.find(col => col.field === columnConfig.field);\n if (targetColumn) {\n targetColumn.formatter = ({\n cellValue\n }) => {\n // 检查是否是类似'[1,2]'的数组字符串\n // if (typeof cellValue === 'string' && cellValue.startsWith('[') && cellValue.endsWith(']')) {\n if (typeof cellValue === 'string') {\n try {\n // 尝试解析为数组\n let values = [];\n if (cellValue.startsWith('[') && cellValue.endsWith(']')) {\n values = JSON.parse(cellValue);\n } else {\n values = cellValue.split(\",\");\n }\n if (Array.isArray(values)) {\n // 查找所有匹配的字典项并拼接标签\n const labels = values.map(value => {\n const dictItem = context.table.other[dictPropName]?.find(item => item.value == value // 使用宽松相等比较\n );\n return dictItem ? dictItem.label : value;\n });\n return labels.join(','); // 用逗号连接标签\n }\n } catch (e) {\n // 解析失败,按原样处理\n }\n }\n const dictItem = context.table.other[dictPropName]?.find(item => item.value == cellValue);\n return dictItem ? dictItem.label : cellValue; // 显示标签或原值\n };\n }\n });\n }\n },\n setEditRules(columns) {\n for (const column of columns) {\n if (column.required === '1') {\n this.table.editRules ||= {};\n this.table.editRules[column.field] = [{\n required: true,\n message: '必须填写'\n }];\n }\n }\n },\n hasEditConfig() {\n return this.table.editConfig && (this.table.editConfig.enabled === true || typeof this.table.editConfig.enabled === 'string' && this.table.editConfig.enabled.toLowerCase() === 'true');\n },\n setEditConfig(o) {\n if (o.tableSaveToOtherProp && o.tableSaveToOtherProp == '1') {\n return;\n }\n if (o.selectDom == '1') {\n o.editRender = {\n name: '$input',\n props: {\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 文本域\n if (o.selectDom == '10') {\n o.editRender = {\n name: 'textarea',\n props: {\n type: 'textarea',\n // 指定为多行文本框\n placeholder: '请输入' + o.title,\n rows: 3,\n // 默认显示行数\n autosize: {\n minRows: 2,\n maxRows: 6\n },\n // 自动调整高度\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 数字\n if (o.selectDom == '7') {\n o.editRender = {\n name: '$input',\n props: {\n type: this.getType(o.selectDom),\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n };\n }\n // 时间\n if (o.selectDom == '3' || o.selectDom == '6') {\n o.editRender = {\n name: 'VxeInput',\n props: {\n type: this.getType(o.selectDom),\n valueFormat: 'yyyy-MM-dd HH:mm:ss'\n }\n };\n }\n // 下拉框\n if (o.selectDom == '2' || o.selectDom == '8') {\n o.editRender = {\n name: 'VxeSelect',\n options: this.dictVal(o.dictCode),\n props: {\n placeholder: '请选择' + o.title\n }\n };\n }\n if (o.selectDom == '5') {\n console.log('复选框:', o);\n // o.slotsName = 'checkbox_default';\n // o.slots = {\n // default: 'checkbox_default'\n // }\n o.slots = {\n default: ({\n row,\n column\n }) => (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"vxe-checkbox\"), {\n \"modelValue\": row[column.field],\n \"onUpdate:modelValue\": $event => row[column.field] = $event,\n \"checkedValue\": 1,\n \"uncheckedValue\": 0\n }, null)\n };\n }\n },\n getType(selectDom) {\n if (selectDom == '3') {\n return 'datetime';\n }\n if (selectDom == '6') {\n return 'date';\n }\n if (selectDom == '7') {\n return 'number';\n }\n },\n /**\r\n * 初始化列左边\r\n * @param columns\r\n * @param type\r\n * @returns {*}\r\n */\n initBodyLeftColumn(columns, type) {\n const hasSeqColumn = columns.some(col => ['seq', 'sequence', '序号'].includes(col.field || col.prop || col.type));\n if (type == 1 && !hasSeqColumn) {\n columns.unshift({\n type: 'seq',\n width: 55,\n title: '序号',\n fixed: 'left'\n });\n }\n const hasCheckboxColumn = columns.some(col => ['checkbox'].includes(col.type));\n const hasRadioColumn = columns.some(col => ['radio'].includes(col.type));\n if (this.selectBox == 2 && !hasCheckboxColumn) {\n columns.unshift({\n type: 'checkbox',\n width: 45,\n showOverflow: false,\n fixed: 'left'\n });\n } else if (this.selectBox == 1 && !hasRadioColumn) {\n columns.unshift({\n type: 'radio',\n width: 45,\n showOverflow: false,\n fixed: 'left'\n });\n }\n return columns;\n },\n setTreeOpenColumn(o, tableConfig) {\n if (tableConfig.tree == 1 && o.field == tableConfig.openColumn) {\n o.treeNode = true;\n if (!o.align) {\n o.align = 'left';\n }\n }\n },\n setMergeField(column) {\n if (column.mergeFlag == '1') {\n this.table.mergeFields.push(column.field);\n }\n },\n setColumnHide(o) {\n //隐藏\n if (o.visible == \"0\") {\n o.visible = false;\n }\n },\n initFormatter(o) {\n try {\n if (o.formatter) {\n o.formatter = eval(\"({cellValue, row, column})=>{\" + o.formatter + \"}\");\n } else if (o.dictCode && (!o.params || !o.params.cssClass)) {\n o.formatter = eval(\"\" + \"({cellValue, row, column})=>{if(column.params && column.params.dictValueLabel){ let dictValueLabelElement = column.params.dictValueLabel[cellValue];if(dictValueLabelElement){return dictValueLabelElement;} }return cellValue}\");\n }\n } catch (e) {\n console.log(o.title, \"formatter异常:\", o.formatter);\n this.$message.error(o.title + \"formatter异常!\");\n }\n },\n initSlots(o) {\n if ('1' === o.customSlotsToOtherProp) {\n //启用自定义插槽\n o.slotsName = this.getSlotName(o.field);\n o.slots = {\n default: o.slotsName\n };\n if (!o.params) {\n o.params = {};\n }\n o.params.customSlots = true;\n } else if (o.selectDom == 20) {\n o.slotsName = 'img_default';\n o.slots = {\n default: 'img_default'\n };\n } else if (o.selectDom == '21') {\n o.slotsName = 'icon_default';\n o.slots = {\n default: 'icon_default'\n };\n } else if (o.selectDom == '23') {\n o.slotsName = 'video_default';\n o.slots = {\n default: 'video_default'\n };\n } else if (o.params && o.params.tableSelect) {\n o.slotsName = 'selectTable_default';\n o.slots = {\n default: 'selectTable_default'\n };\n } else if (!o.formatter && o.dictCode) {\n o.slots = {\n default: 'dict_css_default'\n };\n }\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n /**\r\n * 播放器初始化\r\n * @param player\r\n */\n handleReady(player) {\n console.log(' 播放器已初始化', player);\n this.player = player;\n },\n /**\r\n * 视频播放\r\n */\n handlePlay() {\n console.log(' 视频开始播放');\n },\n changeToChinese() {\n console.log(\"this.playerOptions.value.player\", this.player);\n },\n handlePlay1() {\n console.log(' 视频开始播放');\n this.$refs.playerRef.player.play(); // 通过ref调用播放器方法\n this.showCustomModal.value = false;\n },\n setFixed(item) {\n //修改固定字段的值\n if (item.fixed === '1') {\n item.fixed = 'left';\n } else if (item.fixed === '2') {\n item.fixed = 'right';\n }\n if (item.align === '1') {\n item.align = 'left';\n } else if (item.align === '2') {\n item.align = 'right';\n } else if (item.align === '0') {\n item.align = 'center';\n }\n },\n setProp(item) {\n item.resizable = undefined;\n if (item.sortable != undefined && item.sortable != \"\") {\n let order = item.field + (item.sortable == 0 ? \" ASC \" : \" DESC \");\n this.orderByColumns.push(order);\n }\n ////时间类型\n if (!item.width && (item.selectDom == 3 || item.selectDom == 6)) {\n item.minWidth = 150;\n } else if (!item.width && item.title) {\n item.minWidth = item.title.length * 30;\n }\n },\n setShowFooter(item) {\n if (item['totalToOtherProp']) {\n this.table['show-footer'] = true;\n }\n },\n toParseOtherProp(item) {\n //其他属性赋值\n try {\n let otherProp = JSON.parse(item?.otherProp || {});\n item.otherProp = otherProp;\n for (let key of Object.keys(otherProp)) {\n item[key] = otherProp[key];\n }\n } catch (e) {\n if (item.otherProp) {\n console.error(item.field + \"其他属性无法解析:\" + item.otherProp);\n }\n item.otherProp = {};\n }\n if (item['totalToOtherProp'] === undefined) {\n item['totalToOtherProp'] = '';\n }\n },\n /**\r\n * 设置搜索\r\n * @param items\r\n */\n setSearchArea(items) {\n if (items.length != 0) {\n items.push({\n itemRender: {\n name: '$buttons',\n children: [{\n props: {\n type: 'submit',\n content: '查询',\n status: 'primary'\n },\n events: {\n click: this.query\n }\n }, {\n props: {\n type: 'button',\n content: '重置'\n },\n events: {\n click: this.resetQuery\n }\n }]\n }\n });\n this.table.formConfig.size = this.table.size;\n }\n this.table.formConfig.items = items;\n },\n setFilters(o) {\n if (o.dictCode) {\n o.filters = this.dictVal(o.dictCode);\n o.filterMultiple = true;\n o.filterMethod = ({\n option,\n row,\n column\n }) => {};\n } else {\n // o.slots={\n // header:'OlTableFilterRender'\n // }\n o.filters = [{\n data: ''\n }];\n o.filterMultiple = false;\n o.filterRender = {\n name: 'FilterExtend'\n };\n o.cellType = this.getType(o.selectDom);\n }\n o.filterMethod = this.filterMethod;\n },\n filterMethod({\n option,\n row,\n column\n }) {\n const {\n type,\n value,\n min,\n max\n } = option?.data || {};\n const cellValue = String(row[column.field]);\n switch (type) {\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().EQUAL):\n return this.isEqual(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().NOT_EQUAL):\n return this.isNotEqual(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().STARTS_WITH):\n return this.startsWith(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().ENDS_WITH):\n return this.endsWith(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().CONTAINS):\n return this.contains(cellValue, value);\n case (_utils_FilterType_js__WEBPACK_IMPORTED_MODULE_9___default().BETWEEN):\n if (column.cellType === 'date' || column.cellType === 'datetime') {\n return this.dateTimeFilterMethod({\n cellValue,\n min,\n max\n });\n }\n return this.isInRange(cellValue, min, max);\n default:\n if (option.value) {\n return cellValue === option.value;\n }\n return true;\n }\n },\n /**\r\n * 数值范围筛选方法\r\n * @param cellValue\r\n * @param min\r\n * @param max\r\n * @returns {boolean}\r\n */\n isInRange(cellValue, min, max) {\n const numValue = Number(cellValue) || 0;\n const numMin = Number(min) || -Infinity;\n const numMax = Number(max) || Infinity;\n return numValue >= numMin && numValue <= numMax;\n },\n /**\r\n * 判断是否包含开头\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n endsWith(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.endsWith(item));\n }\n return cellValue.endsWith(value);\n },\n /**\r\n * 判断是否包含开头\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n startsWith(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.startsWith(item));\n }\n return cellValue.startsWith(value);\n },\n /**\r\n * 判断是否包含\r\n * @param cellValue\r\n * @param value\r\n * @returns {*}\r\n */\n contains(cellValue, value) {\n if (Array.isArray(value)) {\n return value.some(item => cellValue.includes(item));\n }\n return cellValue.includes(value);\n },\n /**\r\n * 判断字符串与值是否不相等(支持值可能是数组的情况)\r\n * @param {string} cellValue - 要比较的字符串\r\n * @param {string|Array} value - 要比较的值(可以是字符串或数组)\r\n * @returns {boolean} 是否不相等\r\n */\n isNotEqual(cellValue, value) {\n // 如果value是数组,循环判断是否包含cellValue\n if (Array.isArray(value)) {\n return !value.some(item => item === cellValue);\n }\n\n // 如果value不是数组,直接比较字符串\n return cellValue !== value;\n },\n /**\r\n * 比较字符串与值是否相等(支持值可能是数组的情况)\r\n * @param {string} cellValue - 要比较的字符串\r\n * @param {string|Array} value - 要比较的值(可以是字符串或数组)\r\n * @returns {boolean} 是否相等\r\n */\n isEqual(cellValue, value) {\n // 如果value是数组,循环判断是否包含cellValue\n if (Array.isArray(value)) {\n return value.some(item => item === cellValue);\n }\n\n // 如果value不是数组,直接比较字符串\n return cellValue === value;\n },\n /**\r\n * 日期时间范围筛选方法\r\n * @param cellValue 表格数据值\r\n * @param min 最小值\r\n * @param max 最大值\r\n * @returns {boolean}\r\n */\n dateTimeFilterMethod({\n cellValue,\n min,\n max\n }) {\n if (!min && !max) {\n return true;\n }\n const rowValue = cellValue ? new Date(cellValue) : null;\n const startDate = min ? new Date(min) : null;\n const endDate = max ? new Date(max) : null;\n if (startDate && endDate) {\n return rowValue >= startDate && rowValue <= endDate;\n } else if (startDate) {\n return rowValue >= startDate;\n } else if (endDate) {\n return rowValue <= endDate;\n }\n return true;\n },\n getVNode(o, items) {\n if (o.selectType == undefined) {\n return;\n }\n //99是范围查询\n if (o.selectType == 99) {\n let itemStart = this.initFormConfig(o, 5);\n let itemEnd = this.initFormConfig(o, 6);\n //时间范围查询\n if (o.selectDom == 3 || o.selectDom == 6) {\n let placeholder = o.selectDom == 3 ? '时间' : '';\n itemStart.placeholder = '请选择开始日期' + placeholder;\n delete itemStart.itemRender;\n itemEnd.placeholder = '请选择结束日期' + placeholder;\n }\n items.push(itemStart);\n items.push(itemEnd);\n } else {\n items.push(this.initFormConfig(o));\n }\n },\n initFormConfig(o, type) {\n let key = o.fieldNameSEARCHToOtherProp != undefined && o.fieldNameSEARCHToOtherProp != '' ? o.fieldNameSEARCHToOtherProp : o.tableField;\n if (o.tableNameSEARCHToOtherProp != undefined && o.tableNameSEARCHToOtherProp != '') {\n key = o.tableNameSEARCHToOtherProp + '.' + key;\n }\n let item = {\n align: 'left',\n field: key,\n span: 6,\n searchSort: o.searchSort,\n title: o.titleSEARCHToOtherProp != undefined ? o.titleSEARCHToOtherProp : o.title,\n key: key,\n type: o.selectType,\n selectDom: o.selectDom,\n tableName: o.tableNameSEARCHToOtherProp,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true,\n toDate: o.toDateSEARCHToOtherProp,\n itemRender: {\n name: '$input',\n props: {\n placeholder: '请输入' + o.title,\n clearable: o.clearableSEARCHToOtherProp == '1' ? false : true\n }\n }\n };\n try {\n this.table.formConfig.data[item.key] = eval(o.valueSEARCHToOtherProp);\n } catch (e) {}\n if (type == 5) {\n item.title = o.title + \"开始\";\n item.type = 5;\n item.field = \"$\" + o.tableField;\n item.key = \"$\" + o.tableField;\n } else if (type == 6) {\n item.field = o.tableField + \"$\";\n item.type = 6;\n item.key = o.tableField + \"$\";\n item.title = o.title + \"结束\";\n }\n if ((item.type == 6 || item.type == 5) && o.selectDom == undefined) {\n o.selectDom = 7;\n }\n this.getItemRender(o, item, type);\n if (item.title && item.title.length > 6) {\n item.titleWidth = 20 * (item.title.length - 2);\n } else if (item.title.toString().trim().length == 0) {\n item.titleWidth = 0;\n }\n if (o.spanSEARCHToOtherProp != undefined) {\n item.span = 6;\n }\n return item;\n },\n getItemRender(o, item, type) {\n if (o.dictCode) {\n delete item.itemRender;\n item.slots = {\n default: o.selectDom + item.field\n };\n item.slotsName = o.selectDom + item.field;\n item.options = this.dictVal(o.dictCode);\n item.placeholder = '请选择' + o.title;\n item.clearable = o.clearableSEARCHToOtherProp != '1';\n item.multiple = o.selectDom == '8';\n item.filterable = true;\n } else if (o.selectDom == 7) {\n item.itemRender.props.type = 'number';\n } else if (o.selectDom == 10) {\n item.itemRender.name = 'textarea';\n } else if (o.selectDom == 3 || o.selectDom == 6) {\n delete item.itemRender;\n item.domDate = true;\n item.selectType = o.selectType;\n //这里跟element plus不一样\n item.domFormat = vue__WEBPACK_IMPORTED_MODULE_0__.version.split('.')[0] == 2 ? 'yyyy-MM-dd' : 'YYYY-MM-DD';\n if (item.selectDom == 3) {\n item.domFormat = item.domFormat + ' HH:mm:ss';\n item.domType = o.selectType == 98 ? \"datetimerange\" : 'datetime';\n } else {\n item.domType = o.selectType == 98 ? \"daterange\" : 'date';\n }\n item.slots = {\n default: o.selectDom + item.field + \"_time\"\n };\n item.slotsName = o.selectDom + item.field + \"_time\";\n item.placeholder = '请选择';\n if (type == 5) {\n item.placeholder += \"开始\";\n } else if (type == 6) {\n item.placeholder += \"结束\";\n }\n if (o.selectDom == 3) {\n item.placeholder += \"时间\";\n }\n }\n },\n setColumnShowOverFlow(column, optionObj) {\n if (optionObj) {\n if (optionObj.table && optionObj.table.columnConfig && optionObj.table.columnConfig.showOverflow) {\n if (column.type != 'seq' || column.type != 'checkbox') {\n column.showOverflow = optionObj.table.columnConfig.showOverflow;\n }\n }\n }\n },\n initMergeCells() {\n if (this.table.mergeCells) {\n this.table.mergeCells = JSON.parse(this.table.mergeCells);\n return;\n }\n if (this.table.mergeFields && this.table.mergeFields.length != 0) {\n this.table.spanMethod = this.mergeRowMethod;\n }\n },\n // 通用行合并函数(将相同多列数据合并为一行)\n mergeRowMethod({\n row,\n _rowIndex,\n column,\n visibleData\n }) {\n const cellValue = row[column.field];\n if (cellValue && this.table.mergeFields.includes(column.field)) {\n const prevRow = visibleData[_rowIndex - 1];\n let nextRow = visibleData[_rowIndex + 1];\n if (prevRow && prevRow[column.field] === cellValue) {\n return {\n rowspan: 0,\n colspan: 0\n };\n } else {\n let countRowspan = 1;\n while (nextRow && nextRow[column.field] === cellValue) {\n nextRow = visibleData[++countRowspan + _rowIndex];\n }\n if (countRowspan > 1) {\n return {\n rowspan: countRowspan,\n colspan: 1\n };\n }\n }\n }\n },\n setDictCellStyle({\n row,\n rowIndex,\n $rowIndex,\n column,\n columnIndex,\n $columnIndex\n }) {\n if (column.params && column.params.cssClass) {\n return column.params.cssClass[row[column[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(column)]]];\n }\n },\n setTableStyle(option) {\n if (option['cell-style'] === undefined) {\n option['cell-style'] = {\n flag: \"flag##function#\",\n isFunction: true\n };\n }\n option['cell-style']['code'] = \"let OTMixinColumnMethod_setDictCellStyle = this.setDictCellStyle(params); if(OTMixinColumnMethod_setDictCellStyle){ return OTMixinColumnMethod_setDictCellStyle;}\\n\" + option['cell-style']['code'];\n }\n }\n};\n\n//# sourceURL=webpack://olp-table/./src/mixins/VTMixin/OTMixinColumnMethod.js?");
|
|
12823
12823
|
|
|
12824
12824
|
/***/ }),
|
|
12825
12825
|
|