olp-table 7.2.64 → 7.2.66
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 +10 -10
- package/olp-table.umd.js +10 -10
- package/olp-table.umd.min.js +10 -10
- package/package.json +1 -1
package/olp-table.common.js
CHANGED
|
@@ -498,7 +498,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
498
498
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
499
499
|
|
|
500
500
|
"use strict";
|
|
501
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olUploadFile',\n inject: ['http'],\n props: {\n slotName: {\n required: false\n },\n column: {\n required: false\n },\n url: {\n type: String,\n required: true\n },\n multiple: {\n type: Boolean,\n default: true\n },\n testMode: {\n type: Boolean,\n default: false\n },\n fileListData: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n fileList: [],\n okIndex: 0,\n loading: false,\n okFileInfos: []\n };\n },\n mounted() {\n // 初始化文件列表回显\n this.initFileList();\n },\n watch: {\n // 监听 fileListData 变化,动态更新文件列表\n fileListData: {\n handler() {\n this.initFileList();\n },\n immediate: true\n }\n },\n methods: {\n beforeUpload(file) {\n let fileUploadConfig = null;\n // 解析column.attrs为JSON对象\n if (this.column && this.column.attrs) {\n try {\n const attrs = JSON.parse(this.column.attrs);\n fileUploadConfig = attrs.fileUploadConfig;\n } catch (error) {\n console.error('解析column.attrs失败:', error);\n }\n }\n\n // 如果没有配置fileUploadConfig,跳过所有校验\n if (!fileUploadConfig) {\n return true;\n }\n\n // 文件数量校验(只有配置了maxNumber才校验)\n if (fileUploadConfig.maxNumber) {\n const maxNumber = parseInt(fileUploadConfig.maxNumber);\n if (!isNaN(maxNumber)) {\n // 检查当前文件列表中的文件数量是否超过限制\n if (this.fileList.length > maxNumber) {\n this.$message.error(`最多只能上传 ${maxNumber} 个文件!`);\n return false;\n }\n }\n }\n\n // 文件类型校验(只有配置了uploadTypes才校验)\n if (fileUploadConfig.uploadTypes && fileUploadConfig.uploadTypes.length > 0) {\n const uploadTypes = fileUploadConfig.uploadTypes.split(',');\n const allowedExtensions = uploadTypes.map(ext => ext.trim().toLowerCase());\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n const isAllowedByExtension = allowedExtensions.includes(fileExtension);\n if (!isAllowedByExtension) {\n const allowedTypesStr = allowedExtensions.join('、');\n this.$message.error(`仅支持 ${allowedTypesStr} 格式!`);\n return false;\n }\n }\n\n // 文件大小校验(只有配置了maxSize才校验)\n if (fileUploadConfig.maxSize) {\n const maxSize = parseInt(fileUploadConfig.maxSize);\n if (!isNaN(maxSize)) {\n const fileSizeInKB = file.size / 1024;\n if (fileSizeInKB > maxSize) {\n this.$message.error(`文件大小不能超过 ${maxSize}KB!`);\n return false;\n }\n }\n }\n return true;\n },\n // 初始化文件列表\n initFileList() {\n if (this.fileListData) {\n try {\n const fileInfos = JSON.parse(this.fileListData);\n if (Array.isArray(fileInfos)) {\n this.okFileInfos = fileInfos;\n this.okIndex = fileInfos.length;\n // 为每个已上传的文件创建一个对应的 fileList 项\n this.fileList = fileInfos.map((fileInfo, index) => ({\n uid: Date.now() + index,\n name: fileInfo.name,\n status: 'success',\n percentCompleted: '100%',\n raw: {\n name: fileInfo.name\n } // 模拟 raw 文件对象,实际使用中可能不需要\n }));\n }\n } catch (e) {\n console.error('解析文件列表数据失败:', e);\n }\n } else {\n // 如果 fileListData 为空,清空文件列表\n this.okFileInfos = [];\n this.okIndex = 0;\n this.fileList = [];\n }\n },\n getFile(uid) {\n for (let i = 0; i < this.fileList.length; i++) {\n if (this.fileList[i].uid == uid) {\n return i;\n }\n }\n },\n deleteFile(uid) {\n const index = this.getFile(uid);\n if (index !== undefined) {\n const deletedFile = this.fileList[index];\n this.fileList.splice(index, 1);\n // 从 okFileInfos 中移除对应的文件信息\n if (deletedFile.name) {\n this.okFileInfos = this.okFileInfos.filter(item => item.name !== deletedFile.name);\n this.okIndex = this.okFileInfos.length;\n // 重新触发 uploadChange 事件\n this.$emit(\"uploadChange\", this.slotName, JSON.stringify(this.okFileInfos));\n }\n }\n },\n onchange(file, fileList) {\n this.fileList = fileList;\n if (this.multiple == false) {\n this.uploadFile();\n } else {\n this.loading = false;\n }\n },\n // 模拟上传方法\n async mockUpload(file) {\n return new Promise(resolve => {\n // 模拟上传进度\n let progress = 0;\n const interval = setInterval(() => {\n progress += Math.random() * 30;\n if (progress >= 100) {\n progress = 100;\n clearInterval(interval);\n\n // 模拟成功响应\n resolve({\n code: 200,\n msg: \"上传成功\",\n data: {\n path: `/mock/path/${file.name}`,\n configId: `mock_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n }\n });\n }\n file.percentCompleted = Math.round(progress) + \"%\";\n }, 200);\n });\n },\n async uploadFile(index) {\n if (this.fileList.length == 0) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().error(\"请选择文件!\");\n return;\n }\n this.loading = true;\n // 临时存储本次上传成功的文件信息\n const uploadedFiles = [];\n let successCount = 0;\n // 检查 index 是否为有效数字\n if (typeof index === 'number' && index >= 0 && index < this.fileList.length) {\n // 上传单个文件\n const file = this.fileList[index];\n // 手动调用 beforeUpload 方法进行校验\n if (!this.beforeUpload(file)) {\n this.loading = false;\n return;\n }\n await this.uploadSingleFile(file, uploadedFiles);\n successCount = uploadedFiles.length;\n } else {\n // 上传所有文件\n for (let file of this.fileList) {\n // 手动调用 beforeUpload 方法进行校验\n if (!this.beforeUpload(file)) {\n continue; // 跳过不符合要求的文件\n }\n await this.uploadSingleFile(file, uploadedFiles);\n }\n successCount = uploadedFiles.length;\n }\n // 将本次上传成功的文件信息添加到 okFileInfos 中\n this.okFileInfos = [...this.okFileInfos, ...uploadedFiles];\n this.okIndex += successCount;\n this.loading = false;\n if (successCount === 0) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().error(\"上传失败!\");\n } else {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().success(\"上传成功!\");\n // 触发上传成功事件\n this.$emit(\"uploadChange\", this.slotName, JSON.stringify(this.okFileInfos));\n }\n },\n // 上传单个文件\n async uploadSingleFile(file, uploadedFiles) {\n // 检查文件是否已经上传过\n const exists = this.okFileInfos.some(item => item.name === file.name);\n if (exists) {\n console.info(file.name + \"已经上传过,跳过上传\");\n file.percentCompleted = \"100%\";\n file.status = \"success\";\n return;\n }\n console.info(file.name + \"上传中...\", file);\n file.percentCompleted = 0;\n const formData = new FormData();\n formData.append('files', file.raw);\n //调用文件上传接口\n if (this.testMode) {\n // 测试模式:使用模拟上传\n await this.mockUpload(file).then(({\n code,\n msg,\n data\n }) => {\n if (code === 200 || code === 0) {\n const fileInfo = {\n name: file.name,\n path: data?.path,\n configId: data?.configId,\n suffix: this.getFileExtension(file.name)\n };\n // 检查文件是否已经存在于 okFileInfos 中\n const exists = this.okFileInfos.some(item => item.configId === fileInfo.configId);\n if (!exists) {\n uploadedFiles.push(fileInfo);\n }\n } else {\n file.percentCompleted = \"上传失败\";\n file.message = msg;\n }\n }).catch(error => {\n console.error('上传失败', error);\n });\n } else {\n // 正常模式:调用真实上传接口\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_5__.upload)(this.http, this.url, formData, progressEvent => {\n const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);\n file.percentCompleted = percentCompleted + \"%\";\n }).then(({\n code,\n msg,\n data\n }) => {\n if (code === 200 || code === 0) {\n const fileInfo = {\n name: file.name,\n path: data?.path,\n configId: data?.configId,\n suffix: this.getFileExtension(file.name)\n };\n // 检查文件是否已经存在于 okFileInfos 中\n const exists = this.okFileInfos.some(item => item.configId === fileInfo.configId);\n if (!exists) {\n uploadedFiles.push(fileInfo);\n }\n } else {\n file.percentCompleted = \"上传失败\";\n file.message = msg;\n }\n }).catch(error => {\n // 上传失败处理逻辑\n console.error('上传失败', error);\n });\n }\n },\n getFileExtension(filename) {\n // 检查字符串是否有效\n if (typeof filename !== 'string') {\n return '';\n }\n // 使用 lastIndexOf 和 substring 方法提取后缀\n const lastDotIndex = filename.lastIndexOf('.');\n // 如果找不到点,返回空字符串,表示没有后缀\n if (lastDotIndex === -1) {\n return '';\n }\n // 提取并返回后缀名(不包括点)\n return filename.substring(lastDotIndex + 1);\n },\n reset() {\n this.okFileInfos = [];\n this.fileList = [];\n this.okIndex = 0;\n },\n downloadFile(file) {\n // 根据文件名查找对应的文件信息\n // const fileInfo = this.okFileInfos.find(item => item.name === filename);\n // if (fileInfo) {\n // // 构造下载链接\n // const { configId, path } = fileInfo;\n // // 使用当前浏览器地址栏的域名和端口作为基础路径\n // const baseUrl = window.location.origin.endsWith('/') ? window.location.origin : window.location.origin + '/';\n // // 构造完整的下载链接\n // const downloadUrl = `${baseUrl}${configId}/${filename}/get/${path}`;\n // // 打印调试信息\n // console.log('下载链接:', downloadUrl);\n // console.log('基础路径:', baseUrl);\n // console.log('文件信息:', fileInfo);\n // // 打开新窗口进行下载\n // window.open(downloadUrl, '_blank');\n // } else {\n // useMessage().error(\"文件信息不存在,无法下载!\");\n // }\n\n const urlPattern = /^([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/[^/?#]*)/;\n let origin = window.location.origin;\n origin = this.http.getBaseURL();\n const match = origin.match(urlPattern);\n const baseUrl = match[1];\n const path = file.path.substring(file.path.lastIndexOf('/') + 1);\n const configId = file.configId;\n const filename = file.name;\n const url = baseUrl + '/admin-api/infra/file/' + configId + '/' + filename + '/get/' + path;\n const link = document.createElement('a');\n link.href = url;\n link.download = filename || url.split('/').pop();\n link.style.display = 'none';\n document.body.appendChild(link);\n link.click();\n URL.revokeObjectURL(link.href);\n link.remove();\n }\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/ol-upload-file.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");
|
|
501
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.filter.js */ \"./node_modules/core-js/modules/es.iterator.filter.js\");\n/* harmony import */ var core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_filter_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_4__ = __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_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_some_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_7__);\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olUploadFile',\n inject: ['http'],\n props: {\n slotName: {\n required: false\n },\n column: {\n required: false\n },\n url: {\n type: String,\n required: true\n },\n multiple: {\n type: Boolean,\n default: true\n },\n testMode: {\n type: Boolean,\n default: false\n },\n fileListData: {\n type: String,\n default: ''\n }\n },\n components: {\n View: _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_7__.View\n },\n data() {\n return {\n fileList: [],\n okIndex: 0,\n loading: false,\n okFileInfos: []\n };\n },\n mounted() {\n // 初始化文件列表回显\n this.initFileList();\n },\n watch: {\n // 监听 fileListData 变化,动态更新文件列表\n fileListData: {\n handler() {\n this.initFileList();\n },\n immediate: true\n }\n },\n methods: {\n beforeUpload(file) {\n let fileUploadConfig = null;\n // 解析column.attrs为JSON对象\n if (this.column && this.column.attrs) {\n try {\n const attrs = JSON.parse(this.column.attrs);\n fileUploadConfig = attrs.fileUploadConfig;\n } catch (error) {\n console.error('解析column.attrs失败:', error);\n }\n }\n\n // 如果没有配置fileUploadConfig,跳过所有校验\n if (!fileUploadConfig) {\n return true;\n }\n\n // 文件数量校验(只有配置了maxNumber才校验)\n if (fileUploadConfig.maxNumber) {\n const maxNumber = parseInt(fileUploadConfig.maxNumber);\n if (!isNaN(maxNumber)) {\n // 检查当前文件列表中的文件数量是否超过限制\n if (this.fileList.length > maxNumber) {\n this.$message.error(`最多只能上传 ${maxNumber} 个文件!`);\n return false;\n }\n }\n }\n\n // 文件类型校验(只有配置了uploadTypes才校验)\n if (fileUploadConfig.uploadTypes && fileUploadConfig.uploadTypes.length > 0) {\n const uploadTypes = fileUploadConfig.uploadTypes.split(',');\n const allowedExtensions = uploadTypes.map(ext => ext.trim().toLowerCase());\n const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n const isAllowedByExtension = allowedExtensions.includes(fileExtension);\n if (!isAllowedByExtension) {\n const allowedTypesStr = allowedExtensions.join('、');\n this.$message.error(`仅支持 ${allowedTypesStr} 格式!`);\n return false;\n }\n }\n\n // 文件大小校验(只有配置了maxSize才校验)\n if (fileUploadConfig.maxSize) {\n const maxSize = parseInt(fileUploadConfig.maxSize);\n if (!isNaN(maxSize)) {\n const fileSizeInKB = file.size / 1024;\n if (fileSizeInKB > maxSize) {\n this.$message.error(`文件大小不能超过 ${maxSize}KB!`);\n return false;\n }\n }\n }\n return true;\n },\n // 初始化文件列表\n initFileList() {\n if (this.fileListData) {\n try {\n const fileInfos = JSON.parse(this.fileListData);\n if (Array.isArray(fileInfos)) {\n this.okFileInfos = fileInfos;\n this.okIndex = fileInfos.length;\n // 为每个已上传的文件创建一个对应的 fileList 项\n this.fileList = fileInfos.map((fileInfo, index) => ({\n uid: Date.now() + index,\n name: fileInfo.name,\n status: 'success',\n percentCompleted: '100%',\n raw: {\n name: fileInfo.name\n } // 模拟 raw 文件对象,实际使用中可能不需要\n }));\n }\n } catch (e) {\n console.error('解析文件列表数据失败:', e);\n }\n } else {\n // 如果 fileListData 为空,清空文件列表\n this.okFileInfos = [];\n this.okIndex = 0;\n this.fileList = [];\n }\n },\n getFile(uid) {\n for (let i = 0; i < this.fileList.length; i++) {\n if (this.fileList[i].uid == uid) {\n return i;\n }\n }\n },\n deleteFile(uid) {\n const index = this.getFile(uid);\n if (index !== undefined) {\n const deletedFile = this.fileList[index];\n this.fileList.splice(index, 1);\n // 从 okFileInfos 中移除对应的文件信息\n if (deletedFile.name) {\n this.okFileInfos = this.okFileInfos.filter(item => item.name !== deletedFile.name);\n this.okIndex = this.okFileInfos.length;\n // 重新触发 uploadChange 事件\n this.$emit(\"uploadChange\", this.slotName, JSON.stringify(this.okFileInfos));\n }\n }\n },\n onchange(file, fileList) {\n this.fileList = fileList;\n this.uploadFile();\n },\n // 模拟上传方法\n async mockUpload(file) {\n return new Promise(resolve => {\n // 模拟上传进度\n let progress = 0;\n const interval = setInterval(() => {\n progress += Math.random() * 30;\n if (progress >= 100) {\n progress = 100;\n clearInterval(interval);\n\n // 模拟成功响应\n resolve({\n code: 200,\n msg: \"上传成功\",\n data: {\n path: `/mock/path/${file.name}`,\n configId: `mock_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`\n }\n });\n }\n file.percentCompleted = Math.round(progress) + \"%\";\n }, 200);\n });\n },\n async uploadFile(index) {\n if (this.fileList.length == 0) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().error(\"请选择文件!\");\n return;\n }\n this.loading = true;\n // 临时存储本次上传成功的文件信息\n const uploadedFiles = [];\n let successCount = 0;\n // 检查 index 是否为有效数字\n if (typeof index === 'number' && index >= 0 && index < this.fileList.length) {\n // 上传单个文件\n const file = this.fileList[index];\n // 手动调用 beforeUpload 方法进行校验\n if (!this.beforeUpload(file)) {\n // 校验失败,从文件列表中删除该文件\n this.fileList.splice(index, 1);\n this.loading = false;\n return;\n }\n await this.uploadSingleFile(file, uploadedFiles);\n successCount = uploadedFiles.length;\n } else {\n // 上传所有文件\n for (let i = this.fileList.length - 1; i >= 0; i--) {\n const file = this.fileList[i];\n // 手动调用 beforeUpload 方法进行校验\n if (!this.beforeUpload(file)) {\n // 校验失败,从文件列表中删除该文件\n this.fileList.splice(i, 1);\n continue; // 跳过不符合要求的文件\n }\n await this.uploadSingleFile(file, uploadedFiles);\n }\n successCount = uploadedFiles.length;\n }\n // 将本次上传成功的文件信息添加到 okFileInfos 中\n this.okFileInfos = [...this.okFileInfos, ...uploadedFiles];\n this.okIndex += successCount;\n this.loading = false;\n if (successCount === 0) {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().error(\"上传失败!\");\n } else {\n (0,_utils_message__WEBPACK_IMPORTED_MODULE_6__.useMessage)().success(\"上传成功!\");\n // 触发上传成功事件\n this.$emit(\"uploadChange\", this.slotName, JSON.stringify(this.okFileInfos));\n }\n },\n // 上传单个文件\n async uploadSingleFile(file, uploadedFiles) {\n // 检查文件是否已经上传过\n const exists = this.okFileInfos.some(item => item.name === file.name);\n if (exists) {\n console.info(file.name + \"已经上传过,跳过上传\");\n file.percentCompleted = \"100%\";\n file.status = \"success\";\n return;\n }\n console.info(file.name + \"上传中...\", file);\n file.percentCompleted = 0;\n const formData = new FormData();\n formData.append('files', file.raw);\n //调用文件上传接口\n if (this.testMode) {\n // 测试模式:使用模拟上传\n await this.mockUpload(file).then(({\n code,\n msg,\n data\n }) => {\n if (code === 200 || code === 0) {\n const fileInfo = {\n name: file.name,\n path: data?.path,\n configId: data?.configId,\n suffix: this.getFileExtension(file.name)\n };\n // 检查文件是否已经存在于 okFileInfos 中\n const exists = this.okFileInfos.some(item => item.configId === fileInfo.configId);\n if (!exists) {\n uploadedFiles.push(fileInfo);\n }\n } else {\n file.percentCompleted = \"上传失败\";\n file.message = msg;\n // 上传失败,从文件列表中删除该文件\n const index = this.fileList.findIndex(item => item.uid === file.uid);\n if (index !== -1) {\n this.fileList.splice(index, 1);\n }\n }\n }).catch(error => {\n console.error('上传失败', error);\n // 上传失败,从文件列表中删除该文件\n const index = this.fileList.findIndex(item => item.uid === file.uid);\n if (index !== -1) {\n this.fileList.splice(index, 1);\n }\n });\n } else {\n // 正常模式:调用真实上传接口\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_5__.upload)(this.http, this.url, formData, progressEvent => {\n const percentCompleted = Math.round(progressEvent.loaded * 100 / progressEvent.total);\n file.percentCompleted = percentCompleted + \"%\";\n }).then(({\n code,\n msg,\n data\n }) => {\n if (code === 200 || code === 0) {\n const fileInfo = {\n name: file.name,\n path: data?.path,\n configId: data?.configId,\n suffix: this.getFileExtension(file.name)\n };\n // 检查文件是否已经存在于 okFileInfos 中\n const exists = this.okFileInfos.some(item => item.configId === fileInfo.configId);\n if (!exists) {\n uploadedFiles.push(fileInfo);\n }\n } else {\n file.percentCompleted = \"上传失败\";\n file.message = msg;\n // 上传失败,从文件列表中删除该文件\n const index = this.fileList.findIndex(item => item.uid === file.uid);\n if (index !== -1) {\n this.fileList.splice(index, 1);\n }\n }\n }).catch(error => {\n // 上传失败处理逻辑\n console.error('上传失败', error);\n // 上传失败,从文件列表中删除该文件\n const index = this.fileList.findIndex(item => item.uid === file.uid);\n if (index !== -1) {\n this.fileList.splice(index, 1);\n }\n });\n }\n },\n getFileExtension(filename) {\n // 检查字符串是否有效\n if (typeof filename !== 'string') {\n return '';\n }\n // 使用 lastIndexOf 和 substring 方法提取后缀\n const lastDotIndex = filename.lastIndexOf('.');\n // 如果找不到点,返回空字符串,表示没有后缀\n if (lastDotIndex === -1) {\n return '';\n }\n // 提取并返回后缀名(不包括点)\n return filename.substring(lastDotIndex + 1);\n },\n reset() {\n this.okFileInfos = [];\n this.fileList = [];\n this.okIndex = 0;\n },\n downloadFile(file) {\n // 根据文件名查找对应的文件信息\n // const fileInfo = this.okFileInfos.find(item => item.name === filename);\n // if (fileInfo) {\n // // 构造下载链接\n // // const { configId, path } = fileInfo;\n // // 使用当前浏览器地址栏的域名和端口作为基础路径\n // // const baseUrl = window.location.origin.endsWith('/') ? window.location.origin : window.location.origin + '/';\n // // 构造完整的下载链接\n // // const downloadUrl = `${baseUrl}${configId}/${filename}/get/${path}`;\n // // 打印调试信息\n // // console.log('下载链接:', downloadUrl);\n // // console.log('基础路径:', baseUrl);\n // // console.log('文件信息:', fileInfo);\n // // 打开新窗口进行下载\n // // window.open(downloadUrl, '_blank');\n // } else {\n // useMessage().error(\"文件信息不存在,无法下载!\");\n // }\n\n const urlPattern = /^([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/[^/?#]*)/;\n let origin = window.location.origin;\n origin = this.http.getBaseURL();\n const match = origin.match(urlPattern);\n const baseUrl = match[1];\n const path = file.path.substring(file.path.lastIndexOf('/') + 1);\n const configId = file.configId;\n const filename = file.name;\n const url = baseUrl + '/admin-api/infra/file/' + configId + '/' + filename + '/get/' + path;\n const link = document.createElement('a');\n link.href = url;\n link.download = filename || url.split('/').pop();\n link.style.display = 'none';\n document.body.appendChild(link);\n link.click();\n URL.revokeObjectURL(link.href);\n link.remove();\n }\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/ol-upload-file.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");
|
|
502
502
|
|
|
503
503
|
/***/ }),
|
|
504
504
|
|
|
@@ -608,7 +608,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var spli
|
|
|
608
608
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
609
609
|
|
|
610
610
|
"use strict";
|
|
611
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
611
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/mixins/VTMixin/OForm */ \"./src/mixins/VTMixin/OForm.js\");\n/* harmony import */ var _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/ol-upload-file.vue */ \"./src/components/ol-upload-file.vue\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"olForm\",\n mixins: [_mixins_VTMixin_OForm__WEBPACK_IMPORTED_MODULE_0__.OForm],\n components: {\n OlUploadFile: _components_ol_upload_file_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n },\n data() {\n return {};\n },\n methods: {\n getParams() {\n let params = {\n tableConfigId: this.state.tableConfigId,\n dbName: this.state.dbName,\n tableName: this.state.tableName,\n columnAndValueMap: {}\n };\n if (this.state.type != '0') {\n let formData = this.$refs.formRef.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.columnAndValueMap[prop] = value;\n }\n } else {\n params.columnAndValueMap = this.getTableUpdateValue(this.form.column, this.formData);\n }\n if (this.state.saveUrl && this.state.saveUrl.indexOf(\"/online/crudAes/\") == -1) {\n return params.columnAndValueMap;\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.whereMap[kvs[0]] = params.columnAndValueMap[kvs[1]];\n delete params.columnAndValueMap[kvs[0]];\n } else {\n let val = params.columnAndValueMap[kvs];\n params.whereMap[kvs] = val != undefined ? val : this.formData[kvs];\n delete params.columnAndValueMap[kvs];\n }\n }\n } else {\n // 编辑时默认更新条件为id\n params.whereMap['id'] = this.formData['id'];\n if (!params.whereMap['id']) {\n params.whereMap['id'] = this.formData['t1_id'];\n }\n delete params.columnAndValueMap['id'];\n }\n } else if (this.state.updateKey) {\n let split = this.state.updateKey.split(',');\n params['genIdMap'] = {};\n for (let kv of split) {\n let kvs = kv.split(\"=\");\n if (kvs.length == 2) {\n params['genIdMap'][kvs[0]] = kvs[1];\n } else {\n params['genIdMap'][kvs[0]] = 'uuid';\n }\n }\n }\n this.setOtherProp(params);\n return params;\n }\n }\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/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
612
612
|
|
|
613
613
|
/***/ }),
|
|
614
614
|
|
|
@@ -619,7 +619,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
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\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 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 setTimeout(() => {\n if (!this.state.saveUrl || this.state.saveUrl.trim().length == 0) {\n this.state.saveUrl = \"/online/crudAes/saveMainAndSubs\";\n }\n }, 500);\n\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");
|
|
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 setTimeout(() => {\n if (!this.state.saveUrl || this.state.saveUrl.trim().length == 0) {\n this.state.saveUrl = \"/online/crudAes/saveMainAndSubs\";\n }\n }, 500);\n\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
|
|
|
@@ -729,7 +729,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
729
729
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
730
730
|
|
|
731
731
|
"use strict";
|
|
732
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin */ \"./src/mixins/VTMixin/index.js\");\n/* harmony import */ var _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-table-operate */ \"./src/components/table/ol-table-operate/index.vue\");\n/* harmony import */ var _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/ol-pager */ \"./src/components/table/ol-pager/index.vue\");\n/* harmony import */ var _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/index.vue\");\n/* harmony import */ var _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/table/ol-table-tool-btn/index.vue */ \"./src/components/table/ol-table-tool-btn/index.vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-dict-color/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-dict-color/index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/table/ol-main-form-sub-table/index.vue */ \"./src/components/table/ol-main-form-sub-table/index.vue\");\n/* harmony import */ var _store_permi__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/store/permi */ \"./src/store/permi.js\");\n/* harmony import */ var _utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/utils/filterUtil */ \"./src/utils/filterUtil.js\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-dialog-table.vue */ \"./src/components/ol-dialog-table.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// 注册筛选器\n(0,_utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__.registerFilterRenderer)();\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\nconst permi = (0,_store_permi__WEBPACK_IMPORTED_MODULE_16__.storePermi)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n props: {\n theme: {\n type: String\n },\n initDataSource: {\n default: true\n }\n },\n mixins: [_mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__.OTMixin],\n components: {\n OlDialogTable: _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n OlMainFormSubTable: _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n OlTableColumnDictColor: _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Delete: _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__.Delete,\n OlTableToolBtn: _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n OlTableColumnConfig: _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n olTableOperate: _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n olPager: _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n olForm: _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Icon: _components_Icon__WEBPACK_IMPORTED_MODULE_18__.Icon\n },\n data() {\n return {\n uuid: this.$attrs.uuid,\n videoDialogVisible: false,\n currentVideoSrc: '',\n selectTable: {\n config: {\n uuid: ''\n }\n }\n };\n },\n methods: {\n showToolName(code) {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return true;\n }\n }\n return false;\n },\n isOpenSelectTable(column) {\n const columnSource = this.table.columnSource.find(o => o.field === column.field);\n if (!(columnSource.editDisplay === '1' || columnSource.addDisplay === '1')) {\n return false; //如果不是可编辑字段,那么返回\n }\n if (!columnSource.tableSelectConfToOtherProp) {\n return false;\n }\n if (!JSON.parse(columnSource.tableSelectConfToOtherProp)?.olTableSelect) {\n return false;\n }\n return true;\n },\n openSelectTable(column, row) {\n this.selectTable.config = {\n uuid: ''\n };\n\n // console.group('表格选取')\n // console.info('column', column)\n // console.info('columnSource', this.table.columnSource)\n // console.info('原始column', this.table.columnSource.find(o=>o.field === column.field))\n // console.info('row', row)\n // console.info('column.params', column.params)\n this.selectTable.column = column;\n this.selectTable.rowData = row;\n this.selectTable.config = JSON.parse(column.params.tableSelectConfToOtherProp).olTableSelect;\n /** 打开表格选取窗口 **/\n this.$refs.selectTableDialogRef.init({\n uuid: this.selectTable.config.uuid,\n title: '选择数据'\n });\n },\n getSelectRowChangeButClick(p) {\n const {\n js,\n v\n } = p; //v是选中的数据对象\n if (!v) {\n return;\n }\n const sourceRowData = v[0];\n\n /*赋值逻辑*/\n //字典回显\n this.selectTable.column.params.tableDataObj[sourceRowData[this.selectTable.config.key]] = sourceRowData[this.selectTable.config.label];\n const otherResult = this.selectTable.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n console.info('otherResultArray', otherResultArray);\n //给其他字段赋值\n otherResultArray.forEach(item => {\n this.selectTable.rowData[item.targetField] = sourceRowData[item.sourceField];\n });\n }\n this.$refs.selectTableDialogRef.cancelEvent(); //关闭表格选取弹窗\n },\n getFiledName: _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n getSelectTableValue(column, row, isClick) {\n let cellValue = row[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(column)];\n let v = this.getPKArrays(cellValue);\n\n // if(column.field==='creator'){\n // console.info('----------------------')\n // console.info('column',column)\n // console.info('row',row)\n // console.info('cellValue',cellValue)\n // console.info('v',v)\n // console.info('tableDataObj',column.params.tableDataObj)\n // }\n\n let labels = '';\n for (let k of v) {\n let d = column.params.tableDataObj[k];\n if (d != undefined) {\n if (labels.length > 0) {\n labels += \",\";\n }\n labels += column.params.tableDataObj[k];\n }\n }\n if (!isClick) {\n return labels || cellValue;\n }\n return labels || \"请选择\";\n },\n handleClose() {\n this.selectRowChange();\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n openVideoDialog(src) {\n this.currentVideoSrc = src;\n this.videoDialogVisible = true;\n },\n preventOriginalPlay(player) {\n player.pause();\n },\n filterFields() {},\n initFilterValues() {},\n handleFilter() {},\n handleReset() {}\n },\n mounted() {\n setTimeout(() => {\n this.updateSort();\n }, 500);\n },\n created() {\n dict.init();\n dictType.init();\n permi.init();\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-table/index.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
732
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.find.js */ \"./node_modules/core-js/modules/es.iterator.find.js\");\n/* harmony import */ var core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/mixins/VTMixin */ \"./src/mixins/VTMixin/index.js\");\n/* harmony import */ var _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/table/ol-table-operate */ \"./src/components/table/ol-table-operate/index.vue\");\n/* harmony import */ var _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/table/ol-pager */ \"./src/components/table/ol-pager/index.vue\");\n/* harmony import */ var _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/table/ol-form */ \"./src/components/table/ol-form/index.vue\");\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-config/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-config/index.vue\");\n/* harmony import */ var _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/table/ol-table-tool-btn/index.vue */ \"./src/components/table/ol-table-tool-btn/index.vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @element-plus/icons-vue */ \"@element-plus/icons-vue\");\n/* harmony import */ var _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/components/table/ol-table/components/ol-table-column-dict-color/index.vue */ \"./src/components/table/ol-table/components/ol-table-column-dict-color/index.vue\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _store_dictType__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/store/dictType */ \"./src/store/dictType.js\");\n/* harmony import */ var _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/components/table/ol-main-form-sub-table/index.vue */ \"./src/components/table/ol-main-form-sub-table/index.vue\");\n/* harmony import */ var _store_permi__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/store/permi */ \"./src/store/permi.js\");\n/* harmony import */ var _utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/utils/filterUtil */ \"./src/utils/filterUtil.js\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/components/ol-dialog-table.vue */ \"./src/components/ol-dialog-table.vue\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// 注册筛选器\n(0,_utils_filterUtil__WEBPACK_IMPORTED_MODULE_17__.registerFilterRenderer)();\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_12__.storeDict)();\nconst dictType = (0,_store_dictType__WEBPACK_IMPORTED_MODULE_13__.storeDictType)();\nconst permi = (0,_store_permi__WEBPACK_IMPORTED_MODULE_16__.storePermi)();\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'olTable',\n props: {\n theme: {\n type: String\n },\n initDataSource: {\n default: true\n }\n },\n mixins: [_mixins_VTMixin__WEBPACK_IMPORTED_MODULE_4__.OTMixin],\n components: {\n OlDialogTable: _components_ol_dialog_table_vue__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n OlMainFormSubTable: _components_table_ol_main_form_sub_table_index_vue__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n OlTableColumnDictColor: _components_table_ol_table_components_ol_table_column_dict_color_index_vue__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Delete: _element_plus_icons_vue__WEBPACK_IMPORTED_MODULE_10__.Delete,\n OlTableToolBtn: _components_table_ol_table_tool_btn_index_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n OlTableColumnConfig: _components_table_ol_table_components_ol_table_column_config_index_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n olTableOperate: _components_table_ol_table_operate__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n olPager: _components_table_ol_pager__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n olForm: _components_table_ol_form__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Icon: _components_Icon__WEBPACK_IMPORTED_MODULE_18__.Icon\n },\n data() {\n return {\n uuid: this.$attrs.uuid,\n videoDialogVisible: false,\n currentVideoSrc: '',\n selectTable: {\n config: {\n uuid: ''\n }\n }\n };\n },\n methods: {\n showToolName(code) {\n for (let toolBtn of this.toolBtn) {\n if (toolBtn.code == code) {\n return true;\n }\n }\n return false;\n },\n isOpenSelectTable(column) {\n const columnSource = this.table.columnSource.find(o => o.field === column.field);\n if (!(columnSource.editDisplay === '1' || columnSource.addDisplay === '1')) {\n return false; //如果不是可编辑字段,那么返回\n }\n if (!columnSource.tableSelectConfToOtherProp) {\n return false;\n }\n if (!JSON.parse(columnSource.tableSelectConfToOtherProp)?.olTableSelect) {\n return false;\n }\n return true;\n },\n openSelectTable(column, row) {\n this.selectTable.config = {\n uuid: ''\n };\n\n // console.group('表格选取')\n // console.info('column', column)\n // console.info('columnSource', this.table.columnSource)\n // console.info('原始column', this.table.columnSource.find(o=>o.field === column.field))\n // console.info('row', row)\n // console.info('column.params', column.params)\n this.selectTable.column = column;\n this.selectTable.rowData = row;\n this.selectTable.config = JSON.parse(column.params.tableSelectConfToOtherProp).olTableSelect;\n /** 打开表格选取窗口 **/\n this.$refs.selectTableDialogRef.init({\n uuid: this.selectTable.config.uuid,\n title: '选择数据'\n });\n },\n getSelectRowChangeButClick(p) {\n const {\n js,\n v\n } = p; //v是选中的数据对象\n if (!v) {\n return;\n }\n const sourceRowData = v[0];\n\n /*赋值逻辑*/\n //字典回显\n this.selectTable.column.params.tableDataObj[sourceRowData[this.selectTable.config.key]] = sourceRowData[this.selectTable.config.label];\n let rowData = JSON.parse(JSON.stringify(this.selectTable.rowData));\n const otherResult = this.selectTable.config.otherResult; //返回额外参数字段配置\n if (otherResult !== null && otherResult !== undefined && otherResult !== '') {\n let otherResultArray = [];\n otherResult.split(\",\").forEach(m => {\n let k = m.split(\":\");\n otherResultArray.push({\n targetField: k[0],\n sourceField: k[[k.length - 1]]\n });\n });\n //给其他字段赋值\n otherResultArray.forEach(item => {\n this.selectTable.rowData[item.targetField] = sourceRowData[item.sourceField];\n });\n }\n let params = this.getDifferingProperties(this.selectTable.rowData, rowData);\n if (Object.keys(params).length != 0) {\n this.doPostAes(null, '/online/crudAes/modify', {\n dbName: this.tableConfig.dbName,\n tableName: this.tableConfig.mainTable,\n columnAndValueMap: params,\n whereMap: this.doGetWhereMap(this.selectTable.rowData, this.tableConfig.cardKey)\n });\n }\n this.$refs.selectTableDialogRef.cancelEvent(); //关闭表格选取弹窗\n },\n getFiledName: _utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n getSelectTableValue(column, row, isClick) {\n let cellValue = row[(0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_14__[\"default\"])(column)];\n let v = this.getPKArrays(cellValue);\n\n // if(column.field==='creator'){\n // console.info('----------------------')\n // console.info('column',column)\n // console.info('row',row)\n // console.info('cellValue',cellValue)\n // console.info('v',v)\n // console.info('tableDataObj',column.params.tableDataObj)\n // }\n\n let labels = '';\n for (let k of v) {\n if (!column.params.tableDataObj) {\n continue;\n }\n let d = column.params.tableDataObj[k];\n if (d != undefined) {\n if (labels.length > 0) {\n labels += \",\";\n }\n labels += column.params.tableDataObj[k];\n }\n }\n if (!isClick) {\n return labels || cellValue;\n }\n return labels || \"请选择\";\n },\n handleClose() {\n this.selectRowChange();\n },\n getSlotName(name) {\n return name + \"_\" + this.theme;\n },\n openVideoDialog(src) {\n this.currentVideoSrc = src;\n this.videoDialogVisible = true;\n },\n preventOriginalPlay(player) {\n player.pause();\n },\n filterFields() {},\n initFilterValues() {},\n handleFilter() {},\n handleReset() {}\n },\n mounted() {\n setTimeout(() => {\n this.updateSort();\n }, 500);\n },\n created() {\n dict.init();\n dictType.init();\n permi.init();\n }\n});\n\n//# sourceURL=webpack://olp-table/./src/components/table/ol-table/index.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
733
733
|
|
|
734
734
|
/***/ }),
|
|
735
735
|
|
|
@@ -1345,7 +1345,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core
|
|
|
1345
1345
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1346
1346
|
|
|
1347
1347
|
"use strict";
|
|
1348
|
-
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_map_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_tree_components_o_tree_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/components/o-tree.vue */ \"./src/components/tree/components/o-tree.vue\");\n/* harmony import */ var _views_tree_components_config_core_tree_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/tree/components/config-core-tree/index.vue */ \"./src/views/tree/components/config-core-tree/index.vue\");\n/* harmony import */ var _views_tree_components_config_core_data_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/views/tree/components/config-core-data.vue */ \"./src/views/tree/components/config-core-data.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/views/table/add-or-edit/config/form-config/index.vue */ \"./src/views/table/add-or-edit/config/form-config/index.vue\");\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'treeConfig',\n components: {\n FormConfig: _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n ConfigCoreData: _views_tree_components_config_core_data_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n ConfigCoreTree: _views_tree_components_config_core_tree_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n OTree: _components_tree_components_o_tree_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n provide() {\n return {\n treeConfigAll: this.treeConfigAll\n };\n },\n inject: ['http'],\n data() {\n return {\n loading: true,\n dialogVisible: false,\n show: true,\n activeName: 'data',\n data: [{\n index: \"t1\",\n type: \"主表\",\n joinTable: \"\",\n joinFiled: \"/\",\n deleteWhere: 'id=${id}'\n }],\n treeConfigAll: {\n deleteParameter: {},\n treeConfig: {\n hump: 0,\n selectChildren: 1,\n configName: '',\n width: 400,\n dataSource: '',\n treeId: '',\n treeParentId: '',\n tableDelete: {},\n mainTable: '',\n optionJson: {},\n tableQueryParams: '',\n executeSql: '',\n definitionSql: '',\n lazy: '0',\n firstLazyValue: '',\n executeWhere: '',\n orderBy: '',\n parameterDefault: '',\n api: '',\n title: '',\n label: 'label',\n value: 'value',\n expandIcon: '',\n showCheckbox: 1,\n drawIcon: '',\n treeOper: [],\n convertTree: 1,\n autoInit: 0,\n search: 1,\n firstExpandAll: 1,\n dbName: '',\n optionValue: {},\n //默认多余字段,并接到optionJson\n propValue: {},\n //默认多余字段,并接到optionJson\n eventsValue: {} //默认多余字段,并接到optionJson\n },\n toolButOptions: [],\n formMainList: [],\n formMainMap: {},\n tableColumn: [],\n mainTableColumnList: [],\n uuid: '',\n dicData: {\n joinTableDicData: [],\n joinFiledDicData: []\n }\n }\n };\n },\n watch: {\n 'treeConfigAll.treeConfig.label'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.value'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.treeId'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.treeParentId'() {\n this.refreshTree();\n }\n },\n 'treeConfigAll.treeConfig.treeId'() {\n this.refreshTree();\n },\n methods: {\n init(o) {\n if (o) {\n this.treeConfigAll.uuid = o.uuid;\n this.loading = true;\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/treeConfig/getJson', {\n uuid: o.uuid\n }, undefined, true).then(({\n treeConfig,\n toolButOptions,\n formMainList,\n tableDelete,\n deleteWhere\n }) => {\n this.treeConfigAll.toolButOptions = toolButOptions;\n this.treeConfigAll.formMainMap = formMainList;\n this.treeConfigAll.deleteParameter = tableDelete;\n treeConfig.treeOper = toolButOptions.map(o => o.code);\n if (treeConfig.optionJson) {\n treeConfig.optionJson = JSON.parse(treeConfig.optionJson);\n } else {\n treeConfig.optionJson = {};\n }\n treeConfig.optionValue = treeConfig.optionJson.optionValue ? treeConfig.optionJson.optionValue : {};\n treeConfig.propValue = treeConfig.optionJson.propValue ? treeConfig.optionJson.propValue : {};\n treeConfig.eventsValue = treeConfig.optionJson.eventsValue ? treeConfig.optionJson.eventsValue : {};\n this.treeConfigAll.treeConfig = treeConfig;\n this.treeConfigAll.treeConfig.deleteWhere = deleteWhere;\n this.refreshTree();\n this.$nextTick(() => {\n this.initTable();\n if (treeConfig.treeOper.includes('add')) {\n this.$refs.addFormConfig.setData(formMainList['add']);\n }\n if (treeConfig.treeOper.includes('edit')) {\n this.$refs.editFormConfig.setData(formMainList['edit']);\n }\n });\n }).finally(() => {\n this.loading = false;\n });\n } else {\n this.loading = false;\n }\n this.dialogVisible = true;\n },\n initColumnList() {\n if (this.treeConfigAll.treeConfig.table && this.treeConfigAll.treeConfig.table.length >= 1) {\n this.treeConfigAll.mainTableColumnList = this.treeConfigAll.treeConfig.table[0].columnList;\n return;\n }\n let param = {\n tableName: this.treeConfigAll.treeConfig.mainTable\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableColumnList/' + this.treeConfigAll.treeConfig.dbName, param).then(res => {\n this.treeConfigAll.mainTableColumnList = res;\n });\n },\n getFormMain(formConfig) {\n let form = formConfig.getForm();\n let formConfigData = formConfig.getData();\n let formMain = {\n uuid: this.treeConfigAll.treeConfig.uuid\n };\n let formJson = {};\n if (formConfigData) {\n formMain.designer = \"\" + formConfigData.designer; //表单类型 (0)基础表单 (1)自定义表单\n formMain.customForm = formConfigData.customForm;\n formJson.optionJson = formConfigData.codeForm;\n formJson.customJson = JSON.stringify(formConfigData.customJson);\n }\n for (let key of Object.keys(form)) {\n formMain[key] = form[key];\n }\n return {\n formMain,\n formJson\n };\n },\n setFormList() {\n //保存新增和编辑表单配置\n let formMainList = [];\n if (this.treeConfigAll.treeConfig.treeOper.includes('add')) {\n let formMain = this.getFormMain(this.$refs['addFormConfig']);\n if (formMain) {\n formMainList.push(formMain);\n }\n }\n if (this.treeConfigAll.treeConfig.treeOper.includes('edit')) {\n let formMain = this.getFormMain(this.$refs['editFormConfig']);\n if (formMain) {\n formMainList.push(formMain);\n }\n }\n if (formMainList.length != 0) {\n this.treeConfigAll.formMainList = formMainList;\n }\n },\n initOption(type) {\n let key = type + 'Value';\n let ref = this.$refs.tree.$refs[type];\n if (ref) {\n ref.setData(this.treeConfigAll.treeConfig, key);\n }\n if (this.treeConfigAll.treeConfig[key]) {\n this.treeConfigAll.treeConfig.optionJson[key] = this.treeConfigAll.treeConfig[key];\n }\n },\n async save() {\n this.treeConfigAll.treeConfig.optionJson = {};\n this.initOption(\"option\");\n this.initOption(\"prop\");\n this.initOption(\"events\");\n this.treeConfigAll.treeConfig.optionJson = JSON.stringify(this.treeConfigAll.treeConfig.optionJson);\n this.loading = true;\n await this.$refs.data.$refs.formRef.validate((v, o) => {\n if (!v) {\n this.activeName = \"data\";\n this.loading = false;\n return;\n }\n });\n await this.$refs.tree.$refs.formRef.validate((v, o) => {\n if (!v) {\n for (let key of Object.keys(o)) {\n if (this.treeConfigAll.treeConfig[key] == '' || this.treeConfigAll.treeConfig[key] == undefined) {\n this.activeName = \"tree\";\n this.loading = false;\n return;\n }\n }\n }\n if (this.treeConfigAll.treeConfig.treeOper && this.treeConfigAll.treeConfig.treeOper.length >= 1) {\n this.setFormList();\n }\n this.setDeleteWhere();\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.post)(this.http, \"/online/treeConfig/saveJson\", this.treeConfigAll, undefined, false).then(() => {\n this.$emit(\"emits\", {\n m: 'query'\n });\n this.dialogVisible = false;\n }).finally(() => {\n this.loading = false;\n });\n });\n },\n setDeleteWhere() {\n if (this.treeConfigAll.treeConfig.treeOper.indexOf(\"delete\") != -1) {\n if (this.treeConfigAll.treeConfig.table[0].deleteWhere) {\n this.treeConfigAll.treeConfig.deleteWhere = {\n wheres: this.treeConfigAll.treeConfig.table[0].deleteWhere.trim(),\n tableName: this.treeConfigAll.treeConfig.table[0].joinTable\n };\n } else {\n delete this.treeConfigAll.treeConfig.deleteWhere;\n }\n } else {\n if (this.treeConfigAll.treeConfig.table[0].deleteWhere) {\n this.treeConfigAll.treeConfig.deleteWhere = {\n wheres: this.treeConfigAll.treeConfig.table[0].deleteWhere.trim()\n };\n }\n }\n },\n syncTable() {\n this.$refs.data.$refs.formRef.validate(v => {\n if (!v) {\n this.activeName = \"data\";\n return;\n }\n this.$refs.oTree.doQuery({\n sql: this.treeConfigAll.treeConfig.executeSql,\n dbName: this.treeConfigAll.treeConfig.dbName,\n id: this.treeConfigAll.treeConfig.uuid,\n queryType: 1,\n enablePage: false\n });\n });\n },\n refreshTree() {\n this.show = false;\n this.$nextTick(() => {\n this.show = true;\n });\n },\n initConfigDict() {\n this.treeConfigAll.dicData.joinFiledDicData = this.dict.val('join_filed');\n this.remoteMethod();\n },\n remoteMethod() {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableList/', {\n dbName: this.treeConfigAll.treeConfig.dbName\n }).then(data => {\n this.treeConfigAll.dicData.joinTableDicData = data;\n });\n },\n async initTable() {\n this.treeConfigAll.treeConfig.table = this.data;\n if (!this.treeConfigAll.tableColumn) {\n this.treeConfigAll.tableColumn = [];\n }\n await this.sqlParseTable(this.treeConfigAll.treeConfig.deleteWhere);\n this.treeConfigAll.treeConfig.mainTable = this.treeConfigAll.treeConfig.table[0].joinTable;\n this.initColumnList();\n },\n sqlParseTable(val) {\n console.log(val);\n let form = this.treeConfigAll.treeConfig;\n let executeSql = form.executeSql.toLowerCase();\n if (executeSql.indexOf(\"from\") == -1) {\n return;\n }\n let sql = executeSql.split(\"from\");\n let tables = sql[1].trim().split(\" \");\n let tableData = this.parseTable(tables);\n let promise = [];\n for (let i = 0; i < tableData.length; i++) {\n promise.push((0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableColumnList/' + form.dbName, {\n tableName: tableData[i].joinTable\n }));\n }\n Promise.all(promise).then(result => {\n for (let i = 0; i < result.length; i++) {\n let cloumns = result[i];\n for (let cloumn of cloumns) {\n let checked = \"0\";\n let visible = \"0\";\n if (this.treeConfigAll.tableColumn.length != 0) {\n for (let col of this.treeConfigAll.tableColumn) {\n if (cloumn.column_name == col.tableField && cloumn.table_name == tableData[i].joinTable) {\n checked = '1';\n visible = col.visible;\n }\n }\n } else {\n checked = '1';\n visible = '1';\n }\n cloumn.checked = checked;\n cloumn.visible = visible;\n }\n tableData[i]['columnList'] = cloumns;\n }\n if (val) {\n tableData[0].deleteWhere = val;\n }\n form.table = tableData;\n if (!this.treeConfigAll.tableColumn) {\n this.treeConfigAll.tableColumn = form.table[0].columnList;\n }\n this.treeConfigAll.treeConfig = form;\n });\n },\n parseTable(tables) {\n let tableData = this.data;\n this.treeConfigAll.treeConfig.table[0].joinTable = tables[0].replace(/[\\n\\t\\s]+/g, '');\n for (let i = 2; i < tables.length; i++) {\n let str = tables[i];\n if (str == \"join\") {\n let type = tables[i - 1] == (\"left\" || 0) ? tables[i - 1] + \" join\" : \"join\";\n let joinTable = tables[++i];\n let index = tables[++i];\n i++;\n let joinFiled = tables[++i];\n tableData.push({\n index: index,\n type: type,\n joinTable: joinTable.replace(/[\\n\\t\\s]+/g, ''),\n joinFiled: joinFiled\n });\n }\n }\n return tableData;\n }\n },\n created() {}\n});\n\n//# sourceURL=webpack://olp-table/./src/views/tree/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");
|
|
1348
|
+
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_map_js__WEBPACK_IMPORTED_MODULE_2__ = __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_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _components_tree_components_o_tree_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/tree/components/o-tree.vue */ \"./src/components/tree/components/o-tree.vue\");\n/* harmony import */ var _views_tree_components_config_core_tree_index_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/views/tree/components/config-core-tree/index.vue */ \"./src/views/tree/components/config-core-tree/index.vue\");\n/* harmony import */ var _views_tree_components_config_core_data_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/views/tree/components/config-core-data.vue */ \"./src/views/tree/components/config-core-data.vue\");\n/* harmony import */ var _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/views/table/add-or-edit/config/form-config/index.vue */ \"./src/views/table/add-or-edit/config/form-config/index.vue\");\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'treeConfig',\n components: {\n FormConfig: _views_table_add_or_edit_config_form_config_index_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n ConfigCoreData: _views_tree_components_config_core_data_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n ConfigCoreTree: _views_tree_components_config_core_tree_index_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n OTree: _components_tree_components_o_tree_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n },\n provide() {\n return {\n treeConfigAll: this.treeConfigAll\n };\n },\n inject: ['http'],\n data() {\n return {\n loading: true,\n dialogVisible: false,\n show: true,\n activeName: 'data',\n data: [{\n index: \"t1\",\n type: \"主表\",\n joinTable: \"\",\n joinFiled: \"/\",\n deleteWhere: 'id=${id}'\n }],\n treeConfigAll: {\n deleteParameter: {},\n treeConfig: {\n hump: 0,\n selectChildren: 1,\n configName: '',\n width: 400,\n dataSource: '',\n treeId: '',\n treeParentId: '',\n tableDelete: {},\n mainTable: '',\n optionJson: {},\n tableQueryParams: '',\n executeSql: '',\n definitionSql: '',\n lazy: '0',\n firstLazyValue: '',\n executeWhere: '',\n orderBy: '',\n parameterDefault: '',\n api: '',\n title: '',\n label: 'label',\n value: 'value',\n expandIcon: '',\n showCheckbox: 1,\n drawIcon: '',\n treeOper: [],\n convertTree: 1,\n autoInit: 0,\n search: 1,\n firstExpandAll: 1,\n dbName: '',\n optionValue: {},\n //默认多余字段,并接到optionJson\n propValue: {},\n //默认多余字段,并接到optionJson\n eventsValue: {} //默认多余字段,并接到optionJson\n },\n toolButOptions: [],\n formMainList: [],\n formMainMap: {},\n tableColumn: [],\n mainTableColumnList: [],\n uuid: '',\n dicData: {\n joinTableDicData: [],\n joinFiledDicData: []\n }\n }\n };\n },\n watch: {\n 'treeConfigAll.treeConfig.label'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.value'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.treeId'() {\n this.refreshTree();\n },\n 'treeConfigAll.treeConfig.treeParentId'() {\n this.refreshTree();\n }\n },\n 'treeConfigAll.treeConfig.treeId'() {\n this.refreshTree();\n },\n methods: {\n init(o) {\n if (o) {\n this.treeConfigAll.uuid = o.uuid;\n this.loading = true;\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/treeConfig/getJson', {\n uuid: o.uuid\n }, undefined, true).then(({\n treeConfig,\n toolButOptions,\n formMainList,\n tableDelete,\n deleteWhere\n }) => {\n this.treeConfigAll.toolButOptions = toolButOptions;\n this.treeConfigAll.formMainMap = formMainList;\n this.treeConfigAll.deleteParameter = tableDelete;\n treeConfig.treeOper = toolButOptions.map(o => o.code);\n if (treeConfig.optionJson) {\n treeConfig.optionJson = JSON.parse(treeConfig.optionJson);\n } else {\n treeConfig.optionJson = {};\n }\n treeConfig.optionValue = treeConfig.optionJson.optionValue ? treeConfig.optionJson.optionValue : {};\n treeConfig.propValue = treeConfig.optionJson.propValue ? treeConfig.optionJson.propValue : {};\n treeConfig.eventsValue = treeConfig.optionJson.eventsValue ? treeConfig.optionJson.eventsValue : {};\n this.treeConfigAll.treeConfig = treeConfig;\n this.treeConfigAll.treeConfig.deleteWhere = deleteWhere;\n this.refreshTree();\n this.$nextTick(() => {\n this.initTable();\n if (treeConfig.treeOper.includes('add')) {\n this.$refs.addFormConfig.setData(formMainList['add']);\n }\n if (treeConfig.treeOper.includes('edit')) {\n this.$refs.editFormConfig.setData(formMainList['edit']);\n }\n });\n }).finally(() => {\n this.loading = false;\n });\n } else {\n this.loading = false;\n }\n this.dialogVisible = true;\n },\n initColumnList() {\n if (this.treeConfigAll.treeConfig.table && this.treeConfigAll.treeConfig.table.length >= 1) {\n this.treeConfigAll.mainTableColumnList = this.treeConfigAll.treeConfig.table[0].columnList;\n return;\n }\n let param = {\n tableName: this.treeConfigAll.treeConfig.mainTable\n };\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableColumnList/' + this.treeConfigAll.treeConfig.dbName, param).then(res => {\n this.treeConfigAll.mainTableColumnList = res;\n });\n },\n getFormMain(formConfig) {\n let form = formConfig.getForm();\n let formConfigData = formConfig.getData();\n let formMain = {\n uuid: this.treeConfigAll.treeConfig.uuid\n };\n let formJson = {};\n if (formConfigData) {\n formMain.designer = \"\" + formConfigData.designer; //表单类型 (0)基础表单 (1)自定义表单\n formMain.customForm = formConfigData.customForm;\n formJson.optionJson = formConfigData.codeForm;\n formJson.customJson = JSON.stringify(formConfigData.customJson);\n }\n for (let key of Object.keys(form)) {\n formMain[key] = form[key];\n }\n return {\n formMain,\n formJson\n };\n },\n setFormList() {\n //保存新增和编辑表单配置\n let formMainList = [];\n if (this.treeConfigAll.treeConfig.treeOper.includes('add')) {\n let formMain = this.getFormMain(this.$refs['addFormConfig']);\n if (formMain) {\n formMainList.push(formMain);\n }\n }\n if (this.treeConfigAll.treeConfig.treeOper.includes('edit')) {\n let formMain = this.getFormMain(this.$refs['editFormConfig']);\n if (formMain) {\n formMainList.push(formMain);\n }\n }\n if (formMainList.length != 0) {\n this.treeConfigAll.formMainList = formMainList;\n }\n },\n initOption(type) {\n let key = type + 'Value';\n let ref = this.$refs.tree.$refs[type];\n if (ref) {\n ref.setData(this.treeConfigAll.treeConfig, key);\n }\n if (this.treeConfigAll.treeConfig[key]) {\n this.treeConfigAll.treeConfig.optionJson[key] = this.treeConfigAll.treeConfig[key];\n }\n },\n async save() {\n this.treeConfigAll.treeConfig.optionJson = {};\n this.initOption(\"option\");\n this.initOption(\"prop\");\n this.initOption(\"events\");\n this.treeConfigAll.treeConfig.optionJson = JSON.stringify(this.treeConfigAll.treeConfig.optionJson);\n this.loading = true;\n await this.$refs.data.$refs.formRef.validate((v, o) => {\n if (!v) {\n this.activeName = \"data\";\n this.loading = false;\n return;\n }\n });\n await this.$refs.tree.$refs.formRef.validate((v, o) => {\n if (!v) {\n for (let key of Object.keys(o)) {\n if (this.treeConfigAll.treeConfig[key] == '' || this.treeConfigAll.treeConfig[key] == undefined) {\n this.activeName = \"tree\";\n this.loading = false;\n return;\n }\n }\n }\n if (this.treeConfigAll.treeConfig.treeOper && this.treeConfigAll.treeConfig.treeOper.length >= 1) {\n this.setFormList();\n }\n this.setDeleteWhere();\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.post)(this.http, \"/online/treeConfig/saveJson\", this.treeConfigAll, undefined, false).then(() => {\n this.$emit(\"emits\", {\n m: 'query'\n });\n this.dialogVisible = false;\n }).finally(() => {\n this.loading = false;\n });\n });\n },\n setDeleteWhere() {\n if (this.treeConfigAll.treeConfig.treeOper.indexOf(\"delete\") != -1) {\n if (this.treeConfigAll.treeConfig.table[0].deleteWhere) {\n this.treeConfigAll.treeConfig.deleteWhere = {\n wheres: this.treeConfigAll.treeConfig.table[0].deleteWhere.trim(),\n tableName: this.treeConfigAll.treeConfig.table[0].joinTable\n };\n } else {\n delete this.treeConfigAll.treeConfig.deleteWhere;\n }\n } else {\n if (this.treeConfigAll.treeConfig.table && this.treeConfigAll.treeConfig.table.length >= 1 && this.treeConfigAll.treeConfig.table[0].deleteWhere) {\n this.treeConfigAll.treeConfig.deleteWhere = {\n wheres: this.treeConfigAll.treeConfig.table[0].deleteWhere.trim()\n };\n }\n }\n },\n syncTable() {\n this.$refs.data.$refs.formRef.validate(v => {\n if (!v) {\n this.activeName = \"data\";\n return;\n }\n this.$refs.oTree.doQuery({\n sql: this.treeConfigAll.treeConfig.executeSql,\n dbName: this.treeConfigAll.treeConfig.dbName,\n id: this.treeConfigAll.treeConfig.uuid,\n queryType: 1,\n enablePage: false\n });\n });\n },\n refreshTree() {\n this.show = false;\n this.$nextTick(() => {\n this.show = true;\n });\n },\n initConfigDict() {\n this.treeConfigAll.dicData.joinFiledDicData = this.dict.val('join_filed');\n this.remoteMethod();\n },\n remoteMethod() {\n (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableList/', {\n dbName: this.treeConfigAll.treeConfig.dbName\n }).then(data => {\n this.treeConfigAll.dicData.joinTableDicData = data;\n });\n },\n async initTable() {\n this.treeConfigAll.treeConfig.table = this.data;\n if (!this.treeConfigAll.tableColumn) {\n this.treeConfigAll.tableColumn = [];\n }\n await this.sqlParseTable(this.treeConfigAll.treeConfig.deleteWhere);\n this.treeConfigAll.treeConfig.mainTable = this.treeConfigAll.treeConfig.table[0].joinTable;\n this.initColumnList();\n },\n sqlParseTable(val) {\n console.log(val);\n let form = this.treeConfigAll.treeConfig;\n let executeSql = form.executeSql.toLowerCase();\n if (executeSql.indexOf(\"from\") == -1) {\n return;\n }\n let sql = executeSql.split(\"from\");\n let tables = sql[1].trim().split(\" \");\n let tableData = this.parseTable(tables);\n let promise = [];\n for (let i = 0; i < tableData.length; i++) {\n promise.push((0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_3__.get)(this.http, '/online/getDBTableColumnList/' + form.dbName, {\n tableName: tableData[i].joinTable\n }));\n }\n Promise.all(promise).then(result => {\n for (let i = 0; i < result.length; i++) {\n let cloumns = result[i];\n for (let cloumn of cloumns) {\n let checked = \"0\";\n let visible = \"0\";\n if (this.treeConfigAll.tableColumn.length != 0) {\n for (let col of this.treeConfigAll.tableColumn) {\n if (cloumn.column_name == col.tableField && cloumn.table_name == tableData[i].joinTable) {\n checked = '1';\n visible = col.visible;\n }\n }\n } else {\n checked = '1';\n visible = '1';\n }\n cloumn.checked = checked;\n cloumn.visible = visible;\n }\n tableData[i]['columnList'] = cloumns;\n }\n if (val) {\n tableData[0].deleteWhere = val;\n }\n form.table = tableData;\n if (!this.treeConfigAll.tableColumn) {\n this.treeConfigAll.tableColumn = form.table[0].columnList;\n }\n this.treeConfigAll.treeConfig = form;\n });\n },\n parseTable(tables) {\n let tableData = this.data;\n this.treeConfigAll.treeConfig.table[0].joinTable = tables[0].replace(/[\\n\\t\\s]+/g, '');\n for (let i = 2; i < tables.length; i++) {\n let str = tables[i];\n if (str == \"join\") {\n let type = tables[i - 1] == (\"left\" || 0) ? tables[i - 1] + \" join\" : \"join\";\n let joinTable = tables[++i];\n let index = tables[++i];\n i++;\n let joinFiled = tables[++i];\n tableData.push({\n index: index,\n type: type,\n joinTable: joinTable.replace(/[\\n\\t\\s]+/g, ''),\n joinFiled: joinFiled\n });\n }\n }\n return tableData;\n }\n },\n created() {}\n});\n\n//# sourceURL=webpack://olp-table/./src/views/tree/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");
|
|
1349
1349
|
|
|
1350
1350
|
/***/ }),
|
|
1351
1351
|
|
|
@@ -1576,7 +1576,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1576
1576
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1577
1577
|
|
|
1578
1578
|
"use strict";
|
|
1579
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n class: \"ol-upload-file\"\n};\nconst _hoisted_2 = {\n class: \"
|
|
1579
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"vue\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n\nconst _hoisted_1 = {\n class: \"ol-upload-file\"\n};\nconst _hoisted_2 = {\n class: \"upload-wrapper\"\n};\nconst _hoisted_3 = {\n class: \"upload-control\"\n};\nconst _hoisted_4 = {\n class: \"popover-file-list\"\n};\nconst _hoisted_5 = {\n key: 0,\n class: \"empty-file-list\"\n};\nconst _hoisted_6 = {\n key: 1\n};\nconst _hoisted_7 = {\n class: \"file-name\"\n};\nconst _hoisted_8 = {\n class: \"file-actions\"\n};\nconst _hoisted_9 = {\n class: \"file-status\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_el_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-button\");\n const _component_el_upload = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-upload\");\n const _component_View = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"View\");\n const _component_el_icon = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-icon\");\n const _component_el_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-tooltip\");\n const _component_el_popover = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"el-popover\");\n const _directive_loading = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)(\"loading\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_upload, {\n ref: \"uploadRef\",\n \"file-list\": $data.fileList,\n \"onUpdate:fileList\": _cache[0] || (_cache[0] = $event => $data.fileList = $event),\n multiple: $props.multiple,\n \"on-change\": $options.onchange,\n \"auto-upload\": false,\n \"show-file-list\": false,\n class: \"upload-trigger\"\n }, {\n trigger: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"primary\",\n size: \"small\",\n ref: \"selectFiles\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => _cache[1] || (_cache[1] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"选择文件\")])),\n _: 1 /* STABLE */,\n __: [1]\n }, 512 /* NEED_PATCH */)]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"file-list\", \"multiple\", \"on-change\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" 使用 el-popover 展示文件列表 \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_popover, {\n placement: \"top\",\n width: 300,\n trigger: \"hover\",\n content: ''\n }, {\n reference: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n size: \"small\",\n type: \"text\",\n class: \"file-count-btn\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($data.fileList.length > 0 ? $data.fileList[0].name + ' 等' + $data.fileList.length + '个文件' : '0个文件') + \" \", 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_icon, {\n class: \"ml-1 view-icon\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_View)]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [$data.fileList.length === 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_5, _cache[2] || (_cache[2] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, \"暂无文件\", -1 /* CACHED */)]))) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_6, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($data.fileList, file => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: file.uid,\n class: \"popover-file-item\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(file.name), 1 /* TEXT */), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", _hoisted_9, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(file.percentCompleted ? file.percentCompleted : '未上传'), 1 /* TEXT */), !file.percentCompleted || file.percentCompleted == '上传失败' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_el_button, {\n key: 0,\n type: \"primary\",\n size: \"mini\",\n onClick: $event => $options.uploadFile($options.getFile(file.uid))\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[3] || (_cache[3] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"上传\")]))]),\n _: 2 /* DYNAMIC */,\n __: [3]\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_button, {\n type: \"danger\",\n size: \"mini\",\n onClick: $event => $options.deleteFile(file.uid)\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[4] || (_cache[4] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"删除\")]))]),\n _: 2 /* DYNAMIC */,\n __: [4]\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\"]), file.percentCompleted == '100%' ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_el_button, {\n key: 1,\n type: \"success\",\n size: \"mini\",\n onClick: $event => $options.downloadFile(file)\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[5] || (_cache[5] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"下载\")]))]),\n _: 2 /* DYNAMIC */,\n __: [5]\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_el_tooltip, {\n class: \"box-item\",\n effect: \"dark\",\n content: file.message,\n placement: \"right\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [file.message ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_el_button, {\n key: 0,\n size: \"mini\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[6] || (_cache[6] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"原因\")]))]),\n _: 1 /* STABLE */,\n __: [6]\n })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"content\"])])]);\n }), 128 /* KEYED_FRAGMENT */))]))])]),\n _: 1 /* STABLE */\n })])])), [[_directive_loading, $data.loading]])]);\n}\n\n//# sourceURL=webpack://olp-table/./src/components/ol-upload-file.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");
|
|
1580
1580
|
|
|
1581
1581
|
/***/ }),
|
|
1582
1582
|
|
|
@@ -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: 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: $options.getCascaderOptions(slotRow.slotName),\n props: $data.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[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");
|
|
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
|
|
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[2] || (_cache[2] = $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: _cache[1] || (_cache[1] = $event => {\n _ctx.state.dialogVisible = false;\n })\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 }), _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[4] || (_cache[4] = [(0,vue__WEBPACK_IMPORTED_MODULE_2__.createTextVNode)(\"保 存\")])),\n _: 1 /* STABLE */,\n __: [4]\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
|
|
|
@@ -5279,7 +5279,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
|
5279
5279
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5280
5280
|
|
|
5281
5281
|
"use strict";
|
|
5282
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ol-upload-file[data-v-79ee03e8] {\\n width: 100%;\\n}\\n.upload-
|
|
5282
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ol-upload-file[data-v-79ee03e8] {\\n width: 100%;\\n min-height: 40px;\\n}\\n.upload-wrapper[data-v-79ee03e8] {\\n display: flex;\\n flex-direction: column;\\n gap: 4px;\\n width: 100%;\\n}\\n/* 控制区域:选择文件按钮和文件计数 */\\n.upload-control[data-v-79ee03e8] {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n flex-wrap: nowrap;\\n gap: 12px;\\n width: 100%;\\n min-height: 32px;\\n}\\n.upload-trigger[data-v-79ee03e8] {\\n flex-shrink: 0;\\n}\\n.file-count-btn[data-v-79ee03e8] {\\n flex-shrink: 0;\\n color: #409eff;\\n}\\n.file-count-btn[data-v-79ee03e8]:hover {\\n color: #66b1ff;\\n text-decoration: underline;\\n}\\n.view-icon[data-v-79ee03e8] {\\n font-size: 18px;\\n}\\n.text-danger[data-v-79ee03e8] {\\n color: #f56c6c;\\n}\\n.text-success[data-v-79ee03e8] {\\n color: #67c23a;\\n}\\n/* Popover 文件列表样式 */\\n.popover-file-list[data-v-79ee03e8] {\\n padding: 4px;\\n max-height: 200px;\\n overflow-y: auto;\\n}\\n.empty-file-list[data-v-79ee03e8] {\\n padding: 12px;\\n text-align: center;\\n color: #909399;\\n font-size: 12px;\\n}\\n.popover-file-item[data-v-79ee03e8] {\\n display: flex;\\n justify-content: space-between;\\n align-items: center;\\n padding: 4px 6px;\\n font-size: 11px;\\n border-bottom: 1px solid #e4e7ed;\\n border-radius: 3px;\\n margin-bottom: 2px;\\n transition: all 0.3s ease;\\n}\\n.popover-file-item[data-v-79ee03e8]:hover {\\n background-color: #ecf5ff;\\n}\\n.popover-file-item[data-v-79ee03e8]:last-child {\\n border-bottom: none;\\n}\\n.file-name[data-v-79ee03e8] {\\n flex: 1;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n margin-right: 6px;\\n font-size: 11px;\\n}\\n.file-actions[data-v-79ee03e8] {\\n display: flex;\\n align-items: center;\\n gap: 3px;\\n flex-shrink: 0;\\n}\\n.file-status[data-v-79ee03e8] {\\n min-width: 40px;\\n text-align: right;\\n font-size: 10px;\\n color: #606266;\\n}\\n[data-v-79ee03e8] .el-button--small {\\n padding: 3px 8px;\\n font-size: 11px;\\n height: 24px;\\n}\\n[data-v-79ee03e8] .el-button--mini {\\n padding: 2px 6px;\\n font-size: 10px;\\n height: 20px;\\n}\\n/* 确保与表单其他元素对齐 */\\n@media (max-width: 768px) {\\n.upload-control[data-v-79ee03e8] {\\n flex-direction: column;\\n align-items: flex-start;\\n gap: 4px;\\n}\\n.popover-file-item[data-v-79ee03e8] {\\n flex-direction: column;\\n align-items: flex-start;\\n gap: 3px;\\n padding: 4px;\\n}\\n.file-actions[data-v-79ee03e8] {\\n width: 100%;\\n justify-content: flex-end;\\n}\\n.file-name[data-v-79ee03e8] {\\n width: 100%;\\n}\\n.popover-file-list[data-v-79ee03e8] {\\n max-height: 150px;\\n}\\n}\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://olp-table/./src/components/ol-upload-file.vue?./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use%5B1%5D!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use%5B2%5D!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D");
|
|
5283
5283
|
|
|
5284
5284
|
/***/ }),
|
|
5285
5285
|
|
|
@@ -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_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 _utils_columnProp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/columnProp */ \"./src/utils/columnProp.js\");\n/* harmony import */ var _utils_message__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/utils/message */ \"./src/utils/message.js\");\n/* harmony import */ var _utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/http/httpUtils */ \"./src/utils/http/httpUtils.js\");\n/* harmony import */ var _utils_tree__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/utils/tree */ \"./src/utils/tree.js\");\n/* harmony import */ var _utils_formUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/utils/formUtils */ \"./src/utils/formUtils.js\");\n/* harmony import */ var _api_dist__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/api/dist */ \"./src/api/dist.js\");\n/* harmony import */ var _store_dict__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/store/dict */ \"./src/store/dict.js\");\n/* harmony import */ var _utils_object__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/utils/object */ \"./src/utils/object.js\");\n/* harmony import */ var _components_FileUpload_index_vue__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/components/FileUpload/index.vue */ \"./src/components/FileUpload/index.vue\");\n/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/components/Icon */ \"./src/components/Icon/index.js\");\n/* harmony import */ var _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_15__ = __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\nconst dict = (0,_store_dict__WEBPACK_IMPORTED_MODULE_11__.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_13__[\"default\"],\n IconSelect: _components_Icon__WEBPACK_IMPORTED_MODULE_14__.IconSelect,\n OlTableSelect: _components_ol_table_select_vue__WEBPACK_IMPORTED_MODULE_15__[\"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 };\n },\n methods: {\n hideColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_12__.setArrayObjectKeyValue)(this.form.column, 'display', false, prop);\n },\n showColumn(prop) {\n (0,_utils_object__WEBPACK_IMPORTED_MODULE_12__.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_6__.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_6__.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_6__.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_6__.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_6__.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_7__.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_7__.postAes)(this.http, url, params).then(status => {\n this.saveOk(status);\n });\n } else {\n await (0,_utils_http_httpUtils__WEBPACK_IMPORTED_MODULE_7__.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 if (column.value) {\n column.value = (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_5__.getDefaultValue)(column);\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_12__.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 doInit(data) {\n this.beforeInit();\n if (data.disabled) {\n this.show = false;\n }\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 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 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_7__.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_8__.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_7__.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_8__.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_9__[\"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_10__.initDictTable)(this.http, params).then(data => {\n column.dicData.length = 0;\n if (params[\"parentValue\"]) {\n column.dicData = (0,_utils_tree__WEBPACK_IMPORTED_MODULE_8__.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_11__.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.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 if (column.value) {\n column.value = (0,_utils_columnProp__WEBPACK_IMPORTED_MODULE_6__.getDefaultValue)(column);\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 doInit(data) {\n this.beforeInit();\n if (data.disabled) {\n this.show = false;\n }\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 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
|
|